images {
- image: "e17_button2.png" COMP;
- image: "e17_button.png" COMP;
+ image: "e17_button_sm.png" COMP;
+ image: "e17_button_sm2.png" COMP;
+ image: "e17_button_sm_disabled.png" COMP;
image: "e17_titlebar_glint1.png" COMP;
image: "e17_titlebar_glint2.png" COMP;
image: "e17_titlebar_glint3.png" COMP;
state: "default" 0.0;
min: 56 16;
image {
- normal: "e17_button.png";
+ normal: "e17_button_sm.png";
border: 8 8 8 8;
}
}
state: "clicked" 0.0;
inherit: "default" 0.0;
image {
- normal: "e17_button2.png";
+ normal: "e17_button_sm2.png";
}
}
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "button_image2";
+ type: IMAGE;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ to: "button_image";
+ }
+ rel2 {
+ to: "button_image";
+ }
+ image {
+ normal: "e17_button_sm_disabled.png";
+ }
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
}
part {
name: "icon_swallow";
align: 0.5 0.5;
}
}
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 128;
+ color3: 255 255 255 64;
+ }
}
part {
name: "glint_clip";
transition: ACCELERATE 0.5;
target: "focus";
}
+ program {
+ name: "disable";
+ signal: "disabled";
+ source: "";
+ action: STATE_SET "disabled" 0.0;
+ target: "button_image";
+ target: "button_image2";
+ target: "label";
+ }
+ program {
+ name: "enable";
+ signal: "enabled";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "button_image";
+ target: "button_image2";
+ target: "label";
+ }
}
}
images {
+ image: "e17_menu_check0.png" COMP;
image: "e17_menu_check1.png" COMP;
image: "e17_menu_check2.png" COMP;
image: "focus.png" COMP;
normal: "e17_menu_check1.png";
}
}
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "e17_menu_check0.png";
+ }
+ }
}
part {
name: "item1";
align: 0.0 0.5;
}
}
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 128;
+ color3: 255 255 255 64;
+ }
}
part {
name: "event";
state: "default" 0.0;
color: 0 0 0 0;
}
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
}
part {
name: "focus";
transition: ACCELERATE 0.5;
target: "focus";
}
+ program {
+ name: "disable";
+ signal: "disabled";
+ source: "";
+ action: STATE_SET "disabled" 0.0;
+ target: "outline";
+ target: "event";
+ target: "label";
+ }
+ program {
+ name: "enable";
+ signal: "enabled";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "outline";
+ target: "event";
+ target: "label";
+ }
}
}
images {
image: "e17_menu_bg_border.png" COMP;
- image: "e17_button2.png" COMP;
- image: "e17_button.png" COMP;
image: "e17_dialog_watermark.png" COMP;
image: "e17_ibar_bg_v.png" COMP;
image: "e17_about_over_v.png" COMP;
images {
image: "e17_logo.png" COMP;
- image: "e17_button2.png" COMP;
- image: "e17_button.png" COMP;
+ image: "e17_button_sm.png" COMP;
+ image: "e17_button_sm2.png" COMP;
}
styles
offset: -1 -17;
}
image {
- normal: "e17_button.png";
+ normal: "e17_button_sm.png";
border: 8 8 8 8;
}
}
offset: -1 -17;
}
image {
- normal: "e17_button2.png";
+ normal: "e17_button_sm2.png";
border: 8 8 8 8;
}
}
image: "e17_button_detail_view.png" COMP;
image: "e17_fileman_rubberband.png" COMP;
image: "e17_menu_bg_border.png" COMP;
- image: "e17_button2.png" COMP;
- image: "e17_button.png" COMP;
image: "e17_logo.png" COMP;
}
images {
+ image: "e17_menu_radio0.png" COMP;
image: "e17_menu_radio1.png" COMP;
image: "e17_menu_radio2.png" COMP;
image: "focus.png" COMP;
normal: "e17_menu_radio1.png";
}
}
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "e17_menu_check0.png";
+ }
+ }
}
part {
name: "item1";
align: 0.0 0.5;
}
}
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 128;
+ color3: 255 255 255 64;
+ }
}
part {
name: "event";
state: "default" 0.0;
color: 0 0 0 0;
}
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
}
part {
name: "focus";
transition: ACCELERATE 0.5;
target: "focus";
}
+ program {
+ name: "disable";
+ signal: "disabled";
+ source: "";
+ action: STATE_SET "disabled" 0.0;
+ target: "outline";
+ target: "event";
+ target: "label";
+ }
+ program {
+ name: "enable";
+ signal: "enabled";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "outline";
+ target: "event";
+ target: "label";
+ }
}
}
e17_frame_label_over.png \
e17_frame_label_under.png \
e17_frame_outline.png \
-e17_icon_right_arrow.png
-
+e17_icon_right_arrow.png \
+e17_button_sm.png \
+e17_button_sm2.png \
+e17_button_sm_disabled.png \
+e17_menu_check0.png \
+e17_menu_radio0.png
static void _e_config_dialog_cb_apply(void *data, E_Dialog *dia);
static void _e_config_dialog_cb_advanced(void *data, void *data2);
static void _e_config_dialog_cb_basic(void *data, void *data2);
+static void _e_config_dialog_cb_changed(void *data, Evas_Object *obj);
/* local subsystem globals */
}
e_widget_min_size_get(o, &mw, &mh);
+ e_widget_on_change_hook_set(o, _e_config_dialog_cb_changed, cfd);
e_dialog_content_set(cfd->dia, o, mw, mh);
e_dialog_button_add(cfd->dia, _("OK"), NULL, _e_config_dialog_cb_ok, cfd);
e_dialog_button_add(cfd->dia, _("Apply"), NULL, _e_config_dialog_cb_apply, cfd);
e_dialog_button_add(cfd->dia, _("Cancel"), NULL, NULL, NULL);
+ e_dialog_button_disable_num_set(cfd->dia, 0, 1);
+ e_dialog_button_disable_num_set(cfd->dia, 1, 1);
e_win_centered_set(cfd->dia->win, 1);
e_dialog_show(cfd->dia);
cfd->view_type = type;
cfd->view.basic.apply_cfdata(cfd, cfd->cfdata);
else
cfd->view.advanced.apply_cfdata(cfd, cfd->cfdata);
+ e_dialog_button_disable_num_set(cfd->dia, 0, 1);
+ e_dialog_button_disable_num_set(cfd->dia, 1, 1);
}
static void
cfd = data;
_e_config_dialog_go(cfd, E_CONFIG_DIALOG_CFDATA_TYPE_BASIC);
}
+
+static void
+_e_config_dialog_cb_changed(void *data, Evas_Object *obj)
+{
+ E_Config_Dialog *cfd;
+
+ cfd = data;
+ e_dialog_button_disable_num_set(cfd->dia, 0, 0);
+ e_dialog_button_disable_num_set(cfd->dia, 1, 0);
+}
return 1;
}
+int
+e_dialog_button_disable_num_set(E_Dialog *dia, int button, int disabled)
+{
+ Evas_Object *o;
+
+ o = evas_list_nth(dia->buttons, button);
+ if (o) e_widget_disabled_set(o, disabled);
+ return 1;
+}
+
void
e_dialog_title_set(E_Dialog *dia, char *title)
{
void *data;
};
-EAPI E_Dialog *e_dialog_new (E_Container *con);
-EAPI void e_dialog_button_add (E_Dialog *dia, char *label, char *icon, void (*func) (void *data, E_Dialog *dia), void *data);
-EAPI int e_dialog_button_focus_num (E_Dialog *dia, int button);
-EAPI void e_dialog_title_set (E_Dialog *dia, char *title);
-EAPI void e_dialog_text_set (E_Dialog *dia, char *text);
-EAPI void e_dialog_icon_set (E_Dialog *dia, char *icon, Evas_Coord size);
-EAPI void e_dialog_content_set (E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
-EAPI void e_dialog_show (E_Dialog *dia);
+EAPI E_Dialog *e_dialog_new (E_Container *con);
+EAPI void e_dialog_button_add (E_Dialog *dia, char *label, char *icon, void (*func) (void *data, E_Dialog *dia), void *data);
+EAPI int e_dialog_button_focus_num (E_Dialog *dia, int button);
+EAPI int e_dialog_button_disable_num_set (E_Dialog *dia, int button, int disabled);
+EAPI void e_dialog_title_set (E_Dialog *dia, char *title);
+EAPI void e_dialog_text_set (E_Dialog *dia, char *text);
+EAPI void e_dialog_icon_set (E_Dialog *dia, char *icon, Evas_Coord size);
+EAPI void e_dialog_content_set (E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
+EAPI void e_dialog_show (E_Dialog *dia);
#endif
#endif
}
/**--CREATE--**/
+static void
+_fill_data(CFData *cfdata)
+{
+ cfdata->focus_policy = e_config->focus_policy;
+ cfdata->focus_setting = e_config->focus_setting;
+ cfdata->pass_click_on = e_config->pass_click_on;
+ cfdata->always_click_to_raise = e_config->always_click_to_raise;
+ cfdata->always_click_to_focus = e_config->always_click_to_focus;
+
+ cfdata->mode = cfdata->focus_policy;
+}
+
static void *
_create_data(E_Config_Dialog *cfd)
{
CFData *cfdata;
cfdata = E_NEW(CFData, 1);
- cfdata->focus_policy = e_config->focus_policy;
- cfdata->focus_setting = e_config->focus_setting;
- cfdata->pass_click_on = e_config->pass_click_on;
- cfdata->always_click_to_raise = e_config->always_click_to_raise;
- cfdata->always_click_to_focus = e_config->always_click_to_focus;
-
- cfdata->mode = cfdata->focus_policy;
-
+ _fill_data(cfdata);
return cfdata;
}
Evas_Object *o, *ob;
E_Radio_Group *rg;
+ _fill_data(cfdata);
+
o = e_widget_list_add(evas, 0, 0);
rg = e_widget_radio_group_new(&(cfdata->mode));
ob = e_widget_radio_add(evas, _("Click Window to Focus"), E_FOCUS_CLICK, rg);
Evas_Object *o, *ob, *of;
E_Radio_Group *rg;
+ _fill_data(cfdata);
+
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, _("Focus"), 0);
e_widget_focus_jump(Evas_Object *obj, int forward)
{
API_ENTRY return 0;
- if ((!e_widget_can_focus_get(obj)) ||
- (e_widget_disabled_get(obj)))
- return 0;
+ if (!e_widget_can_focus_get(obj)) return 0;
/* if it has a focus func its an end-point widget like a button */
if (sd->focus_func)
{
for (l = sd->subobjs; l; l = l->next)
{
- if ((e_widget_can_focus_get(l->data)) &&
- (!e_widget_disabled_get(l->data)))
+ if (e_widget_can_focus_get(l->data))
{
- if (focus_next)
+ if ((focus_next) &&
+ (!e_widget_disabled_get(l->data)))
{
/* the previous focused item was unfocused - so focus
* the next one (that can be focused) */
{
for (l = evas_list_last(sd->subobjs); l; l = l->prev)
{
- if ((e_widget_can_focus_get(l->data)) &&
- (!e_widget_disabled_get(l->data)))
+ if (e_widget_can_focus_get(l->data))
{
- if (focus_next)
+ if ((focus_next) &&
+ (!e_widget_disabled_get(l->data)))
{
/* the previous focused item was unfocused - so focus
* the next one (that can be focused) */
{
API_ENTRY return;
if (sd->on_change_func) sd->on_change_func(sd->on_change_data, obj);
+ else e_widget_change(e_widget_parent_get(obj));
}
void
e_widget_disabled_set(Evas_Object *obj, int disabled)
{
API_ENTRY return;
+ if (((sd->disabled) && (disabled)) ||
+ ((!sd->disabled) && (!disabled))) return;
sd->disabled = disabled;
+ if (sd->focused)
+ {
+ Evas_Object *o, *parent;
+
+ printf("disable focused %p!\n", obj);
+ parent = obj;
+ for (;;)
+ {
+ o = e_widget_parent_get(parent);
+ if (!o) break;
+ parent = o;
+ }
+ printf("jump %p\n", parent);
+ e_widget_focus_jump(parent, 1);
+ }
if (sd->disable_func) sd->disable_func(obj);
}
static void _e_wid_del_hook(Evas_Object *obj);
static void _e_wid_focus_hook(Evas_Object *obj);
static void _e_wid_activate_hook(Evas_Object *obj);
+static void _e_wid_disable_hook(Evas_Object *obj);
static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
/* local subsystem functions */
e_widget_del_hook_set(obj, _e_wid_del_hook);
e_widget_focus_hook_set(obj, _e_wid_focus_hook);
e_widget_activate_hook_set(obj, _e_wid_activate_hook);
+ e_widget_disable_hook_set(obj, _e_wid_disable_hook);
wd = calloc(1, sizeof(E_Widget_Data));
wd->func = func;
wd->data = data;
}
static void
+_e_wid_disable_hook(Evas_Object *obj)
+{
+ E_Widget_Data *wd;
+
+ wd = e_widget_data_get(obj);
+ if (e_widget_disabled_get(obj))
+ edje_object_signal_emit(wd->o_button, "disabled", "");
+ else
+ edje_object_signal_emit(wd->o_button, "enabled", "");
+}
+
+static void
_e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source)
{
e_widget_focus_steal(data);
static void _e_wid_focus_hook(Evas_Object *obj);
static void _e_wid_do(Evas_Object *obj);
static void _e_wid_activate_hook(Evas_Object *obj);
+static void _e_wid_disable_hook(Evas_Object *obj);
static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
e_widget_del_hook_set(obj, _e_wid_del_hook);
e_widget_focus_hook_set(obj, _e_wid_focus_hook);
e_widget_activate_hook_set(obj, _e_wid_activate_hook);
+ e_widget_disable_hook_set(obj, _e_wid_disable_hook);
wd = calloc(1, sizeof(E_Widget_Data));
wd->valptr = val;
e_widget_data_set(obj, wd);
}
static void
+_e_wid_disable_hook(Evas_Object *obj)
+{
+ E_Widget_Data *wd;
+
+ wd = e_widget_data_get(obj);
+ if (e_widget_disabled_get(obj))
+ edje_object_signal_emit(wd->o_check, "disabled", "");
+ else
+ edje_object_signal_emit(wd->o_check, "enabled", "");
+}
+
+static void
_e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source)
{
_e_wid_do(data);
static void _e_wid_focus_hook(Evas_Object *obj);
static void _e_wid_do(Evas_Object *obj);
static void _e_wid_activate_hook(Evas_Object *obj);
+static void _e_wid_disable_hook(Evas_Object *obj);
static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
/* local subsystem functions */
e_widget_del_hook_set(obj, _e_wid_del_hook);
e_widget_focus_hook_set(obj, _e_wid_focus_hook);
e_widget_activate_hook_set(obj, _e_wid_activate_hook);
+ e_widget_disable_hook_set(obj, _e_wid_disable_hook);
wd = calloc(1, sizeof(E_Widget_Data));
wd->group = group;
wd->valnum = valnum;
}
static void
+_e_wid_disable_hook(Evas_Object *obj)
+{
+ E_Widget_Data *wd;
+
+ wd = e_widget_data_get(obj);
+ if (e_widget_disabled_get(obj))
+ edje_object_signal_emit(wd->o_radio, "disabled", "");
+ else
+ edje_object_signal_emit(wd->o_radio, "enabled", "");
+}
+
+static void
_e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source)
{
_e_wid_do(data);