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


C++ CHECKOPT函数代码示例

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


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

示例1: clip_GDK_POINTERGRAB

/* Grabs the pointer (usually a mouse) so that all events are passed to this
 * application until the pointer is ungrabbed with gdk_pointer_ungrab(), or
 * the grab window becomes unviewable. This overrides any previous pointer
 * grab by this client.

 * Pointer grabs are used for operations which need complete control over mouse
 * events, even if the mouse leaves the application. For example in GTK+ it is
 * used for Drag and Drop, for dragging the handle in the GtkHPaned and GtkVPaned
 * widgets, and for resizing columns in GtkCList widgets.

 * Note that if the event mask of an X window has selected both button press and
 * button release events, then a button press event will cause an automatic pointer
 * grab until the button is released. X does this automatically since most
 * applications expect to receive button press and release events in pairs.
 * It is equivalent to a pointer grab on the window with owner_events set to TRUE. */
int
clip_GDK_POINTERGRAB(ClipMachine * ClipMachineMemory)
{
   C_widget *cwin = _fetch_cw_arg(ClipMachineMemory);

   GdkWindow *win = NULL;

   gboolean  owner_events = _clip_parl(ClipMachineMemory, 2);

   GdkEventMask event_mask = _clip_parnl(ClipMachineMemory, 3);

   C_widget *cconfine_to = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 4));

   GdkWindow *confine_to = NULL;

   C_object *ccursor = _fetch_cobject(ClipMachineMemory, _clip_spar(ClipMachineMemory, 5));

   GdkCursor *cursor = NULL;

   CHECKCWID(cwin, GTK_IS_WIDGET);
   CHECKOPT(2, LOGICAL_type_of_ClipVarType);
   CHECKOPT(3, NUMERIC_type_of_ClipVarType);
   CHECKOPT2(4, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCWIDOPT(cwin, GTK_IS_WIDGET);
   CHECKOPT2(5, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJOPT(ccursor, GDK_IS_CURSOR(ccursor));

   if (cwin && cwin->widget)
      win = cwin->widget->window;
   if (cconfine_to && cconfine_to->widget)
      confine_to = cconfine_to->widget->window;
   if (ccursor)
      cursor = GDK_CURSOR(ccursor->object);

   _clip_retni(ClipMachineMemory, gdk_pointer_grab(win, owner_events, event_mask, confine_to, cursor, GDK_CURRENT_TIME));

   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:55,代码来源:gdk.c

示例2: clip_GTK_WINDOWNEW

/****  WINDOW constructor ****/
int
clip_GTK_WINDOWNEW(ClipMachine * ClipMachineMemory)
{
   ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

   char     *title = _clip_parc(ClipMachineMemory, 2);

   gint      typ = INT_OPTION(ClipMachineMemory, 3, 0);

   GtkWidget *wid = NULL;

   C_widget *cwid;

   CHECKOPT(1, MAP_type_of_ClipVarType);
   CHECKOPT(2, CHARACTER_type_of_ClipVarType);
   CHECKOPT(3, NUMERIC_type_of_ClipVarType);

  //wid = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   wid = gtk_window_new(typ);
   if (!wid)
      goto err;
   if (_clip_parinfo(ClipMachineMemory, 2) == CHARACTER_type_of_ClipVarType)
    {
       LOCALE_TO_UTF(title);
       gtk_window_set_title(GTK_WINDOW(wid), title);
       FREE_TEXT(title);
    }
  //cwid = (C_widget*)calloc( 1, sizeof(C_widget) );
   cwid = _register_widget(ClipMachineMemory, wid, cv);
   cwid->accel_group = gtk_accel_group_new();
   gtk_window_add_accel_group(GTK_WINDOW(wid), cwid->accel_group);
//      gtk_signal_connect( GTK_OBJECT( wid ), "delete-event",
//              GTK_SIGNAL_FUNC( delete_window_handler ), NULL );

   _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:40,代码来源:window.c

示例3: clip_GTK_WINDOWSETPOLICY

/* Sets resize policy */
int
clip_GTK_WINDOWSETPOLICY(ClipMachine * ClipMachineMemory)
{
   C_widget *cwin = _fetch_cw_arg(ClipMachineMemory);

   gboolean  AutoShrink = FALSE, AllowShrink = TRUE, AllowGrow = TRUE;

   CHECKOPT(2, LOGICAL_type_of_ClipVarType);
   CHECKOPT(3, LOGICAL_type_of_ClipVarType);
   CHECKOPT(4, LOGICAL_type_of_ClipVarType);
   CHECKCWID(cwin, GTK_IS_WINDOW);
   if (_clip_parinfo(ClipMachineMemory, 2) == LOGICAL_type_of_ClipVarType)
      AutoShrink = _clip_parl(ClipMachineMemory, 2);
   if (_clip_parinfo(ClipMachineMemory, 3) == LOGICAL_type_of_ClipVarType)
      AllowGrow = _clip_parl(ClipMachineMemory, 3);
   if (_clip_parinfo(ClipMachineMemory, 4) == LOGICAL_type_of_ClipVarType)
      AllowShrink = _clip_parl(ClipMachineMemory, 4);
   gtk_window_set_policy(GTK_WINDOW(cwin->widget), AllowShrink, AllowGrow, AutoShrink);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:23,代码来源:window.c

示例4: clip_GTK_PANEDSETPOSITION

/* Set the position of the separator, as if set by the user. If position is
 * negative, the remembered position is forgotten, and the division is
 * recomputed from the the requisitions of the children. */
int
clip_GTK_PANEDSETPOSITION(ClipMachine * cm)
{
	C_widget  *cpan = _fetch_cw_arg(cm);
	gint   position = _clip_parni(cm,2);
	CHECKCWID(cpan,GTK_IS_PANED);
	CHECKOPT(2,NUMERIC_t);
	if (_clip_parinfo(cm,2)==UNDEF_t) position = -1;
	gtk_paned_set_position(GTK_PANED(cpan->widget), position);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:16,代码来源:paned.c

示例5: clip_GTK_TREESETVIEWLINES

/* Sets whether or not the connecting lines between branches and children are drawn. */
int
clip_GTK_TREESETVIEWLINES(ClipMachine * cm)
{
	C_widget  *ctree = _fetch_cw_arg(cm);
        gboolean    flag = _clip_parl(cm,2);

        CHECKCWID(ctree,GTK_IS_TREE); CHECKOPT(2,LOGICAL_t);

	gtk_tree_set_view_lines(GTK_TREE(ctree->widget), flag);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:14,代码来源:tree.c

示例6: clip_GTK_PROGRESSSETACTIVITYMODE

/* A GtkProgress can be in one of two different modes: percentage mode (the default)
 * and activity mode. In activity mode, the progress is simply indicated as activity
 * rather than as a percentage complete. */
int
clip_GTK_PROGRESSSETACTIVITYMODE(ClipMachine * cm)
{
	C_widget      *cprg = _fetch_cw_arg(cm);
	guint activity_mode = _clip_parl(cm,2);
        CHECKCWID(cprg,GTK_IS_PROGRESS);
	CHECKOPT(2,LOGICAL_t);
        if (_clip_parinfo(cm,2)==UNDEF_t) activity_mode = TRUE;
        gtk_progress_set_activity_mode(GTK_PROGRESS(cprg->widget), activity_mode);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:16,代码来源:progress.c

示例7: clip_GTK_NOTEBOOKSETSHOWTABS

/* Sets whether to show the bookmarks or not. */
int
clip_GTK_NOTEBOOKSETSHOWTABS(ClipMachine * cm)
{
	C_widget     *cntb = _fetch_cw_arg(cm);
	gboolean show_tabs = _clip_parl(cm,2);
	CHECKCWID(cntb,GTK_IS_NOTEBOOK);
	CHECKOPT(2,LOGICAL_t);
	if (_clip_parinfo(cm,2)==UNDEF_t) show_tabs = TRUE;
	gtk_notebook_set_show_tabs(GTK_NOTEBOOK(cntb->widget), show_tabs);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:14,代码来源:notebook.c

示例8: clip_GTK_NOTEBOOKSETSCROLLABLE

/* Sets whether the bookmarks area may be scrollable or not if there are
 * too many bookmarks to fit in the allocated area. */
int
clip_GTK_NOTEBOOKSETSCROLLABLE(ClipMachine * cm)
{
	C_widget      *cntb = _fetch_cw_arg(cm);
	gboolean scrollable = _clip_parl(cm,2);
	CHECKCWID(cntb,GTK_IS_NOTEBOOK);
	CHECKOPT(2,LOGICAL_t);
	if (_clip_parinfo(cm,2)==UNDEF_t) scrollable = TRUE;
	gtk_notebook_set_scrollable(GTK_NOTEBOOK(cntb->widget), scrollable);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:15,代码来源:notebook.c

示例9: clip_GTK_NOTEBOOKSETTABVBORDER

/* Sets whether the tabs should have a vertical border. */
int
clip_GTK_NOTEBOOKSETTABVBORDER(ClipMachine * cm)
{
	C_widget       *cntb = _fetch_cw_arg(cm);
	gboolean tab_vborder = _clip_parl(cm,2);
	CHECKCWID(cntb,GTK_IS_NOTEBOOK);
	CHECKOPT(2,LOGICAL_t);
	if (_clip_parinfo(cm,2)==UNDEF_t) tab_vborder = TRUE;
	gtk_notebook_set_tab_vborder(GTK_NOTEBOOK(cntb->widget), tab_vborder);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:14,代码来源:notebook.c

示例10: clip_GTK_NOTEBOOKSETHOMOGENEOUSTABS

/* Sets whether the tabs must have all the same size or not. */
int
clip_GTK_NOTEBOOKSETHOMOGENEOUSTABS(ClipMachine * cm)
{
	C_widget     *cntb = _fetch_cw_arg(cm);
	guint  homogeneous = _clip_parl(cm,2);
	CHECKCWID(cntb,GTK_IS_NOTEBOOK);
	CHECKOPT(2,LOGICAL_t);
	if (_clip_parinfo(cm,2)==UNDEF_t) homogeneous = TRUE;
	gtk_notebook_set_homogeneous_tabs(GTK_NOTEBOOK(cntb->widget), homogeneous);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:14,代码来源:notebook.c

示例11: clip_GDK_COLORRGB

/* Returns a map with fields RED, GREEN and BLUE */
int
clip_GDK_COLORRGB(ClipMachine * cm)
{
	long RGB = _clip_parnl(cm,1);
	CHECKOPT(1,NUMERIC_t);
	if (_clip_parinfo(cm,1) != UNDEF_t)
	{
		ClipVar *ret = RETPTR(cm);
		memset(ret, 0, sizeof(*ret)); _clip_map(cm, ret);
		_clip_mputn(cm, ret, HASH_RED, (RGB & 0xFF) << 8);
		_clip_mputn(cm, ret, HASH_GREEN, ((RGB >> 8) & 0xFF) << 8);
		_clip_mputn(cm, ret, HASH_BLUE, ((RGB >> 16) & 0xFF) << 8);
	}
开发者ID:amery,项目名称:clip-itk,代码行数:14,代码来源:gdkcolor.c

示例12: clip_GTK_WINDOWSETMODAL

/* If window is set modal, input will be grabbed when show and released when hide */
int
clip_GTK_WINDOWSETMODAL(ClipMachine * cm)
{
	C_widget *cwin = _fetch_cw_arg(cm);
	gboolean modal = _clip_parl(cm,2);
	CHECKOPT(2,LOGICAL_t);
	if (_clip_parinfo(cm,2) == UNDEF_t) modal = TRUE;
	CHECKCWID(cwin,GTK_IS_WINDOW);
	gtk_window_set_modal(GTK_WINDOW(cwin->widget), modal);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:14,代码来源:window.c

示例13: clip_GTK_ACCELLABELNEW

/**** ACCEL LABEL constructor ****/
int
clip_GTK_ACCELLABELNEW(ClipMachine * cm)
{
	ClipVar * cv   = _clip_spar(cm, 1);
	char  * text   = _clip_parc(cm, 2);
	GtkWidget *wid = NULL;
	C_widget *cwid;
	CHECKOPT(1,MAP_t);
	CHECKOPT(2,CHARACTER_t);

	LOCALE_TO_UTF(text);
	wid = gtk_accel_label_new(text);
	FREE_TEXT(text);
	if (!wid) goto err;

	cwid = _register_widget(cm, wid, cv);
	_clip_mclone(cm,RETPTR(cm),&cwid->obj);

	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:23,代码来源:label.c

示例14: clip_GTK_CURVESETGAMMA

/* Recomputes the entire curve using the given gamma value. A gamma value of 1
 * results in a straight line. Values greater than 1 result in a curve above the
 * straight line. Values less than 1 result in a curve below the straight line.
 * The curve type is changed to GTK_CURVE_TYPE_FREE. */
int
clip_GTK_CURVESETGAMMA(ClipMachine * cm)
{
	C_widget *ccur = _fetch_cw_arg(cm);
        gfloat   gamma = _clip_parnd(cm,2);
        CHECKCWID(ccur,GTK_CURVE);
        CHECKOPT(2,NUMERIC_t);
        if (_clip_parinfo(cm,2)==UNDEF_t) gamma = 1;
        gtk_curve_set_gamma(GTK_CURVE(ccur->widget),gamma);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:17,代码来源:curve.c

示例15: clip_GTK_NOTEBOOKSETPAGE

/* Switches to the page number page_num. Negative values stand for the
 * last page; too large values are ignored. */
int
clip_GTK_NOTEBOOKSETPAGE(ClipMachine * cm)
{
	C_widget   *cntb = _fetch_cw_arg(cm);
	gint    page_num = _clip_parni(cm,2);
	CHECKCWID(cntb,GTK_IS_NOTEBOOK);
	CHECKOPT(2,NUMERIC_t);
	if (_clip_parinfo(cm,2)==UNDEF_t) page_num = 1;
	gtk_notebook_set_page(GTK_NOTEBOOK(cntb->widget), (page_num>0?page_num-1:page_num));
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:15,代码来源:notebook.c


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