diff options
author | pfaedit <pfaedit> | 2008-12-02 08:12:16 +0000 |
---|---|---|
committer | pfaedit <pfaedit> | 2008-12-02 08:12:16 +0000 |
commit | 1d21cb7fe7833874cd2c36627b54533cd7246f5b (patch) | |
tree | 979b70f9d3d6de5498f690711ad6594289e135bd | |
parent | 044e2a2625811d8989201acc1e814f1bce4e9ce2 (diff) |
More stuff for the resource editor.
-rw-r--r-- | fontforge/bitmapview.c | 1 | ||||
-rw-r--r-- | fontforge/fontview.c | 1 | ||||
-rw-r--r-- | fontforge/stamp.c | 6 | ||||
-rw-r--r-- | gdraw/gbuttons.c | 54 | ||||
-rw-r--r-- | gdraw/ggadgetP.h | 4 | ||||
-rw-r--r-- | gdraw/ggadgets.c | 15 | ||||
-rw-r--r-- | gdraw/ggroupbox.c | 24 | ||||
-rw-r--r-- | gdraw/ghvbox.c | 19 | ||||
-rw-r--r-- | gdraw/gmatrixedit.c | 28 | ||||
-rw-r--r-- | gdraw/gmenu.c | 35 | ||||
-rw-r--r-- | gdraw/gradio.c | 32 | ||||
-rw-r--r-- | gdraw/gresedit.c | 183 | ||||
-rw-r--r-- | gdraw/gscrollbar.c | 60 | ||||
-rw-r--r-- | gdraw/gtabset.c | 18 | ||||
-rw-r--r-- | gdraw/gtextfield.c | 40 | ||||
-rw-r--r-- | inc/ggadget.h | 2 |
16 files changed, 484 insertions, 38 deletions
diff --git a/fontforge/bitmapview.c b/fontforge/bitmapview.c index bc5c2236..0101bea5 100644 --- a/fontforge/bitmapview.c +++ b/fontforge/bitmapview.c @@ -2030,6 +2030,7 @@ BitmapView *BitmapViewCreate(BDFChar *bc, BDFFont *bdf, FontView *fv, int enc) { gd.pos.width = sbsize = GDrawPointsToPixels(gw,_GScrollBar_Width); gd.pos.height = pos.height-bv->mbh-bv->infoh - sbsize; gd.pos.x = pos.width-sbsize; + gd.u.sbinit = NULL; gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels|gg_sb_vert; bv->vsb = GScrollBarCreate(gw,&gd,bv); diff --git a/fontforge/fontview.c b/fontforge/fontview.c index 034ccf52..0111ed50 100644 --- a/fontforge/fontview.c +++ b/fontforge/fontview.c @@ -7149,6 +7149,7 @@ static FontView *FontView_Create(SplineFont *sf, int hide) { gd.pos.y = fv->mbh+fv->infoh; gd.pos.height = pos.height; gd.pos.width = GDrawPointsToPixels(gw,_GScrollBar_Width); gd.pos.x = pos.width; + gd.u.sbinit = NULL; gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels|gg_sb_vert; fv->vsb = GScrollBarCreate(gw,&gd,fv); diff --git a/fontforge/stamp.c b/fontforge/stamp.c index de731335..728779c2 100644 --- a/fontforge/stamp.c +++ b/fontforge/stamp.c @@ -1,5 +1,5 @@ #include <time.h> -const time_t source_modtime = 1228099342L; -const char *source_modtime_str = "02:42 GMT 1-Dec-2008"; -const char *source_version_str = "20081201"; +const time_t source_modtime = 1228202804L; +const char *source_modtime_str = "07:26 GMT 2-Dec-2008"; +const char *source_version_str = "20081202"; diff --git a/gdraw/gbuttons.c b/gdraw/gbuttons.c index 99087d98..0a133d14 100644 --- a/gdraw/gbuttons.c +++ b/gdraw/gbuttons.c @@ -58,11 +58,21 @@ static GResInfo glabel_ri = { "Gdraw", false }; +static GTextInfo button_lab[] = { + { (unichar_t *) "Disabled Button", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1 }, + { (unichar_t *) "Enabled Button" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}}; +static GGadgetCreateData button_gcd[] = { + {GButtonCreate, {{0},NULL,0,0,0,0,0,&button_lab[0],NULL,gg_visible}}, + {GButtonCreate, {{0},NULL,0,0,0,0,0,&button_lab[1],NULL,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *barray[] = { GCD_Glue, &button_gcd[0], GCD_Glue, &button_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData buttonbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) barray,gg_visible|gg_enabled}}; static GResInfo gbutton_ri = { &gdefault_ri, &ggadget_ri,&gdefault_ri, &gcancel_ri, &_GGadget_button_box, &label_font, - NULL, + &buttonbox, NULL, N_("Button"), N_("Buttons"), @@ -70,11 +80,18 @@ static GResInfo gbutton_ri = { "Gdraw", true }; +static GGadgetCreateData def_gcd[] = { + {GButtonCreate, {{0},NULL,0,0,0,0,0,&button_lab[0],NULL,gg_visible|gg_but_default}}, + {GButtonCreate, {{0},NULL,0,0,0,0,0,&button_lab[1],NULL,gg_visible|gg_enabled|gg_but_default}} + }; +static GGadgetCreateData *darray[] = { GCD_Glue, &def_gcd[0], GCD_Glue, &def_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData defbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) darray,gg_visible|gg_enabled}}; static GResInfo gdefault_ri = { &gcancel_ri, &gbutton_ri,&gcancel_ri,NULL, &_GGadget_defaultbutton_box, NULL, - NULL, + &defbox, NULL, N_("Default Button"), N_("Default Buttons"), @@ -82,11 +99,18 @@ static GResInfo gdefault_ri = { "Gdraw", true }; +static GGadgetCreateData cancel_gcd[] = { + {GButtonCreate, {{0},NULL,0,0,0,0,0,&button_lab[0],NULL,gg_visible|gg_but_cancel}}, + {GButtonCreate, {{0},NULL,0,0,0,0,0,&button_lab[1],NULL,gg_visible|gg_enabled|gg_but_cancel}} + }; +static GGadgetCreateData *carray[] = { GCD_Glue, &cancel_gcd[0], GCD_Glue, &cancel_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData cancelbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) carray,gg_visible|gg_enabled}}; static GResInfo gcancel_ri = { &gcolor_ri, &gbutton_ri,&gdefault_ri,NULL, &_GGadget_cancelbutton_box, NULL, - NULL, + &cancelbox, NULL, N_("Cancel Button"), N_("Cancel Buttons"), @@ -94,11 +118,18 @@ static GResInfo gcancel_ri = { "Gdraw", true }; +static GGadgetCreateData color_gcd[] = { + {GColorButtonCreate, {{0},NULL,0,0,0,0,0,NULL,(GTextInfo *) (intpt) (0x000000),gg_visible}}, + {GColorButtonCreate, {{0},NULL,0,0,0,0,0,NULL,(GTextInfo *) (intpt) (0x000000),gg_visible|gg_enabled}} + }; +static GGadgetCreateData *colarray[] = { GCD_Glue, &color_gcd[0], GCD_Glue, &color_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData colorbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) colarray,gg_visible|gg_enabled}}; static GResInfo gcolor_ri = { &gdroplist_ri, &gbutton_ri,NULL,NULL, &_GGadget_droplist_box, NULL, - NULL, + &colorbox, NULL, N_("Color Button"), N_("Color Button"), @@ -106,11 +137,24 @@ static GResInfo gcolor_ri = { "Gdraw", true }; +static GTextInfo list_choices[] = { + { (unichar_t *) "1", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1 }, + { (unichar_t *) "2" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}, + { (unichar_t *) "3" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}, + NULL + }; +static GGadgetCreateData droplist_gcd[] = { + {GListButtonCreate, {{0,0,80},NULL,0,0,0,0,0,&list_choices[0],list_choices,gg_visible}}, + {GListButtonCreate, {{0,0,80},NULL,0,0,0,0,0,&list_choices[1],list_choices,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *dlarray[] = { GCD_Glue, &droplist_gcd[0], GCD_Glue, &droplist_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData droplistbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) dlarray,gg_visible|gg_enabled}}; static GResInfo gdroplist_ri = { NULL, &gbutton_ri,&listmark_ri,NULL, &_GGadget_droplist_box, NULL, - NULL, + &droplistbox, NULL, N_("Drop List Button"), N_("Drop List Button"), diff --git a/gdraw/ggadgetP.h b/gdraw/ggadgetP.h index 0ea2a47b..f948069b 100644 --- a/gdraw/ggadgetP.h +++ b/gdraw/ggadgetP.h @@ -576,4 +576,6 @@ extern int _ggadget_use_gettext; extern GResInfo ggadget_ri, listmark_ri; extern GResInfo *_GGadgetRIHead(void), *_GButtonRIHead(void), *_GTextFieldRIHead(void); -extern GResInfo *_GRadioRIHead(void); +extern GResInfo *_GRadioRIHead(void), *_GScrollBarRIHead(void), *_GLineRIHead(void); +extern GResInfo *_GMenuRIHead(void), *_GTabSetRIHead(void), *_GHVBoxRIHead(void); +extern GResInfo *_GMatrixEditRIHead(void); diff --git a/gdraw/ggadgets.c b/gdraw/ggadgets.c index 0fe3ebaf..09713402 100644 --- a/gdraw/ggadgets.c +++ b/gdraw/ggadgets.c @@ -101,11 +101,24 @@ static struct resed listmark_re[] = { {N_("Image"), "Image", rt_image, &_GListMark_Image, N_("Image used for enabled listmarks (overrides the box)")}, {N_("Disabled Image"), "DisImage", rt_image, &_GListMark_DisImage, N_("Image used for disabled listmarks (overrides the box)")}, { NULL }}; +static GTextInfo list_choices[] = { + { (unichar_t *) "1", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1 }, + { (unichar_t *) "2" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}, + { (unichar_t *) "3" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}, + NULL + }; +static GGadgetCreateData droplist_gcd[] = { + {GListFieldCreate, {{0,0,80},NULL,0,0,0,0,0,&list_choices[0],list_choices,gg_visible}}, + {GListFieldCreate, {{0,0,80},NULL,0,0,0,0,0,&list_choices[1],list_choices,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *dlarray[] = { GCD_Glue, &droplist_gcd[0], GCD_Glue, &droplist_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData droplistbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) dlarray,gg_visible|gg_enabled}}; GResInfo listmark_ri = { NULL, &ggadget_ri, NULL,NULL, &_GListMark_Box, /* No box */ NULL, - NULL, + &droplistbox, listmark_re, N_("List Mark"), N_("This is the mark that differenciates ComboBoxes and ListButtons\n" diff --git a/gdraw/ggroupbox.c b/gdraw/ggroupbox.c index 62b90840..9ea95238 100644 --- a/gdraw/ggroupbox.c +++ b/gdraw/ggroupbox.c @@ -32,6 +32,24 @@ GBox _GGroup_LineBox = { /* Don't initialize here */ 0 }; static GBox group_box = { /* Don't initialize here */ 0 }; static int ggroup_inited = false; +static GGadgetCreateData gline_gcd[] = { + {GLineCreate, {{0,0,100},NULL,0,0,0,0,0,NULL,NULL,gg_visible|gg_enabled}}}; +static GGadgetCreateData *larray[] = { GCD_Glue, &gline_gcd[0], GCD_Glue, NULL, NULL }; +static GGadgetCreateData linebox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) larray,gg_visible|gg_enabled}}; +GResInfo gline_ri = { + NULL, &ggadget_ri, NULL, NULL, + &_GGroup_LineBox, + NULL, + &linebox, + NULL, + N_("Line"), + N_("A separator line drawn across a dialog or in a menu"), + "GLine", + "Gdraw", + false +}; + void _GGroup_Init(void) { if ( ggroup_inited ) return; @@ -255,3 +273,9 @@ GGadget *GGroupCreate(struct gwindow *base, GGadgetData *gd,void *data) { _GGadget_FinalPosition(g,base,gd); return( g ); } + +GResInfo *_GLineRIHead(void) { + + _GGroup_Init(); +return( &gline_ri ); +} diff --git a/gdraw/ghvbox.c b/gdraw/ghvbox.c index b973db02..86128704 100644 --- a/gdraw/ghvbox.c +++ b/gdraw/ghvbox.c @@ -39,6 +39,19 @@ static GBox hvgroup_box = { /* Don't initialize here */ 0 }; static GBox hvbox_box = { /* Don't initialize here */ 0 }; static int ghvbox_inited = false; +GResInfo ghvgroupbox_ri = { + NULL, &ggadget_ri, NULL, NULL, + &hvgroup_box, + NULL, + NULL, + NULL, + N_("HV Group Box"), + N_("A box drawn around other gadgets"), + "GHVGroupBox", + "Gdraw", + false +}; + static void _GHVBox_Init(void) { if ( ghvbox_inited ) return; @@ -665,3 +678,9 @@ return; void GHVBoxReflow(GGadget *g) { GHVBoxResize(g, g->r.width, g->r.height); } + +GResInfo *_GHVBoxRIHead(void) { + + _GHVBox_Init(); +return( &ghvgroupbox_ri ); +} diff --git a/gdraw/gmatrixedit.c b/gdraw/gmatrixedit.c index 35ddbe1e..b6927842 100644 --- a/gdraw/gmatrixedit.c +++ b/gdraw/gmatrixedit.c @@ -41,6 +41,28 @@ static Color gmatrixedit_rules = 0x000000; static Color gmatrixedit_frozencol = 0xff0000, gmatrixedit_activecol = 0x0000ff; static int gmatrixedit_inited = false; +static struct resed gmatrixedit_re[] = { + {N_("Title Background"), "TitleBG", rt_color, &gmatrixedit_title_bg, N_("Background color of column headers at the top of a matrix edit")}, + {N_("Title Text Color"), "TitleFG", rt_color, &gmatrixedit_title_fg, N_("Text color of column headers at the top of a matrix edit")}, + {N_("Title Divider Color"), "TitleDivider", rt_color, &gmatrixedit_title_divider, N_("Color of column dividers in the title section of a matrix edit")}, + {N_("Rule Color"), "RuleCol", rt_color, &gmatrixedit_rules, N_("Color of column dividers in the main section of a matrix edit")}, + {N_("Frozen Color"), "FrozenCol", rt_color, &gmatrixedit_frozencol, N_("Color of frozen (unchangeable) entries in the main section of a matrix edit")}, + {N_("Active Color"), "ActiveCol", rt_color, &gmatrixedit_activecol, N_("Color of the active entry in the main section of a matrix edit")}, + NULL +}; +static GResInfo gmatrixedit_ri = { + NULL, &ggadget_ri, NULL,NULL, + NULL, /* No box */ + &gmatrixedit_font, + NULL, + gmatrixedit_re, + N_("Matrix Edit"), + N_("Matrix Edit (sort of like a spreadsheet)"), + "GMatrixEdit", + "Gdraw", + false +}; + static void _GMatrixEdit_Init(void) { FontRequest rq; @@ -2118,3 +2140,9 @@ void GMatrixEditSetBeforeDelete(GGadget *g, void (*predelete)(GGadget *g, int r) gme->predelete = predelete; } + +GResInfo *_GMatrixEditRIHead(void) { + + _GMatrixEdit_Init(); +return( &gmatrixedit_ri ); +} diff --git a/gdraw/gmenu.c b/gdraw/gmenu.c index 9f3a7698..0fdc798a 100644 --- a/gdraw/gmenu.c +++ b/gdraw/gmenu.c @@ -58,6 +58,35 @@ static enum { kb_ibm, kb_mac, kb_sun, kb_ppc } keyboard = _Keyboard; /* While in Suse PPC X, the command key is 0x8 (meta) and option is 0x2000 */ /* and the standard mac option conversions are done */ +static GResInfo gmenu_ri; +static GResInfo gmenubar_ri = { + &gmenu_ri, &ggadget_ri,&gmenu_ri, NULL, + &menubar_box, + &menu_font, + NULL, + NULL, + N_("Menu Bar"), + N_("Menu Bar"), + "GMenuBar", + "Gdraw", + false +}; +static struct resed menu_re[] = { + {N_("MacIcons"), "MacIcons", rt_bool, &mac_menu_icons, N_("Whether to use mac-like icons to indicate modifiers (for instance ^ for Control)\nor to use an abreviation (for instance \"Cnt-\")")}, + { NULL }}; +static GResInfo gmenu_ri = { + NULL, &ggadget_ri,&gmenubar_ri, NULL, + &menu_box, + &menu_font, + NULL, + menu_re, + N_("Menu"), + N_("Menu"), + "GMenu", + "Gdraw", + false +}; + static void GMenuBarChangeSelection(GMenuBar *mb, int newsel,GEvent *); static struct gmenu *GMenuCreateSubMenu(struct gmenu *parent,GMenuItem *mi,int disable); static struct gmenu *GMenuCreatePulldownMenu(GMenuBar *mb,GMenuItem *mi, int disabled); @@ -1709,3 +1738,9 @@ return( (menumask&event->u.chr.state)==foo.short_mask && foo.shortcut == keysym int GMenuMask(void) { return( menumask ); } + +GResInfo *_GMenuRIHead(void) { + if ( !gmenubar_inited ) + GMenuInit(); +return( &gmenubar_ri ); +} diff --git a/gdraw/gradio.c b/gdraw/gradio.c index 034d2680..e0bd6588 100644 --- a/gdraw/gradio.c +++ b/gdraw/gradio.c @@ -42,11 +42,21 @@ static int gradio_inited = false; static GResInfo gradio_ri, gradioon_ri, gradiooff_ri; static GResInfo gcheckbox_ri, gcheckboxon_ri, gcheckboxoff_ri; +static GTextInfo radio_lab[] = { + { (unichar_t *) "Disabled Radio", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1 }, + { (unichar_t *) "Enabled Radio" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}}; +static GGadgetCreateData radio_gcd[] = { + {GRadioCreate, {{0},NULL,0,0,0,0,0,&radio_lab[0],NULL,gg_visible}}, + {GRadioCreate, {{0},NULL,0,0,0,0,0,&radio_lab[1],NULL,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *rarray[] = { GCD_Glue, &radio_gcd[0], GCD_Glue, &radio_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData radiobox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) rarray,gg_visible|gg_enabled}}; static GResInfo gradio_ri = { &gradioon_ri, &ggadget_ri,&gradioon_ri, &gradiooff_ri, &radio_box, &checkbox_font, - NULL, + &radiobox, NULL, N_("Radio Button"), N_("Radio Button"), @@ -63,7 +73,7 @@ static GResInfo gradioon_ri = { &gradiooff_ri, &ggadget_ri,&gradiooff_ri, &gradio_ri, &radio_on_box, NULL, - NULL, + &radiobox, gradioon_re, N_("Radio On Mark"), N_("The mark showing a radio button is on (depressed, selected)"), @@ -82,7 +92,7 @@ static GResInfo gradiooff_ri = { &gcheckbox_ri, &ggadget_ri,&gradioon_ri, &gradio_ri, &radio_off_box, NULL, - NULL, + &radiobox, gradiooff_re, N_("Radio Off Mark"), N_("The mark showing a radio button is off (up, not selected)"), @@ -90,11 +100,21 @@ static GResInfo gradiooff_ri = { "Gdraw", false }; +static GTextInfo checkbox_lab[] = { + { (unichar_t *) "Disabled Radio", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1 }, + { (unichar_t *) "Enabled Radio" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}}; +static GGadgetCreateData checkbox_gcd[] = { + {GCheckBoxCreate, {{0},NULL,0,0,0,0,0,&checkbox_lab[0],NULL,gg_visible}}, + {GCheckBoxCreate, {{0},NULL,0,0,0,0,0,&checkbox_lab[1],NULL,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *carray[] = { GCD_Glue, &checkbox_gcd[0], GCD_Glue, &checkbox_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData checkboxbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) carray,gg_visible|gg_enabled}}; static GResInfo gcheckbox_ri = { &gcheckboxon_ri, &ggadget_ri,&gcheckboxon_ri, &gcheckboxoff_ri, &checkbox_box, &checkbox_font, - NULL, + &checkboxbox, NULL, N_("Check Box"), N_("Check Box"), @@ -113,7 +133,7 @@ static GResInfo gcheckboxon_ri = { &gcheckboxoff_ri, &ggadget_ri,&gcheckboxoff_ri, &gcheckbox_ri, &checkbox_on_box, NULL, - NULL, + &checkboxbox, gcheckboxon_re, N_("Check Box On Mark"), N_("The mark showing a checkbox is on (depressed, selected)"), @@ -132,7 +152,7 @@ static GResInfo gcheckboxoff_ri = { NULL, &ggadget_ri,&gcheckboxon_ri, &gcheckbox_ri, &checkbox_off_box, NULL, - NULL, + &checkboxbox, gcheckboxoff_re, N_("Check Box Off Mark"), N_("The mark showing a checkbox is off (up, not selected)"), diff --git a/gdraw/gresedit.c b/gdraw/gresedit.c index 79658d81..61306a45 100644 --- a/gdraw/gresedit.c +++ b/gdraw/gresedit.c @@ -85,6 +85,81 @@ static void GRE_Reflow(GRE *gre,GResInfo *res) { GRE_RefreshAll(gre); } +static void GRE_FigureInheritance( GRE *gre, GResInfo *parent, int cid_off_inh, + int cid_off_data, int is_font, void *whatever, + void (*do_something)(GRE *gre, int child_index, int cid_off_data, void *whatever)) { + /* Look through the gadget tree for gadgets which inherit from parent */ + /* (which just changed) then check if this child ggadget actually does */ + /* inherit this field. If it does, set the field to the new value, and */ + /* look for any grandchildren which inherit from the child, and so forth */ + GResInfo *child; + int i; + + for ( i=0; (child = gre->tofree[i].res)!=NULL; ++i ) { + if ( child->inherits_from==parent && + (( is_font && child->font!=NULL ) || + ( !is_font && child->boxdata!=NULL)) ) { + /* Fonts may have a different cid offset depending on wether */ + /* The ResInfo has a box or not */ + if (( is_font && GGadgetIsChecked(GWidgetGetControl(gre->gw,gre->tofree[i].fontcid-2)) ) || + ( !is_font && GGadgetIsChecked(GWidgetGetControl(gre->gw,gre->tofree[i].startcid+cid_off_inh)) )) { + (do_something)(gre,i,cid_off_data,whatever); + GRE_FigureInheritance(gre,child,cid_off_inh,cid_off_data,is_font,whatever,do_something); + } + } + } +} + +static void inherit_color_change(GRE *gre, int childindex, int cid_off, + void *whatever) { + GGadget *g = GWidgetGetControl(gre->gw,gre->tofree[childindex].startcid+cid_off); + Color col = (Color) (intpt) whatever; + + GColorButtonSetColor(g,col); + *((Color *) GGadgetGetUserData(g)) = col; +} + +static void inherit_list_change(GRE *gre, int childindex, int cid_off, + void *whatever) { + GGadget *g = GWidgetGetControl(gre->gw,gre->tofree[childindex].startcid+cid_off); + int sel = (intpt) whatever; + + GGadgetSelectOneListItem(g,sel); + *((uint8 *) GGadgetGetUserData(g)) = sel; +} + +static void inherit_byte_change(GRE *gre, int childindex, int cid_off, + void *whatever) { + GGadget *g = GWidgetGetControl(gre->gw,gre->tofree[childindex].startcid+cid_off); + int val = (intpt) whatever; + char buf[20]; + + sprintf( buf, "%d", val ); + GGadgetSetTitle8(g,buf); + *((uint8 *) GGadgetGetUserData(g)) = val; +} + +static void inherit_flag_change(GRE *gre, int childindex, int cid_off, + void *whatever) { + GGadget *g = GWidgetGetControl(gre->gw,gre->tofree[childindex].startcid+cid_off); + int on = (intpt) whatever; + int flag = (intpt) GGadgetGetUserData(g); + GResInfo *res = gre->tofree[childindex].res; + + if ( on ) + res->inherits_from->boxdata->flags |= flag; + else + res->inherits_from->boxdata->flags &= ~flag; +} + +static void inherit_font_change(GRE *gre, int childindex, int cid_off, + void *whatever) { + GGadget *g = GWidgetGetControl(gre->gw,gre->tofree[childindex].fontcid); + const unichar_t *fontdesc = (const unichar_t *) whatever; + + GGadgetSetTitle(g,fontdesc); +} + static int GRE_InheritColChange(GGadget *g, GEvent *e) { if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) { @@ -99,8 +174,11 @@ static int GRE_InheritColChange(GGadget *g, GEvent *e) { int offset = ((char *) GGadgetGetUserData(g)) - ((char *) (res->boxdata)); Color col = *((Color *) (((char *) (res->inherits_from->boxdata))+offset)); if ( col!= *(Color *) GGadgetGetUserData(g) ) { + int cid_off = cid - gre->tofree[index].startcid; GColorButtonSetColor(g,col); *((Color *) GGadgetGetUserData(g)) = col; + GRE_FigureInheritance(gre,res,cid_off,cid_off+2,false, + (void *) (intpt) col, inherit_color_change); GRE_RefreshAll(gre); } } @@ -122,8 +200,11 @@ static int GRE_InheritListChange(GGadget *g, GEvent *e) { int offset = ((char *) GGadgetGetUserData(g)) - ((char *) (res->boxdata)); int sel = *((uint8 *) (((char *) (res->inherits_from->boxdata))+offset)); if ( sel != *(uint8 *) GGadgetGetUserData(g) ) { + int cid_off = cid - gre->tofree[index].startcid; GGadgetSelectOneListItem(g,sel); *((uint8 *) GGadgetGetUserData(g)) = sel; + GRE_FigureInheritance(gre,res,cid_off,cid_off+2,false, + (void *) (intpt) sel, inherit_list_change); GRE_Reflow(gre,res); } } @@ -131,7 +212,7 @@ static int GRE_InheritListChange(GGadget *g, GEvent *e) { return( true ); } -static int GRE_InheritTextChange(GGadget *g, GEvent *e) { +static int GRE_InheritByteChange(GGadget *g, GEvent *e) { if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) { GRE *gre = GDrawGetUserData(GGadgetGetWindow(g)); @@ -145,10 +226,13 @@ static int GRE_InheritTextChange(GGadget *g, GEvent *e) { int offset = ((char *) GGadgetGetUserData(g)) - ((char *) (res->boxdata)); int val = *((uint8 *) (((char *) (res->inherits_from->boxdata))+offset)); if ( val != *(uint8 *) GGadgetGetUserData(g) ) { + int cid_off = cid - gre->tofree[index].startcid; char buf[20]; sprintf( buf, "%d", val ); GGadgetSetTitle8(g,buf); *((uint8 *) GGadgetGetUserData(g)) = val; + GRE_FigureInheritance(gre,res,cid_off,cid_off+2,false, + (void *) (intpt) val, inherit_byte_change); GRE_Reflow(gre,res); } } @@ -168,12 +252,15 @@ static int GRE_InheritFlagChange(GGadget *g, GEvent *e) { GResInfo *res = gre->tofree[index].res; int flag = (intpt) GGadgetGetUserData(g); if ( (res->boxdata->flags&flag) != (res->inherits_from->boxdata->flags&flag)) { - GGadgetSetChecked(g, - (res->inherits_from->boxdata->flags&flag)?1:0); - if ( res->inherits_from->boxdata->flags&flag ) + int cid_off = cid - gre->tofree[index].startcid; + int on = (res->inherits_from->boxdata->flags&flag)?1:0 ; + GGadgetSetChecked(g,on); + if ( on ) res->boxdata->flags |= flag; else res->boxdata->flags &= ~flag; + GRE_FigureInheritance(gre,res,cid_off,cid_off+2,false, + (void *) (intpt) on, inherit_flag_change); GRE_Reflow(gre,res); } } @@ -181,16 +268,45 @@ static int GRE_InheritFlagChange(GGadget *g, GEvent *e) { return( true ); } +static int GRE_InheritFontChange(GGadget *g, GEvent *e) { + + if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) { + GRE *gre = GDrawGetUserData(GGadgetGetWindow(g)); + int cid = GGadgetGetCid(g), on = GGadgetIsChecked(g); + GGadgetSetEnabled(GWidgetGetControl(gre->gw,cid+1),!on); + g = GWidgetGetControl(gre->gw,cid+2); + GGadgetSetEnabled(g,!on); + if ( on ) { + int index = GTabSetGetSel(gre->tabset); + GResInfo *res = gre->tofree[index].res; + int pi; + for ( pi=0; gre->tofree[pi].res!=NULL && gre->tofree[pi].res!=res->inherits_from; ++pi ); + if ( gre->tofree[pi].res!=NULL ) { + const unichar_t *fontdesc = _GGadgetGetTitle(GWidgetGetControl(gre->gw,gre->tofree[pi].fontcid)); + int cid_off = cid - gre->tofree[index].startcid; + GGadgetSetTitle(g,fontdesc); + GRE_FigureInheritance(gre,res,cid_off,cid_off+2,false, + (void *) fontdesc, inherit_font_change); + } + } + } +return( true ); +} + static int GRE_FlagChanged(GGadget *g, GEvent *e) { if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) { GRE *gre = GDrawGetUserData(GGadgetGetWindow(g)); int index = GTabSetGetSel(gre->tabset); GResInfo *res = gre->tofree[index].res; - if ( GGadgetIsChecked(g)) + int cid_off = GGadgetGetCid(g) - gre->tofree[index].startcid; + int on; + if ( (on = GGadgetIsChecked(g)) ) res->boxdata->flags |= (int) (intpt) GGadgetIsChecked(g); else res->boxdata->flags |= ~(int) (intpt) GGadgetIsChecked(g); + GRE_FigureInheritance(gre,res,cid_off-2,cid_off,false, + (void *) (intpt) on, inherit_flag_change); GRE_Reflow(gre,res); } return( true ); @@ -202,7 +318,12 @@ static int GRE_ListChanged(GGadget *g, GEvent *e) { GRE *gre = GDrawGetUserData(GGadgetGetWindow(g)); int index = GTabSetGetSel(gre->tabset); GResInfo *res = gre->tofree[index].res; - *((uint8 *) GGadgetGetUserData(g)) = GGadgetGetFirstListSelectedItem(g); + int cid_off = GGadgetGetCid(g) - gre->tofree[index].startcid; + int sel = GGadgetGetFirstListSelectedItem(g); + + *((uint8 *) GGadgetGetUserData(g)) = sel; + GRE_FigureInheritance(gre,res,cid_off-2,cid_off,false, + (void *) (intpt) sel, inherit_list_change); GRE_Reflow(gre,res); } return( true ); @@ -225,7 +346,10 @@ static int GRE_ByteChanged(GGadget *g, GEvent *e) { int index = GTabSetGetSel(gre->tabset); GResInfo *res = gre->tofree[index].res; if ( *end=='\0' && val>=0 && val<=255 ) { + int cid_off = GGadgetGetCid(g) - gre->tofree[index].startcid; *((uint8 *) GGadgetGetUserData(g)) = val; + GRE_FigureInheritance(gre,res,cid_off-2,cid_off,false, + (void *) (intpt) val, inherit_byte_change); GRE_Reflow(gre,res); } } @@ -261,9 +385,16 @@ return( true ); static int GRE_ColorChanged(GGadget *g, GEvent *e) { - if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) { + if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) { GRE *gre = GDrawGetUserData(GGadgetGetWindow(g)); - *((Color *) GGadgetGetUserData(g)) = GColorButtonGetColor(g); + int index = GTabSetGetSel(gre->tabset); + GResInfo *res = gre->tofree[index].res; + int cid_off = GGadgetGetCid(g) - gre->tofree[index].startcid; + Color col = GColorButtonGetColor(g); + + *((Color *) GGadgetGetUserData(g)) = col; + GRE_FigureInheritance(gre,res,cid_off-2,cid_off,false, + (void *) (intpt) col, inherit_color_change); GRE_RefreshAll(gre); } return( true ); @@ -272,7 +403,14 @@ return( true ); static int GRE_FontChanged(GGadget *g, GEvent *e) { if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) { - /*GRE *gre = GDrawGetUserData(GGadgetGetWindow(g));*/ + GRE *gre = GDrawGetUserData(GGadgetGetWindow(g)); + int index = GTabSetGetSel(gre->tabset); + GResInfo *res = gre->tofree[index].res; + int cid_off = GGadgetGetCid(g) - gre->tofree[index].startcid; + const unichar_t *fontdesc = _GGadgetGetTitle(g); + + GRE_FigureInheritance(gre,res,cid_off-2,cid_off,true, + (void *) fontdesc, inherit_font_change); } return( true ); } @@ -1461,7 +1599,7 @@ static void GResEditDlg(GResInfo *all,const char *def_res_file,void (*change_res gcd[k].gd.flags = gg_visible|gg_enabled|gg_utf8_popup; gcd[k].gd.popup_msg = (unichar_t *) _("Inherits for same field in parent"); gcd[k].gd.cid = ++cid; - gcd[k].gd.handle_controlevent = GRE_InheritTextChange; + gcd[k].gd.handle_controlevent = GRE_InheritByteChange; gcd[k++].creator = GCheckBoxCreate; tofree[i].carray[l][0] = &gcd[k-1]; @@ -1500,7 +1638,7 @@ static void GResEditDlg(GResInfo *all,const char *def_res_file,void (*change_res gcd[k].gd.flags = gg_visible|gg_enabled|gg_utf8_popup; gcd[k].gd.popup_msg = (unichar_t *) _("Inherits for same field in parent"); gcd[k].gd.cid = ++cid; - gcd[k].gd.handle_controlevent = GRE_InheritTextChange; + gcd[k].gd.handle_controlevent = GRE_InheritByteChange; gcd[k++].creator = GCheckBoxCreate; tofree[i].carray[l][4] = &gcd[k-1]; @@ -1541,7 +1679,7 @@ static void GResEditDlg(GResInfo *all,const char *def_res_file,void (*change_res gcd[k].gd.flags = gg_visible|gg_enabled|gg_utf8_popup; gcd[k].gd.popup_msg = (unichar_t *) _("Inherits for same field in parent"); gcd[k].gd.cid = ++cid; - gcd[k].gd.handle_controlevent = GRE_InheritTextChange; + gcd[k].gd.handle_controlevent = GRE_InheritByteChange; gcd[k++].creator = GCheckBoxCreate; tofree[i].carray[l][0] = &gcd[k-1]; @@ -1617,7 +1755,7 @@ static void GResEditDlg(GResInfo *all,const char *def_res_file,void (*change_res gcd[k].gd.flags = gg_visible|gg_enabled|gg_utf8_popup; gcd[k].gd.popup_msg = (unichar_t *) _("Inherits for same field in parent"); gcd[k].gd.cid = ++cid; - gcd[k].gd.handle_controlevent = GRE_InheritTextChange; + gcd[k].gd.handle_controlevent = GRE_InheritFontChange; gcd[k++].creator = GCheckBoxCreate; tofree[i].fontarray[0] = &gcd[k-1]; @@ -1717,7 +1855,7 @@ static void GResEditDlg(GResInfo *all,const char *def_res_file,void (*change_res lab[k].text_is_1byte = true; gcd[k].gd.label = &lab[k]; gcd[k].gd.flags = gg_visible|gg_enabled; - gcd[k++].creator = GCheckBoxCreate; + gcd[k++].creator = GLabelCreate; tofree[i].earray[hl][base] = &gcd[k-1]; tofree[i].extradefs[l] = galloc(20); @@ -1740,7 +1878,7 @@ static void GResEditDlg(GResInfo *all,const char *def_res_file,void (*change_res lab[k].text_is_1byte = true; gcd[k].gd.label = &lab[k]; gcd[k].gd.flags = gg_visible|gg_enabled; - gcd[k++].creator = GCheckBoxCreate; + gcd[k++].creator = GLabelCreate; tofree[i].earray[hl][base] = &gcd[k-1]; tofree[i].extradefs[l] = galloc(40); @@ -1762,8 +1900,9 @@ static void GResEditDlg(GResInfo *all,const char *def_res_file,void (*change_res lab[k].text_is_1byte = true; gcd[k].gd.label = &lab[k]; gcd[k].gd.flags = gg_visible|gg_enabled; - gcd[k++].creator = GCheckBoxCreate; + gcd[k++].creator = GLabelCreate; tofree[i].earray[hl][base] = &gcd[k-1]; + gcd[k].gd.u.col = extras->orig.ival; gcd[k].gd.flags = gg_visible|gg_enabled; gcd[k].gd.cid = extras->cid = ++cid; @@ -1973,6 +2112,18 @@ void GResEdit(GResInfo *additional,const char *def_res_file,void (*change_res_fi re_end->next = _GRadioRIHead(); for ( re_end = _GRadioRIHead(); re_end->next!=NULL; re_end = re_end->next ); re_end->next = _GTextFieldRIHead(); + for ( re_end = _GTextFieldRIHead(); re_end->next!=NULL; re_end = re_end->next ); + re_end->next = _GScrollBarRIHead(); + for ( re_end = _GScrollBarRIHead(); re_end->next!=NULL; re_end = re_end->next ); + re_end->next = _GLineRIHead(); + for ( re_end = _GLineRIHead(); re_end->next!=NULL; re_end = re_end->next ); + re_end->next = _GHVBoxRIHead(); + for ( re_end = _GHVBoxRIHead(); re_end->next!=NULL; re_end = re_end->next ); + re_end->next = _GMenuRIHead(); + for ( re_end = _GMenuRIHead(); re_end->next!=NULL; re_end = re_end->next ); + re_end->next = _GMatrixEditRIHead(); + for ( re_end = _GMatrixEditRIHead(); re_end->next!=NULL; re_end = re_end->next ); + re_end->next = _GTabSetRIHead(); } if ( additional!=NULL ) { for ( re_end=additional; re_end->next!=NULL; re_end = re_end->next ); diff --git a/gdraw/gscrollbar.c b/gdraw/gscrollbar.c index 5ed3e64c..8919516a 100644 --- a/gdraw/gscrollbar.c +++ b/gdraw/gscrollbar.c @@ -35,6 +35,41 @@ int _GScrollBar_Width = 13; /* in points */ int _GScrollBar_StartTime=300, _GScrollBar_RepeatTime=200; static int gscrollbar_inited = false; +static GGadget *GScrollBarCreateInitialized(struct gwindow *base, GGadgetData *gd,void *data); +static struct scrollbarinit sbinit = { 0, 40, 20, 10 }; +static GGadgetCreateData scrollbar_gcd[] = { + {GScrollBarCreateInitialized, {{0,0,100,13},NULL,0,0,0,0,0,NULL,(GTextInfo *) &sbinit,gg_visible}}, + {GScrollBarCreateInitialized, {{0,0,100,13},NULL,0,0,0,0,0,NULL,(GTextInfo *) &sbinit,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *sarray[] = { GCD_Glue, &scrollbar_gcd[0], GCD_Glue, &scrollbar_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData scrollbarbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) sarray,gg_visible|gg_enabled}}; +static GResInfo gthumb_ri; +static GResInfo gscrollbar_ri = { + >humb_ri, &ggadget_ri,>humb_ri, NULL, + &scrollbar_box, + NULL, + &scrollbarbox, + NULL, + N_("ScrollBar"), + N_("Scroll Bar"), + "GScrollBar", + "Gdraw", + false +}; +static GResInfo gthumb_ri = { + NULL, &ggadget_ri,&gscrollbar_ri, NULL, + &thumb_box, + NULL, + &scrollbarbox, + NULL, + N_("SB Thumb"), + N_("Scroll Bar Thumb"), + "GScrollBarThumb", + "Gdraw", + true +}; + static void GScrollBarChanged(GScrollBar *gsb, enum sb sbtype, int32 pos) { GEvent e; int active_len; @@ -477,18 +512,35 @@ static GScrollBar *_GScrollBarCreate(GScrollBar *gsb, struct gwindow *base, GGad gsb->thumbbox = &thumb_box; GScrollBarFit(gsb); + if ( gd->u.sbinit!=NULL ) + GScrollBarSetMustShow(&gsb->g, + gd->u.sbinit->sb_min, + gd->u.sbinit->sb_max, + gd->u.sbinit->sb_pagesize, + gd->u.sbinit->sb_pos); if ( gd->flags & gg_group_end ) _GGadgetCloseGroup(&gsb->g); return( gsb ); } -GGadget *GScrollBarCreate(struct gwindow *base, GGadgetData *gd,void *data) { +static GGadget *GScrollBarCreateInitialized(struct gwindow *base, GGadgetData *gd,void *data) { GScrollBar *gsb = _GScrollBarCreate(gcalloc(1,sizeof(GScrollBar)),base,gd,data,&scrollbar_box); return( &gsb->g ); } +GGadget *GScrollBarCreate(struct gwindow *base, GGadgetData *gd,void *data) { + GScrollBar *gsb; + struct scrollbarinit *hold = gd->u.sbinit; + + gd->u.sbinit = NULL; + gsb = _GScrollBarCreate(gcalloc(1,sizeof(GScrollBar)),base,gd,data,&scrollbar_box); + gd->u.sbinit = hold; + +return( &gsb->g ); +} + int32 GScrollBarGetPos(GGadget *g) { return( ((GScrollBar *) g)->sb_pos ); } @@ -546,3 +598,9 @@ void GScrollBarGetBounds(GGadget *g, int32 *sb_min, int32 *sb_max, int32 *sb_pag *sb_max = gsb->sb_max; *sb_pagesize = gsb->sb_pagesize; } + +GResInfo *_GScrollBarRIHead(void) { + if ( !gscrollbar_inited ) + GScrollBarInit(); +return( &gscrollbar_ri ); +} diff --git a/gdraw/gtabset.c b/gdraw/gtabset.c index 7e78e71a..668e78f5 100644 --- a/gdraw/gtabset.c +++ b/gdraw/gtabset.c @@ -35,6 +35,18 @@ static GBox gtabset_box = { /* Don't initialize here */ 0 }; static FontInstance *gtabset_font = NULL; static int gtabset_inited = false; +static GResInfo gtabset_ri = { + NULL, &ggadget_ri, NULL, NULL, + >abset_box, + NULL, + NULL, + NULL, + N_("TabSet"), + N_("Tab Set"), + "GTabSet", + "Gdraw", + false +}; #define NEST_INDENT 4 static void GTabSetInit() { @@ -953,3 +965,9 @@ void GTabSetRemoveTabByName(GGadget *g, char *name) { free(uname); } + +GResInfo *_GTabSetRIHead(void) { + if ( !gtabset_inited ) + GTabSetInit(); +return( >abset_ri ); +} diff --git a/gdraw/gtextfield.c b/gdraw/gtextfield.c index 79408d43..7d0a995f 100644 --- a/gdraw/gtextfield.c +++ b/gdraw/gtextfield.c @@ -44,11 +44,27 @@ FontInstance *_gtextfield_font = NULL; static int gtextfield_inited = false; static GResInfo listfield_ri, listfieldmenu_ri, numericfield_ri, numericfieldspinner_ri; +static GTextInfo text_lab[] = { + { (unichar_t *) "Disabled", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1 }, + { (unichar_t *) "Enabled" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}}; +static GTextInfo list_choices[] = { + { (unichar_t *) "1", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1 }, + { (unichar_t *) "2" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}, + { (unichar_t *) "3" , NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1}, + NULL + }; +static GGadgetCreateData text_gcd[] = { + {GTextFieldCreate, {{0,0,70},NULL,0,0,0,0,0,&text_lab[0],NULL,gg_visible}}, + {GTextFieldCreate, {{0,0,70},NULL,0,0,0,0,0,&text_lab[1],NULL,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *tarray[] = { GCD_Glue, &text_gcd[0], GCD_Glue, &text_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData textbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) tarray,gg_visible|gg_enabled}}; static GResInfo gtextfield_ri = { &listfield_ri, &ggadget_ri,NULL, NULL, &_GGadget_gtextfield_box, &_gtextfield_font, - NULL, + &textbox, NULL, N_("Text Field"), N_("Text Field"), @@ -56,11 +72,18 @@ static GResInfo gtextfield_ri = { "Gdraw", false }; +static GGadgetCreateData textlist_gcd[] = { + {GListFieldCreate, {{0},NULL,0,0,0,0,0,&text_lab[0],list_choices,gg_visible}}, + {GListFieldCreate, {{0},NULL,0,0,0,0,0,&text_lab[1],list_choices,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *tlarray[] = { GCD_Glue, &textlist_gcd[0], GCD_Glue, &textlist_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData textlistbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) tlarray,gg_visible|gg_enabled}}; static GResInfo listfield_ri = { &listfieldmenu_ri, >extfield_ri,&listfieldmenu_ri, &listmark_ri, &glistfield_box, NULL, - NULL, + &textlistbox, NULL, N_("List Field"), N_("List Field (Combo Box)"), @@ -72,7 +95,7 @@ static GResInfo listfieldmenu_ri = { &numericfield_ri, &listfield_ri, &listmark_ri,NULL, &glistfieldmenu_box, NULL, - NULL, + &textlistbox, NULL, N_("List Field Menu"), N_("Box surrounding the ListMark in a list field (combobox)"), @@ -80,11 +103,18 @@ static GResInfo listfieldmenu_ri = { "Gdraw", false }; +static GGadgetCreateData num_gcd[] = { + {GNumericFieldCreate, {{0,0,50},NULL,0,0,0,0,0,&list_choices[0],NULL,gg_visible}}, + {GNumericFieldCreate, {{0,0,50},NULL,0,0,0,0,0,&list_choices[0],NULL,gg_visible|gg_enabled}} + }; +static GGadgetCreateData *narray[] = { GCD_Glue, &num_gcd[0], GCD_Glue, &num_gcd[1], GCD_Glue, NULL, NULL }; +static GGadgetCreateData numbox = + {GHVGroupCreate, {{2,2},NULL,0,0,0,0,0,NULL,(GTextInfo *) narray,gg_visible|gg_enabled}}; static GResInfo numericfield_ri = { &numericfieldspinner_ri, >extfield_ri,&numericfieldspinner_ri, NULL, &gnumericfield_box, NULL, - NULL, + &numbox, NULL, N_("Numeric Field"), N_("Numeric Field (Spinner)"), @@ -96,7 +126,7 @@ static GResInfo numericfieldspinner_ri = { NULL, &numericfield_ri,NULL, NULL, &gnumericfieldspinner_box, NULL, - NULL, + &numbox, NULL, N_("Numeric Field Sign"), N_("The box around the up/down arrows of a numeric field (spinner)"), diff --git a/inc/ggadget.h b/inc/ggadget.h index b32fd84e..757c71e1 100644 --- a/inc/ggadget.h +++ b/inc/ggadget.h @@ -138,6 +138,7 @@ typedef struct ggadget GGadget; typedef struct ggadget *GGadgetSet; enum sb_type { sb_upline, sb_downline, sb_uppage, sb_downpage, sb_track, sb_trackrelease }; +struct scrollbarinit { int32 sb_min, sb_max, sb_pagesize, sb_pos; }; typedef int (*GGadgetHandler)(GGadget *,GEvent *); typedef unichar_t **(*GTextCompletionHandler)(GGadget *,int from_tab); @@ -160,6 +161,7 @@ typedef struct ggadgetdata { struct matrixinit *matrix; GDrawEH drawable_e_h; /* Drawable event handler */ GTextCompletionHandler completion; + struct scrollbarinit *sbinit; Color col; } u; enum gg_flags { gg_visible=1, gg_enabled=2, gg_pos_in_pixels=4, |