当前位置: 首页>>代码示例>>C++>>正文


C++ GDrawGetUserData函数代码示例

本文整理汇总了C++中GDrawGetUserData函数的典型用法代码示例。如果您正苦于以下问题:C++ GDrawGetUserData函数的具体用法?C++ GDrawGetUserData怎么用?C++ GDrawGetUserData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GDrawGetUserData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: e_h

static int
e_h (GWindow gw, GEvent *event)
{
  if (event->type == et_close)
    {
      struct gfc_data *d = GDrawGetUserData (gw);
      d->done = true;
    }
  else if (event->type == et_map)
    /* Above palettes */
    GDrawRaise (gw);
  else if (event->type == et_char)
    return (false);
  else if (event->type == et_mousemove ||
           (event->type == et_mousedown && event->u.mouse.button == 3))
    {
      struct gfc_data *d = GDrawGetUserData (gw);
      GFileChooserPopupCheck (d->gfc, event);
    }
  else if ((event->type == et_mouseup || event->type == et_mousedown) &&
           (event->u.mouse.button >= 4 && event->u.mouse.button <= 7))
    {
      struct gfc_data *d = GDrawGetUserData (gw);
      return (GGadgetDispatchEvent ((GGadget *) (d->gfc), event));
    }
  return (true);
}
开发者ID:khaledhosny,项目名称:sortsmill,代码行数:27,代码来源:gfiledlg.c

示例2: kpd_e_h

static int kpd_e_h(GWindow gw, GEvent *event) {
    if ( event->type==et_close ) {
	KPData *kpd = GDrawGetUserData(gw);
	kpd->done = true;
    } else if ( event->type == et_mousemove ) {
	kpdpopup(GDrawGetUserData(gw));
    } else if ( event->type == et_expose ) {
	KPData *kpd = GDrawGetUserData(gw);
	GRect size, sbsize;
	GDrawGetSize(kpd->v,&size);
	GGadgetGetSize(GWidgetGetControl(kpd->gw,CID_ScrollBar),&sbsize);
	GDrawSetLineWidth(gw,0);
	GDrawDrawLine(gw,size.x,size.y-1,sbsize.x+sbsize.width-1,size.y-1,0x000000);
	GDrawDrawLine(gw,size.x,size.y+size.height,sbsize.x+sbsize.width-1,size.y+size.height,0x000000);
	GDrawDrawLine(gw,size.x-1,size.y-1,size.x-1,size.y+size.height,0x000000);
    } else if ( event->type == et_char ) {
	if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
	    help("kernpairs.html");
return( true );
	}
	if ( event->u.chr.chars[0]!='\0' && event->u.chr.chars[1]=='\0' ) {
	    enum sortby sort = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_SortBy));
	    KPData *kpd = GDrawGetUserData(gw);
	    if ( sort!=sb_kern ) {
		KPScrollTo(kpd,event->u.chr.chars[0],sort);
return( true );
	    } else
		GDrawBeep(NULL);
	}
return( false );
    } else if ( event->type == et_resize && event->u.resize.sized ) {
	KP_Resize((KPData *) GDrawGetUserData(gw) );
    }
return( true );
}
开发者ID:IceJacool,项目名称:fontforge,代码行数:35,代码来源:combinations.c

示例3: e_h

static int e_h(GWindow gw, GEvent *event) {
    if ( event->type==et_close ) {
	struct gfc_data *d = GDrawGetUserData(gw);
	d->done = true;
    } else if ( event->type == et_map ) {
	/* Above palettes */
	GDrawRaise(gw);
    } else if ( event->type == et_char ) {
return( false );
    } else if ( event->type == et_mousemove ||
	    (event->type==et_mousedown && event->u.mouse.button==3 )) {
	struct gfc_data *d = GDrawGetUserData(gw);
	if ( !WithinList(d,event) )
	    GFileChooserPopupCheck(d->gfc,event);
    } else if (( event->type==et_mouseup || event->type==et_mousedown ) &&
	    (event->u.mouse.button>=4 && event->u.mouse.button<=7) ) {
	struct gfc_data *d = GDrawGetUserData(gw);
return( GGadgetDispatchEvent((GGadget *) (d->gfc),event));
    } else if ( event->type == et_resize ) {
	GRect r, size;
	struct gfc_data *d = GDrawGetUserData(gw);
	if ( d->gfc!=NULL ) {
	    GDrawGetSize(gw,&size);
	    GGadgetGetSize(d->gfc,&r);
	    GGadgetResize(d->gfc,size.width-2*r.x,r.height);
	}
    }
return( event->type!=et_char );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:29,代码来源:openfontdlg.c

示例4: nld_e_h

static int nld_e_h(GWindow gw, GEvent *event) {
    if ( event->type==et_close ) {
	struct nldlg *d = GDrawGetUserData(gw);
	d->done = true;
    } else if ( event->type == et_char ) {
return( false );
    } else if ( event->type==et_controlevent && event->u.control.subtype==et_buttonactivate ) {
	struct nldlg *d = GDrawGetUserData(gw);
	d->done = true;
	d->ok = GGadgetGetCid(event->u.control.g);
    }
return( true );
}
开发者ID:Decepticoner,项目名称:fontforge,代码行数:13,代码来源:nonlineartransui.c

示例5: DE_Delete

static int DE_Delete(GGadget *g, GEvent *e) {
    GWindow gw;
    int *done;
    GGadget *list;
    int sel,i;
    Encoding *item;

    if ( e->type==et_controlevent &&
            (e->u.control.subtype == et_buttonactivate ||
             e->u.control.subtype == et_listdoubleclick )) {
        gw = GGadgetGetWindow(g);
        done = GDrawGetUserData(gw);
        list = GWidgetGetControl(gw,CID_Encodings);
        sel = GGadgetGetFirstListSelectedItem(list);
        i=0;
        for ( item=enclist; item!=NULL; item=item->next ) {
            if ( item->builtin )
                /* Do Nothing */;
            else if ( i==sel )
                break;
            else
                ++i;
        }
        if ( item!=NULL )
            DeleteEncoding(item);
        *done = true;
    }
    return( true );
}
开发者ID:monkeyiq,项目名称:fontforge-fill-off-by-one,代码行数:29,代码来源:encodingui.c

示例6: _BdfP_VScroll

static int _BdfP_VScroll(GGadget *g, GEvent *e) {
    if ( e->type==et_controlevent && e->u.control.subtype == et_scrollbarchange ) {
	struct bdf_dlg *bd = (struct bdf_dlg *) GDrawGetUserData(GGadgetGetWindow(g));
	BdfP_VScroll(bd,&e->u.control.u.sb);
    }
return( true );
}
开发者ID:IceJacool,项目名称:fontforge,代码行数:7,代码来源:bdfinfo.c

示例7: BdfP_Cancel

static int BdfP_Cancel(GGadget *g, GEvent *e) {
    if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
	struct bdf_dlg *bd = GDrawGetUserData(GGadgetGetWindow(g));
	BdfP_DoCancel(bd);
    }
return( true );
}
开发者ID:IceJacool,项目名称:fontforge,代码行数:7,代码来源:bdfinfo.c

示例8: GFD_Cancel

static int GFD_Cancel(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;
    }
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:7,代码来源:openfontdlg.c

示例9: Filter_OK

static int Filter_OK(GGadget *g, GEvent *e) {
    struct filter_d *d;
    struct matrix_data *md;
    int rows,i,cnt;

    if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
	if ( user_font_filters!=NULL ) {
	    for ( i=0; user_font_filters[i].name!=NULL; ++i ) {
		free(user_font_filters[i].name);
		free(user_font_filters[i].filter);
	    }
	    free(user_font_filters);
	    user_font_filters = NULL;
	}
	d = GDrawGetUserData(GGadgetGetWindow(g));
	md = GMatrixEditGet(d->gme,&rows);
	for ( i=cnt=0; i<rows; ++i )
	    if ( !md[2*i].frozen )
		++cnt;
	if ( cnt!=0 ) {
	    user_font_filters = malloc((cnt+1)*sizeof(struct openfilefilters));
	    for ( i=cnt=0; i<rows; ++i ) if ( !md[2*i].frozen ) {
		user_font_filters[cnt].name = copy(md[2*i].u.md_str);
		user_font_filters[cnt].filter = copy(md[2*i+1].u.md_str);
		++cnt;
	    }
	    user_font_filters[cnt].name = user_font_filters[cnt].filter = NULL;
	}
	SavePrefs(true);
	d->done = true;
    }
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:33,代码来源:openfontdlg.c

示例10: OD_Cancel

static int OD_Cancel(GGadget *g, GEvent *e) {
    if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
	OutlineData *od = GDrawGetUserData(GGadgetGetWindow(g));
	od->done = true;
    }
return( true );
}
开发者ID:catharanthus,项目名称:fontforge,代码行数:7,代码来源:effectsui.c

示例11: L2L_OK

static int L2L_OK(GGadget *g, GEvent *e) {

    if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
	L2LDlg *d = GDrawGetUserData(GGadgetGetWindow(g));
	int from, to, clear;
	int err=0;
	double errbound;

	from = GGadgetGetFirstListSelectedItem(GWidgetGetControl(d->gw,CID_FromLayer));
	to   = GGadgetGetFirstListSelectedItem(GWidgetGetControl(d->gw,CID_ToLayer));
	if ( d->l2l==l2l_copy ) {
	    clear = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_ClearOld));
	    if ( d->cv )
		_DoCVCopy(d->cv,from,to,clear);
	    else
		_DoFVCopy(d->fv,from,to,clear);
	} else {
	    errbound = GetReal8(d->gw,CID_ErrorBound,_("Error Bound"),&err);
	    if ( err )
return( true );
	    if ( d->cv )
		_DoCVCompare(d->cv,from,to,errbound);
	    else
		_DoFVCompare(d->fv,from,to,errbound);
	}
	d->done = true;
    }
return( true );
}
开发者ID:UIKit0,项目名称:fontforge-1,代码行数:29,代码来源:layer2layer.c

示例12: BaseLang_OK

static int BaseLang_OK(GGadget *g, GEvent *e) {

    if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
        BaseLangDlg *b = GDrawGetUserData(GGadgetGetWindow(g));
        GGadget *g = GWidgetGetControl(b->gw,CID_Languages);
        int r, rows, cols = GMatrixEditGetColCnt(g);
        struct matrix_data *md = GMatrixEditGet(g,&rows);
        struct baselangextent *cur, *last;

        if ( md==NULL )
            return( true );

        b->old = last = NULL;
        for ( r=0; r<rows; ++r ) {
            cur = XZALLOC(struct baselangextent);
            cur->lang = TagFromString(md[r*cols+0].u.md_str);
            cur->descent = md[r*cols+1].u.md_ival;
            cur->ascent = md[r*cols+2].u.md_ival;
            cur->features = (struct baselangextent *) md[r*cols+3].u.md_str;
            md[r*cols+3].u.md_str = NULL;
            if ( last==NULL )
                b->old = cur;
            else
                last->next = cur;
            last = cur;
        }
        b->done = true;
    }
开发者ID:jric,项目名称:fontforge,代码行数:28,代码来源:basedlg.c

示例13: AnchorD_Cancel

static int AnchorD_Cancel(GGadget *g, GEvent *e) {
    if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
	AnchorDlg *a = GDrawGetUserData(GGadgetGetWindow(g));
	AnchorD_DoCancel(a);
    }
return( true );
}
开发者ID:catharanthus,项目名称:fontforge,代码行数:7,代码来源:anchorsaway.c

示例14: delta_e_h

static int delta_e_h(GWindow gw, GEvent *event) {
    if ( event->type==et_close ) {
	QGData *qg = GDrawGetUserData(gw);
	qg->done = true;
    } else if ( event->type == et_char ) {
return( false );
    } else if ( event->type == et_map ) {
	/* Above palettes */
	GDrawRaise(gw);
    } else if ( event->type == et_destroy ) {
	QGData *qg = GDrawGetUserData(gw);
	free(qg->qg);
	free(qg);
    }
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:16,代码来源:deltaui.c

示例15: Delta_Cancel

static int Delta_Cancel(GGadget *g, GEvent *e) {
    if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
	QGData *qg = GDrawGetUserData(GGadgetGetWindow(g));
	qg->done = true;
    }
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:7,代码来源:deltaui.c


注:本文中的GDrawGetUserData函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。