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


C++ WIDGET函数代码示例

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


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

示例1: scrollbar_set_range

void scrollbar_set_range( object_t *w, int min, int max )
{
	scrollbar_widget_t *sb = (scrollbar_widget_t *)w;
	
	assert_valid_scrollbar_widget( w, "w" );
	
	sb->min = min;
	sb->max = max;
	
	cgraphics_scrollbar_set_range( WIDGET(w) );
}
开发者ID:Airr,项目名称:Claro,代码行数:11,代码来源:scrollbar.c

示例2: cgraphics_workspace_window_widget_create

void cgraphics_workspace_window_widget_create( widget_t *widget )
{
	widget_t *parent = WIDGET(OBJECT(widget)->parent);
		
	widget->native = gtk_layout_new( NULL, NULL );
		
	cgraphics_widget_create( widget );
    
    gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(parent->native), GTK_WIDGET(widget->native), TRUE);
	gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(parent->native), GTK_WIDGET(widget->native), TRUE);
}
开发者ID:theojulienne,项目名称:Claro,代码行数:11,代码来源:workspace.c

示例3: contact_list_editor_cancel_button_clicked_cb

void
contact_list_editor_cancel_button_clicked_cb (GtkWidget *widget)
{
	EContactListEditor *editor;
	GtkWindow *window;

	editor = contact_list_editor_extract (widget);
	window = GTK_WINDOW (WIDGET (DIALOG));

	eab_editor_prompt_to_save_changes (EAB_EDITOR (editor), window);
}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:11,代码来源:e-contact-list-editor.c

示例4: menubar_add_menu

void
menubar_add_menu (WMenuBar * menubar, menu_t * menu)
{
    if (menu != NULL)
    {
        menu_arrange (menu, WIDGET (menubar)->owner->get_shortcut);
        menubar->menu = g_list_append (menubar->menu, menu);
    }

    menubar_arrange (menubar);
}
开发者ID:iNode,项目名称:mc,代码行数:11,代码来源:menu.c

示例5: edit_reload_syntax

static void
edit_reload_syntax (void *data, void *user_data)
{
    (void) user_data;

    if (edit_widget_is_editor (WIDGET (data)))
    {
        WEdit *edit = (WEdit *) data;
        edit_load_syntax (edit, NULL, edit->syntax_type);
    }
}
开发者ID:ActionLuzifer,项目名称:mc,代码行数:11,代码来源:editoptions.c

示例6: buttonInit

void buttonInit(button *self, const char *id, int w, int h)
{
	// Buttons need to be redrawn when the following events fire
	int i, handlers[] = {
	    EVT_ENABLE,
	    EVT_DISABLE,
	    EVT_MOUSE_ENTER,
	    EVT_MOUSE_LEAVE,
	    EVT_MOUSE_DOWN,
	    EVT_MOUSE_UP
	};

	// Init our parent
	widgetInit((widget *)self, id);

	// Prepare our vtable
	buttonInitVtbl(self);

	// Set our type
	((widget *)self)->classInfo = &buttonClassInfo;

	// initialise button state
	self->state = BUTTON_STATE_NORMAL;

	// Mask for exact mouse events
	widgetEnableMask(WIDGET(self));

	// Install necessary event handlers
	for (i = 0; i < sizeof(handlers) / sizeof(int); i++)
	{
		widgetAddEventHandler(WIDGET(self), handlers[i],
		                      buttonSetButtonStateHandler, NULL, NULL);
	}

	buttonSetPatternsForState(self, BUTTON_STATE_NORMAL, "button/normal/fill", "button/normal/contour");
	buttonSetPatternsForState(self, BUTTON_STATE_DISABLED, "button/disabled/fill", "button/disabled/contour");
	buttonSetPatternsForState(self, BUTTON_STATE_MOUSEOVER, "button/mouseover/fill", "button/mouseover/contour");
	buttonSetPatternsForState(self, BUTTON_STATE_MOUSEDOWN, "button/mousedown/fill", "button/mousedown/contour");

	widgetResize(WIDGET(self), w, h);
}
开发者ID:BG1,项目名称:warzone2100,代码行数:41,代码来源:button.cpp

示例7: mcview_toggle_hex_mode

void
mcview_toggle_hex_mode (mcview_t * view)
{
    view->hex_mode = !view->hex_mode;

    if (view->hex_mode)
    {
        view->hex_cursor = view->dpy_start;
        view->dpy_start = mcview_offset_rounddown (view->dpy_start, view->bytes_per_line);
        widget_want_cursor (WIDGET (view), TRUE);
    }
    else
    {
        view->dpy_start = mcview_bol (view, view->hex_cursor, 0);
        view->hex_cursor = view->dpy_start;
        widget_want_cursor (WIDGET (view), FALSE);
    }
    mcview_altered_hex_mode = 1;
    view->dpy_bbar_dirty = TRUE;
    view->dirty++;
}
开发者ID:iNode,项目名称:mc,代码行数:21,代码来源:lib.c

示例8: hline_set_text

void
hline_set_text (WHLine * l, const char *text)
{
    g_free (l->text);

    if (text == NULL || *text == '\0')
        l->text = NULL;
    else
        l->text = g_strdup (text);

    widget_redraw (WIDGET (l));
}
开发者ID:ActionLuzifer,项目名称:mc,代码行数:12,代码来源:hline.c

示例9: box_add

void box_add ( box *box, widget *child, gboolean expand )
{
    if ( box == NULL ) {
        return;
    }
    // Make sure box is width/heigh enough.
    if ( box->type == ROFI_ORIENTATION_VERTICAL ) {
        int width = box->widget.w;
        width         = MAX ( width, child->w + widget_padding_get_padding_width ( WIDGET ( box ) ) );
        box->widget.w = width;
    }
    else {
        int height = box->widget.h;
        height        = MAX ( height, child->h + widget_padding_get_padding_height ( WIDGET ( box ) ) );
        box->widget.h = height;
    }
    child->expand = rofi_theme_get_boolean ( child, "expand", expand );
    g_assert ( child->parent == WIDGET ( box ) );
    box->children = g_list_append ( box->children, (void *) child );
    widget_update ( WIDGET ( box ) );
}
开发者ID:yusiwen,项目名称:rofi,代码行数:21,代码来源:box.c

示例10: listbox_select_last

/* Selects the last entry and scrolls the list to the bottom */
void
listbox_select_last (WListbox * l)
{
    int lines = WIDGET (l)->lines;
    int length = 0;

    if (!listbox_is_empty (l))
        length = g_queue_get_length (l->list);

    l->pos = length > 0 ? length - 1 : 0;
    l->top = length > lines ? length - lines : 0;
}
开发者ID:Distrotech,项目名称:mc,代码行数:13,代码来源:listbox.c

示例11: PollWidgets

static void
PollWidgets(AG_Event *event)
{
	AG_Tlist *tl = AG_SELF();
	AG_Driver *drv = WIDGET(tl)->drv;
	AG_Window *win;

	AG_TlistClear(tl);
	AG_LockVFS(drv);
	AG_FOREACH_WINDOW_REVERSE(win, drv) {
		FindWindows(tl, win, 0);
	}
开发者ID:adsr,项目名称:agar,代码行数:12,代码来源:debugger.c

示例12: edit_update_screen

void
edit_update_screen (WEdit * e)
{
    WDialog *h = WIDGET (e)->owner;

    edit_scroll_screen_over_cursor (e);
    edit_update_curs_col (e);
    edit_status (e, widget_get_state (WIDGET (e), WST_FOCUSED));

    /* pop all events for this window for internal handling */
    if (!is_idle ())
        e->force |= REDRAW_PAGE;
    else
    {
        if ((e->force & REDRAW_COMPLETELY) != 0)
            e->force |= REDRAW_PAGE;
        edit_render_keypress (e);
    }

    widget_redraw (WIDGET (find_buttonbar (h)));
}
开发者ID:MidnightCommander,项目名称:mc,代码行数:21,代码来源:editwidget.c

示例13: listview_nav_down_int

static void listview_nav_down_int ( listview *lv )
{
    if ( lv == NULL ) {
        return;
    }
    if ( lv->req_elements == 0 || ( lv->selected == ( lv->req_elements - 1 ) && !lv->cycle ) ) {
        return;
    }
    lv->selected = lv->selected < lv->req_elements - 1 ? MIN ( lv->req_elements - 1, lv->selected + 1 ) : 0;

    widget_queue_redraw ( WIDGET ( lv ) );
}
开发者ID:DaveDavenport,项目名称:rofi,代码行数:12,代码来源:listview.c

示例14: gauge_set_value

void
gauge_set_value (WGauge * g, int max, int current)
{
    if (g->current == current && g->max == max)
        return;                 /* Do not flicker */

    if (max == 0)
        max = 1;                /* I do not like division by zero :) */
    g->current = current;
    g->max = max;
    widget_redraw (WIDGET (g));
}
开发者ID:Distrotech,项目名称:mc,代码行数:12,代码来源:gauge.c

示例15: setup_cmdline

void
setup_cmdline (void)
{
    int prompt_len;
    int y;
    char *tmp_prompt = (char *) mc_prompt;

#ifdef ENABLE_SUBSHELL
    if (mc_global.tty.use_subshell)
    {
        tmp_prompt = g_string_free (subshell_prompt, FALSE);
        (void) strip_ctrl_codes (tmp_prompt);
    }
#endif

    prompt_len = str_term_width1 (tmp_prompt);

    /* Check for prompts too big */
    if (COLS > 8 && prompt_len > COLS - 8)
    {
        prompt_len = COLS - 8;
        tmp_prompt[prompt_len] = '\0';
    }

#ifdef ENABLE_SUBSHELL
    if (mc_global.tty.use_subshell)
    {
        subshell_prompt = g_string_new (tmp_prompt);
        g_free (tmp_prompt);
        mc_prompt = subshell_prompt->str;
    }
#endif

    y = LINES - 1 - mc_global.keybar_visible;

    widget_set_size (WIDGET (the_prompt), y, 0, 1, prompt_len);
    label_set_text (the_prompt, mc_prompt);
    widget_set_size (WIDGET (cmdline), y, prompt_len, 1, COLS - prompt_len);
    input_set_origin (cmdline, prompt_len, COLS - prompt_len);
}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:40,代码来源:layout.c


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