The R Project SVN R

Rev

Rev 60023 | Rev 83479 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 60023 Rev 76745
Line 283... Line 283...
283
    switch (obj->kind) {
283
    switch (obj->kind) {
284
    case CursorObject: case FontObject: case BitmapObject:
284
    case CursorObject: case FontObject: case BitmapObject:
285
    case MenubarObject: case MenuObject: case MenuitemObject:
285
    case MenubarObject: case MenuObject: case MenuitemObject:
286
	break;
286
	break;
287
    case WindowObject:
287
    case WindowObject:
288
	obj->state |= Visible;
288
	obj->state |= GA_Visible;
289
	show_window(obj);
289
	show_window(obj);
290
	break;
290
	break;
291
    default:
291
    default:
292
	ShowWindow(obj->handle, SW_SHOWNORMAL);
292
	ShowWindow(obj->handle, SW_SHOWNORMAL);
293
	SetFocus(obj->handle);
293
	SetFocus(obj->handle);
294
	UpdateWindow(obj->handle);
294
	UpdateWindow(obj->handle);
295
    }
295
    }
296
    obj->state |= Visible;
296
    obj->state |= GA_Visible;
297
}
297
}
298
 
298
 
299
void hide(control obj)
299
void hide(control obj)
300
{
300
{
301
    if (! obj)
301
    if (! obj)
Line 308... Line 308...
308
	hide_window(obj);
308
	hide_window(obj);
309
	break;
309
	break;
310
    default:
310
    default:
311
	ShowWindow(obj->handle, SW_HIDE);
311
	ShowWindow(obj->handle, SW_HIDE);
312
    }
312
    }
313
    obj->state &= ~Visible;
313
    obj->state &= ~GA_Visible;
314
}
314
}
315
 
315
 
316
int isvisible(control obj)
316
int isvisible(control obj)
317
{
317
{
318
    if (! obj)
318
    if (! obj)
319
	return 0;
319
	return 0;
320
    return (obj->state & Visible) ? 1 : 0;
320
    return (obj->state & GA_Visible) ? 1 : 0;
321
}
321
}
322
 
322
 
323
/*
323
/*
324
 *  Enabling and disabling controls and windows.
324
 *  Enabling and disabling controls and windows.
325
 */
325
 */
Line 339... Line 339...
339
	sendmessage(obj->handle, EM_SETREADONLY, FALSE, 0L);
339
	sendmessage(obj->handle, EM_SETREADONLY, FALSE, 0L);
340
	break;
340
	break;
341
    default:
341
    default:
342
	if (! isenabled(obj)) {
342
	if (! isenabled(obj)) {
343
	    EnableWindow(obj->handle, 1);
343
	    EnableWindow(obj->handle, 1);
344
	    obj->state |= Enabled;
344
	    obj->state |= GA_Enabled;
345
	    draw(obj);
345
	    draw(obj);
346
	}
346
	}
347
    }
347
    }
348
    obj->state |= Enabled;
348
    obj->state |= GA_Enabled;
349
}
349
}
350
 
350
 
351
void disable(control obj)
351
void disable(control obj)
352
{
352
{
353
    if (! obj)
353
    if (! obj)
Line 364... Line 364...
364
	sendmessage(obj->handle, EM_SETREADONLY, TRUE, 0L);
364
	sendmessage(obj->handle, EM_SETREADONLY, TRUE, 0L);
365
	break;
365
	break;
366
    default:
366
    default:
367
	if (isenabled(obj)) {
367
	if (isenabled(obj)) {
368
	    EnableWindow(obj->handle, 0);
368
	    EnableWindow(obj->handle, 0);
369
	    obj->state &= ~Enabled;
369
	    obj->state &= ~GA_Enabled;
370
	    draw(obj);
370
	    draw(obj);
371
	}
371
	}
372
    }
372
    }
373
    obj->state &= ~Enabled;
373
    obj->state &= ~GA_Enabled;
374
}
374
}
375
 
375
 
376
int isenabled(control obj)
376
int isenabled(control obj)
377
{
377
{
378
    if (! obj)
378
    if (! obj)
379
	return 0;
379
	return 0;
380
    return (obj->state & Enabled) ? 1 : 0;
380
    return (obj->state & GA_Enabled) ? 1 : 0;
381
}
381
}
382
 
382
 
383
/*
383
/*
384
 *  Checking and unchecking controls.
384
 *  Checking and unchecking controls.
385
 */
385
 */
Line 405... Line 405...
405
	sendmessage(obj->handle, BM_SETCHECK, 1, 0L);
405
	sendmessage(obj->handle, BM_SETCHECK, 1, 0L);
406
	break;
406
	break;
407
#endif
407
#endif
408
    default:
408
    default:
409
	if (! ischecked(obj)) {
409
	if (! ischecked(obj)) {
410
	    obj->state |= Checked;
410
	    obj->state |= GA_Checked;
411
	    draw(obj);
411
	    draw(obj);
412
	}
412
	}
413
    }
413
    }
414
    obj->state |= Checked;
414
    obj->state |= GA_Checked;
-
 
415
 
415
}
416
}
416
 
417
 
417
void uncheck(control obj)
418
void uncheck(control obj)
418
{
419
{
419
    if (! obj)
420
    if (! obj)
Line 436... Line 437...
436
	sendmessage(obj->handle, BM_SETCHECK, 0, 0L);
437
	sendmessage(obj->handle, BM_SETCHECK, 0, 0L);
437
	break;
438
	break;
438
#endif
439
#endif
439
    default:
440
    default:
440
	if (ischecked(obj)) {
441
	if (ischecked(obj)) {
441
	    obj->state &= ~Checked;
442
	    obj->state &= ~GA_Checked;
442
	    draw(obj);
443
	    draw(obj);
443
	}
444
	}
444
    }
445
    }
445
    obj->state &= ~Checked;
446
    obj->state &= ~GA_Checked;
446
}
447
}
447
 
448
 
448
int ischecked(control obj)
449
int ischecked(control obj)
449
{
450
{
450
    if (! obj)
451
    if (! obj)
451
	return 0;
452
	return 0;
452
    return (obj->state & Checked) ? 1 : 0;
453
    return (obj->state & GA_Checked) ? 1 : 0;
453
}
454
}
454
 
455
 
455
/*
456
/*
456
 *  Highlighting and unhighlighting controls.
457
 *  Highlighting and unhighlighting controls.
457
 */
458
 */
Line 476... Line 477...
476
    case FieldObject: case TextboxObject:
477
    case FieldObject: case TextboxObject:
477
	sendmessage(obj->handle, EM_SETSEL, 0, MAKELONG(0,-1));
478
	sendmessage(obj->handle, EM_SETSEL, 0, MAKELONG(0,-1));
478
	break;
479
	break;
479
    default:
480
    default:
480
	if (! ishighlighted(obj)) {
481
	if (! ishighlighted(obj)) {
481
	    obj->state |= Highlighted;
482
	    obj->state |= GA_Highlighted;
482
	    draw(obj);
483
	    draw(obj);
483
	}
484
	}
484
    }
485
    }
485
    obj->state |= Highlighted;
486
    obj->state |= GA_Highlighted;
486
}
487
}
487
 
488
 
488
void unhighlight(control obj)
489
void unhighlight(control obj)
489
{
490
{
490
    if (! obj)
491
    if (! obj)
Line 506... Line 507...
506
    case FieldObject: case TextboxObject:
507
    case FieldObject: case TextboxObject:
507
	sendmessage(obj->handle, EM_SETSEL, 0, MAKELONG(0,0));
508
	sendmessage(obj->handle, EM_SETSEL, 0, MAKELONG(0,0));
508
	break;
509
	break;
509
    default:
510
    default:
510
	if (ishighlighted(obj)) {
511
	if (ishighlighted(obj)) {
511
	    obj->state &= ~Highlighted;
512
	    obj->state &= ~GA_Highlighted;
512
	    draw(obj);
513
	    draw(obj);
513
	}
514
	}
514
    }
515
    }
515
    obj->state &= ~Highlighted;
516
    obj->state &= ~GA_Highlighted;
516
}
517
}
517
 
518
 
518
int ishighlighted(control obj)
519
int ishighlighted(control obj)
519
{
520
{
520
    if (! obj)
521
    if (! obj)
521
	return 0;
522
	return 0;
522
    return (obj->state & Highlighted) ? 1 : 0;
523
    return (obj->state & GA_Highlighted) ? 1 : 0;
523
}
524
}
524
 
525
 
525
/*
526
/*
526
 *  The flashcontrol function highlights a control as if the user
527
 *  The flashcontrol function highlights a control as if the user
527
 *  just used it, e.g. a button will become pressed down for a
528
 *  just used it, e.g. a button will become pressed down for a
Line 946... Line 947...
946
void setcaret(object obj, int x, int y, int width, int height)
947
void setcaret(object obj, int x, int y, int width, int height)
947
{
948
{
948
    if (! obj)
949
    if (! obj)
949
    	return;
950
    	return;
950
    if (width != obj->caretwidth || height != obj->caretheight) {
951
    if (width != obj->caretwidth || height != obj->caretheight) {
951
	if (obj->caretwidth > 0 && (obj->state & Focus)) DestroyCaret();
952
	if (obj->caretwidth > 0 && (obj->state & GA_Focus)) DestroyCaret();
952
	obj->caretwidth = width;
953
	obj->caretwidth = width;
953
	obj->caretheight = height;
954
	obj->caretheight = height;
954
	if (width > 0) {
955
	if (width > 0) {
955
	    if (obj->state & Focus)
956
	    if (obj->state & GA_Focus)
956
		CreateCaret(obj->handle, (HBITMAP) NULL, width, height);
957
		CreateCaret(obj->handle, (HBITMAP) NULL, width, height);
957
	    obj->caretshowing = 0;
958
	    obj->caretshowing = 0;
958
	}
959
	}
959
    }
960
    }
960
    if (obj->state & Focus)
961
    if (obj->state & GA_Focus)
961
    	SetCaretPos(x, y);
962
    	SetCaretPos(x, y);
962
}
963
}
963
 
964
 
964
void showcaret(object obj, int showing)
965
void showcaret(object obj, int showing)
965
{
966
{