本文整理汇总了C++中GDrawSetVisible函数的典型用法代码示例。如果您正苦于以下问题:C++ GDrawSetVisible函数的具体用法?C++ GDrawSetVisible怎么用?C++ GDrawSetVisible使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GDrawSetVisible函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GProgressDisplay
static void GProgressDisplay(void) {
GDrawSetVisible(current->gw,true);
current->visible = true;
if ( current->prev!=NULL && current->prev->visible ) {
GDrawSetVisible(current->prev->gw,false);
current->prev->visible = false;
}
}
开发者ID:Cyclens,项目名称:fontforge,代码行数:8,代码来源:gprogress.c
示例2: ManagePalettesVis
static void ManagePalettesVis(GTopLevelD *td, int is_visible ) {
GTopLevelD *palette;
if ( td->w!=last_paletted_focus_window )
return;
for ( palette=td->palettes; palette!=NULL; palette = palette->nextp ) {
if ( is_visible && palette->w->visible_request )
GDrawSetVisible(palette->w,true);
else if ( !is_visible && palette->w->visible_request ) {
GDrawSetVisible(palette->w,false);
palette->w->visible_request = true;
}
}
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:14,代码来源:gcontainer.c
示例3: AW2_OK
static int AW2_OK(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
GWindow gw = GGadgetGetWindow(g);
struct widthinfo *wi = GDrawGetUserData(gw);
int err = false;
int separation, min_side, max_side, height, loop;
separation = GetInt8(gw,CID_Separation, _("Separation"),&err);
min_side = GetInt8(gw,CID_MinSep, _("Min Bearing"),&err);
max_side = GetInt8(gw,CID_MaxSep, _("Max Bearing"),&err);
height = GetInt8(gw,CID_Height, _("Height"),&err);
loop = GetInt8(gw,CID_Loop, _("Loop Count"),&err);
if ( err )
return( true );
GDrawSetVisible(gw,false);
GDrawSync(NULL);
GDrawProcessPendingEvents(NULL);
width_last_em_size = wi->sf->ascent + wi->sf->descent;
width_separation = separation;
wi->sf->width_separation=separation;
if ( wi->sf->italicangle==0 )
width_min_side_bearing = min_side;
width_max_side_bearing = max_side;
width_chunk_height = height;
width_loop_cnt = loop;
AutoWidth2((FontViewBase *) wi->fv,separation,min_side,max_side,
height, loop);
wi->done = true;
}
return( true );
}
开发者ID:ystk,项目名称:debian-fontforge,代码行数:34,代码来源:autowidth2dlg.c
示例4: progress_eh
static int progress_eh(GWindow gw, GEvent *event) {
GProgress *p = GDrawGetUserData(gw);
switch ( event->type ) {
case et_destroy:
free(p->line1);
free(p->line2);
free(p);
break;
case et_close:
p->aborted = true;
GDrawSetVisible(gw,false);
break;
case et_expose:
GProgressDraw(p,gw,&event->u.expose.rect);
break;
case et_controlevent:
if ( event->u.control.subtype == et_buttonactivate )
p->aborted = true;
break;
case et_char:
if ( (event->u.chr.state&ksm_control) && event->u.chr.chars[0]=='.' )
p->aborted = true;
break;
case et_map:
p->sawmap = true;
break;
}
return( true );
}
开发者ID:Cyclens,项目名称:fontforge,代码行数:30,代码来源:gprogress.c
示例5: GTabSetChangeSel
static void GTabSetChangeSel(GTabSet *gts, int sel,int sendevent) {
int i, width;
int oldsel = gts->sel;
if ( sel==-2 ) /* left arrow */
--gts->toff;
else if ( sel==-3 )
++gts->toff;
else if ( sel<0 || sel>=gts->tabcnt || gts->tabs[sel].disabled )
return;
else {
if ( gts->vertical )
gts->sel = sel;
else {
for ( i=0; i<gts->rcnt && sel>=gts->rowstarts[i+1]; ++i );
if ( gts->active_row != i ) {
gts->active_row = i;
if ( gts->rcnt>1 && (!gts->filllines || gts->offset_per_row!=0))
GTabSetFigureWidths(gts);
}
gts->sel = sel;
if ( sel<gts->toff )
gts->toff = sel;
else if ( gts->scrolled ) {
for ( i=gts->toff; i<sel && gts->tabs[i].x!=0x7fff; ++i );
if ( gts->tabs[i].x==0x7fff ) {
width = gts->g.r.width-2*gts->arrow_width; /* it will have a left arrow */
if ( sel!=gts->tabcnt )
width -= gts->arrow_width; /* it might have a right arrow */
for ( i=sel; i>=0 && width-gts->tabs[i].width>=0; --i )
width -= gts->tabs[i].width;
if ( ++i>sel ) i = sel;
gts->toff = i;
}
}
}
if ( oldsel!=sel ) {
if ( sendevent )
GTabSetChanged(gts,oldsel);
if ( gts->tabs[oldsel].w!=NULL )
GDrawSetVisible(gts->tabs[oldsel].w,false);
if ( gts->tabs[gts->sel].w!=NULL )
GDrawSetVisible(gts->tabs[gts->sel].w,true);
}
}
_ggadget_redraw(>s->g);
}
开发者ID:BorisLucas,项目名称:fontforge,代码行数:47,代码来源:gtabset.c
示例6: CVMouseDownRuler
void CVMouseDownRuler(CharView *cv, GEvent *event) {
cv->autonomous_ruler_w = false;
RulerPlace(cv,event);
cv->p.rubberlining = true;
GDrawSetVisible(cv->ruler_w,true);
}
开发者ID:ystk,项目名称:debian-fontforge,代码行数:8,代码来源:cvruler.c
示例7: GWidgetRequestVisiblePalette
void GWidgetRequestVisiblePalette(GWindow palette,int visible) {
GTopLevelD *td = (GTopLevelD *) (palette->widget_data);
if ( td->owner!=NULL ) {
palette->visible_request = visible;
if ( td->owner->w == last_paletted_focus_window )
GDrawSetVisible(palette,visible);
}
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:9,代码来源:gcontainer.c
示例8: start_splash_screen
static void start_splash_screen(void){
GDrawSetVisible(splashw,true);
GDrawSync(NULL);
GDrawProcessPendingEvents(NULL);
GDrawProcessPendingEvents(NULL);
splasht = GDrawRequestTimer(splashw,1000,1000,NULL);
localsplash = false;
}
开发者ID:MichinariNukazawa,项目名称:fontforge,代码行数:9,代码来源:startui.c
示例9: DoFindOne
static int DoFindOne(SearchView *sv,int startafter) {
int i, gid;
SplineChar *startcur = sv->sd.curchar;
/* It is possible that some idiot deleted the current character since */
/* the last search... do some mild checks */
if ( sv->sd.curchar!=NULL &&
sv->sd.curchar->parent == sv->sd.fv->sf &&
sv->sd.curchar->orig_pos>=0 && sv->sd.curchar->orig_pos<sv->sd.fv->sf->glyphcnt &&
sv->sd.curchar==sv->sd.fv->sf->glyphs[sv->sd.curchar->orig_pos] )
/* Looks ok */;
else
sv->sd.curchar=startcur=NULL;
if ( !sv->sd.subpatternsearch ) startafter = false;
if ( sv->showsfindnext && sv->sd.curchar!=NULL )
i = sv->sd.fv->map->backmap[sv->sd.curchar->orig_pos]+1-startafter;
else {
startafter = false;
if ( !sv->sd.onlyselected )
i = 0;
else {
for ( i=0; i<sv->sd.fv->map->enccount; ++i )
if ( sv->sd.fv->selected[i] && (gid=sv->sd.fv->map->map[i])!=-1 &&
sv->sd.fv->sf->glyphs[gid]!=NULL )
break;
}
}
for ( ; i<sv->sd.fv->map->enccount; ++i ) {
if (( !sv->sd.onlyselected || sv->sd.fv->selected[i]) && (gid=sv->sd.fv->map->map[i])!=-1 &&
sv->sd.fv->sf->glyphs[gid]!=NULL ) {
SCSplinePointsUntick(sv->sd.fv->sf->glyphs[gid],sv->sd.fv->active_layer);
if ( SearchChar(&sv->sd,gid,startafter) )
break;
}
startafter = false;
}
if ( i>=sv->sd.fv->map->enccount ) {
ff_post_notice(_("Not Found"),sv->showsfindnext?_("The search pattern was not found again in the font %.100s"):_("The search pattern was not found in the font %.100s"),sv->sd.fv->sf->fontname);
sv->sd.curchar = startcur;
GGadgetSetTitle8(GWidgetGetControl(sv->gw,CID_Find),_("Find"));
sv->showsfindnext = false;
return( false );
}
SVSelectSC(sv);
if ( sv->lastcv!=NULL && sv->lastcv->b.sc==startcur && sv->lastcv->b.fv== sv->sd.fv ) {
CVChangeSC(sv->lastcv,sv->sd.curchar);
GDrawSetVisible(sv->lastcv->gw,true);
GDrawRaise(sv->lastcv->gw);
} else
sv->lastcv = CharViewCreate(sv->sd.curchar,(FontView *) sv->sd.fv,-1);
GGadgetSetTitle8(GWidgetGetControl(sv->gw,CID_Find),_("Find Next"));
sv->showsfindnext = true;
return( true );
}
开发者ID:ystk,项目名称:debian-fontforge,代码行数:57,代码来源:searchview.c
示例10: CPStartInfo
void CPStartInfo(CharView *cv, GEvent *event) {
if ( !cv->showcpinfo )
return;
cv->autonomous_ruler_w = false;
CpInfoPlace(cv,event);
GDrawSetVisible(cv->ruler_w,true);
}
开发者ID:ystk,项目名称:debian-fontforge,代码行数:9,代码来源:cvruler.c
示例11: GFD_New
static int GFD_New(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
struct gfc_data *d = GDrawGetUserData(GGadgetGetWindow(g));
d->done = true;
GDrawSetVisible(GGadgetGetWindow(g),false);
FontNew();
}
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:9,代码来源:openfontdlg.c
示例12: ShowErrorWindow
void ShowErrorWindow(void) {
if ( errdata.gw==NULL )
return;
GDrawSetVisible(errdata.gw,true);
GDrawRaise(errdata.gw);
if ( errdata.showing )
GDrawRequestExpose(errdata.v,NULL,false);
errdata.showing = true;
}
开发者ID:monkeyiq,项目名称:fontforge-fork,代码行数:9,代码来源:uiutil.c
示例13: ShowAboutScreen
void ShowAboutScreen(void) {
static int first=1;
if ( first ) {
GDrawResize(splashw,splashimage.u.image->width,splashimage.u.image->height+linecnt*fh);
first = false;
}
if ( splasht!=NULL )
GDrawCancelTimer(splasht);
splasht=NULL;
GDrawSetVisible(splashw,true);
}
开发者ID:MichinariNukazawa,项目名称:fontforge,代码行数:12,代码来源:startui.c
示例14: GWidgetHidePalettes
void GWidgetHidePalettes(void) {
GTopLevelD *td, *palette;
if ( last_paletted_focus_window==NULL )
return;
td = (GTopLevelD *) (last_paletted_focus_window->widget_data);
for ( palette=td->palettes; palette!=NULL; palette = palette->nextp ) {
if ( palette->w->visible_request ) {
GDrawSetVisible(palette->w,false);
palette->w->visible_request = true;
}
}
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:13,代码来源:gcontainer.c
示例15: CreateErrorWindow
static void CreateErrorWindow(void) {
GWindowAttrs wattrs;
FontRequest rq;
GRect pos,size;
int as, ds, ld;
GWindow gw;
GGadgetData gd;
extern int _GScrollBar_Width;
GDrawGetSize(GDrawGetRoot(NULL),&size);
memset(&wattrs,0,sizeof(wattrs));
wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_isdlg|wam_positioned;
wattrs.event_masks = ~(1<<et_charup);
wattrs.is_dlg = true;
wattrs.cursor = ct_pointer;
wattrs.positioned = true;
wattrs.utf8_window_title = _("Warnings");
pos.width = GDrawPointsToPixels(NULL,GGadgetScale(400));
pos.height = GDrawPointsToPixels(NULL,GGadgetScale(100));
pos.x = size.width - pos.width - 10;
pos.y = size.height - pos.height - 30;
errdata.gw = gw = GDrawCreateTopWindow(NULL,&pos,warnings_e_h,&errdata,&wattrs);
memset(&rq,0,sizeof(rq));
rq.utf8_family_name = SANS_UI_FAMILIES;
rq.point_size = 10;
rq.weight = 400;
errdata.font = GDrawInstanciateFont(NULL,&rq);
errdata.font = GResourceFindFont("Warnings.Font",errdata.font);
GDrawWindowFontMetrics(errdata.gw,errdata.font,&as,&ds,&ld);
errdata.as = as;
errdata.fh = as+ds;
memset(&gd,0,sizeof(gd));
gd.pos.y = 0;
gd.pos.height = pos.height;
gd.pos.width = GDrawPointsToPixels(gw,_GScrollBar_Width);
gd.pos.x = pos.width-gd.pos.width;
gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels|gg_sb_vert;
errdata.vsb = GScrollBarCreate(gw,&gd,&errdata);
pos.width -= gd.pos.width;
pos.x = pos.y = 0;
wattrs.mask = wam_events|wam_cursor;
errdata.v = GWidgetCreateSubWindow(gw,&pos,warningsv_e_h,&errdata,&wattrs);
GDrawSetVisible(errdata.v,true);
errdata.linecnt = pos.height/errdata.fh;
errdata.start_l = errdata.end_l = -1;
}
开发者ID:mapreri,项目名称:fontforge,代码行数:51,代码来源:uiutil.c
示例16: CVMouseMoveRuler
void CVMouseMoveRuler(CharView *cv, GEvent *event) {
if ( cv->autonomous_ruler_w )
return;
if ( !cv->p.pressed && (event->u.mouse.state&ksm_alt) ) {
if ( cv->ruler_w!=NULL && GDrawIsVisible(cv->ruler_w)) {
GDrawDestroyWindow(cv->ruler_w);
cv->ruler_w = NULL;
}
return;
}
if ( !cv->p.pressed )
CVMouseAtSpline(cv,event);
RulerPlace(cv,event);
if ( !cv->p.pressed )
GDrawSetVisible(cv->ruler_w,true);
GDrawSync(NULL);
GDrawProcessPendingEvents(NULL); /* The resize needs to happen before the expose */
if ( !cv->p.pressed && (event->u.mouse.state&ksm_alt) ) /* but a mouse up might sneak in... */
return;
GDrawRequestExpose(cv->ruler_w,NULL,false);
GDrawRequestExpose(cv->v,NULL,false);
}
开发者ID:ystk,项目名称:debian-fontforge,代码行数:23,代码来源:cvruler.c
示例17: GIntGetResource
//.........这里部分代码省略.........
gcd[i].gd.mnemonic = 'O';
gcd[i].gd.label = &label[i];
gcd[i].gd.handle_controlevent = GFD_Ok;
harray3[0] = GCD_Glue; harray3[1] = &gcd[i];
gcd[i++].creator = GButtonCreate;
gcd[i].gd.pos.x = -(spacing+bs)*100/GIntGetResource(_NUM_ScaleFactor)-12; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
gcd[i].gd.pos.width = -1;
gcd[i].gd.flags = gg_visible | gg_enabled;
label[i].text = (unichar_t *) S_("Font|_New");
label[i].text_is_1byte = true;
label[i].text_in_resource = true;
gcd[i].gd.mnemonic = 'N';
gcd[i].gd.label = &label[i];
gcd[i].gd.handle_controlevent = GFD_New;
harray3[2] = GCD_Glue; harray3[3] = &gcd[i];
gcd[i++].creator = GButtonCreate;
filter = i;
gcd[i].gd.pos.x = (spacing+bs)*100/GIntGetResource(_NUM_ScaleFactor)+12; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y;
gcd[i].gd.pos.width = -1;
gcd[i].gd.flags = /* gg_visible |*/ gg_enabled;
label[i].text = (unichar_t *) _("_Filter");
label[i].text_is_1byte = true;
label[i].text_in_resource = true;
gcd[i].gd.mnemonic = 'F';
gcd[i].gd.label = &label[i];
gcd[i].gd.handle_controlevent = GFileChooserFilterEh;
harray3[4] = &gcd[i];
gcd[i++].creator = GButtonCreate;
gcd[i].gd.pos.x = -12; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y;
gcd[i].gd.pos.width = -1;
gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
label[i].text = (unichar_t *) _("_Cancel");
label[i].text_is_1byte = true;
label[i].text_in_resource = true;
gcd[i].gd.label = &label[i];
gcd[i].gd.mnemonic = 'C';
gcd[i].gd.handle_controlevent = GFD_Cancel;
harray3[5] = GCD_Glue; harray3[6] = &gcd[i]; harray3[7] = GCD_Glue; harray3[8] = NULL;
gcd[i++].creator = GButtonCreate;
boxes[4].gd.flags = gg_visible | gg_enabled;
boxes[4].gd.u.boxelements = harray3;
boxes[4].creator = GHBoxCreate;
varray[6] = &boxes[4]; varray[7] = NULL;
varray[8] = NULL;
boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
boxes[0].gd.flags = gg_visible | gg_enabled;
boxes[0].gd.u.boxelements = varray;
boxes[0].creator = GHVGroupCreate;
gcd[i].gd.pos.x = 2; gcd[i].gd.pos.y = 2;
gcd[i].gd.pos.width = pos.width-4; gcd[i].gd.pos.height = pos.height-4;
gcd[i].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
gcd[i++].creator = GGroupCreate;
GGadgetsCreate(gw,boxes);
d.gfc = gcd[0].ret;
d.rename = gcd[renamei].ret;
filts = StandardFilters();
GGadgetSetList(harray1[2]->ret,filts,true);
GHVBoxSetExpandableRow(boxes[0].ret,0);
GHVBoxSetExpandableCol(boxes[2].ret,gb_expandglue);
GHVBoxSetExpandableCol(boxes[3].ret,gb_expandglue);
GHVBoxSetExpandableCol(boxes[4].ret,gb_expandgluesame);
GHVBoxFitWindow(boxes[0].ret);
free(namelistnames);
GGadgetSetUserData(gcd[filter].ret,gcd[0].ret);
GFileChooserConnectButtons(gcd[0].ret,harray3[1]->ret,gcd[filter].ret);
temp = utf82u_copy(filts[default_font_filter_index]->userdata);
GFileChooserSetFilterText(gcd[0].ret,temp);
free(temp);
GFileChooserGetChildren(gcd[0].ret,NULL, NULL, &tf);
if ( RecentFiles[0]!=NULL ) {
GGadgetSetList(tf,GTextInfoFromChars(RecentFiles,RECENT_MAX),false);
}
GGadgetSetTitle8(gcd[0].ret,defaultfile);
GWidgetHidePalettes();
GDrawSetVisible(gw,true);
while ( !d.done )
GDrawProcessOneEvent(NULL);
GDrawDestroyWindow(gw);
GDrawProcessPendingEvents(NULL); /* Give the window a chance to vanish... */
GDrawSync(NULL);
GDrawProcessPendingEvents(NULL); /* Give the window a chance to vanish... */
free( d.lastpopupfontname );
GTextInfoArrayFree(filts);
for ( cnt=0; nlnames[cnt]!=NULL; ++cnt) {
free(nlnames[cnt]);
}
free(nlnames);
return(d.ret);
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:101,代码来源:openfontdlg.c
示例18: ShadowDlg
//.........这里部分代码省略.........
label[i].text_is_1byte = true;
gcd[i].gd.label = &label[i];
gcd[i].gd.pos.x = 90; gcd[i].gd.pos.y = 7; gcd[i].gd.pos.width = 50;
gcd[i].gd.flags = gg_enabled|gg_visible;
gcd[i].gd.cid = CID_Width;
gcd[i++].creator = GTextFieldCreate;
hvarray[k++] = &gcd[i-1]; hvarray[k++] = NULL;
label[i].text = (unichar_t *) _("Shadow Length:");
label[i].text_is_1byte = true;
gcd[i].gd.label = &label[i];
gcd[i].gd.pos.x = gcd[i-2].gd.pos.x; gcd[i].gd.pos.y = gcd[i-2].gd.pos.y+26;
gcd[i].gd.flags = gg_enabled|gg_visible;
gcd[i++].creator = GLabelCreate;
hvarray[k++] = &gcd[i-1];
sprintf( buffer2, "%g", def_shadow_len );
label[i].text = (unichar_t *) buffer2;
label[i].text_is_1byte = true;
gcd[i].gd.label = &label[i];
gcd[i].gd.pos.x = gcd[i-2].gd.pos.x; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y-3; gcd[i].gd.pos.width = gcd[i-2].gd.pos.width;
gcd[i].gd.flags = gg_enabled|gg_visible;
gcd[i].gd.cid = CID_ShadowLen;
gcd[i++].creator = GTextFieldCreate;
hvarray[k++] = &gcd[i-1]; hvarray[k++] = NULL;
label[i].text = (unichar_t *) _("Light Angle:");
label[i].text_is_1byte = true;
gcd[i].gd.label = &label[i];
gcd[i].gd.pos.x = gcd[i-2].gd.pos.x; gcd[i].gd.pos.y = gcd[i-2].gd.pos.y+26;
gcd[i].gd.flags = gg_enabled|gg_visible;
gcd[i++].creator = GLabelCreate;
hvarray[k++] = &gcd[i-1];
sprintf( buffer3, "%g", def_sun_angle );
label[i].text = (unichar_t *) buffer3;
label[i].text_is_1byte = true;
gcd[i].gd.label = &label[i];
gcd[i].gd.pos.x = gcd[i-2].gd.pos.x; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y-3; gcd[i].gd.pos.width = gcd[i-2].gd.pos.width;
gcd[i].gd.flags = gg_enabled|gg_visible;
gcd[i].gd.cid = CID_LightAngle;
gcd[i++].creator = GTextFieldCreate;
hvarray[k++] = &gcd[i-1]; hvarray[k++] = NULL;
hvarray[k++] = &boxes[2]; hvarray[k++] = GCD_ColSpan; hvarray[k++] = NULL;
hvarray[k++] = GCD_Glue; hvarray[k++] = GCD_Glue; hvarray[k++] = NULL;
hvarray[k] = NULL;
k = 0;
gcd[i].gd.pos.x = 20-3; gcd[i].gd.pos.y = gcd[i-2].gd.pos.y+30;
gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
label[i].text = (unichar_t *) _("_OK");
label[i].text_is_1byte = true;
label[i].text_in_resource = true;
gcd[i].gd.label = &label[i];
gcd[i].gd.handle_controlevent = SD_OK;
gcd[i++].creator = GButtonCreate;
butarray[k++] = GCD_Glue; butarray[k++] = &gcd[i-1]; butarray[k++] = GCD_Glue;
gcd[i].gd.pos.x = -20; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
label[i].text = (unichar_t *) _("_Cancel");
label[i].text_is_1byte = true;
label[i].text_in_resource = true;
gcd[i].gd.label = &label[i];
gcd[i].gd.handle_controlevent = OD_Cancel;
gcd[i++].creator = GButtonCreate;
butarray[k++] = GCD_Glue; butarray[k++] = &gcd[i-1]; butarray[k++] = GCD_Glue;
butarray[k] = NULL;
boxes[2].gd.flags = gg_enabled|gg_visible;
boxes[2].gd.u.boxelements = butarray;
boxes[2].creator = GHBoxCreate;
boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
boxes[0].gd.flags = gg_enabled|gg_visible;
boxes[0].gd.u.boxelements = hvarray;
boxes[0].creator = GHVGroupCreate;
gcd[i].gd.pos.x = 2; gcd[i].gd.pos.y = 2;
gcd[i].gd.pos.width = pos.width-4; gcd[i].gd.pos.height = pos.height-4;
gcd[i].gd.flags = gg_enabled|gg_visible|gg_pos_in_pixels;
gcd[i].creator = GGroupCreate;
GGadgetsCreate(gw,boxes);
GHVBoxSetExpandableRow(boxes[0].ret,gb_expandglue);
GHVBoxSetExpandableCol(boxes[2].ret,gb_expandgluesame);
GHVBoxFitWindow(boxes[0].ret);
GWidgetIndicateFocusGadget(GWidgetGetControl(gw,CID_ShadowLen));
GTextFieldSelect(GWidgetGetControl(gw,CID_ShadowLen),0,-1);
GWidgetHidePalettes();
GDrawSetVisible(gw,true);
while ( !od.done )
GDrawProcessOneEvent(NULL);
GDrawSetVisible(gw,false);
}
开发者ID:catharanthus,项目名称:fontforge,代码行数:101,代码来源:effectsui.c
示例19: FilterDlg
//.........这里部分代码省略.........
for ( i=0; user_font_filters[i].name!=NULL; ++i ) {
if ( *(char *) user_font_filters[i].name != '-' ) {
if ( k ) {
md[2*cnt].u.md_str = copy(user_font_filters[i].name);
md[2*cnt].frozen = false;
md[2*cnt+1].u.md_str = copy(user_font_filters[i].filter);
md[2*cnt+1].frozen = false;
}
++cnt;
}
}
}
if ( !k )
md = calloc(2*cnt,sizeof(struct matrix_data));
}
mi.initial_row_cnt = cnt;
mi.matrix_data = md;
memset(&d,'\0',sizeof(d));
memset(&wattrs,0,sizeof(wattrs));
wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict|wam_isdlg;
wattrs.event_masks = ~(1<<et_charup);
wattrs.restrict_input_to_me = 1;
wattrs.is_dlg = true;
wattrs.undercursor = 1;
wattrs.cursor = ct_pointer;
wattrs.utf8_window_title = _("Edit Font Filters");
pos.x = pos.y = 0;
ptwidth = 2*GIntGetResource(_NUM_Buttonsize)+GGadgetScale(60);
pos.width =GDrawPointsToPixels(NULL,ptwidth);
pos.height = GDrawPointsToPixels(NULL,90);
gw = GDrawCreateTopWindow(NULL,&pos,filter_e_h,&d,&wattrs);
memset(&label,0,sizeof(label));
memset(&gcd,0,sizeof(gcd));
memset(&boxes,0,sizeof(boxes));
gcd[0].gd.pos.x = 10; gcd[0].gd.pos.y = 6;
gcd[0].gd.pos.width = 300; gcd[0].gd.pos.height = 200;
gcd[0].gd.flags = gg_visible | gg_enabled;
gcd[0].creator = GMatrixEditCreate;
gcd[0].gd.u.matrix = &mi;
varray[0] = &gcd[0]; varray[1] = NULL;
gcd[1].gd.pos.x = 20-3; gcd[1].gd.pos.y = 90-35-3;
gcd[1].gd.pos.width = -1; gcd[1].gd.pos.height = 0;
gcd[1].gd.flags = gg_visible | gg_enabled | gg_but_default;
label[1].text = (unichar_t *) _("_OK");
label[1].text_is_1byte = true;
label[1].text_in_resource = true;
gcd[1].gd.label = &label[1];
gcd[1].gd.handle_controlevent = Filter_OK;
gcd[1].creator = GButtonCreate;
harray[0] = GCD_Glue; harray[1] = &gcd[1]; harray[2] = GCD_Glue;
gcd[2].gd.pos.x = -20; gcd[2].gd.pos.y = 90-35;
gcd[2].gd.pos.width = -1; gcd[2].gd.pos.height = 0;
gcd[2].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
label[2].text = (unichar_t *) _("_Cancel");
label[2].text_is_1byte = true;
label[2].text_in_resource = true;
gcd[2].gd.label = &label[2];
gcd[2].gd.handle_controlevent = Filter_Cancel;
gcd[2].creator = GButtonCreate;
harray[3] = GCD_Glue; harray[4] = &gcd[2]; harray[5] = GCD_Glue;
harray[6] = NULL;
varray[2] = &boxes[2]; varray[3] = NULL;
varray[4] = NULL;
boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
boxes[0].gd.flags = gg_enabled|gg_visible;
boxes[0].gd.u.boxelements = varray;
boxes[0].creator = GHVGroupCreate;
boxes[2].gd.flags = gg_enabled|gg_visible;
boxes[2].gd.u.boxelements = harray;
boxes[2].creator = GHBoxCreate;
GGadgetsCreate(gw,boxes);
GHVBoxSetExpandableRow(boxes[0].ret,0);
GHVBoxSetExpandableCol(boxes[2].ret,gb_expandgluesame);
GHVBoxFitWindow(boxes[0].ret);
GMatrixEditSetNewText(gcd[0].ret,S_("Filter|New"));
d.gme = gcd[0].ret;
GDrawSetVisible(gw,true);
while ( !d.done )
GDrawProcessOneEvent(NULL);
GDrawDestroyWindow(gw);
for ( i=0; i<cnt; ++i ) {
free(md[2*i].u.md_str);
free(md[2*i+1].u.md_str);
}
free(md);
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:101,代码来源:openfontdlg.c
示例20: GWidgetOpenFileWPath
//.........这里部分代码省略.........
memset (&label, 0, sizeof (label));
memset (&gcd, 0, sizeof (gcd));
memset (&boxes, 0, sizeof (boxes));
gcd[0].gd.pos.x = 12;
gcd[0].gd.pos.y = 6;
gcd[0].gd.pos.width = 223 - 24;
gcd[0].gd.pos.height = 180;
gcd[0].gd.flags = gg_visible | gg_enabled;
gcd[0].creator = GFileChooserCreate;
varray[0] = &gcd[0];
varray[1] = NULL;
gcd[1].gd.pos.x = 12;
gcd[1].gd.pos.y = 192 - 3;
gcd[1].gd.pos.width = -1;
gcd[1].gd.flags = gg_visible | gg_enabled | gg_but_default;
label[1].text = (uint32_t *) _("_OK");
label[1].text_is_1byte = true;
label[1].text_has_mnemonic = true;
gcd[1].gd.label = &label[1];
gcd[1].gd.handle_controlevent = GFD_Ok;
gcd[1].creator = GButtonCreate;
harray[0] = GCD_Glue;
harray[1] = &gcd[1];
gcd[2].gd.pos.x =
(totwid - bs) * 100 / GIntGetResource (_NUM_ScaleFactor) / 2;
gcd[2].gd.pos.y = gcd[1].gd.pos.y + 3;
gcd[2].gd.pos.width = -1;
gcd[2].gd.flags = gg_visible | gg_enabled;
label[2].text = (uint32_t *) _("_Filter");
label[2].text_is_1byte = true;
label[2].text_has_mnemonic = true;
gcd[2].gd.label = &label[2];
gcd[2].gd.handle_controlevent = GFileChooserFilterEh;
gcd[2].creator = GButtonCreate;
harray[2] = GCD_Glue;
harray[3] = &gcd[2];
gcd[3].gd.pos.x = -gcd[1].gd.pos.x;
gcd[3].gd.pos.y = gcd[2].gd.pos.y;
gcd[3].gd.pos.width = -1;
gcd[3].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
label[3].text = (uint32_t *) _("_Cancel");
label[3].text_is_1byte = true;
label[3].text_has_mnemonic = true;
gcd[3].gd.label = &label[3];
gcd[3].gd.handle_controlevent = GFD_Cancel;
gcd[3].creator = GButtonCreate;
harray[4] = GCD_Glue;
harray[5] = &gcd[3];
harray[6] = GCD_Glue;
harray[7] = NULL;
boxes[2].gd.flags = gg_visible | gg_enabled;
boxes[2].gd.u.boxelements = harray;
boxes[2].creator = GHBoxCreate;
varray[2] = &boxes[2];
varray[3] = NULL;
varray[4] = NULL;
boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
boxes[0].gd.flags = gg_visible | gg_enabled;
boxes[0].gd.u.boxelements = varray;
boxes[0].creator = GHVGroupCreate;
gcd[4].gd.pos.x = 2;
gcd[4].gd.pos.y = 2;
gcd[4].gd.pos.width = pos.width - 4;
gcd[4].gd.pos.height = pos.height - 4;
gcd[4].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
gcd[4].creator = GGroupCreate;
GGadgetsCreate (gw, boxes);
GGadgetSetUserData (gcd[2].ret, gcd[0].ret);
GHVBoxSetExpandableRow (boxes[0].ret, 0);
GHVBoxSetExpandableCol (boxes[2].ret, gb_expandgluesame);
GHVBoxFitWindow (boxes[0].ret);
GFileChooserConnectButtons (gcd[0].ret, gcd[1].ret, gcd[2].ret);
GFileChooserSetFilterText (gcd[0].ret, initial_filter);
GFileChooserSetFilterFunc (gcd[0].ret, filter);
GFileChooserSetMimetypes (gcd[0].ret, mimetypes);
GFileChooserSetPaths (gcd[0].ret, path);
GGadgetSetTitle (gcd[0].ret, defaultfile);
memset (&d, '\0', sizeof (d));
d.gfc = gcd[0].ret;
GDrawSetVisible (gw, true);
while (!d.done)
GDrawProcessOneEvent (NULL);
GDrawDestroyWindow (gw);
GDrawProcessPendingEvents (NULL); /* Give the window a chance to vanish... */
GDrawSync (NULL);
GDrawProcessPendingEvents (NULL); /* Give the window a chance to vanish... */
GProgressResumeTimer ();
return (d.ret);
}
开发者ID:khaledhosny,项目名称:sortsmill,代码行数:101,代码来源:gfiledlg.c
注:本文中的GDrawSetVisible函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论