2005-10-12 17:41:09 -07:00
|
|
|
#include "e.h"
|
|
|
|
|
|
|
|
typedef struct _E_Widget_Data E_Widget_Data;
|
|
|
|
struct _E_Widget_Data
|
|
|
|
{
|
2015-01-15 00:04:42 -08:00
|
|
|
Evas_Object *obj;
|
2005-10-12 17:41:09 -07:00
|
|
|
Evas_Object *o_frame, *o_table;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void _e_wid_del_hook(Evas_Object *obj);
|
2006-08-12 05:49:52 -07:00
|
|
|
static void _e_wid_disable_hook(Evas_Object *obj);
|
2005-10-12 17:41:09 -07:00
|
|
|
|
|
|
|
/* local subsystem functions */
|
|
|
|
|
|
|
|
/* externally accessible functions */
|
2006-01-07 02:39:46 -08:00
|
|
|
EAPI Evas_Object *
|
2008-02-06 12:33:29 -08:00
|
|
|
e_widget_frametable_add(Evas *evas, const char *label, int homogenous)
|
2005-10-12 17:41:09 -07:00
|
|
|
{
|
|
|
|
Evas_Object *obj, *o;
|
|
|
|
E_Widget_Data *wd;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2005-10-12 17:41:09 -07:00
|
|
|
obj = e_widget_add(evas);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2005-10-12 17:41:09 -07:00
|
|
|
e_widget_del_hook_set(obj, _e_wid_del_hook);
|
2006-08-12 05:49:52 -07:00
|
|
|
e_widget_disable_hook_set(obj, _e_wid_disable_hook);
|
2005-10-12 17:41:09 -07:00
|
|
|
wd = calloc(1, sizeof(E_Widget_Data));
|
|
|
|
e_widget_data_set(obj, wd);
|
2015-01-15 00:04:42 -08:00
|
|
|
wd->obj = obj;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2015-01-15 00:04:42 -08:00
|
|
|
o = elm_frame_add(e_win_evas_win_get(evas));
|
2005-10-12 17:41:09 -07:00
|
|
|
wd->o_frame = o;
|
2015-01-15 00:04:42 -08:00
|
|
|
elm_object_text_set(o, label);
|
2005-10-12 17:41:09 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
e_widget_sub_object_add(obj, o);
|
|
|
|
e_widget_resize_object_set(obj, o);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2015-01-15 00:04:42 -08:00
|
|
|
o = elm_table_add(e_win_evas_win_get(evas));
|
2005-10-12 17:41:09 -07:00
|
|
|
wd->o_table = o;
|
2015-01-15 00:04:42 -08:00
|
|
|
elm_table_homogeneous_set(o, homogenous);
|
|
|
|
elm_object_content_set(wd->o_frame, o);
|
2005-10-12 17:41:09 -07:00
|
|
|
e_widget_sub_object_add(obj, o);
|
|
|
|
evas_object_show(o);
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2005-10-12 17:41:09 -07:00
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2006-01-07 02:39:46 -08:00
|
|
|
EAPI void
|
2005-10-12 17:41:09 -07:00
|
|
|
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)
|
|
|
|
{
|
2015-01-15 00:04:42 -08:00
|
|
|
e_widget_frametable_object_append_full(obj, sobj, col, row, colspan, rowspan, fill_w, fill_h, expand_w, expand_h, 0.5, 0.5, -1, -1, -1, -1);
|
2010-03-02 10:53:02 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
e_widget_frametable_object_append_full(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, double align_x, double align_y, Evas_Coord min_w, Evas_Coord min_h, Evas_Coord max_w, Evas_Coord max_h)
|
|
|
|
{
|
2012-05-13 10:45:44 -07:00
|
|
|
E_Widget_Data *wd = e_widget_data_get(obj);
|
2015-01-15 00:04:42 -08:00
|
|
|
|
|
|
|
if ((min_w > 0) || (min_h > 0))
|
|
|
|
evas_object_size_hint_min_set(sobj, min_w, min_h);
|
|
|
|
if ((max_w > 0) || (max_h > 0))
|
|
|
|
evas_object_size_hint_max_set(sobj, max_w, max_h);
|
|
|
|
if (fill_w) align_x = -1;
|
|
|
|
if (fill_h) align_y = -1;
|
|
|
|
E_ALIGN(sobj, align_x, align_y);
|
|
|
|
E_WEIGHT(sobj, expand_w, expand_h);
|
|
|
|
elm_table_pack(wd->o_table, sobj, col, row, colspan, rowspan);
|
2005-10-12 17:41:09 -07:00
|
|
|
e_widget_sub_object_add(obj, sobj);
|
|
|
|
evas_object_show(sobj);
|
|
|
|
}
|
|
|
|
|
2012-12-13 12:12:32 -08:00
|
|
|
EAPI void
|
2015-01-15 00:04:42 -08:00
|
|
|
e_widget_frametable_object_repack(Evas_Object *obj EINA_UNUSED, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h)
|
2012-12-13 12:12:32 -08:00
|
|
|
{
|
2015-01-15 00:04:42 -08:00
|
|
|
if (fill_w || fill_h)
|
|
|
|
E_ALIGN(sobj, fill_w ? -1 : 0.5, fill_h ? -1 : 0.5);
|
|
|
|
E_WEIGHT(sobj, expand_w, expand_h);
|
|
|
|
elm_table_pack_set(sobj, col, row, colspan, rowspan);
|
2012-12-13 12:12:32 -08:00
|
|
|
}
|
|
|
|
|
2007-02-20 19:55:18 -08:00
|
|
|
EAPI void
|
|
|
|
e_widget_frametable_content_align_set(Evas_Object *obj, double halign, double valign)
|
|
|
|
{
|
|
|
|
E_Widget_Data *wd;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2007-02-20 19:55:18 -08:00
|
|
|
wd = e_widget_data_get(obj);
|
2015-01-15 00:04:42 -08:00
|
|
|
elm_table_align_set(wd->o_table, halign, valign);
|
2007-02-20 19:55:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2008-02-06 12:33:29 -08:00
|
|
|
e_widget_frametable_label_set(Evas_Object *obj, const char *label)
|
2007-02-20 19:55:18 -08:00
|
|
|
{
|
|
|
|
E_Widget_Data *wd;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2007-02-20 19:55:18 -08:00
|
|
|
wd = e_widget_data_get(obj);
|
2015-01-15 13:25:56 -08:00
|
|
|
elm_object_text_set(wd->o_frame, label);
|
2007-02-20 19:55:18 -08:00
|
|
|
}
|
|
|
|
|
2005-10-12 17:41:09 -07:00
|
|
|
static void
|
|
|
|
_e_wid_del_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
E_Widget_Data *wd;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2005-10-12 17:41:09 -07:00
|
|
|
wd = e_widget_data_get(obj);
|
|
|
|
free(wd);
|
|
|
|
}
|
2006-08-12 05:49:52 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_e_wid_disable_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
E_Widget_Data *wd;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2006-08-12 05:49:52 -07:00
|
|
|
wd = e_widget_data_get(obj);
|
2015-01-15 13:25:56 -08:00
|
|
|
elm_object_disabled_set(wd->o_frame, e_widget_disabled_get(obj));
|
2006-08-12 05:49:52 -07:00
|
|
|
}
|
2012-07-03 02:11:44 -07:00
|
|
|
|