本文整理汇总了C++中CHECKOPT2函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECKOPT2函数的具体用法?C++ CHECKOPT2怎么用?C++ CHECKOPT2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CHECKOPT2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clip_GTK_EXTEXTSETADJUSTMENTS
int
clip_GTK_EXTEXTSETADJUSTMENTS(ClipMachine * cm)
{
C_widget *extext = _fetch_cw_arg(cm);
C_widget *chadj = _fetch_cwidget(cm, _clip_spar(cm, 2));
C_widget *cvadj = _fetch_cwidget(cm, _clip_spar(cm, 3));
GtkAdjustment *hadj, *vadj;
CHECKCWID(extext, GTK_IS_EXTEXT);
CHECKOPT2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
CHECKCWIDOPT(chadj, GTK_IS_ADJUSTMENT);
CHECKOPT2(3, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
CHECKCWIDOPT(cvadj, GTK_IS_ADJUSTMENT);
hadj = chadj ? GTK_ADJUSTMENT(chadj->widget) : NULL;
vadj = cvadj ? GTK_ADJUSTMENT(cvadj->widget) : NULL;
gtk_extext_set_adjustments(GTK_EXTEXT(extext->widget), hadj, vadj);
return 0;
err:
return 1;
}
示例2: clip_GTK_CTREENODESETPIXTEXT
/* Set the pixmap in a node. */
int
clip_GTK_CTREENODESETPIXTEXT(ClipMachine * cm)
{
C_widget *cctree = _fetch_cw_arg(cm);
C_object *cnode = _fetch_cobject(cm,_clip_spar(cm,2));
gint column = _clip_parni(cm,3);
gchar *text = _clip_parc(cm,4);
gint spacing = _clip_parni(cm,5);
C_widget *cpixmap = _fetch_cwidget(cm,_clip_spar(cm,6));
GdkPixmap *pixmap=NULL; GdkBitmap *mask=NULL;
CHECKCWID(cctree,GTK_IS_CTREE);
CHECKOPT2(2,MAP_t,NUMERIC_t); CHECKCOBJOPT(cnode,cnode->type==GTK_TYPE_CTREE_NODE);
CHECKOPT(3,NUMERIC_t); CHECKOPT(4,CHARACTER_t); CHECKOPT(5,NUMERIC_t);
CHECKOPT2(6,MAP_t,NUMERIC_t); CHECKCWIDOPT(cpixmap,GTK_IS_PIXMAP);
if (_clip_parinfo(cm,3)==UNDEF_t) column = 1;
if (_clip_parinfo(cm,4)==UNDEF_t) text = "";
if (cpixmap)
{
pixmap = GTK_PIXMAP(cpixmap->widget)->pixmap;
mask = GTK_PIXMAP(cpixmap->widget)->mask;
}
LOCALE_TO_UTF(text);
gtk_ctree_node_set_pixtext(GTK_CTREE(cctree->widget),
GTK_CTREE_NODE(cnode->object), column-1,
text,spacing,pixmap,mask);
FREE_TEXT(text);
return 0;
err:
return 1;
}
示例3: clip_GTK_WIDGETSETSCROLLADJUSTMENTS
/* Sets vertical and horizontal adjustments */
int
clip_GTK_WIDGETSETSCROLLADJUSTMENTS(ClipMachine * cm)
{
C_widget *cwid = _fetch_cw_arg(cm);
C_widget *chadj = _fetch_cwidget(cm, _clip_spar(cm,2));
C_widget *cvadj = _fetch_cwidget(cm, _clip_spar(cm,3));
CHECKCWID(cwid,GTK_IS_WIDGET);
CHECKOPT2(2,NUMERIC_t,MAP_t); CHECKCWIDOPT(chadj,GTK_IS_ADJUSTMENT);
CHECKOPT2(3,NUMERIC_t,MAP_t); CHECKCWIDOPT(cvadj,GTK_IS_ADJUSTMENT);
_clip_retl(cm, gtk_widget_set_scroll_adjustments(cwid->widget,
GTK_ADJUSTMENT(chadj->widget),GTK_ADJUSTMENT(cvadj->widget)));
return 0;
err:
return 1;
}
示例4: clip_GTK_TREESELECTIONGETSELECTED
int
clip_GTK_TREESELECTIONGETSELECTED(ClipMachine * cm)
{
C_object *ctreesel = _fetch_co_arg(cm);
C_object *cmodel = _fetch_cobject(cm, _clip_par(cm, 2));
ClipVar *cviter = _clip_par(cm, 3);
C_object *citer;
GtkTreeModel *model;
gboolean ret;
CHECKOPT2(1, MAP_t, NUMERIC_t); CHECKCOBJ(ctreesel,GTK_IS_TREE_SELECTION(ctreesel->object));
memset(Iter, 0, sizeof(Iter));
if (cmodel)
{
model = GTK_TREE_MODEL(cmodel->object);
ret = gtk_tree_selection_get_selected(GTK_TREE_SELECTION(ctreesel->object),
&model, Iter);
}
else
ret = gtk_tree_selection_get_selected(GTK_TREE_SELECTION(ctreesel->object),
NULL, Iter);
if (ret && Iter)
{
citer = _list_get_cobject(cm,Iter);
if (!citer) citer = _register_object(cm,Iter,GTK_TYPE_TREE_ITER, cviter, NULL);
if (citer) _clip_mclone(cm, cviter,&citer->obj);
}
_clip_retl(cm, ret);
return 0;
err:
return 1;
}
示例5: clip_GTK_EXTEXTSETPOPUPMENU
int
clip_GTK_EXTEXTSETPOPUPMENU(ClipMachine * cm)
{
C_widget *extext = _fetch_cw_arg(cm);
C_widget *widget = _fetch_cwidget(cm, _clip_spar(cm, 2));
C_widget *marginmenu = _fetch_cwidget(cm, _clip_spar(cm, 3));
CHECKCWID(extext, GTK_IS_EXTEXT);
CHECKOPT2(2, MAP_t, NUMERIC_t); CHECKCWID(widget, GTK_IS_WIDGET);
CHECKOPT2(3, MAP_t, NUMERIC_t); CHECKCWID(marginmenu, GTK_IS_WIDGET);
gtk_extext_set_popup_menu(GTK_EXTEXT(extext->widget), GTK_WIDGET(widget->widget), GTK_WIDGET(marginmenu->widget));
return 0;
err:
return 1;
}
示例6: clip_GTK_IMAGEMENUITEMNEWFROMSTOCK
int
clip_GTK_IMAGEMENUITEMNEWFROMSTOCK(ClipMachine * cm)
{
ClipVar *cv = _clip_spar(cm, 1);
gchar *stock_id = _clip_parc(cm, 2);
C_widget *accelgr = _fetch_cwidget(cm, _clip_spar(cm, 3));
C_widget *cimage ;
GtkWidget *image ;
CHECKOPT(1,MAP_t);
CHECKARG(2, CHARACTER_t);
CHECKOPT2(3, MAP_t, NUMERIC_t); CHECKCWIDOPT(accelgr, GTK_IS_ACCEL_GROUP);
image = gtk_image_menu_item_new_from_stock(stock_id,
(accelgr != NULL)?GTK_ACCEL_GROUP(accelgr->widget):NULL);
if (image)
{
cimage = _list_get_cwidget(cm, image);
if (!cimage) cimage = _register_widget(cm, image, cv);
if (cimage) _clip_mclone(cm, RETPTR(cm), &cimage->obj);
}
return 0;
err:
return 1;
}
示例7: clip_GDK_DRAWLINE
/* Draws a line, using the foreground color and other attributes of the GdkGC. */
int
clip_GDK_DRAWLINE(ClipMachine * ClipMachineMemory)
{
C_widget *cwid = _fetch_cw_arg(ClipMachineMemory);
C_object *cgc = _fetch_cobject(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));
gint x1 = _clip_parni(ClipMachineMemory, 3);
gint y1 = _clip_parni(ClipMachineMemory, 4);
gint x2 = _clip_parni(ClipMachineMemory, 5);
gint y2 = _clip_parni(ClipMachineMemory, 6);
GdkDrawable *drw = NULL;
CHECKCWID(cwid, GTK_IS_WIDGET);
CHECKOPT2(2, NUMERIC_type_of_ClipVarType, MAP_type_of_ClipVarType);
CHECKCOBJ(cgc, GDK_IS_GC(cgc));
CHECKOPT(3, NUMERIC_type_of_ClipVarType);
CHECKOPT(4, NUMERIC_type_of_ClipVarType);
CHECKOPT(5, NUMERIC_type_of_ClipVarType);
CHECKOPT(6, NUMERIC_type_of_ClipVarType);
drw = cwid->widget->window;
if (GTK_IS_PIXMAP(cwid->widget))
drw = GTK_PIXMAP(cwid->widget)->pixmap;
gdk_draw_line(drw, GDK_GC(cgc->object), x1, y1, x2, y2);
return 0;
err:
return 1;
}
示例8: clip_GDK_DRAWRECTANGLE
/* Note: A rectangle drawn filled is 1 pixel smaller in both dimensions
* than a rectangle outlined. Calling gdk_draw_rectangle (window, gc, TRUE, 0, 0, 20, 20)
* results in a filled rectangle 20 pixels wide and 20 pixels high. Calling
* gdk_draw_rectangle (window, gc, FALSE, 0, 0, 20, 20) results in an outlined
* rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which makes
* it 21 pixels wide and 21 pixels high. */
int
clip_GDK_DRAWRECTANGLE(ClipMachine * ClipMachineMemory)
{
C_widget *cwid = _fetch_cw_arg(ClipMachineMemory);
C_object *cgc = _fetch_cobject(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));
gint filled = BOOL_OPTION(ClipMachineMemory, 3, TRUE);
gint x = _clip_parni(ClipMachineMemory, 4);
gint y = _clip_parni(ClipMachineMemory, 5);
gint width = _clip_parni(ClipMachineMemory, 6);
gint height = _clip_parni(ClipMachineMemory, 7);
GdkDrawable *drw = NULL;
CHECKCWID(cwid, GTK_IS_WIDGET);
CHECKOPT2(2, NUMERIC_type_of_ClipVarType, MAP_type_of_ClipVarType);
CHECKCOBJ(cgc, GDK_IS_GC(cgc));
CHECKOPT(3, LOGICAL_type_of_ClipVarType);
CHECKOPT(4, NUMERIC_type_of_ClipVarType);
CHECKOPT(5, NUMERIC_type_of_ClipVarType);
CHECKOPT(6, NUMERIC_type_of_ClipVarType);
CHECKOPT(7, NUMERIC_type_of_ClipVarType);
drw = cwid->widget->window;
if (GTK_IS_PIXMAP(cwid->widget))
drw = GTK_PIXMAP(cwid->widget)->pixmap;
gdk_draw_rectangle(drw, GDK_GC(cgc->object), filled, x, y, width, height);
return 0;
err:
return 1;
}
示例9: clip_GTK_ACCELGROUPCONNECT
int
clip_GTK_ACCELGROUPCONNECT(ClipMachine * ClipMachineMemory)
{
C_widget *caccelg = _fetch_cw_arg(ClipMachineMemory);
guint accel_key = _clip_parni(ClipMachineMemory, 2);
GdkModifierType accel_mods = _clip_parni(ClipMachineMemory, 3);
GtkAccelFlags accel_flags = _clip_parni(ClipMachineMemory, 4);
C_object *cclosure = _fetch_cobject(ClipMachineMemory, _clip_spar(ClipMachineMemory, 5));
GClosure *closure;
CHECKCWID(caccelg, GTK_IS_ACCEL_GROUP);
CHECKOPT2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
CHECKOPT(2, NUMERIC_type_of_ClipVarType);
CHECKOPT(3, NUMERIC_type_of_ClipVarType);
CHECKOPT(4, NUMERIC_type_of_ClipVarType);
closure = (GClosure *) (cclosure->object);
gtk_accel_group_connect(GTK_ACCEL_GROUP(caccelg->widget), accel_key, accel_mods, accel_flags, closure);
return 0;
err:
return 1;
}
示例10: clip_GTK_SPINBUTTONCONFIGURE
int
clip_GTK_SPINBUTTONCONFIGURE(ClipMachine * ClipMachineMemory)
{
C_widget *cspb = _fetch_cw_arg(ClipMachineMemory);
C_widget *cadj = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));
gfloat climb_rate = DBL_OPTION(ClipMachineMemory, 3, 1);
guint digits = INT_OPTION(ClipMachineMemory, 4, 1);
GtkAdjustment *adj;
CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
CHECKCWID(cspb, GTK_IS_SPIN_BUTTON);
CHECKOPT2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
CHECKCWIDOPT(cadj, GTK_IS_ADJUSTMENT);
CHECKOPT(3, NUMERIC_type_of_ClipVarType);
CHECKOPT(4, NUMERIC_type_of_ClipVarType);
adj = cadj ? GTK_ADJUSTMENT(cadj->widget) : NULL;
gtk_spin_button_configure(GTK_SPIN_BUTTON(cspb->widget), adj, climb_rate, digits);
return 0;
err:
return 1;
}
示例11: clip_GTK_CTREENODEGETPIXMAP
int
clip_GTK_CTREENODEGETPIXMAP(ClipMachine * cm)
{
C_widget *cctree = _fetch_cw_arg(cm);
C_object *cnode = _fetch_cobject(cm,_clip_spar(cm,2));
gint column = _clip_parni(cm,3);
GdkPixmap *pixmap;
GdkBitmap *mask;
C_widget *cpixmap;
CHECKCWID(cctree,GTK_IS_CTREE);
CHECKOPT2(2,MAP_t,NUMERIC_t); CHECKCOBJOPT(cnode,cnode->type==GTK_TYPE_CTREE_NODE);
CHECKOPT(3,NUMERIC_t);
if (_clip_parinfo(cm,3)==UNDEF_t) column = 1;
if (gtk_ctree_node_get_pixmap(GTK_CTREE(cctree->widget),
GTK_CTREE_NODE(cnode->object),column-1,&pixmap,&mask))
{
if (pixmap)
{
cpixmap = _list_get_cwidget_by_data(cm,pixmap);
if (!cpixmap) cpixmap = _register_widget(cm,gtk_pixmap_new(pixmap,mask),NULL);
if (cpixmap) _clip_mclone(cm,RETPTR(cm),&cpixmap->obj);
}
}
return 0;
err:
return 1;
}
示例12: clip_SX_CHILL
int
clip_SX_CHILL(ClipMachine * ClipMachineMemory)
{
const char *__PROC__ = "SX_CHILL";
ClipVar *order = _clip_par(ClipMachineMemory, 1);
ClipVar *index = _clip_par(ClipMachineMemory, 2);
DBWorkArea *wa = cur_area(ClipMachineMemory);
int ord, er;
ClipMachineMemory->m6_error = 0;
CHECKWA(wa);
CHECKOPT2(1, CHARACTER_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
CHECKOPT1(2, CHARACTER_type_of_ClipVarType);
_clip_retl(ClipMachineMemory, 0);
ord = get_orderno(wa, order, index);
if (ord == -1)
ord = wa->rd->curord;
if (ord == -1)
return 0;
wa->rd->orders[ord]->custom = 0;
wa->rd->orders[ord]->canadd = 0;
_clip_retl(ClipMachineMemory, 1);
return 0;
err:
return er;
}
示例13: clip_GTK_HSCROLLBARNEW
/**** Horizontal scrollbar constructor ****/
int
clip_GTK_HSCROLLBARNEW(ClipMachine * ClipMachineMemory)
{
ClipVar *cv = _clip_spar(ClipMachineMemory, 1);
C_widget *cadj = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));
GtkAdjustment *adj;
GtkWidget *wid = NULL;
C_widget *cwid;
CHECKOPT(1, MAP_type_of_ClipVarType);
CHECKOPT2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
CHECKCWIDOPT(cadj, GTK_IS_ADJUSTMENT);
adj = cadj ? GTK_ADJUSTMENT(cadj->widget) : NULL;
wid = gtk_hscrollbar_new(adj);
if (!wid)
goto err;
cwid = _register_widget(ClipMachineMemory, wid, cv);
_clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
return 0;
err:
return 1;
}
示例14: clip_GTK_FILECHOOSERWIDGETNEWWITHBACKEND
int
clip_GTK_FILECHOOSERWIDGETNEWWITHBACKEND(ClipMachine * ClipMachineMemory)
{
ClipVar *cv = _clip_spar(ClipMachineMemory, 1);
GtkFileChooserAction action = _clip_parni(ClipMachineMemory, 2);
gchar *backend = _clip_parc(ClipMachineMemory, 2);
GtkWidget *wid;
C_widget *cwid;
CHECKOPT2(1, NUMERIC_type_of_ClipVarType, MAP_type_of_ClipVarType);
CHECKARG(2, NUMERIC_type_of_ClipVarType);
CHECKARG(3, CHARACTER_type_of_ClipVarType);
wid = gtk_file_chooser_widget_new_with_backend(action, backend);
if (wid)
{
cwid = _list_get_cwidget(ClipMachineMemory, wid);
if (!cwid)
cwid = _register_widget(ClipMachineMemory, wid, cv);
if (cwid)
_clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
}
return 0;
err:
return 1;
}
示例15: clip_GTK_SPINBUTTONNEW
/**** SPIN BUTTON constructor ****/
int
clip_GTK_SPINBUTTONNEW(ClipMachine * ClipMachineMemory)
{
ClipVar *cv = _clip_spar(ClipMachineMemory, 1);
C_widget *cadj = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));
gfloat climb_rate = DBL_OPTION(ClipMachineMemory, 3, 1);
guint digits = INT_OPTION(ClipMachineMemory, 4, 1);
GtkWidget *wid = NULL;
GtkAdjustment *adj;
C_widget *cwid;
CHECKOPT(1, MAP_type_of_ClipVarType);
CHECKOPT2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
CHECKCWIDOPT(cadj, GTK_IS_ADJUSTMENT);
CHECKOPT(3, NUMERIC_type_of_ClipVarType);
CHECKOPT(4, NUMERIC_type_of_ClipVarType);
adj = cadj ? GTK_ADJUSTMENT(cadj->widget) : NULL;
wid = gtk_spin_button_new(adj, climb_rate, digits);
if (!wid)
goto err;
cwid = _register_widget(ClipMachineMemory, wid, cv);
_clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
return 0;
err:
return 1;
}