From 76a872c8420fbbfdd83c3466d368e1ed456ef463 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sun, 16 Oct 2005 07:32:12 +0000 Subject: [PATCH] config dialogs now can enable/disable widgets and dialog buttons. ok and apply are disabeld until a change is made - then they get enabled until u apply (or ok) then they disable again until u change things again etc. SVN revision: 17598 --- data/themes/default_button.edc | 61 ++++++++++++++++++++++++-- data/themes/default_check.edc | 37 ++++++++++++++++ data/themes/default_configure.edc | 2 - data/themes/default_error.edc | 8 ++-- data/themes/default_fileman.edc | 2 - data/themes/default_radio.edc | 37 ++++++++++++++++ data/themes/images/Makefile.am | 8 +++- data/themes/images/e17_button_sm.png | Bin 0 -> 2637 bytes data/themes/images/e17_button_sm2.png | Bin 0 -> 2466 bytes data/themes/images/e17_button_sm_disabled.png | Bin 0 -> 1045 bytes data/themes/images/e17_menu_check0.png | Bin 0 -> 426 bytes data/themes/images/e17_menu_radio0.png | Bin 0 -> 615 bytes src/bin/e_config_dialog.c | 16 +++++++ src/bin/e_dialog.c | 10 +++++ src/bin/e_dialog.h | 17 +++---- src/bin/e_int_config_focus.c | 25 +++++++---- src/bin/e_widget.c | 34 ++++++++++---- src/bin/e_widget_button.c | 14 ++++++ src/bin/e_widget_check.c | 14 ++++++ src/bin/e_widget_radio.c | 14 ++++++ 20 files changed, 260 insertions(+), 39 deletions(-) create mode 100644 data/themes/images/e17_button_sm.png create mode 100644 data/themes/images/e17_button_sm2.png create mode 100644 data/themes/images/e17_button_sm_disabled.png create mode 100644 data/themes/images/e17_menu_check0.png create mode 100644 data/themes/images/e17_menu_radio0.png diff --git a/data/themes/default_button.edc b/data/themes/default_button.edc index 73bda1e..3ff2aef 100644 --- a/data/themes/default_button.edc +++ b/data/themes/default_button.edc @@ -1,6 +1,7 @@ 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; @@ -18,7 +19,7 @@ group { state: "default" 0.0; min: 56 16; image { - normal: "e17_button.png"; + normal: "e17_button_sm.png"; border: 8 8 8 8; } } @@ -26,9 +27,37 @@ group { 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"; @@ -95,6 +124,12 @@ group { 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"; @@ -372,5 +407,23 @@ group { 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"; + } } } diff --git a/data/themes/default_check.edc b/data/themes/default_check.edc index b522f75..ab825c0 100644 --- a/data/themes/default_check.edc +++ b/data/themes/default_check.edc @@ -1,4 +1,5 @@ images { + image: "e17_menu_check0.png" COMP; image: "e17_menu_check1.png" COMP; image: "e17_menu_check2.png" COMP; image: "focus.png" COMP; @@ -27,6 +28,13 @@ group { normal: "e17_menu_check1.png"; } } + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "e17_menu_check0.png"; + } + } } part { name: "item1"; @@ -81,6 +89,12 @@ group { 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"; @@ -89,6 +103,11 @@ group { state: "default" 0.0; color: 0 0 0 0; } + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } } part { name: "focus"; @@ -164,5 +183,23 @@ group { 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"; + } } } diff --git a/data/themes/default_configure.edc b/data/themes/default_configure.edc index 9a8c3e5..7989f90 100644 --- a/data/themes/default_configure.edc +++ b/data/themes/default_configure.edc @@ -1,7 +1,5 @@ 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; diff --git a/data/themes/default_error.edc b/data/themes/default_error.edc index 553cd2a..1548f00 100644 --- a/data/themes/default_error.edc +++ b/data/themes/default_error.edc @@ -1,7 +1,7 @@ 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 @@ -171,7 +171,7 @@ group { offset: -1 -17; } image { - normal: "e17_button.png"; + normal: "e17_button_sm.png"; border: 8 8 8 8; } } @@ -188,7 +188,7 @@ group { offset: -1 -17; } image { - normal: "e17_button2.png"; + normal: "e17_button_sm2.png"; border: 8 8 8 8; } } diff --git a/data/themes/default_fileman.edc b/data/themes/default_fileman.edc index 1d8d40c..1f6d3dd 100644 --- a/data/themes/default_fileman.edc +++ b/data/themes/default_fileman.edc @@ -116,8 +116,6 @@ images 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; } diff --git a/data/themes/default_radio.edc b/data/themes/default_radio.edc index fda7946..d69badd 100644 --- a/data/themes/default_radio.edc +++ b/data/themes/default_radio.edc @@ -1,4 +1,5 @@ images { + image: "e17_menu_radio0.png" COMP; image: "e17_menu_radio1.png" COMP; image: "e17_menu_radio2.png" COMP; image: "focus.png" COMP; @@ -27,6 +28,13 @@ group { normal: "e17_menu_radio1.png"; } } + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "e17_menu_check0.png"; + } + } } part { name: "item1"; @@ -81,6 +89,12 @@ group { 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"; @@ -89,6 +103,11 @@ group { state: "default" 0.0; color: 0 0 0 0; } + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } } part { name: "focus"; @@ -157,5 +176,23 @@ group { 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"; + } } } diff --git a/data/themes/images/Makefile.am b/data/themes/images/Makefile.am index fd0811e..8c2ca47 100644 --- a/data/themes/images/Makefile.am +++ b/data/themes/images/Makefile.am @@ -371,5 +371,9 @@ e17_button_detail_open.png \ 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 diff --git a/data/themes/images/e17_button_sm.png b/data/themes/images/e17_button_sm.png new file mode 100644 index 0000000000000000000000000000000000000000..c369afeb8e8b96762714333e5c6660d4d4abdab2 GIT binary patch literal 2637 zcmV-T3bOTy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=1Km6(M|GIVagLjv_ zg4X(fM17i#@*HhL-$1|yKL_{*;oDtr;&LkknV2-%OAtvs zC-~3bMjgfBE5c}wo)CrnIDCjuf6X0r?b&)OG!aGCSx zfiBtQq*+O4Gbsp_zu8JsLvD{w&k2~dxsHkN1>-52zx(;aC;$BF^lwysfq2i?9K0z{ z$&rMeZU0M$YEIbO--A;#JW93Yq)yPy*7e zh{8*jv;#$R*X;f8kRLpBgQrNluURj+#|T%lAj6M?60_frs+THh1-{*B3I4~We3Isz vI!uyKM9tghqJD=XzrQub5+uUYu1NJC00p2Fx;dDg00000NkvXXu0mjf;pq&_ literal 0 HcmV?d00001 diff --git a/data/themes/images/e17_button_sm2.png b/data/themes/images/e17_button_sm2.png new file mode 100644 index 0000000000000000000000000000000000000000..b70a473a5d35cc43ffb0b07f7253c05eee0f0086 GIT binary patch literal 2466 zcmV;T30?MyP)T*6JCL*;sJ7lB5pzE z1+awRK7wE&90@0O#@>fM^L?wTdU|?KI9yszCCgP^wYsYQe;ulJPgQ+W-fjj~3-~^7 zvaG3><8LZkBO4!(K8w#$<^XNqLEb?wkqbmJ-gFWKEAS(-L-t661PNRJ$wjd5JbwK6 zR}UXP{N?@o_kYUsYQ0`>R+O3ENpl>>Y8+dnW6bt|91z#+a=&A)+h(y{p5340jCIsC z@6`v|^fOo0v)7h(!}y`84!c9O+aIfA)1!_)I{mx2)x7wbFT%Qog-ZTRb~$At8g8 zfOF)sW()$tYt?hSNL!tw_ioF(HF87%3u$ko;Bv;FZ{eenL}qaT0& zJMQ6QL@#i{8w42h=UD#d4*dVc%{r&GMN8`ef-IXafJ-eD3O&dS7rqW!G}=m07V=RhaA&Ns>LiLszaKMj^eXw8obv& zyqYKYSZz*#`V}$1{$Jca-kx?=LdtqBT7GWz@~q{R;vMYLofz|H?if+k*f$3h*M^ue zENzUZ+_KTMXIm`1;&uDomU$?VhrSPVlF`?}o1CQ%8gl|d=|2}O>$|rBb;r8Bb?iPr zms+s1aT8`wUk4GocZ2}r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J^AF}Pd;3K@BMo}+n7%MG3A7w=Y0Aeh6dpaO-J2O zd-(|$)6$86NQBw#BL1`W<0uWl+0w~WvDt{uOoZ$t0LfFYojvJfRjVj@nyBMB_u1yd zNw4LfKD+ue@(Er3ZQwK(=yV-F1^Gu2#jmF)Ns_)dv3Rf7{{^r3X)EZOl0io0^IP?& gv5fnh>aAtq--TpujM{8X^#A|>07*qoM6N<$f@RyzK>z>% literal 0 HcmV?d00001 diff --git a/data/themes/images/e17_button_sm_disabled.png b/data/themes/images/e17_button_sm_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..6e8383af67d34a55a8363722bafa66cb634ac2a6 GIT binary patch literal 1045 zcmV+w1nT>VP)wrd!X$Ezn(GU%y%|m*-vAy#}NZLRQgi%s+c) zsq3Y^I}X32wceQD9(&dpqqWxD-rjz`yu5sOc6Rm=_~C{^>%F@L7R%-Ge6d)(4J1?! zCPMtRuhwURC?8x5WDK;wDWw>O0i{$UgkV0OpPrnY%z!U31xRc2uIt|HG~m3B#5`02 z5CV?@bSm)oIYQlW*L5#}XTS~c8yIB}0}g5>UsA#pHSGGmicQ-1wuxh_>fc6MH5zggZ-s3<-D;z^Trr?s1Y&1-zP|8d~c6v8~+}Y^`@{+iLEQ zDX9d!6i|}{jN?e#wkV~N9n5*G=9!YW!?sZ3sUR3rlY58OdV?uTfO|>o=9JfS-b&q9 zLssfImUc@dr-EgYfLf3_5ViM~ilEYU2Tn@4QA7wh)|MndDU~clN~Dye9vhoe2uOX$ z2bpTm65x-S+JdKsjFQJ|-t|xgT2TS9>T2poY6Igg#f}S-zRdmLDTJt3z!Xo^fU6xA zrRzRmKRY;(VUYBlSrr4^i=>p*()T}{8rM@iUqg79BEx>WbFDSwIMxv$rQAGNN+;p< zrfHHDSxvQ<0vnTdDe#49y{ZnV8P7EVtn}v>BQ^w*N_8QrPUgA4L#;K#Fq8@C`<|w0 z==(nVds!37rv}dy`Jwu9DbMd?Yyu@ofU5z*n`0h|rOmJ-sf;p}ux(?9-@hsXX0sVh z({OlrSUr;ynqQ}H^JlnAeeqBP7(fKk(!_pYV_;+Bur&5_F=UtQ;2jHJ-FA}H#0W5e z(ppFVzQTPBczB+h3Y(e|r>MdhgHnpSyE}lvC&4E`0e9>5`cv0+r?DKHlX(ez&il1N zZz=&wDemv@S*=!IfnRPy6fmvtePDfcb@l%E__&+T=P&%~Y8wkl*;W39DX%OM<2ahW z?^&%@-!3jLJ^vsjNAij3;qW9>1Kt)m7&(I4jlnA zOG>-P1Q?Hm!4lD18vq?!8*Bo542z_0ZO|=~xwSzp5_9Jwu*a~Oz%;-g1YEK(uB{3;3#BBfo0XIoR zK~y-)&67=P12GJRpQW*g7$(GvXLrrru`4)6Aws zN{K|omPArYWM(ikcM}-drWhlSkPIZyC}PHgBr>Tyq?P~x0rW{k zK~y-)m6O40+dvS8zg>BSBr7Xp>c)o(9B}V}LLB0|>EnbvLEbFapcdR~sh|eu5GV~r zY-(B7YIE77X%bR8r)75kZ-<$G1b;^iOo1_w`kVo-ffCp}d5?H>J^&7Z2p9ng&;vT4 z@t_Of>q~$G-~;dm*w_Ii*26g^>8?BUl0Qj1c6J_v>OhGtq?*2Q+ao!eO`;zzx#3o77 z0b}XM(@iE58%0s~n)oq9Db)d~^d@Qe&rnJ^0O=iOR;yJ|*R{0Pihqf%wZa38^!B_c zilSFlRnHg`yaw^(lv$Rwz;)pBKbxlE=;$cl+uLiyFzl34NGYF*jWJS6Nx$FU0mVIl zo12@flamt>$MHKU<-@$4b69Id(=^f;6G$n^vdjWYA;gborIuy+-WYQ%gpf&+bV{jC zDdm(>F3Yku48s=qB82$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; @@ -157,6 +161,8 @@ _e_config_dialog_cb_apply(void *data, E_Dialog *dia) 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 @@ -176,3 +182,13 @@ _e_config_dialog_cb_basic(void *data, void *data2) 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); +} diff --git a/src/bin/e_dialog.c b/src/bin/e_dialog.c index d9aab26..24c8138 100644 --- a/src/bin/e_dialog.c +++ b/src/bin/e_dialog.c @@ -93,6 +93,16 @@ e_dialog_button_focus_num(E_Dialog *dia, int button) 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) { diff --git a/src/bin/e_dialog.h b/src/bin/e_dialog.h index c3f47ea..6f4a0fa 100644 --- a/src/bin/e_dialog.h +++ b/src/bin/e_dialog.h @@ -27,14 +27,15 @@ struct _E_Dialog 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 diff --git a/src/bin/e_int_config_focus.c b/src/bin/e_int_config_focus.c index 3ce7e1d..9c7acf8 100644 --- a/src/bin/e_int_config_focus.c +++ b/src/bin/e_int_config_focus.c @@ -45,6 +45,18 @@ e_int_config_focus(E_Container *con) } /**--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) { @@ -55,14 +67,7 @@ _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; } @@ -131,6 +136,8 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *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); @@ -149,6 +156,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata) 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); diff --git a/src/bin/e_widget.c b/src/bin/e_widget.c index caf3ef1..95631cd 100644 --- a/src/bin/e_widget.c +++ b/src/bin/e_widget.c @@ -202,9 +202,7 @@ int 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) @@ -235,10 +233,10 @@ e_widget_focus_jump(Evas_Object *obj, int forward) { 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) */ @@ -262,10 +260,10 @@ e_widget_focus_jump(Evas_Object *obj, int forward) { 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) */ @@ -405,13 +403,31 @@ e_widget_change(Evas_Object *obj) { 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); } diff --git a/src/bin/e_widget_button.c b/src/bin/e_widget_button.c index b8e68fa..b6d25d4 100644 --- a/src/bin/e_widget_button.c +++ b/src/bin/e_widget_button.c @@ -16,6 +16,7 @@ struct _E_Widget_Data 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 */ @@ -33,6 +34,7 @@ e_widget_button_add(Evas *evas, char *label, char *icon, void (*func) (void *dat 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; @@ -106,6 +108,18 @@ _e_wid_activate_hook(Evas_Object *obj) } 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); diff --git a/src/bin/e_widget_check.c b/src/bin/e_widget_check.c index 5b2cecf..9b1dd9d 100644 --- a/src/bin/e_widget_check.c +++ b/src/bin/e_widget_check.c @@ -14,6 +14,7 @@ static void _e_wid_del_hook(Evas_Object *obj); 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); @@ -32,6 +33,7 @@ e_widget_check_add(Evas *evas, char *label, int *val) 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); @@ -112,6 +114,18 @@ _e_wid_activate_hook(Evas_Object *obj) } 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); diff --git a/src/bin/e_widget_radio.c b/src/bin/e_widget_radio.c index cecda96..a177556 100644 --- a/src/bin/e_widget_radio.c +++ b/src/bin/e_widget_radio.c @@ -21,6 +21,7 @@ static void _e_wid_del_hook(Evas_Object *obj); 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 */ @@ -48,6 +49,7 @@ e_widget_radio_add(Evas *evas, char *label, int valnum, E_Radio_Group *group) 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; @@ -152,6 +154,18 @@ _e_wid_activate_hook(Evas_Object *obj) } 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); -- 2.7.4