Ewl_Context_Menu: A context menu
Detailed Description
- Remarks:
- Inherits from Ewl_Popup.
Data Structures | |
struct | Ewl_Context_Menu |
Inherits from Ewl_Popup and extends to provide a context menu. More... | |
Defines | |
#define | EWL_CONTEXT_MENU(context_menu) ((Ewl_Context_Menu *) context_menu) |
#define | EWL_CONTEXT_MENU_IS(w) |
#define | EWL_CONTEXT_MENU_TYPE "context_menu" |
Typedefs | |
typedef struct Ewl_Context_Menu | Ewl_Context_Menu |
Functions | |
void | ewl_context_menu_attach (Ewl_Context_Menu *cm, Ewl_Widget *w) |
void | ewl_context_menu_cb_attach_mouse_down (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_context_menu_cb_child_add (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_context_menu_cb_child_clicked (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_context_menu_cb_child_mouse_in (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_context_menu_cb_child_remove (Ewl_Container *c, Ewl_Widget *w, int idx) |
void | ewl_context_menu_cb_focus_in (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_context_menu_cb_hide (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_context_menu_cb_mouse_down (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_context_menu_cb_mouse_move (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_context_menu_container_set (Ewl_Context_Menu *cm, Ewl_Container *c) |
set a custom container for the context menu | |
void | ewl_context_menu_detach (Ewl_Context_Menu *cm, Ewl_Widget *w) |
int | ewl_context_menu_init (Ewl_Context_Menu *cm) |
Initialize the context_menu and inherited fields. | |
Ewl_Widget * | ewl_context_menu_new (void) |
Allocate a new context_menu widget. |
Define Documentation
#define EWL_CONTEXT_MENU | ( | context_menu | ) | ((Ewl_Context_Menu *) context_menu) |
Typecast a pointer to an Ewl_Context_Menu pointer.
Referenced by ewl_combo_popup_container_set(), ewl_combo_scrollable_set(), ewl_context_menu_cb_child_add(), ewl_context_menu_cb_child_mouse_in(), ewl_context_menu_cb_child_remove(), ewl_context_menu_cb_focus_in(), ewl_context_menu_cb_hide(), ewl_context_menu_cb_mouse_down(), ewl_context_menu_cb_mouse_move(), ewl_filedialog_init(), and ewl_menu_cb_expand().
#define EWL_CONTEXT_MENU_IS | ( | w | ) |
Value:
Returns TRUE if the widget is an Ewl_Context_Menu, FALSE otherwise#define EWL_CONTEXT_MENU_TYPE "context_menu" |
The type name for the Ewl_Context_Menu widget
Referenced by ewl_context_menu_attach(), ewl_context_menu_cb_focus_in(), ewl_context_menu_cb_hide(), ewl_context_menu_cb_mouse_down(), ewl_context_menu_cb_mouse_move(), ewl_context_menu_container_set(), ewl_context_menu_detach(), and ewl_context_menu_init().
Typedef Documentation
typedef struct Ewl_Context_Menu Ewl_Context_Menu |
Function Documentation
void ewl_context_menu_attach | ( | Ewl_Context_Menu * | cm, | |
Ewl_Widget * | w | |||
) |
- Parameters:
-
cm,: the context menu to attach w,: a widget that gets the context menu attached
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN, DWARNING, ewl_callback_append(), EWL_CALLBACK_MOUSE_DOWN, ewl_context_menu_cb_attach_mouse_down(), EWL_CONTEXT_MENU_TYPE, ewl_embed_widget_find(), EWL_POPUP, ewl_popup_follow_get(), ewl_popup_follow_set(), EWL_WIDGET, and EWL_WIDGET_TYPE.
Referenced by ewl_filedialog_init().
void ewl_context_menu_cb_attach_mouse_down | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References Ewl_Event_Mouse_Down::base, Ewl_Event_Mouse_Down::button, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_POPUP, ewl_popup_mouse_position_set(), EWL_POPUP_TYPE, EWL_WIDGET, ewl_widget_focus_send(), ewl_widget_show(), Ewl_Event_Mouse::x, and Ewl_Event_Mouse::y.
Referenced by ewl_context_menu_attach(), and ewl_context_menu_detach().
void ewl_context_menu_cb_child_add | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
References child_add, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, ewl_callback_append(), EWL_CALLBACK_CLICKED, EWL_CALLBACK_MOUSE_IN, EWL_CONTAINER_TYPE, EWL_CONTEXT_MENU, ewl_context_menu_cb_child_clicked(), ewl_context_menu_cb_child_mouse_in(), ewl_embed_widget_find(), EWL_MENU_IS, EWL_MENU_ITEM, EWL_WIDGET, ewl_widget_focusable_get(), ewl_widget_internal_is(), and EWL_WIDGET_TYPE.
Referenced by ewl_context_menu_container_set().
void ewl_context_menu_cb_child_clicked | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_embed_widget_find(), EWL_POPUP, ewl_popup_follow_get(), EWL_POPUP_IS, EWL_WIDGET, ewl_widget_hide(), and EWL_WIDGET_TYPE.
Referenced by ewl_context_menu_cb_child_add(), and ewl_context_menu_cb_child_remove().
void ewl_context_menu_cb_child_mouse_in | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CONTEXT_MENU, ewl_embed_widget_find(), EWL_MENU, ewl_menu_collapse(), ewl_widget_focus_send(), EWL_WIDGET_TYPE, and open_menu.
Referenced by ewl_context_menu_cb_child_add(), and ewl_context_menu_cb_child_remove().
void ewl_context_menu_cb_child_remove | ( | Ewl_Container * | c, | |
Ewl_Widget * | w, | |||
int | idx | |||
) |
References child_remove, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_CALLBACK_CLICKED, ewl_callback_del(), EWL_CALLBACK_MOUSE_IN, EWL_CONTAINER_TYPE, EWL_CONTEXT_MENU, ewl_context_menu_cb_child_clicked(), ewl_context_menu_cb_child_mouse_in(), ewl_embed_widget_find(), EWL_MENU_IS, EWL_MENU_ITEM, EWL_WIDGET, ewl_widget_focusable_get(), ewl_widget_internal_is(), and EWL_WIDGET_TYPE.
Referenced by ewl_context_menu_container_set().
void ewl_context_menu_cb_focus_in | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CONTEXT_MENU, and EWL_CONTEXT_MENU_TYPE.
Referenced by ewl_context_menu_init().
void ewl_context_menu_cb_hide | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CONTEXT_MENU, EWL_CONTEXT_MENU_TYPE, EWL_MENU, ewl_menu_collapse(), and open_menu.
Referenced by ewl_context_menu_init().
void ewl_context_menu_cb_mouse_down | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CONTEXT_MENU, EWL_CONTEXT_MENU_TYPE, EWL_EMBED, ewl_embed_focused_widget_get(), ewl_embed_widget_find(), EWL_MENU, ewl_menu_collapse(), EWL_POPUP, ewl_popup_follow_get(), EWL_POPUP_IS, EWL_WIDGET, ewl_widget_hide(), and open_menu.
Referenced by ewl_context_menu_init().
void ewl_context_menu_cb_mouse_move | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_CONTEXT_MENU, EWL_CONTEXT_MENU_TYPE, EWL_EMBED, ewl_embed_active_embed_get(), ewl_embed_active_set(), ewl_embed_widget_find(), ewl_embed_window_position_get(), EWL_MENU, ewl_menu_mouse_feed(), EWL_OBJECT, ewl_object_current_size_get(), EWL_POPUP, ewl_popup_follow_get(), EWL_POPUP_IS, open_menu, Ewl_Event_Mouse::x, and Ewl_Event_Mouse::y.
Referenced by ewl_context_menu_init().
void ewl_context_menu_container_set | ( | Ewl_Context_Menu * | cm, | |
Ewl_Container * | c | |||
) |
set a custom container for the context menu
- Parameters:
-
cm,: the context menu to set the container c,: the container to use inside of the context menu, if c is NULL then this function will use a vbox instead This function give you the ability to set a custom container as the internal used container of the context menu. It is not necessary to use this function, because the context menu uses a vbox as default, if you do not add an own one. If you override a previous added container, this container will be destroyed, but the children will be moved into the new container.
References Ewl_Container::child_add, child_add, Ewl_Container::child_remove, child_remove, container, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_CONTAINER, ewl_container_add_notify_set(), ewl_container_child_append(), ewl_container_child_iterate_begin(), ewl_container_child_next(), ewl_container_child_remove(), ewl_container_end_redirect_get(), ewl_container_redirect_set(), ewl_container_remove_notify_set(), EWL_CONTAINER_TYPE, ewl_context_menu_cb_child_add(), ewl_context_menu_cb_child_remove(), EWL_CONTEXT_MENU_TYPE, EWL_FLAG_FILL_HFILL, EWL_OBJECT, ewl_object_fill_policy_set(), ewl_vbox_new(), EWL_WIDGET, ewl_widget_destroy(), ewl_widget_internal_set(), and ewl_widget_show().
Referenced by ewl_combo_popup_container_set(), ewl_combo_scrollable_set(), and ewl_context_menu_init().
void ewl_context_menu_detach | ( | Ewl_Context_Menu * | cm, | |
Ewl_Widget * | w | |||
) |
- Parameters:
-
cm,: the context menu to detach w,: a widget that has cm attached
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN, ewl_callback_del(), EWL_CALLBACK_MOUSE_DOWN, ewl_context_menu_cb_attach_mouse_down(), EWL_CONTEXT_MENU_TYPE, and EWL_WIDGET_TYPE.
int ewl_context_menu_init | ( | Ewl_Context_Menu * | cm | ) |
Initialize the context_menu and inherited fields.
- Parameters:
-
cm,: the context_menu to initialize
- Returns:
- Returns TRUE on success, FALSE on failure. Clears the contents of the context_menu and stores the default values.
References DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_callback_append(), EWL_CALLBACK_FOCUS_IN, EWL_CALLBACK_HIDE, EWL_CALLBACK_MOUSE_DOWN, EWL_CALLBACK_MOUSE_MOVE, ewl_context_menu_cb_focus_in(), ewl_context_menu_cb_hide(), ewl_context_menu_cb_mouse_down(), ewl_context_menu_cb_mouse_move(), ewl_context_menu_container_set(), EWL_CONTEXT_MENU_TYPE, EWL_FLAG_ALIGN_LEFT, EWL_FLAG_ALIGN_TOP, EWL_MENU_TYPE, EWL_OBJECT, ewl_object_alignment_set(), EWL_POPUP, ewl_popup_init(), ewl_popup_offset_set(), EWL_POPUP_TYPE_MOUSE, ewl_popup_type_set(), ewl_theme_data_int_get(), EWL_WIDGET, ewl_widget_appearance_set(), and ewl_widget_inherit().
Referenced by ewl_context_menu_new().
Ewl_Widget* ewl_context_menu_new | ( | void | ) |
Allocate a new context_menu widget.
- Returns:
- Returns pointer to new context_menu widget on success, NULL on failure.
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_context_menu_init(), EWL_WIDGET, ewl_widget_destroy(), and NEW.
Referenced by ewl_combo_init(), ewl_filedialog_init(), and ewl_menu_init().