The R Project SVN R

Rev

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

Rev 65805 Rev 76745
Line 45... Line 45...
45
#include "ga.h"
45
#include "ga.h"
46
#include <richedit.h>
46
#include <richedit.h>
47
 
47
 
48
#define SHADOW_WIDTH 1
48
#define SHADOW_WIDTH 1
49
 
49
 
50
#define isarmed(obj) ((obj)->state & Armed)
50
#define isarmed(obj) ((obj)->state & GA_Armed)
51
#define arm(obj)     ((obj)->state |= Armed)
51
#define arm(obj)     ((obj)->state |= GA_Armed)
52
#define disarm(obj)  ((obj)->state &= ~Armed)
52
#define disarm(obj)  ((obj)->state &= ~GA_Armed)
53
 
53
 
54
#define hasfocus(obj) ((obj)->state & Focus)
54
#define hasfocus(obj) ((obj)->state & GA_Focus)
55
#define setfocus(obj) SetFocus((obj)->handle)
55
#define setfocus(obj) SetFocus((obj)->handle)
56
 
56
 
57
/*
57
/*
58
 *  Ensure there is a current window, create one if there isn't.
58
 *  Ensure there is a current window, create one if there isn't.
59
 *  If a window is created, it is also shown on the screen.
59
 *  If a window is created, it is also shown on the screen.
Line 159... Line 159...
159
    }
159
    }
160
    obj->die = private_delcontrol;
160
    obj->die = private_delcontrol;
161
    obj->rect = r;
161
    obj->rect = r;
162
    obj->id = child_id++;
162
    obj->id = child_id++;
163
    obj->action = fn;
163
    obj->action = fn;
164
    obj->state = (Visible | Enabled);
164
    obj->state = (GA_Visible | GA_Enabled);
165
    obj->flags = ChildWindow;
165
    obj->flags = ChildWindow;
166
    obj->text = new_string(text);
166
    obj->text = new_string(text);
167
    set_new_winproc(obj); /* set custom winproc */
167
    set_new_winproc(obj); /* set custom winproc */
168
    settextfont(obj, SystemFont);
168
    settextfont(obj, SystemFont);
169
    return obj;
169
    return obj;
Line 1261... Line 1261...
1261
    object obj;
1261
    object obj;
1262
    int index;
1262
    int index;
1263
 
1263
 
1264
    obj = find_by_handle(hwnd);
1264
    obj = find_by_handle(hwnd);
1265
 
1265
 
1266
    if ((! obj) || (! (obj->state & Enabled)))
1266
    if ((! obj) || (! (obj->state & GA_Enabled)))
1267
	return;
1267
	return;
1268
 
1268
 
1269
    /* Only let certain events cause activation. */
1269
    /* Only let certain events cause activation. */
1270
    switch (obj->kind)
1270
    switch (obj->kind)
1271
    {
1271
    {
1272
    case CheckboxObject:
1272
    case CheckboxObject:
1273
	if (obj->state & Checked)
1273
	if (obj->state & GA_Checked)
1274
	    uncheck(obj);
1274
	    uncheck(obj);
1275
	else
1275
	else
1276
	    check(obj);
1276
	    check(obj);
1277
	break;
1277
	break;
1278
 
1278
 
1279
    case RadioObject:
1279
    case RadioObject:
1280
	if (!(obj->state & Checked)) {
1280
	if (!(obj->state & GA_Checked)) {
1281
	    uncheck_neighbours(obj);
1281
	    uncheck_neighbours(obj);
1282
	    check(obj);
1282
	    check(obj);
1283
	}
1283
	}
1284
	break;
1284
	break;
1285
 
1285
 
Line 1362... Line 1362...
1362
    }
1362
    }
1363
    obj->die = private_delcontrol;
1363
    obj->die = private_delcontrol;
1364
    obj->rect = r;
1364
    obj->rect = r;
1365
    obj->id = child_id++;
1365
    obj->id = child_id++;
1366
    obj->action = NULL;
1366
    obj->action = NULL;
1367
    obj->state = (Visible | Enabled);
1367
    obj->state = (GA_Visible | GA_Enabled);
1368
    obj->flags = ChildWindow;
1368
    obj->flags = ChildWindow;
1369
    set_new_winproc(obj); /* set custom winproc */
1369
    set_new_winproc(obj); /* set custom winproc */
1370
    settextfont(obj, SystemFont);
1370
    settextfont(obj, SystemFont);
1371
    obj->kind = ListboxObject;
1371
    obj->kind = ListboxObject;
1372
    SendMessage(hwnd, PBM_SETRANGE32, (WPARAM) pbmin, (LPARAM) pbmax);
1372
    SendMessage(hwnd, PBM_SETRANGE32, (WPARAM) pbmin, (LPARAM) pbmax);