void icon_editor_hide() { if (!editor) return; ewl_widget_hide(editor->win); ewl_widget_hide(editor->filesel.win); }
void ethpanel_update_advanced_mode(eth_panel *pnl) { if(!pnl->win->advanced_mode) { ewl_widget_hide(pnl->entry_cmd); ewl_widget_hide(pnl->lbl_cmd); } else { ewl_widget_show(pnl->entry_cmd); ewl_widget_show(pnl->lbl_cmd); } }
/** * @param e: The Ewl_Entry to set the editable status of * @param editable: The value to set for the editable flag * @return Returns no value * @brief Set if the entry is editable or not */ void ewl_entry_editable_set(Ewl_Entry *e, unsigned int editable) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(e); DCHECK_TYPE(e, EWL_ENTRY_TYPE); if (e->editable == !!editable) DRETURN(DLEVEL_STABLE); e->editable = !!editable; if (e->editable) { ewl_callback_append(EWL_WIDGET(e), EWL_CALLBACK_KEY_DOWN, ewl_entry_cb_key_down, NULL); if (ewl_widget_state_has(EWL_WIDGET(e), EWL_STATE_FOCUSED)) ewl_widget_show(e->cursor); ewl_widget_state_add(EWL_WIDGET(e), EWL_STATE_ON); } else { ewl_callback_del(EWL_WIDGET(e), EWL_CALLBACK_KEY_DOWN, ewl_entry_cb_key_down); if (ewl_widget_state_has(EWL_WIDGET(e), EWL_STATE_FOCUSED)) ewl_widget_hide(e->cursor); ewl_widget_state_remove(EWL_WIDGET(e), EWL_STATE_ON); } DLEAVE_FUNCTION(DLEVEL_STABLE); }
void cb_goto_key_down(Ewl_Widget *w, void *ev, void *data) { Ewl_Widget *curwidget; char temp[50]; Ewl_Event_Key_Down *e; e = (Ewl_Event_Key_Down*)ev; int k = translate_key(e); int page,totalpages; switch(k) { case K_RETURN: ewl_widget_hide(menu); totalpages=epdf_document_page_count_get(ewl_pdf_pdf_document_get(EWL_PDF(pdfwidget))); page=(int)strtol(ewl_text_text_get(EWL_TEXT(goto_entry)),NULL,10); sprintf(temp,"menuitem1"); curwidget=ewl_widget_name_find(temp); ewl_menu_collapse(EWL_MENU(curwidget)); if(page>0&&page<=totalpages) ewl_pdf_page_set(EWL_PDF(pdfwidget),page-1); break; case K_ESCAPE: sprintf(temp,"menuitem1"); curwidget=ewl_widget_name_find(temp); ewl_menu_collapse(EWL_MENU(curwidget)); ewl_widget_focus_send(menu); break; default: return; } }
static void _editor_filesel_cb (Ewl_Widget *widget, void *ev_data, void *user_data) { char *file = ev_data; if (file) { icon_editor_image_file_set(file); } ewl_widget_hide(editor->filesel.win); }
/** * @param menu: the menu to work with * @return Returns no value * @brief Collapses the popup portion of the menu */ void ewl_menu_collapse(Ewl_Menu *menu) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(menu); DCHECK_TYPE(menu, EWL_MENU_TYPE); ewl_widget_hide(menu->popup); DLEAVE_FUNCTION(DLEVEL_STABLE); }
void cb_menu_key_down(Ewl_Widget *w, void *ev, void *data) { Ewl_Widget *curwidget; char temp[50]; Ewl_Event_Key_Down *e; e = (Ewl_Event_Key_Down*)ev; int k = translate_key(e); switch(k) { case 1: sprintf(temp,"menuitem1"); curwidget=ewl_widget_name_find(temp); ewl_menu_cb_expand(curwidget,NULL,NULL); ewl_widget_focus_send(EWL_WIDGET(EWL_MENU(curwidget)->popup)); int curpage=ewl_pdf_page_get(EWL_PDF(pdfwidget))+1; //sprintf(temp,"%d",curpage); ewl_text_text_set(EWL_TEXT(goto_entry),""); ewl_widget_focus_send(goto_entry); break; case 2: /*ewl_widget_hide(menu); opt_dlg_init(); ewl_window_transient_for(EWL_WINDOW(opt_dlg_widget_get()),EWL_WINDOW(win)); ewl_widget_show(opt_dlg_widget_get()); ewl_widget_focus_send(opt_dlg_widget_get());*/ ewl_widget_hide(menu); OptionsDialog(); break; case K_ESCAPE: ewl_widget_hide(menu); break; default: return; } }
/** * @param n: The Ewl_Notebook to set the visible page of * @param page: The page to set visible in the tabbar * @return Returns no value. * @brief Set the current visible page of the notebook */ void ewl_notebook_visible_page_set(Ewl_Notebook *n, Ewl_Widget *page) { Ewl_Widget *t; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(n); DCHECK_PARAM_PTR(page); DCHECK_TYPE(n, EWL_NOTEBOOK_TYPE); DCHECK_TYPE(page, EWL_WIDGET_TYPE); if (page == n->cur_page) DRETURN(DLEVEL_STABLE); if (n->cur_page) { Ewl_Widget *w; t = ewl_attach_widget_association_get(n->cur_page); if (t) ewl_widget_state_remove(t, EWL_STATE_SELECTED); /* make sure we set n->cur_page null first or the hide * callback won't let us hide */ w = n->cur_page; n->cur_page = NULL; ewl_widget_hide(w); } n->cur_page = page; ewl_widget_show(n->cur_page); t = ewl_attach_widget_association_get(n->cur_page); if (t) ewl_widget_state_add(t, EWL_STATE_SELECTED); ewl_callback_call(EWL_WIDGET(n), EWL_CALLBACK_VALUE_CHANGED); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @internal * @param c: The container to work with * @param w: The widget to work with * @return Returns no value * @brief The child show callback */ void ewl_notebook_cb_child_show(Ewl_Container *c, Ewl_Widget *w) { Ewl_Notebook *n; int pw, ph; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(c); DCHECK_PARAM_PTR(w); DCHECK_TYPE(c, EWL_CONTAINER_TYPE); DCHECK_TYPE(w, EWL_WIDGET_TYPE); n = EWL_NOTEBOOK(EWL_WIDGET(c)->parent); if (n->cur_page != w) ewl_widget_hide(w); ewl_object_preferred_size_get(EWL_OBJECT(n->cur_page), &pw, &ph); ewl_object_preferred_inner_size_set(EWL_OBJECT(n->body.pages), pw, ph); DLEAVE_FUNCTION(DLEVEL_STABLE); }
/** * @param n: The Ewl_Notebook to set the visible flag of the tabbar * @param visible: The flag to set for the tabbar visibility * @return Returns no value. * @brief Set if the tabbar is visible */ void ewl_notebook_tabbar_visible_set(Ewl_Notebook *n, unsigned int visible) { DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(n); DCHECK_TYPE(n, EWL_NOTEBOOK_TYPE); if (visible) { ewl_widget_custom_state_set(EWL_WIDGET(n->body.pages), "tabs", EWL_PERSISTENT); ewl_widget_show(n->body.tabbar); } else { ewl_widget_custom_state_set(EWL_WIDGET(n->body.pages), "notabs", EWL_PERSISTENT); ewl_widget_hide(n->body.tabbar); } DLEAVE_FUNCTION(DLEVEL_STABLE); }
void ethpanel_hide(eth_panel* pnl) { ewl_widget_hide(pnl->frame); }
void ethpanel_show(eth_panel* pnl) { ewl_widget_show(pnl->frame); ewl_widget_hide(pnl->hbox_pbar); ethpanel_update_advanced_mode(pnl); }
/** * hack for getting the file popup menu to configure */ static EWL_CALLBACK_DEFN(project_file_menu_configure) { ewl_callback_del(w, EWL_CALLBACK_CONFIGURE, project_file_menu_configure); ewl_widget_hide(w); }
void generalpanel_hide(general_panel* pnl) { ewl_widget_hide(pnl->frame); }