本文整理匯總了C++中GDrawSetVisible函數的典型用法代碼示例。如果您正苦於以下問題:C++ GDrawSetVisible函數的具體用法?C++ GDrawSetVisible怎麽用?C++ GDrawSetVisible使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GDrawSetVisible函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
}
示例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;
}
}
}
示例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 );
}
示例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 );
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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 );
}
示例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);
}
示例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 );
}
示例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;
}
示例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);
}
示例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;
}
}
}
示例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;
}