Enlightenment CVS committal

Author  : davemds
Project : e17
Module  : proto/edje_editor

Dir     : e17/proto/edje_editor/src/bin


Modified Files:
        callbacks.c callbacks.h interface.c 


Log Message:
* Add a sort of "history" to the signal emit combobox

===================================================================
RCS file: /cvs/e/e17/proto/edje_editor/src/bin/callbacks.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -3 -r1.76 -r1.77
--- callbacks.c 1 Jul 2008 16:05:00 -0000       1.76
+++ callbacks.c 1 Jul 2008 21:13:54 -0000       1.77
@@ -63,6 +63,43 @@
    return ETK_TRUE;
 }
 
+
+void
+emit_entry_item_append_ifnot(Etk_Widget *combo_entry, const char *text)
+{
+   Etk_Combobox_Entry_Item *item;
+   char *str;
+   
+   if (!text || strlen(text) < 1) return;
+   
+   item = etk_combobox_entry_first_item_get(combo_entry);
+   while (item)
+   {
+      str = etk_combobox_entry_item_field_get(item, 0);
+      if (!strcmp(str, text))
+         return;
+      item = etk_combobox_entry_item_next_get(item);
+   } 
+   
+   etk_combobox_entry_item_append(combo_entry, text);
+}
+
+Etk_Bool
+on_SignalEmitEntry_activated(Etk_Combobox_Entry *combo, void *data)
+{
+   Etk_Combobox_Entry_Item *item;
+   Etk_Widget *entry;
+   char *str;
+   
+   entry = etk_combobox_entry_entry_get(combo);
+   item = etk_combobox_entry_active_item_get(combo);
+ 
+   str = etk_combobox_entry_item_field_get(item, 0);
+   etk_entry_text_set(entry, str);
+   
+   return ETK_TRUE;
+}
+
 /* All the buttons Callback */
 Etk_Bool
 on_AllButton_click(Etk_Button *button, void *data)
@@ -268,6 +305,8 @@
       sig = 
etk_entry_text_get(etk_combobox_entry_entry_get(UI_SignalEmitEntry));
       sou = 
etk_entry_text_get(etk_combobox_entry_entry_get(UI_SourceEmitEntry));
       edje_object_signal_emit(edje_o, sig, sou);
+      emit_entry_item_append_ifnot(UI_SignalEmitEntry, sig);
+      emit_entry_item_append_ifnot(UI_SourceEmitEntry, sou);
       break;
    case RUN_PROG:
       if (etk_string_length_get(Cur.prog))
===================================================================
RCS file: /cvs/e/e17/proto/edje_editor/src/bin/callbacks.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- callbacks.h 30 Jun 2008 23:54:20 -0000      1.28
+++ callbacks.h 1 Jul 2008 21:13:54 -0000       1.29
@@ -10,6 +10,7 @@
 Etk_Bool on_canvas_geometry_changed        (Etk_Object *canvas, const char 
*property_name, void *data);
 Etk_Bool on_PartsTree_row_selected         (Etk_Object *object, Etk_Tree_Row 
*row, void *data);
 Etk_Bool on_PartsTree_click                (Etk_Tree *tree, Etk_Tree_Row *row, 
Etk_Event_Mouse_Up *event, void *data);
+Etk_Bool on_SignalEmitEntry_activated      (Etk_Combobox_Entry *combo, void 
*data);
 void     on_ColorCanvas_click              (void *data, Evas *e, Evas_Object 
*obj, void *event_info);
 Etk_Bool on_ColorDialog_change             (Etk_Object *object, void *data);
 Etk_Bool on_ImageBrowserIconbox_selected(Etk_Iconbox *iconbox, 
Etk_Iconbox_Icon *icon, void *data);
===================================================================
RCS file: /cvs/e/e17/proto/edje_editor/src/bin/interface.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- interface.c 1 Jul 2008 01:56:28 -0000       1.77
+++ interface.c 1 Jul 2008 21:13:54 -0000       1.78
@@ -1848,9 +1848,9 @@
 {
    //UI_GroupsComboBox
    UI_GroupsComboBox = etk_combobox_new();
+   etk_combobox_items_height_set(ETK_COMBOBOX(UI_GroupsComboBox), 18);
    etk_combobox_column_add(ETK_COMBOBOX(UI_GroupsComboBox), 
ETK_COMBOBOX_LABEL, 30, ETK_COMBOBOX_NONE, 0.0);
    etk_combobox_build(ETK_COMBOBOX(UI_GroupsComboBox));
-   //etk_combobox_items_height_set(ETK_COMBOBOX(UI_GroupsComboBox), 18);
    
    etk_signal_connect("item-activated", ETK_OBJECT(UI_GroupsComboBox),
                       ETK_CALLBACK(on_GroupsComboBox_activated), NULL);
@@ -3027,6 +3027,7 @@
    label = etk_label_new("<b>Signal</b>");
    etk_box_append(ETK_BOX(hbox), label, 0, ETK_BOX_NONE, 0);
    UI_SignalEmitEntry = etk_combobox_entry_new();
+   etk_combobox_entry_items_height_set(ETK_COMBOBOX_ENTRY(UI_SignalEmitEntry), 
18);
    etk_combobox_entry_column_add(ETK_COMBOBOX_ENTRY(UI_SignalEmitEntry),
                   ETK_COMBOBOX_ENTRY_LABEL, 75, ETK_COMBOBOX_ENTRY_EXPAND, 
0.0);
    etk_combobox_entry_build(ETK_COMBOBOX_ENTRY(UI_SignalEmitEntry));
@@ -3036,6 +3037,7 @@
    label = etk_label_new("<b>Source</b>");
    etk_box_append(ETK_BOX(hbox), label, 0, ETK_BOX_NONE, 0);
    UI_SourceEmitEntry = etk_combobox_entry_new();
+   etk_combobox_entry_items_height_set(ETK_COMBOBOX_ENTRY(UI_SourceEmitEntry), 
18);
    etk_combobox_entry_column_add(ETK_COMBOBOX_ENTRY(UI_SourceEmitEntry),
                   ETK_COMBOBOX_ENTRY_LABEL, 75, ETK_COMBOBOX_ENTRY_EXPAND, 
0.0);
    etk_combobox_entry_build(ETK_COMBOBOX_ENTRY(UI_SourceEmitEntry));
@@ -3045,6 +3047,11 @@
    button = etk_button_new_from_stock(ETK_STOCK_DIALOG_OK);
    etk_object_properties_set(ETK_OBJECT(button), "label", "Emit", NULL);
    etk_box_append(ETK_BOX(hbox), button, 0, ETK_BOX_NONE, 0);
+   
+   etk_signal_connect("active-item-changed", ETK_OBJECT(UI_SignalEmitEntry),
+                      ETK_CALLBACK(on_SignalEmitEntry_activated), NULL);
+   etk_signal_connect("active-item-changed", ETK_OBJECT(UI_SourceEmitEntry),
+                      ETK_CALLBACK(on_SignalEmitEntry_activated), NULL);
    
    etk_signal_connect("clicked", ETK_OBJECT(button),
                       ETK_CALLBACK(on_AllButton_click), (void*)EMIT_SIGNAL);



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to