table widget wrapper - NOTE - NON-homogenous tables do NOT work. :) need to


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 18 years ago
parent cf3104fd8d
commit b2205f66f6
  1. 4
      src/bin/Makefile.am
  2. 1
      src/bin/e_includes.h
  3. 19
      src/bin/e_test.c
  4. 2
      src/bin/e_widget_framelist.c
  5. 85
      src/bin/e_widget_frametable.c
  6. 14
      src/bin/e_widget_frametable.h

@ -89,7 +89,8 @@ e_widget_radio.h \
e_widget_framelist.h \
e_widget_list.h \
e_widget_button.h \
e_widget_label.h
e_widget_label.h \
e_widget_frametable.h
enlightenment_src = \
e_user.c \
@ -161,6 +162,7 @@ e_widget_framelist.c \
e_widget_list.c \
e_widget_button.c \
e_widget_label.c \
e_widget_frametable.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_SOURCES = \

@ -71,3 +71,4 @@
#include "e_widget_list.h"
#include "e_widget_button.h"
#include "e_widget_label.h"
#include "e_widget_frametable.h"

@ -307,7 +307,7 @@ _e_test_internal(E_Container *con)
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
}
#elif 0
#elif 1
static int my_val = 0;
static int my_val2 = 0;
static int my_val3 = 0;
@ -365,6 +365,23 @@ _e_test_internal(E_Container *con)
e_widget_list_object_append(hb, o, 0, 0, 0.0);
o = e_widget_frametable_add(e, "My Frame Table", 1);
e_widget_frametable_object_append(o, e_widget_label_add(e, "Label 1"),
0, 0, 1, 1,
1, 1, 1, 1);
e_widget_frametable_object_append(o, e_widget_label_add(e, "Label 2"),
1, 0, 1, 1,
1, 1, 1, 1);
e_widget_frametable_object_append(o, e_widget_label_add(e, "Label 3"),
2, 0, 1, 1,
1, 1, 1, 1);
e_widget_frametable_object_append(o, e_widget_label_add(e, "Label 4"),
0, 1, 1, 1,
1, 1, 1, 1);
e_widget_list_object_append(hb, o, 0, 0, 0.5);
e_widget_list_object_append(ol, hb, 1, 1, 0.5);
o = e_widget_button_add(e, "Button", "enlightenment/exit", NULL, NULL, NULL);

@ -40,7 +40,7 @@ e_widget_framelist_add(Evas *evas, char *label, int horiz)
wd->o_box = o;
e_box_orientation_set(o, horiz);
e_box_homogenous_set(o, 0);
edje_object_part_swallow(o, "items", wd->o_box);
edje_object_part_swallow(wd->o_frame, "items", o);
e_widget_sub_object_add(obj, o);
evas_object_show(o);

@ -0,0 +1,85 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
typedef struct _E_Widget_Data E_Widget_Data;
struct _E_Widget_Data
{
Evas_Object *o_frame, *o_table;
};
static void _e_wid_del_hook(Evas_Object *obj);
/* local subsystem functions */
/* externally accessible functions */
Evas_Object *
e_widget_frametable_add(Evas *evas, char *label, int homogenous)
{
Evas_Object *obj, *o;
E_Widget_Data *wd;
Evas_Coord mw, mh;
obj = e_widget_add(evas);
e_widget_del_hook_set(obj, _e_wid_del_hook);
wd = calloc(1, sizeof(E_Widget_Data));
e_widget_data_set(obj, wd);
o = edje_object_add(evas);
wd->o_frame = o;
e_theme_edje_object_set(o, "base/theme/widgets",
"widgets/frame");
edje_object_part_text_set(o, "label", label);
evas_object_show(o);
e_widget_sub_object_add(obj, o);
e_widget_resize_object_set(obj, o);
o = e_table_add(evas);
wd->o_table = o;
e_table_homogenous_set(o, homogenous);
edje_object_part_swallow(wd->o_frame, "items", o);
e_widget_sub_object_add(obj, o);
evas_object_show(o);
edje_object_size_min_calc(wd->o_frame, &mw, &mh);
e_widget_min_size_set(obj, mw, mh);
return obj;
}
void
e_widget_frametable_object_append(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h)
{
E_Widget_Data *wd;
Evas_Coord mw, mh;
wd = e_widget_data_get(obj);
e_table_pack(wd->o_table, sobj, col, row, colspan, rowspan);
e_widget_min_size_get(sobj, &mw, &mh);
e_table_pack_options_set(sobj,
fill_w, fill_h, /* fill */
expand_w, expand_h, /* expand */
0.5, 0.5, /* align */
mw, mh, /* min */
99999, 99999 /* max */
);
e_table_min_size_get(wd->o_table, &mw, &mh);
edje_extern_object_min_size_set(wd->o_table, mw, mh);
edje_object_part_swallow(wd->o_frame, "items", wd->o_table);
edje_object_size_min_calc(wd->o_frame, &mw, &mh);
e_widget_min_size_set(obj, mw, mh);
e_widget_sub_object_add(obj, sobj);
evas_object_show(sobj);
}
static void
_e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
free(wd);
}

@ -0,0 +1,14 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_WIDGET_FRAMETABLE_H
#define E_WIDGET_FRAMETABLE_H
EAPI Evas_Object *e_widget_frametable_add(Evas *evas, char *label, int homogenous);
EAPI void e_widget_frametable_object_append(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h);
#endif
#endif
Loading…
Cancel
Save