예제 #1
0
/* Initializes the members */
static void _etk_dialog_constructor(Etk_Dialog *dialog)
{
   if (!dialog)
      return;

   dialog->dialog_vbox = etk_vbox_new(ETK_FALSE, 0);
   etk_container_add(ETK_CONTAINER(dialog), dialog->dialog_vbox);
   etk_widget_show(dialog->dialog_vbox);

   dialog->main_area_vbox = etk_vbox_new(ETK_FALSE, 0);
   etk_widget_internal_set(dialog->main_area_vbox, ETK_TRUE);
   etk_box_append(ETK_BOX(dialog->dialog_vbox), dialog->main_area_vbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
   etk_widget_show(dialog->main_area_vbox);

   dialog->separator = etk_hseparator_new();
   etk_widget_internal_set(dialog->separator, ETK_TRUE);
   etk_widget_theme_parent_set(dialog->separator, ETK_WIDGET(dialog));
   etk_box_append(ETK_BOX(dialog->dialog_vbox), dialog->separator, ETK_BOX_START, ETK_BOX_FILL, 6);
   etk_widget_show(dialog->separator);

   dialog->action_area_alignment = etk_alignment_new(0.5, 0.5, 0.0, 0.0);
   etk_widget_internal_set(dialog->action_area_alignment, ETK_TRUE);
   etk_box_append(ETK_BOX(dialog->dialog_vbox), dialog->action_area_alignment, ETK_BOX_END, ETK_BOX_FILL, 0);
   etk_widget_show(dialog->action_area_alignment);

   dialog->action_area_hbox = etk_hbox_new(ETK_TRUE, 4);
   etk_widget_internal_set(dialog->action_area_hbox, ETK_TRUE);
   etk_container_add(ETK_CONTAINER(dialog->action_area_alignment), dialog->action_area_hbox);
   etk_widget_show(dialog->action_area_hbox);

   etk_widget_lower(dialog->separator);
   dialog->has_separator = ETK_TRUE;
}
예제 #2
0
static E_Widget *
_e_widget_hseparator_handle(Enhance *en, EXML_Node *node)
{
    E_Widget   *sep;
    char       *id;

    id = ecore_hash_get(node->attributes, "id");
    if(!id) return NULL;

    sep = _e_widget_new(en, node, etk_hseparator_new(), id);

    return sep;
}
예제 #3
0
ELAPI void *
el_about(void) 
{
   Etk_Widget *win, *vbox, *hbox;
   Etk_Widget *button, *label;
   Etk_Widget *about;
   Etk_Textblock *msg;
   Etk_Textblock_Iter *iter;
   char buf[4096];
   
   win = etk_dialog_new();
   etk_window_title_set(ETK_WINDOW(win), "About "PACKAGE_NAME);
   etk_window_wmclass_set(ETK_WINDOW(win), PACKAGE"_About", PACKAGE_NAME"_About");
   etk_container_border_width_set(ETK_CONTAINER(win), 3);
   etk_signal_connect("delete_event", ETK_OBJECT(win), ETK_CALLBACK(_close_cb), NULL);

   vbox = etk_vbox_new(ETK_FALSE, 0);
   etk_container_add(ETK_CONTAINER(win), vbox);
   
   label = etk_label_new("<h1>"PACKAGE_NAME"</h1>");
   etk_label_alignment_set(ETK_LABEL(label), 0.5, 0.5);
   etk_box_append(ETK_BOX(vbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   snprintf(buf, sizeof(buf), 
	    "<b>%s is an Etk-based IRC client in development</b>\n\n"
	    "Christopher 'devilhorns' Michael\n\n%s\n", 
	    PACKAGE_NAME, PACKAGE_BUGREPORT);
   about = etk_text_view_new();
   etk_widget_size_request_set(about, 250, 150);
   etk_box_append(ETK_BOX(vbox), about, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   msg = etk_text_view_textblock_get(ETK_TEXT_VIEW(about));
   etk_textblock_object_cursor_visible_set(ETK_TEXT_VIEW(about)->textblock_object, ETK_FALSE);
   
   iter = etk_textblock_iter_new(msg);
   etk_textblock_iter_forward_end(iter);
   etk_textblock_insert_markup(msg, iter, buf, -1);

   etk_box_append(ETK_BOX(vbox), etk_hseparator_new(), ETK_BOX_END, ETK_BOX_FILL, 5);
   
   hbox = etk_hbox_new(ETK_FALSE, 3);
   etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_END, ETK_BOX_NONE, 0);

   button = etk_button_new_from_stock(ETK_STOCK_DIALOG_CLOSE);
   etk_signal_connect_swapped("clicked", ETK_OBJECT(button), ETK_CALLBACK(_close_cb), win);
   etk_box_append(ETK_BOX(hbox), button, ETK_BOX_END, ETK_BOX_NONE, 0);
   
   return win;
}
예제 #4
0
/* Called when a widget is added to the toolbar's box */
static Etk_Bool _etk_toolbar_child_added_cb(Etk_Object *object, Etk_Widget *child, void *data)
{
   Etk_Toolbar *toolbar;

   if (!(toolbar = ETK_TOOLBAR(data)) || !child)
      return ETK_TRUE;

   /* Sets the style and the stock size if the new child is a tool-item */
   if (ETK_IS_TOOL_ITEM(child))
   {
      Etk_Button_Style button_style;

      switch (toolbar->style)
      {
         case ETK_TOOLBAR_ICON:
            button_style = ETK_BUTTON_ICON;
            break;
         case ETK_TOOLBAR_TEXT:
            button_style = ETK_BUTTON_TEXT;
            break;
         case ETK_TOOLBAR_BOTH_VERT:
            button_style = ETK_BUTTON_BOTH_VERT;
            break;
         case ETK_TOOLBAR_BOTH_HORIZ:
            button_style = ETK_BUTTON_BOTH_HORIZ;
            break;
         default:
            button_style = ETK_BUTTON_BOTH_VERT;
            break;
      }
      etk_button_style_set(ETK_BUTTON(child), button_style);
      etk_button_stock_size_set(ETK_BUTTON(child), toolbar->stock_size);
   }
   /* Reorientate the separators */
   else if (toolbar->reorientating
      && (((toolbar->orientation == ETK_TOOLBAR_HORIZ) && ETK_IS_VSEPARATOR(child))
         || ((toolbar->orientation == ETK_TOOLBAR_VERT) && ETK_IS_HSEPARATOR(child))))
   {
      Etk_Bool visible;
      Etk_Box_Fill_Policy policy;
      Etk_Box_Group group;
      int pos, padding;

      visible = etk_widget_is_visible(child);
      etk_box_child_position_get(ETK_BOX(toolbar->box), child, &group, &pos);
      etk_box_child_packing_get(ETK_BOX(toolbar->box), child, &policy, &padding);

      etk_object_destroy(ETK_OBJECT(child));
      if (toolbar->orientation == ETK_TOOLBAR_HORIZ)
         child = etk_vseparator_new();
      else
         child = etk_hseparator_new();

      etk_box_insert_at(ETK_BOX(toolbar->box), child, group, pos, policy, padding);
      if (visible)
         etk_widget_show(child);
   }

   if (etk_theme_group_exists(etk_widget_theme_file_get(ETK_WIDGET(toolbar)),
      etk_widget_theme_group_get(child), etk_widget_theme_group_get(ETK_WIDGET(toolbar))))
   {
      etk_widget_theme_parent_set(child, ETK_WIDGET(toolbar));
   }
   //etk_signal_emit(ETK_CONTAINER_CHILD_ADDED_SIGNAL, ETK_OBJECT(toolbar), child);

   return ETK_TRUE;
}