Пример #1
0
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *statusbar = NULL, *button = NULL, *hbox = NULL;

        statusbar = ewl_statusbar_new();
        ewl_container_child_append(EWL_CONTAINER(box), statusbar);
        ewl_statusbar_left_hide(EWL_STATUSBAR(statusbar));
        ewl_widget_show(statusbar);

        button_push_cb(NULL, NULL, statusbar);

        hbox = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(box), hbox);
        ewl_widget_show(hbox);

        button = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(button), "push");
        ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_push_cb,
                                                                statusbar);
        ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_NONE);
        ewl_container_child_append(EWL_CONTAINER(hbox), button);
        ewl_widget_show(button);

        button = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(button), "pop");
        ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_pop_cb,
                                                                statusbar);
        ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_NONE);
        ewl_container_child_append(EWL_CONTAINER(hbox), button);
        ewl_widget_show(button);

        return 1;
}
Пример #2
0
/**
 * @param s: The separator to set the orientation on
 * @param o: The orientation to set on the separator
 * @return Returns no value
 * @brief Set the orientation of the separator
 */
void
ewl_separator_orientation_set(Ewl_Separator *s, Ewl_Orientation o)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR(s);
        DCHECK_TYPE(s, EWL_SEPARATOR_TYPE);

        if (s->orientation == o)
                DRETURN(DLEVEL_STABLE);

        s->orientation = o;

        if (o == EWL_ORIENTATION_HORIZONTAL) {
                ewl_widget_appearance_set(EWL_WIDGET(s), "hseparator");
                ewl_object_fill_policy_set(EWL_OBJECT(s),
                                           EWL_FLAG_FILL_HFILL |
                                           EWL_FLAG_FILL_HSHRINKABLE);
        }
        else {
                ewl_widget_appearance_set(EWL_WIDGET(s), "vseparator");
                ewl_object_fill_policy_set(EWL_OBJECT(s),
                                           EWL_FLAG_FILL_VFILL |
                                           EWL_FLAG_FILL_VSHRINKABLE);
        }

        ewl_widget_configure(EWL_WIDGET(s));

        DLEAVE_FUNCTION(DLEVEL_STABLE);
}
Пример #3
0
int
tools_init( void )
{
	Ewl_Widget *vbox, *button, *image;

	if( tools_win )
		return -1;

	tools_win = ewl_window_new();
	ewl_window_title_set(EWL_WINDOW(tools_win), "Tools");
	ewl_object_size_request(EWL_OBJECT(tools_win), 200, 320);
	ewl_callback_append(tools_win, EWL_CALLBACK_DELETE_WINDOW,
											tools_toggle, NULL);

	vbox = ewl_vbox_new();
	ewl_container_child_append(EWL_CONTAINER(tools_win), vbox);

	button = ewl_button_new(NULL);
	ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
	ewl_object_insets_set(EWL_OBJECT(button), 0, 0, 0, 0);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, tools_click, "Ewl_Text");
	ewl_container_child_append(EWL_CONTAINER(vbox), button);

	image = ewl_image_new(EWLER_IMAGE_DIR"/text-small.png", "text");
	ewl_container_child_append(EWL_CONTAINER(button), image);
	ewl_widget_show(image);

	ewl_widget_show(button);

	button = ewl_button_new(NULL);
	ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
	ewl_object_insets_set(EWL_OBJECT(button), 0, 0, 0, 0);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, tools_click, "Ewl_Entry");
	ewl_container_child_append(EWL_CONTAINER(vbox), button);

	image = ewl_image_new(EWLER_IMAGE_DIR"/entry-small.png", "entry");
	ewl_container_child_append(EWL_CONTAINER(button), image);
	ewl_widget_show(image);

	ewl_widget_show(button);

	button = ewl_button_new(NULL);
	ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
	ewl_object_insets_set(EWL_OBJECT(button), 0, 0, 0, 0);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, tools_click, "Ewl_Border");
	ewl_container_child_append(EWL_CONTAINER(vbox), button);

	image = ewl_image_new(EWLER_IMAGE_DIR"/border-small.png", "border");
	ewl_container_child_append(EWL_CONTAINER(button), image);
	ewl_widget_show(image);

	ewl_widget_show(button);

	ewl_widget_show(vbox);
	
	ewl_widget_show(tools_win);

	return 0;
}
Пример #4
0
/**
 * @param sp: The Ewl_Spectrum to init
 * @return Returns TRUE on success or FALSE on failure
 * @brief Initializes an Ewl_Specturm widget to default values
 */
int
ewl_spectrum_init(Ewl_Spectrum *sp)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(sp, FALSE);

        if (!ewl_container_init(EWL_CONTAINER(sp)))
        {
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }

        ewl_widget_appearance_set(EWL_WIDGET(sp), EWL_SPECTRUM_TYPE);
        ewl_widget_inherit(EWL_WIDGET(sp), EWL_SPECTRUM_TYPE);
        ewl_object_fill_policy_set(EWL_OBJECT(sp), EWL_FLAG_FILL_FILL);
        ewl_container_callback_intercept(EWL_CONTAINER(sp),
                                        EWL_CALLBACK_MOUSE_MOVE);
        ewl_container_callback_intercept(EWL_CONTAINER(sp),
                                        EWL_CALLBACK_MOUSE_DOWN);
        ewl_container_callback_intercept(EWL_CONTAINER(sp),
                                        EWL_CALLBACK_MOUSE_UP);

        ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_MOUSE_DOWN,
                                ewl_spectrum_cb_mouse_down, NULL);
        ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_MOUSE_UP,
                                ewl_spectrum_cb_mouse_up, NULL);

        sp->type = EWL_SPECTRUM_TYPE_SQUARE;

        /* create the canvas */
        sp->canvas = ewl_image_new();
        ewl_container_child_append(EWL_CONTAINER(sp), sp->canvas);
        ewl_object_fill_policy_set(EWL_OBJECT(sp->canvas), EWL_FLAG_FILL_FILL);
        ewl_widget_internal_set(sp->canvas, TRUE);
        ewl_callback_append(EWL_WIDGET(sp->canvas), EWL_CALLBACK_REVEAL,
                                ewl_spectrum_canvas_cb_reveal, sp);
        ewl_widget_show(sp->canvas);

        /* create the cross hairs to draw on the spectrum */
        sp->cross_hairs.horizontal = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(sp), sp->cross_hairs.horizontal);
        ewl_widget_internal_set(sp->cross_hairs.horizontal, TRUE);
        ewl_widget_layer_priority_set(sp->cross_hairs.horizontal, 1);

        sp->cross_hairs.vertical = ewl_vseparator_new();
        ewl_container_child_append(EWL_CONTAINER(sp), sp->cross_hairs.vertical);
        ewl_widget_internal_set(sp->cross_hairs.vertical, TRUE);
        ewl_widget_layer_priority_set(sp->cross_hairs.vertical, 1);

        ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_CONFIGURE,
                        ewl_spectrum_cb_configure, NULL);

        ewl_spectrum_rgb_set(sp, 255, 255, 255);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #5
0
Ewl_Widget *
widget_new( char *name )
{
	Ewler_Widget *w;

	if( !name )
		return NULL;

	w = spec_new( name );
	if( !w || !w->w )
		return NULL;

	w->selected = false;
	
	ewl_callback_append(w->w, EWL_CALLBACK_REALIZE, realize, w);
	ewl_callback_append(w->w, EWL_CALLBACK_CONFIGURE, configure, w);
	ewl_widget_show(w->w);

	w->bg = ewl_vbox_new();
	w->bg->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
	ewl_widget_appearance_set(w->bg, "select_bg");
	ewl_theme_data_str_set(w->bg, "/select_bg/file", EWLER_EET);
	ewl_theme_data_str_set(w->bg, "/select_bg/group", "select_bg");
	ewl_object_fill_policy_set(EWL_OBJECT(w->bg), EWL_FLAG_FILL_NONE);
	ewl_widget_data_set(w->bg, "EWLER_WIDGET", w);
	ewl_container_child_append(EWL_CONTAINER(w->bg), w->w);
	ewl_widget_show(w->bg);

	w->fg = ewl_vbox_new();
	w->fg->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
	ewl_widget_appearance_set(w->fg, "select_fg");
	ewl_theme_data_str_set(w->fg, "/select_fg/file", EWLER_EET);
	ewl_theme_data_str_set(w->fg, "/select_fg/group", "select_fg");
	ewl_callback_append(w->fg, EWL_CALLBACK_CONFIGURE, fg_configure, w);
	ewl_callback_append(w->fg, EWL_CALLBACK_REALIZE, fg_realize, w);
	ewl_callback_append(w->fg, EWL_CALLBACK_FOCUS_IN, fg_mouse_in, w);
	ewl_callback_append(w->fg, EWL_CALLBACK_FOCUS_OUT, fg_mouse_out, w);
	ewl_callback_append(w->fg, EWL_CALLBACK_MOUSE_DOWN, fg_mouse_down, w);
	ewl_callback_append(w->fg, EWL_CALLBACK_MOUSE_UP, fg_mouse_up, w);
	ewl_callback_append(w->fg, EWL_CALLBACK_MOUSE_MOVE, fg_mouse_move, w);
	ewl_callback_append(w->fg, EWL_CALLBACK_DESTROY, widget_destroy, w);
	ewl_object_fill_policy_set(EWL_OBJECT(w->fg), EWL_FLAG_FILL_NONE);
	ewl_widget_data_set(w->fg, "EWLER_WIDGET", w);
	ewl_container_child_append(EWL_CONTAINER(w->fg), w->bg);
	ewl_widget_show(w->fg);

	w->selectable = true;
	w->configured = false;

	return w->fg;
}
Пример #6
0
/**
 * @param n: The Ewl_Notebook widget to initialize
 * @return Returns TRUE on success or NULL on failure.
 * @brief Initialize a notebook to default values and callbacks
 */
int
ewl_notebook_init(Ewl_Notebook *n)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(n, FALSE);

        if (!ewl_box_init(EWL_BOX(n)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_box_orientation_set(EWL_BOX(n), EWL_ORIENTATION_VERTICAL);

        ewl_widget_appearance_set(EWL_WIDGET(n), EWL_NOTEBOOK_TYPE);
        ewl_widget_inherit(EWL_WIDGET(n), EWL_NOTEBOOK_TYPE);

        n->tabbar_position = EWL_POSITION_TOP;

        n->body.tabbar = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(n), n->body.tabbar);
        ewl_object_fill_policy_set(EWL_OBJECT(n->body.tabbar),
                                EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(n->body.tabbar),
                                                EWL_FLAG_ALIGN_CENTER);
        ewl_widget_internal_set(n->body.tabbar, TRUE);
        ewl_widget_appearance_set(n->body.tabbar, "top/tabbar");
        ewl_widget_show(n->body.tabbar);

        n->body.pages = ewl_vbox_new();
        ewl_object_fill_policy_set(EWL_OBJECT(n->body.pages),
                                   EWL_FLAG_FILL_ALL);
        ewl_container_child_append(EWL_CONTAINER(n), n->body.pages);
        ewl_widget_internal_set(n->body.pages, TRUE);
        ewl_widget_layer_priority_set(n->body.pages, -1);
        ewl_widget_appearance_set(n->body.pages, "pages");
        ewl_widget_show(n->body.pages);

        ewl_container_redirect_set(EWL_CONTAINER(n),
                                        EWL_CONTAINER(n->body.pages));

        ewl_container_show_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_show);
        ewl_container_hide_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_hide);
        ewl_container_add_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_add);
        ewl_container_remove_notify_set(EWL_CONTAINER(n->body.pages),
                                        ewl_notebook_cb_child_remove);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #7
0
/**
 * @param t: the toolbar to initialize
 * @return Returns TRUE on success, FALSE on failure.
 * @brief Initialize the toolbar and inherited fields
 *
 * Clears the contents of the toolbar and stores the
 * default values.
 */
int
ewl_toolbar_init(Ewl_Toolbar *t)
{
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(t, FALSE);

        w = EWL_WIDGET(t);
        if (!ewl_menubar_init(EWL_MENUBAR(t)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_inherit(w, EWL_TOOLBAR_TYPE);
        ewl_widget_appearance_set(w, "htoolbar");

        ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_HFILL |
                                                  EWL_FLAG_FILL_SHRINKABLE);
        ewl_object_alignment_set(EWL_OBJECT(t), EWL_FLAG_ALIGN_LEFT |
                                                        EWL_FLAG_ALIGN_TOP);

        ewl_container_add_notify_set(EWL_CONTAINER(EWL_MENUBAR(t)->inner_box),
                                        ewl_toolbar_cb_child_add);
        t->hidden = EWL_ICON_PART_NONE;

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #8
0
/**
 * @param s: the separator to initialize
 * @return Returns TRUE on success, FALSE on failure.
 * @brief Initialize the separator and inherited fields
 *
 * Clears the contents of the separator and stores the
 * default values.
 */
int
ewl_separator_init(Ewl_Separator *s)
{
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(s, FALSE);

        w = EWL_WIDGET(s);
        if (!ewl_widget_init(w))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_inherit(w, EWL_SEPARATOR_TYPE);
        ewl_widget_appearance_set(EWL_WIDGET(s), "hseparator");
        ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_HFILL |
                                                  EWL_FLAG_FILL_SHRINKABLE);

        ewl_object_alignment_set(EWL_OBJECT(s), EWL_FLAG_ALIGN_LEFT);

        s->orientation = EWL_ORIENTATION_HORIZONTAL;

        ewl_widget_focusable_set(w, FALSE);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #9
0
/**
 * @param w: the overlay to be initialized to default values and callbacks
 * @return Returns TRUE or FALSE depending on if initialization succeeds.
 * @brief initialize a overlay to default values and callbacks
 *
 * Sets the values and callbacks of a overlay @a w to their defaults.
 */
int
ewl_overlay_init(Ewl_Overlay *w)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(w, FALSE);

        /*
         * Initialize the fields of the inherited container class
         */
        if (!ewl_container_init(EWL_CONTAINER(w)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_appearance_set(EWL_WIDGET(w), EWL_OVERLAY_TYPE);
        ewl_widget_inherit(EWL_WIDGET(w), EWL_OVERLAY_TYPE);

        ewl_container_show_notify_set(EWL_CONTAINER(w),
                                        ewl_overlay_cb_child_show);
        ewl_container_resize_notify_set(EWL_CONTAINER(w),
                                        ewl_overlay_cb_child_resize);

        ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);

        /*
         * Override the default configure callbacks since the overlay
         * has special needs for placement.
         */
        ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE,
                             ewl_overlay_cb_configure, NULL);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #10
0
/**
 * @param p: the popup to initialize
 * @return Returns TRUE on success, FALSE on failure.
 * @brief Initialize the popup and inherited fields
 *
 * Clears the contents of the popup and stores the
 * default values.
 */
int
ewl_popup_init(Ewl_Popup *p)
{
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(p, FALSE);

        w = EWL_WIDGET(p);
        if (!ewl_window_init(EWL_WINDOW(w)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_inherit(w, EWL_POPUP_TYPE);
        ewl_widget_appearance_set(w, EWL_POPUP_TYPE);
        ewl_object_fill_policy_set(EWL_OBJECT(p), EWL_FLAG_FILL_NONE);

        ewl_window_override_set(EWL_WINDOW(p), TRUE);

        ewl_container_show_notify_set(EWL_CONTAINER(p),
                                        ewl_popup_cb_child_show);
        ewl_container_resize_notify_set(EWL_CONTAINER(p),
                                        ewl_popup_cb_child_resize);

        /*
         * add the callbacks
         */
        ewl_callback_append(w, EWL_CALLBACK_SHOW, ewl_popup_cb_show, NULL);
        ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_popup_cb_show, NULL);
        ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, ewl_popup_cb_mouse_move,
                                                                        NULL);
        ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_popup_cb_destroy,
                                                                        NULL);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #11
0
/**
 * @param b: the border container to initialize
 * @return Returns TRUE on success, FALSE on failure.
 * @brief Initialize a border container to default values
 */
int
ewl_border_init(Ewl_Border *b)
{
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(b, FALSE);

        w = EWL_WIDGET(b);

        if (!ewl_box_init(EWL_BOX(w))) {
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }
        ewl_box_orientation_set(EWL_BOX(w), EWL_ORIENTATION_VERTICAL);
        ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);

        ewl_widget_appearance_set(EWL_WIDGET(b), EWL_BORDER_TYPE);
        ewl_widget_inherit(EWL_WIDGET(b), EWL_BORDER_TYPE);

        b->label = ewl_label_new();
        ewl_widget_internal_set(b->label, TRUE);
        ewl_container_child_append(EWL_CONTAINER(b), b->label);
        ewl_widget_show(b->label);

        b->body = ewl_vbox_new();
        ewl_widget_internal_set(b->body, TRUE);
        ewl_container_child_append(EWL_CONTAINER(b), b->body);
        ewl_widget_show(b->body);

        b->label_position = EWL_POSITION_TOP;

        ewl_container_redirect_set(EWL_CONTAINER(b), EWL_CONTAINER(b->body));

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #12
0
EvasEwl::EvasEwl( EvasCanvas &canvas, EwlEmbed* ewlobj, const char* name )
{
#warning not sure whether this belongs here
#if 0 // [audifahrer]
  ewl_object_fill_policy_set( EWL_OBJECT(ewlobj->obj() ), EWL_FLAG_FILL_ALL );
  o = ewl_embed_evas_set( EWL_EMBED( ewlobj->obj() ), canvas->obj(), EWL_EMBED_EVAS_WINDOW(ecore_evas_software_x11_window_get(canvas->obj())));
#endif
}
Пример #13
0
static void
eke_gui_ewl_manage_feed_cb(Ewl_Widget *w, void *ev, void *data)
{
    Eke *eke;
    Ewl_Widget *win, *box, *button;

    eke = data;

    win = ewl_dialog_new(EWL_POSITION_BOTTOM);
    ewl_window_title_set(EWL_WINDOW(win), PACKAGE " -- manage feeds");
    ewl_window_name_set(EWL_WINDOW(win), PACKAGE);
    ewl_window_class_set(EWL_WINDOW(win), PACKAGE);
    ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW,
                            eke_gui_ewl_manage_feed_exit_cb, win);
    ewl_widget_show(win);

    box = ewl_vbox_new();
    ewl_dialog_widget_add(EWL_DIALOG(win), box);
    ewl_widget_show(box);

    button = ewl_button_new("add feed");
    ewl_widget_data_set(button, "manage_feed_win", win);
    ewl_container_child_append(EWL_CONTAINER(box), button);
    ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
    ewl_callback_append(button, EWL_CALLBACK_CLICKED,
                                eke_gui_ewl_add_feed_cb, eke);
    ewl_widget_show(button);

    button = ewl_button_stock_with_id_new(EWL_STOCK_CANCEL,
                                            EWL_RESPONSE_CANCEL);
    ewl_container_child_append(EWL_CONTAINER(win), button);
    ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
    ewl_callback_append(button, EWL_CALLBACK_VALUE_CHANGED,
                                eke_gui_ewl_manage_feed_exit_cb, win);
    ewl_widget_show(button);

    return;
    w = NULL;
    ev = NULL;
}
Пример #14
0
/**
 * @param pdf the pdf widget to initialize
 * @return Returns no value.
 * @brief Initialize an pdf widget to default values and callbacks
 *
 * Sets the fields and callbacks of @a pdf to their default values.
 */
int
ewl_pdf_init(Ewl_Pdf *pdf)
{
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(pdf, FALSE);

        if (!epdf_init()) 
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        w = EWL_WIDGET(pdf);

        if (!ewl_widget_init(w))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_appearance_set(w, EWL_PDF_TYPE);
        ewl_widget_inherit(w, EWL_PDF_TYPE);

        ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);

        /*
         * Append necessary callbacks.
         */
        ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_pdf_configure_cb,
                            NULL);
        ewl_callback_append(w, EWL_CALLBACK_REVEAL, ewl_pdf_reveal_cb,
                            NULL);
        ewl_callback_append(w, EWL_CALLBACK_OBSCURE, ewl_pdf_obscure_cb,
                            NULL);
        ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_pdf_destroy_cb,
                            NULL);

        pdf->filename = NULL;

        pdf->pdf_document = NULL;
        pdf->pdf_page = NULL;
        pdf->pdf_index = NULL;

        pdf->dirty = 1;

        pdf->search.o = NULL;
        pdf->search.text = NULL;
        pdf->search.list = NULL;
        pdf->search.page = -1;
        pdf->search.is_case_sensitive = FALSE;
        pdf->search.is_circular = FALSE;

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #15
0
/**
 * popup menu for managing files in the project
 */
static EWL_CALLBACK_DEFN(project_file_menu)
{
	Ewl_Widget *item;
	Ewl_Event_Mouse_Up *ev = ev_data;

	if( file_menu ) {
		ewl_widget_destroy(file_menu);
		file_menu = NULL;
	} else if( ev->button == 3 ) {
		ewl_window_raise(EWL_WINDOW(project_win));

		file_menu = ewl_imenu_new(NULL, "File Options");
		ewl_object_position_request(EWL_OBJECT(file_menu), ev->x, ev->y);
		ewl_object_fill_policy_set(EWL_OBJECT(file_menu), EWL_FLAG_FILL_NONE);
		ewl_container_child_append(EWL_CONTAINER(project_win), file_menu);
		ewl_callback_append(file_menu, EWL_CALLBACK_CONFIGURE,
												project_file_menu_configure, NULL);
		ewl_callback_call(file_menu, EWL_CALLBACK_SELECT);
		ewl_widget_show(file_menu);

		item = ewl_menu_item_new(NULL, "Save");
		/* HACK FOR NON-STRING DATA HASHES */
		item->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
		ewl_widget_data_set(item, "Action", (void *) EWLER_FILE_SAVE);
		ewl_callback_append(item, EWL_CALLBACK_SELECT,
												project_file_menu_cb, user_data);
		ewl_container_child_append(EWL_CONTAINER(file_menu), item);
		ewl_widget_show(item);

		item = ewl_menu_item_new(NULL, "Settings...");
		/* HACK FOR NON-STRING DATA HASHES */
		item->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
		ewl_widget_data_set(item, "Action", (void *) EWLER_FILE_SETTINGS);
		ewl_callback_append(item, EWL_CALLBACK_SELECT,
												project_file_menu_cb, user_data);
		ewl_container_child_append(EWL_CONTAINER(file_menu), item);
		ewl_widget_show(item);

		item = ewl_menu_item_new(NULL, "Delete");
		/* HACK FOR NON-STRING DATA HASHES */
		item->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
		ewl_widget_data_set(item, "Action", (void *) EWLER_FILE_DELETE);
		ewl_callback_append(item, EWL_CALLBACK_SELECT,
												project_file_menu_cb, user_data);
		ewl_container_child_append(EWL_CONTAINER(file_menu), item);
		ewl_widget_show(item);
	}
}
Пример #16
0
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *overlay;
        Ewl_Widget *img;
        Ewl_Widget *hist;

        overlay = ewl_overlay_new();
        ewl_container_child_append(EWL_CONTAINER(box), overlay);
        ewl_object_fill_policy_set(EWL_OBJECT(overlay), EWL_FLAG_FILL_ALL);
         ewl_callback_append(EWL_WIDGET(overlay), EWL_CALLBACK_CONFIGURE,
                        ewl_histogram_test_cb_configure, NULL);
        ewl_widget_show(overlay);

        img = ewl_image_new();
        ewl_image_file_path_set(EWL_IMAGE(img),
                                ewl_test_image_get("entrance.png"));
        ewl_image_proportional_set(EWL_IMAGE(img), TRUE);
        ewl_container_child_append(EWL_CONTAINER(overlay), img);
        ewl_object_fill_policy_set(EWL_OBJECT(img), EWL_FLAG_FILL_ALL);
        ewl_widget_show(img);

        hist = ewl_histogram_new();
        ewl_histogram_channel_set(EWL_HISTOGRAM(hist), EWL_HISTOGRAM_CHANNEL_Y);
        ewl_histogram_image_set(EWL_HISTOGRAM(hist), EWL_IMAGE(img));
        ewl_container_child_append(EWL_CONTAINER(overlay), hist);
        ewl_object_fill_policy_set(EWL_OBJECT(hist), EWL_FLAG_FILL_ALL);
        ewl_widget_show(hist);

        hist = ewl_histogram_new();
        ewl_histogram_channel_set(EWL_HISTOGRAM(hist), EWL_HISTOGRAM_CHANNEL_R);
        ewl_histogram_image_set(EWL_HISTOGRAM(hist), EWL_IMAGE(img));
        ewl_container_child_append(EWL_CONTAINER(overlay), hist);
        ewl_object_fill_policy_set(EWL_OBJECT(hist), EWL_FLAG_FILL_ALL);
        ewl_widget_show(hist);

        hist = ewl_histogram_new();
        ewl_histogram_channel_set(EWL_HISTOGRAM(hist), EWL_HISTOGRAM_CHANNEL_G);
        ewl_histogram_image_set(EWL_HISTOGRAM(hist), EWL_IMAGE(img));
        ewl_container_child_append(EWL_CONTAINER(overlay), hist);
        ewl_object_fill_policy_set(EWL_OBJECT(hist), EWL_FLAG_FILL_ALL);
        ewl_widget_show(hist);

        hist = ewl_histogram_new();
        ewl_histogram_channel_set(EWL_HISTOGRAM(hist), EWL_HISTOGRAM_CHANNEL_B);
        ewl_histogram_image_set(EWL_HISTOGRAM(hist), EWL_IMAGE(img));
        ewl_container_child_append(EWL_CONTAINER(overlay), hist);
        ewl_object_fill_policy_set(EWL_OBJECT(hist), EWL_FLAG_FILL_ALL);
        ewl_widget_show(hist);

        return 1;
}
Пример #17
0
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *o, *o2;

        o2 = ewl_button_new();
        ewl_stock_type_set(EWL_STOCK(o2), EWL_STOCK_OPEN);
        ewl_callback_append(o2, EWL_CALLBACK_CLICKED, cb_clicked, NULL);
        ewl_object_fill_policy_set(EWL_OBJECT(o2), EWL_FLAG_FILL_NONE);
        ewl_container_child_append(box, o2);
        ewl_widget_show(o2);

        o = ewl_scrollpane_new();
        ewl_container_child_append(box, o);
        ewl_widget_name_set(o, "scroll");
        ewl_widget_show(o);

        return 1;
}
Пример #18
0
/**
 * @param w: the window to be initialized to default values and callbacks
 * @return Returns TRUE or FALSE depending on if initialization succeeds.
 * @brief Initialize a window to default values and callbacks
 *
 * Sets the values and callbacks of a window @a w to their defaults.
 */
int
ewl_window_init(Ewl_Window *w)
{
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(w, FALSE);

        /*
         * Initialize the fields of the inherited container class
         */
        if (!ewl_embed_init(EWL_EMBED(w)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_appearance_set(EWL_WIDGET(w), EWL_WINDOW_TYPE);
        ewl_widget_inherit(EWL_WIDGET(w), EWL_WINDOW_TYPE);
        ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
        ewl_embed_render_set(EWL_EMBED(w), TRUE);

        ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_REALIZE,
                             ewl_window_cb_realize, NULL);
        ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_REALIZE,
                             ewl_window_cb_postrealize, NULL);
        ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_UNREALIZE,
                             ewl_window_cb_unrealize, NULL);
        ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_SHOW,
                            ewl_window_cb_show, NULL);
        ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_EXPOSE,
                            ewl_window_cb_expose, NULL);
        ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_HIDE,
                            ewl_window_cb_hide, NULL);
        ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_DESTROY,
                             ewl_window_cb_destroy, NULL);
        /*
         * Override the default configure callbacks since the window
         * has special needs for placement.
         */
        ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE,
                             ewl_window_cb_configure, NULL);

        ecore_list_append(ewl_window_list, w);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #19
0
/**
 * @param dialog: the icondialog to initialize.
 * @return Return TRUE on success, FALSE otherwise.
 * @brief Initialize an internal icondialog to starting values
 */
int
ewl_icondialog_init(Ewl_Icondialog *dialog)
{
        Ewl_Widget *w;
        Ewl_Widget *box;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(dialog, FALSE);

        w = EWL_WIDGET(dialog);

        if (!ewl_dialog_init(EWL_DIALOG(dialog))) {
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }

        ewl_widget_appearance_set(w, EWL_ICONDIALOG_TYPE);
        ewl_widget_inherit(w, EWL_ICONDIALOG_TYPE);

        /* get the parent vbox */
        box = dialog->dialog.vbox;
        /* we need a hbox */
        ewl_box_orientation_set(EWL_BOX(box), EWL_ORIENTATION_HORIZONTAL);

        /*
         * Setup a vertical box for the displayed window contents.
         */
        dialog->vbox = ewl_vbox_new();
        if (!dialog->vbox) {
                DRETURN_INT(FALSE, DLEVEL_STABLE);
        }

        ewl_container_child_append(EWL_CONTAINER(box), dialog->vbox);
        ewl_widget_internal_set(dialog->vbox, TRUE);
        ewl_object_fill_policy_set(EWL_OBJECT(dialog->vbox), EWL_FLAG_FILL_ALL);
        ewl_widget_show(dialog->vbox);

        ewl_container_redirect_set(EWL_CONTAINER(box), 
                                        EWL_CONTAINER(dialog->vbox));

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #20
0
void
ecrin_ewl_window_create (void)
{
  Ewl_Widget *window;
  Ewl_Widget *hbox;
  Ewl_Widget *notebook;
  Ewl_Widget *tab;
  Ewl_Widget *vbox;
  Ewl_Widget *separator;

  /* We order the list */
  sorted_keys = _list_keys_order (ecrin_hash_keys_get ());

  window = ewl_window_new ();
  ewl_object_size_request (EWL_OBJECT (window), 400, 400);
  ewl_window_title_set (EWL_WINDOW (window),
                       "Ecrin");
  ewl_window_name_set (EWL_WINDOW (window), "Ecrin");
  ewl_window_class_set (EWL_WINDOW (window), "Ecrin");
  ewl_callback_append (window, EWL_CALLBACK_DELETE_WINDOW,
                      _main_window_close, NULL);

  hbox = ewl_hbox_new ();
  ewl_container_child_append (EWL_CONTAINER (window), hbox);
  ewl_widget_show (hbox);

  notebook = ewl_notebook_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), notebook);
  ewl_widget_show (notebook);

  tab = ewl_label_new ("EFL package");
  ewl_widget_show (tab);
  
  tree = ewl_tree_new (1);
  ewl_tree_headers_visible_set (EWL_TREE (tree), 0);
  ewl_notebook_page_append (EWL_NOTEBOOK (notebook), tab, tree);
  ewl_widget_show (tree);

  tab = ewl_label_new ("Search");
  ewl_widget_show (tab);

  vbox = ewl_vbox_new ();
  ewl_box_homogeneous_set (EWL_BOX (vbox), 0);
  ewl_notebook_page_append (EWL_NOTEBOOK (notebook), tab, vbox);
  ewl_widget_show (vbox);

  entry = ewl_entry_new ("");
  ewl_object_fill_policy_set(EWL_OBJECT(entry),
                             EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
  ewl_container_child_append (EWL_CONTAINER (vbox), entry);
  ewl_callback_append (entry, EWL_CALLBACK_VALUE_CHANGED, _list_display_cb, NULL);
  ewl_widget_show (entry);

  separator = ewl_hseparator_new ();
  ewl_container_child_append (EWL_CONTAINER (vbox), separator);
  ewl_widget_show (separator);

  list = ewl_tree_new (1);
  ewl_tree_headers_visible_set (EWL_TREE (list), 0);
  ewl_container_child_append (EWL_CONTAINER (vbox), list);
  ewl_widget_show (list);

  separator = ewl_vseparator_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), separator);
  ewl_widget_show (separator);

  text = ewl_text_new ("");
  ewl_container_child_append (EWL_CONTAINER (hbox), text);
  ewl_widget_show (text);

  ecrin_ewl_tree_fill_package ();
  ecrin_ewl_list_fill_package ("");

  ewl_widget_show (window);
}
Пример #21
0
int
create_test(Ewl_Container *box)
{
        Ewl_Widget *vbox[2], *hbox[3];
        Ewl_Widget *vbox_button[2][3];
        Ewl_Widget *hbox_button[2][3];

        /*
         * Create the first horizontal box, this is positioned in the upper
         * left corner.
         */
        hbox[0] = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(box), hbox[0]);
        ewl_widget_show(hbox[0]);

        /******************************************************************/
        /* Create a box for holding the horizontal alignment test buttons */
        /******************************************************************/
        vbox[0] = ewl_vbox_new();
        ewl_container_child_append(EWL_CONTAINER(hbox[0]), vbox[0]);
        ewl_widget_show(vbox[0]);

        /*
         * Create and setup the button that starts in the left position.
         */
        vbox_button[0][0] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[0][0]), "Left");
        ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][0]);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][0]),
                                  EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][0]),
                                 EWL_FLAG_ALIGN_LEFT);
        ewl_callback_append(vbox_button[0][0], EWL_CALLBACK_CLICKED,
                            toggle_child_horizontal_align, NULL);
        ewl_widget_show(vbox_button[0][0]);

        /*
         * Create and setup the button that starts in the center position.
         */
        vbox_button[0][1] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[0][1]), "Center");
        ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][1]);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][1]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][1]),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(vbox_button[0][1], EWL_CALLBACK_CLICKED,
                            toggle_child_horizontal_align, NULL);
        ewl_widget_show(vbox_button[0][1]);

        /*
         * Create and setup the button that starts in the right position.
         */
        vbox_button[0][2] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[0][2]), "Right");
        ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][2]);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][2]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][2]),
                                 EWL_FLAG_ALIGN_RIGHT);
        ewl_callback_append(vbox_button[0][2], EWL_CALLBACK_CLICKED,
                            toggle_child_horizontal_align, NULL);
        ewl_widget_show(vbox_button[0][2]);

        /****************************************************************/
        /* Create a box for holding the Fill test buttons               */
        /****************************************************************/
        vbox[1] = ewl_vbox_new();
        ewl_container_child_append(EWL_CONTAINER(hbox[0]), vbox[1]);
        ewl_widget_show(vbox[1]);

        /*
         * Create and setup a button with no filling by default.
         */
        vbox_button[1][0] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[1][0]), "None");
        ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][0]);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][0]),
                                   EWL_FLAG_FILL_NONE);
        ewl_box_orientation_set(EWL_BOX(vbox_button[1][0]),
                        EWL_ORIENTATION_VERTICAL);
        ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][0])->label_object),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(vbox_button[1][0], EWL_CALLBACK_CLICKED,
                            toggle_child_fill, NULL);
        ewl_widget_show(vbox_button[1][0]);

        /*
         * Create and setup a button with filling by default.
         */
        vbox_button[1][1] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[1][1]), "Fill");
        ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][1]);
        ewl_box_orientation_set(EWL_BOX(vbox_button[1][1]),
                       EWL_ORIENTATION_VERTICAL);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][1]),
                                   EWL_FLAG_FILL_FILL);
        ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][1])->label_object),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(vbox_button[1][1], EWL_CALLBACK_CLICKED,
                            toggle_child_fill, NULL);
        ewl_widget_show(vbox_button[1][1]);

        /*
         * Create and setup a button with no filling by default.
         */
        vbox_button[1][2] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(vbox_button[1][2]), "None");
        ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][2]);
        ewl_box_orientation_set(EWL_BOX(vbox_button[1][2]),
                        EWL_ORIENTATION_VERTICAL);
        ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][2]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][2])->label_object),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(vbox_button[1][2], EWL_CALLBACK_CLICKED,
                            toggle_child_fill, NULL);
        ewl_widget_show(vbox_button[1][2]);

        /****************************************************************/
        /* Create a box for holding the vertical alignment test buttons */
        /****************************************************************/
        hbox[1] = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(box), hbox[1]);
        ewl_widget_show(hbox[1]);

        /*
         * Create and setup a button with top alignment by default.
         */
        hbox_button[0][0] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[0][0]), "Top");
        ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][0]);
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][0]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][0]),
                                 EWL_FLAG_ALIGN_TOP);
        ewl_callback_append(hbox_button[0][0], EWL_CALLBACK_CLICKED,
                            toggle_child_vertical_align, NULL);
        ewl_widget_show(hbox_button[0][0]);

        /*
         * Create and setup a button with center alignment by default.
         */
        hbox_button[0][1] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[0][1]), "Center");
        ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][1]);
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][1]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][1]),
                                 EWL_FLAG_ALIGN_CENTER);
        ewl_callback_append(hbox_button[0][1], EWL_CALLBACK_CLICKED,
                            toggle_child_vertical_align, NULL);
        ewl_widget_show(hbox_button[0][1]);

        /*
         * Create and setup a button with bottom alignment by default.
         */
        hbox_button[0][2] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[0][2]), "Bottom");
        ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][2]);
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][2]),
                                   EWL_FLAG_FILL_NONE);
        ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][2]),
                                 EWL_FLAG_ALIGN_BOTTOM);
        ewl_callback_append(hbox_button[0][2], EWL_CALLBACK_CLICKED,
                            toggle_child_vertical_align, NULL);
        ewl_widget_show(hbox_button[0][2]);

        /****************************************************************/
        /* Create a box for holding the Shrink test buttons             */
        /****************************************************************/
        hbox[2] = ewl_hbox_new();
        ewl_container_child_append(EWL_CONTAINER(box), hbox[2]);
        ewl_object_fill_policy_set(EWL_OBJECT(hbox[2]), EWL_FLAG_FILL_HFILL);
        ewl_widget_show(hbox[2]);

        /*
         * Create and setup a button with no filling by default.
         */
        hbox_button[1][0] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[1][0]),
                             "Shrink This Box To Fit It's Parent");
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][0]),
                                   EWL_FLAG_FILL_HSHRINK);
        ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][0]);
        ewl_callback_append(hbox_button[1][0], EWL_CALLBACK_CLICKED,
                            toggle_child_shrink, NULL);
        ewl_widget_show(hbox_button[1][0]);

        /*
         * Create and setup a button with shrinking by default.
         */
        hbox_button[1][1] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[1][1]),
                             "Shrink This Box To Fit It's Parent");
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][1]),
                                   EWL_FLAG_FILL_HSHRINK);
        ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][1]);
        ewl_callback_append(hbox_button[1][1], EWL_CALLBACK_CLICKED,
                            toggle_child_shrink, NULL);
        ewl_widget_show(hbox_button[1][1]);

        /*
         * Create and setup a button with no filling by default.
         */
        hbox_button[1][2] = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(hbox_button[1][2]),
                             "Don't shrink this box at all");
        ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][2]),
                                   EWL_FLAG_FILL_NONE);
        ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][2]);
        ewl_callback_append(hbox_button[1][2], EWL_CALLBACK_CLICKED,
                            toggle_child_shrink, NULL);
        ewl_widget_show(hbox_button[1][2]);

        return 1;
}
Пример #22
0
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *o, *o2, *hbox;

        hbox = ewl_hbox_new();
        ewl_container_child_append(box, hbox);
        ewl_widget_show(hbox);

        o = ewl_icon_new();
        ewl_box_orientation_set(EWL_BOX(o), EWL_ORIENTATION_HORIZONTAL);
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "Draw");
        ewl_container_child_append(EWL_CONTAINER(hbox), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "Fill None");
        ewl_container_child_append(EWL_CONTAINER(hbox), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "Draw");
        ewl_container_child_append(EWL_CONTAINER(hbox), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "Draw (Editable)");
        ewl_icon_editable_set(EWL_ICON(o), TRUE);
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o2 = ewl_text_new();
        ewl_text_text_set(EWL_TEXT(o2), "This icon has\nextended data\n set "
                                        "on it.\n\n That data is just \n"
                                        "text, but could\nbe any widget.");
        ewl_widget_show(o2);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_extended_data_set(EWL_ICON(o), o2);
        ewl_icon_label_set(EWL_ICON(o), "World");
        ewl_icon_type_set(EWL_ICON(o), EWL_ICON_TYPE_LONG);
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "This is a long title that is compressed.");
        ewl_icon_label_compressed_set(EWL_ICON(o), TRUE);
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_image_set(EWL_ICON(o), ewl_test_image_get("Draw.png"), NULL);
        ewl_icon_label_set(EWL_ICON(o), "This is a long title that is compressed.");
        ewl_icon_label_compressed_set(EWL_ICON(o), TRUE);
        ewl_icon_editable_set(EWL_ICON(o), TRUE);
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        o = ewl_icon_new();
        ewl_icon_alt_text_set(EWL_ICON(o), "Icon Alt Text");
        ewl_container_child_append(EWL_CONTAINER(box), o);
        ewl_widget_show(o);

        return 1;
}
Пример #23
0
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *menu1, *menu2, *menu3, *item;

        item = ewl_label_new();
        ewl_label_text_set(EWL_LABEL(item), "");
        ewl_widget_name_set(item, "menu_label");
        ewl_container_child_append(EWL_CONTAINER(box), item);
        ewl_widget_show(item);

        menu1 = ewl_menu_new();
        ewl_button_image_set(EWL_BUTTON(menu1),
                        ewl_test_image_get("Draw.png"), NULL);
        ewl_button_label_set(EWL_BUTTON(menu1), "Test Menu");
        ewl_container_child_append(EWL_CONTAINER(box), menu1);
        ewl_object_fill_policy_set(EWL_OBJECT(menu1), EWL_FLAG_FILL_NONE);
        ewl_widget_show(menu1);

        item = ewl_menu_item_new();
        ewl_button_image_set(EWL_BUTTON(item),
                        ewl_test_image_get("Open.png"), NULL);
        ewl_button_label_set(EWL_BUTTON(item), "Dia");
        ewl_container_child_append(EWL_CONTAINER(menu1), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        item = ewl_menu_item_new();
        ewl_button_image_set(EWL_BUTTON(item),
                                ewl_test_image_get("Package.png"), NULL);
        ewl_button_label_set(EWL_BUTTON(item), "Gimp");
        ewl_container_child_append(EWL_CONTAINER(menu1), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        item = ewl_menu_item_new();
        ewl_stock_type_set(EWL_STOCK(item), EWL_STOCK_OK);
        ewl_container_child_append(EWL_CONTAINER(menu1), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        item = ewl_hseparator_new();
        ewl_container_child_append(EWL_CONTAINER(menu1), item);
        ewl_widget_show(item);

        item = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(item), "Button");
        ewl_container_child_append(EWL_CONTAINER(menu1), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        /* Create a sub-menu */
        menu2 = ewl_menu_new();
        ewl_button_label_set(EWL_BUTTON(menu2), "Sub Menu");
        ewl_container_child_append(EWL_CONTAINER(menu1), menu2);
        ewl_widget_show(menu2);

        item = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(item), "Button 1");
        ewl_container_child_append(EWL_CONTAINER(menu2), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        item = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(item), "Button 2");
        ewl_container_child_append(EWL_CONTAINER(menu2), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        /* create a sub-sub-menu */
        menu3 = ewl_menu_new();
        ewl_button_label_set(EWL_BUTTON(menu3), "Sub Sub Menu");
        ewl_container_child_append(EWL_CONTAINER(menu2), menu3);
        ewl_widget_show(menu3);

        item = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(item), "Sub Button 1");
        ewl_container_child_append(EWL_CONTAINER(menu3), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        item = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(item), "Sub Button 2");
        ewl_container_child_append(EWL_CONTAINER(menu3), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        /* Create a sub-menu */
        menu2 = ewl_menu_new();
        ewl_button_label_set(EWL_BUTTON(menu2), "Sub Menu2");
        ewl_container_child_append(EWL_CONTAINER(menu1), menu2);
        ewl_widget_show(menu2);

        item = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(item), "Button 2-1");
        ewl_container_child_append(EWL_CONTAINER(menu2), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        item = ewl_menu_item_new();
        ewl_button_label_set(EWL_BUTTON(item), "Button 2-2");
        ewl_container_child_append(EWL_CONTAINER(menu2), item);
        ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
        ewl_widget_show(item);

        return 1;
}
Пример #24
0
void entropy_ewl_mime_dialog_display() {
	Ewl_Widget* window = ewl_window_new();
	Ewl_Widget* box = ewl_vbox_new();
	Ewl_Widget* button = ewl_button_new();
	Ewl_Widget* hbox;
	
	entropy_core* core = entropy_core_get_core();
	char* entries[3];
	char* key;
	entropy_mime_action* action;
	Ecore_List* keys;

	last_select_text = NULL;


	/*Init the mime tree*/
	mime_tree = ewl_tree_new(2);

	ewl_tree_mode_set(EWL_TREE(mime_tree), EWL_SELECTION_MODE_SINGLE);
	ewl_object_minimum_size_set(EWL_OBJECT(window), 530, 400);
	ewl_window_title_set(EWL_WINDOW(window), "Edit MIME Actions..");
	ewl_container_child_append(EWL_CONTAINER(window), box);
	ewl_container_child_append(EWL_CONTAINER(box), mime_tree);
	
	ewl_widget_show(box);

	keys = ecore_hash_keys(core->mime_action_hint);
	while ((key = ecore_list_first_remove(keys))) {
		Ewl_Widget* row;
		
		entries[0] = key;
		entries[1] = ((entropy_mime_action*)ecore_hash_get(core->mime_action_hint, key))->executable;
		entries[2] = NULL;

		row = ewl_tree_text_row_add(EWL_TREE(mime_tree), NULL,entries);
		ewl_widget_color_set(row,0,0,0,255);
		ewl_callback_append(row, EWL_CALLBACK_MOUSE_DOWN, 
			mime_row_click_cb, key);
	}
	ecore_list_destroy(keys);


	hbox = ewl_hbox_new();
	ewl_container_child_append(EWL_CONTAINER(box), hbox);
	ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_SHRINK);
	ewl_widget_show(hbox);


	/*Add Button*/
	ewl_button_label_set(EWL_BUTTON(button), "Add MIME Action");
	ewl_object_maximum_h_set(EWL_OBJECT(button), 15);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, entropy_ewl_mime_add_display_cb, NULL);
	ewl_container_child_append(EWL_CONTAINER(hbox), button);
	ewl_widget_show(button);

	
	/*OK Button*/
	button = ewl_button_new();
	ewl_button_label_set(EWL_BUTTON(button), "Close");
	ewl_object_maximum_h_set(EWL_OBJECT(button), 15);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, window_dismiss_cb, window);
	ewl_container_child_append(EWL_CONTAINER(hbox), button);
	ewl_widget_show(button);

	
	
	
	ewl_widget_show(window);
	ewl_widget_show(mime_tree);
	
}
Пример #25
0
void ewl_frontend_dialog_config_open(Eli_App * eap)
{
    Ewl_Widget * o;
    Ewl_Widget * border_box;
    Ewl_Widget * hbox;
    Ewl_Widget * vbox;
    Ewl_Widget * main_box;
    Ewl_Widget * radio_b[2];

    /* one open config dialog should be enough */
    if (conf_win) return;
    /* Setup and show the configuration window */
    conf_win = ewl_dialog_new();
    ewl_dialog_action_position_set(EWL_DIALOG(conf_win), EWL_POSITION_BOTTOM);
    ewl_window_title_set(EWL_WINDOW(conf_win), _("Configuration"));
    ewl_window_name_set(EWL_WINDOW(conf_win), "Elitaire");
    ewl_window_class_set(EWL_WINDOW(conf_win), "Elitaire");
    ewl_window_leader_foreign_set(EWL_WINDOW(conf_win),
		    		EWL_EMBED_WINDOW(eap->main_win));
    ewl_callback_append(conf_win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb,
                        NULL);
    ewl_dialog_has_separator_set(EWL_DIALOG(conf_win), 1);
    ewl_object_fill_policy_set(EWL_OBJECT(conf_win), EWL_FLAG_FILL_NONE);
    ewl_widget_show(conf_win);
    
    /* the main_box contain the border_boxes */
    ewl_dialog_active_area_set(EWL_DIALOG(conf_win), EWL_POSITION_TOP);
    main_box = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(conf_win), main_box);
    ewl_object_fill_policy_set(EWL_OBJECT(main_box), EWL_FLAG_ALIGN_CENTER);
    ewl_widget_show(main_box);

    /* Setup and show the stock icons */
    ewl_dialog_active_area_set(EWL_DIALOG(conf_win), EWL_POSITION_BOTTOM);

    o = ewl_button_new();
    ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_CANCEL);
    ewl_container_child_append(EWL_CONTAINER(conf_win), o);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, conf_win_clicked_cb,
                        conf_win);
    ewl_widget_show(o);

    o = ewl_button_new();
    ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_APPLY);
    ewl_container_child_append(EWL_CONTAINER(conf_win), o);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, conf_win_clicked_cb,
                        conf_win);
    ewl_widget_show(o);

    o = ewl_button_new();
    ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_OK);
    ewl_container_child_append(EWL_CONTAINER(conf_win), o);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, conf_win_clicked_cb,
                        conf_win);
    ewl_widget_show(o);

    /* *** Graphic Box *** */
    /* Setup and show the border box */
    border_box = ewl_border_new();
    ewl_border_label_set(EWL_BORDER(border_box), _("Graphic"));
    ewl_container_child_append(EWL_CONTAINER(main_box), border_box);
    //ewl_object_fill_policy_set(EWL_OBJECT(border_box), EWL_FLAG_FILL_HFILL);
    ewl_widget_show(border_box);

    /* Setup and show the checkbuttons */
    o = ewl_checkbutton_new();
    ewl_button_label_set(EWL_BUTTON(o), _("animated movements"));
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
    ewl_widget_show(o);
    config.animations = ecore_config_boolean_get("/graphic/animations");
    ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(o), config.animations);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, _check_selected, NULL);

    o = ewl_checkbutton_new();
    ewl_button_label_set(EWL_BUTTON(o), _("shadows"));
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
    ewl_widget_show(o);
    config.shadows = ecore_config_boolean_get("/graphic/shadows");
    ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(o), config.shadows);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, _check_selected, NULL);

    /* Setup and show the velocity label and seeker */
    hbox = ewl_grid_new();
    ewl_container_child_append(EWL_CONTAINER(border_box), hbox);
    ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_FILL);
    ewl_grid_column_preferred_w_use(EWL_GRID(hbox), 1);
    ewl_widget_show(hbox);

    o = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(o), _("velocity:"));
    ewl_container_child_append(EWL_CONTAINER(hbox), o);
    ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
    ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
    ewl_widget_show(o);

    o = ewl_label_new();
    ewl_container_child_append(EWL_CONTAINER(hbox), o);
    ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
    ewl_widget_show(o);
    config.vel_label = o;

    o = ewl_hseeker_new();
    config.velocity = ecore_config_int_get("velocity");
    ewl_range_minimum_value_set(EWL_RANGE(o), 200.0);
    ewl_range_maximum_value_set(EWL_RANGE(o), 800.0);
    ewl_range_step_set(EWL_RANGE(o), 60.0);
    ewl_range_value_set(EWL_RANGE(o), (double) config.velocity);
    ewl_widget_name_set(o, "velocity");
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED, _hseeker_cb, NULL);
                          _hseeker_cb(o, NULL, NULL);
    ewl_widget_show(o);

    /* Setup and show the frame_rate label and seeker */
    hbox = ewl_grid_new();
    ewl_container_child_append(EWL_CONTAINER(border_box), hbox);
    ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_ALL);
    ewl_grid_column_preferred_w_use(EWL_GRID(hbox), 1);
    ewl_widget_show(hbox);

    o = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(o), _("frame rate:"));
    ewl_container_child_append(EWL_CONTAINER(hbox), o);
    ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
    ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
    ewl_widget_show(o);
    
    o = ewl_label_new();
    ewl_container_child_append(EWL_CONTAINER(hbox), o);
    ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
    ewl_widget_show(o);
    config.frt_label = o;

    o = ewl_hseeker_new();
    config.frame_rate = ecore_config_int_get("frame_rate");
    ewl_range_minimum_value_set(EWL_RANGE(o), 10.0);
    ewl_range_maximum_value_set(EWL_RANGE(o), 100.0);
    ewl_range_step_set(EWL_RANGE(o), 10.0);
    ewl_range_value_set(EWL_RANGE(o), (double) config.frame_rate);
    ewl_widget_name_set(o, "frame_rate");
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED, _hseeker_cb, NULL);
    _hseeker_cb(o, NULL, NULL);
    ewl_widget_show(o);

    /* *** Lazy Box *** */
    vbox = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(main_box), vbox);
    ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_NORMAL);
    ewl_widget_show(vbox);

    border_box = ewl_border_new();
    ewl_container_child_append(EWL_CONTAINER(vbox), border_box);
    ewl_border_label_set(EWL_BORDER(border_box), _("Laziness"));
    ewl_widget_show(border_box);
    /* the radio buttons */
    config.lazy = ecore_config_int_get("lazy");
    radio_b[0] = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(radio_b[0]), _("normal mode"));
    ewl_object_alignment_set(EWL_OBJECT(radio_b[0]), EWL_FLAG_ALIGN_LEFT);
    ewl_container_child_append(EWL_CONTAINER(border_box), radio_b[0]);
    ewl_callback_append(radio_b[0], EWL_CALLBACK_CLICKED, _check_selected,
                        NULL);
    ewl_widget_show(radio_b[0]);

    radio_b[1] = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(radio_b[1]), _("lazy mode"));
    ewl_container_child_append(EWL_CONTAINER(border_box), radio_b[1]);
    ewl_object_alignment_set(EWL_OBJECT(radio_b[1]), EWL_FLAG_ALIGN_LEFT);
    ewl_radiobutton_chain_set(EWL_RADIOBUTTON(radio_b[1]),
                              EWL_RADIOBUTTON(radio_b[0]));
    ewl_callback_append(radio_b[1], EWL_CALLBACK_CLICKED, _check_selected,
                        NULL);
    ewl_widget_show(radio_b[1]);
    if (config.lazy)
        ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(radio_b[1]), 1);
    else
        ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(radio_b[0]), 1);

    /* *** Render Box *** */
    /* Setup and show the border box */
    border_box = ewl_border_new();
    ewl_border_label_set(EWL_BORDER(border_box), _("Render Engine"));
    ewl_container_child_append(EWL_CONTAINER(vbox), border_box);
    ewl_object_fill_policy_set(EWL_OBJECT(border_box), EWL_FLAG_FILL_FILL);
    ewl_object_alignment_set(EWL_OBJECT(border_box), EWL_FLAG_ALIGN_CENTER);
    ewl_object_alignment_set(EWL_OBJECT(main_box), EWL_FLAG_ALIGN_TOP);
    ewl_widget_show(border_box);

    o = ewl_text_new();
    ewl_text_text_set(EWL_TEXT(o), _("Changes only affect after new start"));
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_widget_show(o);

    /* the radio buttons */
    config.gl = ecore_config_boolean_get("/graphic/gl");
    radio_b[0] = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(radio_b[0]), _("Software"));
    ewl_container_child_append(EWL_CONTAINER(border_box), radio_b[0]);
    ewl_object_alignment_set(EWL_OBJECT(radio_b[0]), EWL_FLAG_ALIGN_LEFT);
    ewl_callback_append(radio_b[0], EWL_CALLBACK_CLICKED, _check_selected,
                        NULL);
    ewl_widget_show(radio_b[0]);

    radio_b[1] = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(radio_b[1]), _("OpenGL (testing)"));
    ewl_container_child_append(EWL_CONTAINER(border_box), radio_b[1]);
    ewl_object_alignment_set(EWL_OBJECT(radio_b[1]), EWL_FLAG_ALIGN_LEFT);
    ewl_radiobutton_chain_set(EWL_RADIOBUTTON(radio_b[1]),
                              EWL_RADIOBUTTON(radio_b[0]));
    ewl_callback_append(radio_b[1], EWL_CALLBACK_CLICKED, _check_selected,
                        NULL);
    ewl_widget_show(radio_b[1]);
    if (config.gl)
        ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(radio_b[1]), 1);
    else
        ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(radio_b[0]), 1);

}
Пример #26
0
static int
create_test(Ewl_Container *box)
{
        int i;
        const Freebox_Test fbtests[] = {
                {
                        "Manual Placement",
                        EWL_FREEBOX_LAYOUT_MANUAL,
                        NULL
                       },
                {
                        "Auto Placement",
                        EWL_FREEBOX_LAYOUT_AUTO,
                        NULL
                },
                {
                        "Comparator Placement (by name)",
                        EWL_FREEBOX_LAYOUT_COMPARATOR,
                        ewl_freebox_cb_compare
                },
                { NULL, EWL_FREEBOX_LAYOUT_AUTO, NULL }
        };

        srand(time(NULL));

        ewl_object_fill_policy_set(EWL_OBJECT(box), EWL_FLAG_FILL_ALL);

        for (i = 0; fbtests[i].name != NULL; i++) {
                Ewl_Widget *border, *hbox, *fb, *pane, *o;

                border  = ewl_border_new();
                ewl_border_label_set(EWL_BORDER(border),
                                (char *)fbtests[i].name);
                ewl_object_fill_policy_set(EWL_OBJECT(border), EWL_FLAG_FILL_FILL);
                ewl_container_child_append(EWL_CONTAINER(box), border);
                ewl_widget_show(border);

                /* nest the freebox in a scrollpane */
                pane = ewl_scrollpane_new();
                ewl_container_child_append(EWL_CONTAINER(border), pane);
                ewl_widget_show(pane);

                /* create a freebox of the type for this test */
                fb = ewl_freebox_new();
                ewl_freebox_layout_type_set(EWL_FREEBOX(fb), fbtests[i].type);
                if (fbtests[i].compare) {
                        ewl_freebox_comparator_set(EWL_FREEBOX(fb),
                                        fbtests[i].compare);
                        sort_fb = fb;
                }
                ewl_container_child_append(EWL_CONTAINER(pane), fb);
                ewl_widget_show(fb);

                /* pack controls for the freebox */
                hbox = ewl_hbox_new();
                ewl_container_child_append(EWL_CONTAINER(border), hbox);
                ewl_object_fill_policy_set(EWL_OBJECT(hbox),
                                EWL_FLAG_FILL_NONE);
                ewl_object_alignment_set(EWL_OBJECT(hbox), EWL_FLAG_ALIGN_TOP);
                ewl_widget_show(hbox);

                o = ewl_button_new();
                ewl_button_label_set(EWL_BUTTON(o), "Add items");
                ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
                ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_TOP);
                ewl_container_child_append(EWL_CONTAINER(hbox), o);
                ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                        ewl_freebox_cb_add, fb);
                ewl_widget_show(o);

                o = ewl_button_new();
                ewl_button_label_set(EWL_BUTTON(o), "Clear items");
                ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
                ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_TOP);
                ewl_container_child_append(EWL_CONTAINER(hbox), o);
                ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                        ewl_freebox_cb_clear, fb);
                ewl_widget_show(o);
        }

        return 1;
}
Пример #27
0
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *tree, *o, *o2, *o3;
        Ewl_Model *model;
        Ewl_View *view;
        void *data;

        o2 = ewl_hbox_new();
        ewl_container_child_append(box, o2);
        ewl_object_fill_policy_set(EWL_OBJECT(o2), EWL_FLAG_FILL_HFILL);
        ewl_widget_show(o2);

        /* create our data */
        data = tree_test_data_setup();

        /* the tree will only use one model. We could use a model per
         * column, but a single model will work fine for this test */
        model = ewl_model_new();
        ewl_model_data_fetch_set(model, tree_test_data_fetch);
        ewl_model_data_header_fetch_set(model,
                                tree_test_cb_header_data_fetch);
        ewl_model_data_sort_set(model, tree_test_data_sort);
        ewl_model_column_sortable_set(model, tree_test_column_sortable);
        ewl_model_data_count_set(model, tree_test_data_count_get);
        ewl_model_data_expandable_set(model, tree_test_data_expandable_get);
        ewl_model_expansion_data_fetch_set(model,
                                tree_test_data_expansion_fetch);

        view = ewl_view_new();
        ewl_view_widget_constructor_set(view, tree_test_cb_widget_fetch);
        ewl_view_widget_assign_set(view, tree_test_cb_widget_assign);
        ewl_view_header_fetch_set(view, tree_test_cb_header_fetch);

        tree = ewl_tree_new();
        ewl_container_child_append(EWL_CONTAINER(box), tree);
        ewl_object_fill_policy_set(EWL_OBJECT(tree), EWL_FLAG_FILL_ALL);
        ewl_callback_append(tree, EWL_CALLBACK_VALUE_CHANGED,
                                        tree_cb_value_changed, NULL);
        ewl_mvc_data_set(EWL_MVC(tree), data);
        ewl_mvc_model_set(EWL_MVC(tree), model);
        ewl_mvc_view_set(EWL_MVC(tree), view);
        ewl_mvc_selection_mode_set(EWL_MVC(tree), EWL_SELECTION_MODE_MULTI);
        ewl_tree_column_count_set(EWL_TREE(tree), 3);
        ewl_tree_row_expand(EWL_TREE(tree), data, 2);
        ewl_widget_name_set(tree, "tree");
        ewl_widget_show(tree);

        o3 = ewl_vbox_new();
        ewl_container_child_append(EWL_CONTAINER(o2), o3);
        ewl_widget_show(o3);

        /* create the checkbuttons for the top box */
        o = ewl_checkbutton_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
        ewl_button_label_set(EWL_BUTTON(o), "Scroll headers");
        ewl_container_child_append(EWL_CONTAINER(o3), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_tree_cb_scroll_headers, tree);
        ewl_widget_show(o);

        o = ewl_checkbutton_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
        ewl_button_label_set(EWL_BUTTON(o), "Hide headers");
        ewl_container_child_append(EWL_CONTAINER(o3), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_tree_cb_hide_headers, tree);
        ewl_widget_show(o);

        o = ewl_checkbutton_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_button_label_set(EWL_BUTTON(o), "Plain view");
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_tree_cb_plain_view, tree);
        ewl_widget_show(o);

        o = ewl_spinner_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_spinner_digits_set(EWL_SPINNER(o), 0);
        ewl_range_minimum_value_set(EWL_RANGE(o), 0);
        ewl_range_maximum_value_set(EWL_RANGE(o), 10000);
        ewl_range_value_set(EWL_RANGE(o), 5);
        ewl_range_step_set(EWL_RANGE(o), 1);
        ewl_widget_name_set(o, "rows_spinner");
        ewl_widget_show(o);

        o = ewl_button_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_button_label_set(EWL_BUTTON(o), "Set number of rows");
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                ewl_tree_cb_set_rows_clicked, NULL);
        ewl_widget_show(o);

        o = ewl_button_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_button_label_set(EWL_BUTTON(o), "Row select");
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                tree_cb_select_mode_change, NULL);
        ewl_widget_show(o);

	o = ewl_button_new();
        ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
        ewl_button_label_set(EWL_BUTTON(o), "Ensure visible");
        ewl_container_child_append(EWL_CONTAINER(o2), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                tree_cb_ensure_visible, NULL);
        ewl_widget_show(o);

        return 1;
}
Пример #28
0
eth_panel* ethpanel_create(main_window* win)
{
    Ewl_Widget *hbox,*grid;
    Ewl_Widget *label;
    eth_panel* pnl;
    pnl=(eth_panel*)malloc((unsigned int)sizeof(eth_panel));

    pnl->interface = NULL;
    pnl->win = win;
    pnl->frame = ewl_border_new();
    pnl->apply = 0;
    ewl_border_label_set(EWL_BORDER(pnl->frame),"hehe");
    ewl_widget_show(pnl->frame);

    pnl->box_configuration = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->frame), pnl->box_configuration);
    ewl_widget_show(pnl->box_configuration);
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->box_configuration), EWL_FLAG_FILL_HFILL);
    ewl_object_alignment_set(EWL_OBJECT(pnl->box_configuration),EWL_FLAG_ALIGN_LEFT);


    //#########################################
    //## box_configuration: box_activate ##
    //#########################################
    pnl->box_activate = ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), pnl->box_activate);
    pnl->btn_activate = ewl_button_new();
    ewl_button_label_set(EWL_BUTTON(pnl->btn_activate),_("Activate"));
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->btn_activate), EWL_FLAG_FILL_SHRINK);

    pnl->btn_deactivate = ewl_button_new();
    ewl_button_label_set(EWL_BUTTON(pnl->btn_deactivate),_("Deactivate"));
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->btn_deactivate), EWL_FLAG_FILL_SHRINK);

    ewl_container_child_append(EWL_CONTAINER(pnl->box_activate), pnl->btn_deactivate);
    ewl_container_child_append(EWL_CONTAINER(pnl->box_activate), pnl->btn_activate);
    ewl_widget_show(pnl->btn_activate);
    ewl_widget_show(pnl->btn_deactivate);
    ewl_widget_show(pnl->box_activate);
    ewl_callback_append(pnl->btn_activate, EWL_CALLBACK_CLICKED,
            ethpanel_btn_activate_clicked_cb, pnl);
    ewl_callback_append(pnl->btn_deactivate, EWL_CALLBACK_CLICKED,
            ethpanel_btn_deactivate_clicked_cb, pnl);



    //###################################################
    //## box_configuration: check list (static / dhcp) ##
    //###################################################

    hbox = ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), hbox);

    pnl->check_static = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(pnl->check_static),_("Static address"));
    pnl->check_dhcp = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(pnl->check_dhcp),_("DHCP (Automatic configuration)"));
    ewl_radiobutton_chain_set(EWL_RADIOBUTTON(pnl->check_dhcp),
                              EWL_RADIOBUTTON(pnl->check_static));
    ewl_container_child_append(EWL_CONTAINER(hbox), pnl->check_static);
    ewl_container_child_append(EWL_CONTAINER(hbox), pnl->check_dhcp);
    ewl_widget_show(hbox);
    ewl_widget_show(pnl->check_dhcp);
    ewl_widget_show(pnl->check_static);
    ewl_callback_append(pnl->check_static, EWL_CALLBACK_CLICKED,
            ethpanel_set_static_dhcp_clicked_cb, pnl);
    ewl_callback_append(pnl->check_dhcp, EWL_CALLBACK_CLICKED,
            ethpanel_set_static_dhcp_clicked_cb, pnl);


    //###################################
    //## box_configuration: Entry list ##
    //###################################
    pnl->entry_ip = ewl_entry_new();
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->entry_ip), EWL_FLAG_FILL_FILL);
    ewl_object_alignment_set(EWL_OBJECT(pnl->entry_ip),EWL_FLAG_ALIGN_LEFT);

    pnl->entry_mask = ewl_entry_new();
    pnl->entry_gateway = ewl_entry_new();
    pnl->entry_cmd = ewl_entry_new();
    ewl_callback_append(pnl->entry_ip, EWL_CALLBACK_KEY_UP,
            ethpanel_textchanged_entry_cb, pnl);
    ewl_callback_append(pnl->entry_mask, EWL_CALLBACK_KEY_UP,
            ethpanel_textchanged_entry_cb, pnl);
    ewl_callback_append(pnl->entry_gateway, EWL_CALLBACK_KEY_UP,
            ethpanel_textchanged_entry_cb, pnl);

    grid = ewl_grid_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), grid);
    ewl_object_fill_policy_set(EWL_OBJECT(grid), EWL_FLAG_FILL_HFILL);
    ewl_grid_dimensions_set(EWL_GRID(grid), 2, 5);
    ewl_grid_column_relative_w_set(EWL_GRID(grid), 0, 0.20);

    label = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(label),_("Ip address: "));
    ewl_container_child_append(EWL_CONTAINER(grid), label);
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->entry_ip);
    ewl_widget_show(label);
    ewl_widget_show(pnl->entry_ip);

    label = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(label),_("Network mask: "));
    ewl_container_child_append(EWL_CONTAINER(grid), label);
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->entry_mask);
    ewl_widget_show(label);
    ewl_widget_show(pnl->entry_mask);

    label = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(label),_("Gateway: "));
    ewl_container_child_append(EWL_CONTAINER(grid), label);
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->entry_gateway);
    ewl_widget_show(label);
    ewl_widget_show(pnl->entry_gateway);

    pnl->lbl_cmd = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(pnl->lbl_cmd),_("Command: "));
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->lbl_cmd);
    ewl_container_child_append(EWL_CONTAINER(grid), pnl->entry_cmd);
    ewl_widget_show(pnl->lbl_cmd);
    ewl_widget_show(pnl->entry_cmd);

    ewl_widget_show(grid);

    //#####################################
    //## box_configuration: Apply button ##
    //#####################################

    hbox = ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), hbox);
    pnl->btn_apply = ewl_button_new();
    ewl_stock_type_set(EWL_STOCK(pnl->btn_apply), EWL_STOCK_APPLY);
    ewl_object_fill_policy_set(EWL_OBJECT(pnl->btn_apply), EWL_FLAG_FILL_SHRINK);

    ewl_container_child_append(EWL_CONTAINER(hbox), pnl->btn_apply);
    ewl_widget_show(pnl->btn_apply);
    ewl_widget_show(hbox);

    ewl_callback_append(pnl->btn_apply, EWL_CALLBACK_CLICKED,
            ethpanel_btn_apply_clicked_cb, pnl);

    //########################################
    //## box_configuration: hbox_pbar	##
    //########################################

    pnl->hbox_pbar = ewl_hbox_new();
    pnl->pbar = ewl_progressbar_new();
    ewl_container_child_append(EWL_CONTAINER(pnl->box_configuration), pnl->hbox_pbar);
    ewl_container_child_append(EWL_CONTAINER(pnl->hbox_pbar), pnl->pbar);

    ewl_progressbar_label_set(EWL_PROGRESSBAR(pnl->pbar), APPLY_TEXT);
    ewl_range_unknown_set(EWL_RANGE(pnl->pbar), TRUE);

    ewl_widget_show(pnl->pbar);
    ewl_widget_show(pnl->hbox_pbar);

    return pnl;
}
Пример #29
0
/**
 * @param e: The Ewl_Entry to initialize
 * @return Returns TRUE on success or FALSE on failure
 * @brief Initializes an Ewl_Entry widget to default values
 */
int
ewl_entry_init(Ewl_Entry *e)
{
        const char *text_types[] = { "UTF8_STRING", "text/plain", NULL };
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(e, FALSE);

        w = EWL_WIDGET(e);

        if (!ewl_text_init(EWL_TEXT(e)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_inherit(w, EWL_ENTRY_TYPE);
        ewl_widget_appearance_set(w, EWL_ENTRY_TYPE);
        ewl_widget_focusable_set(EWL_WIDGET(e), TRUE);

        ewl_object_fill_policy_set(EWL_OBJECT(e), EWL_FLAG_FILL_HSHRINK |
                                                  EWL_FLAG_FILL_HFILL);

        ewl_container_callback_intercept(EWL_CONTAINER(w), EWL_CALLBACK_FOCUS_IN);
        ewl_container_callback_intercept(EWL_CONTAINER(w), EWL_CALLBACK_FOCUS_OUT);
        ewl_container_callback_intercept(EWL_CONTAINER(w), EWL_CALLBACK_DND_POSITION);
        ewl_container_callback_intercept(EWL_CONTAINER(w), EWL_CALLBACK_DND_DATA_RECEIVED);

        /* setup the cursor */
        e->cursor = ewl_entry_cursor_new(e);
        ewl_container_child_append(EWL_CONTAINER(e), e->cursor);
        ewl_widget_internal_set(e->cursor, TRUE);
        ewl_object_fill_policy_set(EWL_OBJECT(e->cursor), EWL_FLAG_FILL_VFILL);

        /* Set the pointer */
        ewl_attach_mouse_cursor_set(EWL_WIDGET(e), EWL_MOUSE_CURSOR_XTERM);

        /* this has to be called after the cursor is created as it will try
         * to show the cursor */
        ewl_entry_multiline_set(e, FALSE);
        ewl_entry_editable_set(e, TRUE);
        ewl_text_selectable_set(EWL_TEXT(e), TRUE);
        ewl_dnd_accepted_types_set(EWL_WIDGET(e), text_types);

        /* setup callbacks */
        ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN,
                                ewl_entry_cb_focus_in, NULL);
        ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT,
                                ewl_entry_cb_focus_out, NULL);
        ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE,
                                ewl_entry_cb_configure, NULL);
        ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN,
                                ewl_entry_cb_mouse_down, NULL);
        ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP,
                                ewl_entry_cb_mouse_up, NULL);
        ewl_callback_append(w, EWL_CALLBACK_WIDGET_DISABLE,
                                ewl_entry_cb_disable, NULL);
        ewl_callback_append(w, EWL_CALLBACK_WIDGET_ENABLE,
                                ewl_entry_cb_enable, NULL);
        ewl_callback_append(w, EWL_CALLBACK_DND_POSITION,
                                ewl_entry_cb_dnd_position, NULL);
        ewl_callback_append(w, EWL_CALLBACK_DND_DATA_RECEIVED,
                                ewl_entry_cb_dnd_data, NULL);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Пример #30
0
void
_icon_editor_gui_init()
{
  if (!editor) return;

  editor->win = ewl_window_new();
  ewl_window_title_set(EWL_WINDOW(editor->win), "Iconbar Icon Editor");
  ewl_window_name_set(EWL_WINDOW(editor->win), "Iconbar Icon Editor");
  ewl_callback_append(editor->win, EWL_CALLBACK_DELETE_WINDOW,
                      _editor_close_win, NULL);

  /* boxes */
  editor->main_vbox = ewl_vbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->win), editor->main_vbox);
  ewl_widget_show(editor->main_vbox);
  
  editor->top_hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->main_vbox), editor->top_hbox);
  ewl_widget_show(editor->top_hbox);

  editor->bot_hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->main_vbox), editor->bot_hbox);
  ewl_widget_show(editor->bot_hbox);

  /* image */
  editor->icon_image = ewl_image_new("test.png", NULL);
  ewl_container_child_append(EWL_CONTAINER(editor->top_hbox), editor->icon_image);
  ewl_object_padding_set(EWL_OBJECT(editor->icon_image), 5, 5, 5, 5);
  ewl_widget_show(editor->icon_image);
  ewl_callback_append(editor->icon_image, EWL_CALLBACK_REALIZE,
                      _editor_realize, NULL);
  ewl_callback_append(editor->icon_image, EWL_CALLBACK_MOUSE_UP,
                      _editor_icon_image_cb, NULL);

  /* vbox for entry hboxes */
  editor->right_vbox = ewl_vbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->top_hbox), editor->right_vbox);
  ewl_widget_show(editor->right_vbox);


  /* name */
  editor->name.hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->right_vbox), editor->name.hbox);
  ewl_widget_show(editor->name.hbox);

  editor->name.label = ewl_text_new("Name: ");
  ewl_container_child_append(EWL_CONTAINER(editor->name.hbox), editor->name.label);
  ewl_widget_show(editor->name.label);

  editor->name.entry = ewl_entry_new("");
  ewl_container_child_append(EWL_CONTAINER(editor->name.hbox), editor->name.entry);
  ewl_widget_show(editor->name.entry);


  /* exec */
  editor->exec.hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->right_vbox), editor->exec.hbox);
  ewl_widget_show(editor->exec.hbox);

  editor->exec.label = ewl_text_new("Exec:");
  ewl_container_child_append(EWL_CONTAINER(editor->exec.hbox), editor->exec.label);
  ewl_widget_show(editor->exec.label);

  editor->exec.entry = ewl_entry_new("");
  ewl_container_child_append(EWL_CONTAINER(editor->exec.hbox), editor->exec.entry);
  ewl_widget_show(editor->exec.entry);


  /* cancel and save buttons */
  editor->cancel_but = ewl_button_new("Cancel");
  ewl_object_fill_policy_set(EWL_OBJECT(editor->cancel_but), EWL_FLAG_FILL_NONE);
  ewl_object_padding_set(EWL_OBJECT(editor->cancel_but), 5, 5, 5, 5);
  ewl_object_alignment_set(EWL_OBJECT(editor->cancel_but), EWL_FLAG_ALIGN_RIGHT);
  ewl_container_child_append(EWL_CONTAINER(editor->bot_hbox), editor->cancel_but);
  ewl_widget_show(editor->cancel_but);
  ewl_callback_append(editor->cancel_but, EWL_CALLBACK_CLICKED,
                      _editor_button_cb, NULL);

  editor->ok_but = ewl_button_new("Save and Close");
  ewl_object_fill_policy_set(EWL_OBJECT(editor->ok_but), EWL_FLAG_FILL_NONE);
  ewl_object_padding_set(EWL_OBJECT(editor->ok_but), 5, 5, 5, 5);
  ewl_object_alignment_set(EWL_OBJECT(editor->ok_but), EWL_FLAG_ALIGN_RIGHT);
  ewl_container_child_append(EWL_CONTAINER(editor->bot_hbox), editor->ok_but);
  ewl_widget_show(editor->ok_but);
  ewl_callback_append(editor->ok_but, EWL_CALLBACK_CLICKED,
                      _editor_button_cb, NULL);

  editor->filesel.win = ewl_window_new();

  editor->filesel.dialog = ewl_filedialog_new(EWL_FILEDIALOG_TYPE_OPEN);
  ewl_container_child_append(EWL_CONTAINER(editor->filesel.win), editor->filesel.dialog);
  ewl_widget_show(editor->filesel.dialog);
  ewl_callback_append(editor->filesel.dialog, EWL_CALLBACK_VALUE_CHANGED, _editor_filesel_cb, NULL);
}