summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Atton <jonathan.atton@gmail.com>2010-11-15 18:50:38 +0000
committerJonathan Atton <jonathan.atton@gmail.com>2010-11-15 18:50:38 +0000
commitb71f1a1f4b476cd53efe4eff534ba7575f54f63c (patch)
tree8172478f0e998a686b695ad7d9340e1f39169a6c
parent526ea47aa5afd8ed752808b1bfcf76719f2889b3 (diff)
detour-elm : add checkbox and radio
SVN revision: 54568
-rw-r--r--images.edc10
-rw-r--r--images/check_bt0.pngbin0 -> 314 bytes
-rw-r--r--images/check_bt1.pngbin0 -> 400 bytes
-rw-r--r--images/check_bt2.pngbin0 -> 613 bytes
-rw-r--r--images/radio_bt0.pngbin0 -> 628 bytes
-rw-r--r--images/radio_bt1.pngbin0 -> 508 bytes
-rw-r--r--images/radio_bt2.pngbin0 -> 568 bytes
-rw-r--r--main.edc513
8 files changed, 523 insertions, 0 deletions
diff --git a/images.edc b/images.edc
index 66b5fc0..8c1af14 100644
--- a/images.edc
+++ b/images.edc
@@ -41,3 +41,13 @@ image: "images/gadman_im6.png" COMP; /* right arrow */
41image: "images/scrollframe_im1.png" COMP; /* inset */ 41image: "images/scrollframe_im1.png" COMP; /* inset */
42image: "images/scrollframe-bar_im2.png" COMP; /* vertical bar */ 42image: "images/scrollframe-bar_im2.png" COMP; /* vertical bar */
43 43
44//~ check
45image: "images/check_bt0.png" COMP;
46image: "images/check_bt1.png" COMP;
47image: "images/check_bt2.png" COMP;
48
49//~ radio
50image: "images/radio_bt0.png" COMP;
51image: "images/radio_bt1.png" COMP;
52image: "images/radio_bt2.png" COMP;
53
diff --git a/images/check_bt0.png b/images/check_bt0.png
new file mode 100644
index 0000000..dbd194e
--- /dev/null
+++ b/images/check_bt0.png
Binary files differ
diff --git a/images/check_bt1.png b/images/check_bt1.png
new file mode 100644
index 0000000..95cb3ac
--- /dev/null
+++ b/images/check_bt1.png
Binary files differ
diff --git a/images/check_bt2.png b/images/check_bt2.png
new file mode 100644
index 0000000..646d794
--- /dev/null
+++ b/images/check_bt2.png
Binary files differ
diff --git a/images/radio_bt0.png b/images/radio_bt0.png
new file mode 100644
index 0000000..6eeb506
--- /dev/null
+++ b/images/radio_bt0.png
Binary files differ
diff --git a/images/radio_bt1.png b/images/radio_bt1.png
new file mode 100644
index 0000000..7c0853d
--- /dev/null
+++ b/images/radio_bt1.png
Binary files differ
diff --git a/images/radio_bt2.png b/images/radio_bt2.png
new file mode 100644
index 0000000..02273b0
--- /dev/null
+++ b/images/radio_bt2.png
Binary files differ
diff --git a/main.edc b/main.edc
index cdf553d..25c30bd 100644
--- a/main.edc
+++ b/main.edc
@@ -4844,5 +4844,518 @@ collections {
4844 } 4844 }
4845 } 4845 }
4846 /////////////////////////////////////////////////////////////////////////////// 4846 ///////////////////////////////////////////////////////////////////////////////
4847
4848
4849 ///////////////////////////////////////////////////////////////////////////////
4850 group { name: "elm/check/base/default";
4851 parts {
4852 part { name: "bg_check";
4853 mouse_events: 0;
4854 scale: 1;
4855 description { state: "default" 0.0;
4856 rel1 {
4857 to: "bg";
4858 }
4859 rel2 {
4860 to: "bg";
4861 }
4862 color: 255 255 255 0;
4863 image.normal: "images/check_bt0.png";
4864 }
4865 description { state: "visible" 0.0;
4866 inherit: "default" 0.0;
4867 color: 255 255 255 255;
4868 }
4869 description { state: "disabled" 0.0;
4870 inherit: "default" 0.0;
4871 color: 128 128 128 0;
4872 }
4873 description { state: "disabled_visible" 0.0;
4874 inherit: "default" 0.0;
4875 color: 128 128 128 0;
4876 }
4877
4878 }
4879 part { name: "bg";
4880 mouse_events: 0;
4881 scale: 1;
4882 description { state: "default" 0.0;
4883 rel2.relative: 0.0 1.0;
4884 align: 0.0 0.5;
4885 min: 20 18;
4886 max: 20 18;
4887 aspect: 1.0 1.0;
4888 aspect_preference: BOTH;
4889 image {
4890 normal: "images/check_bt1.png";
4891 border: 8 7 8 7;
4892 middle: 0;
4893 }
4894 fill.smooth : 0;
4895 }
4896 }
4897 part { name: "check";
4898 mouse_events: 0;
4899 scale: 1;
4900 description { state: "default" 0.0;
4901 rel1 {
4902 to: "bg";
4903 }
4904 rel2 {
4905 to: "bg";
4906 }
4907 color: 255 255 255 0;
4908 image.normal: "images/check_bt2.png";
4909 }
4910 description { state: "visible" 0.0;
4911 inherit: "default" 0.0;
4912 color: 255 255 255 255;
4913 }
4914 description { state: "disabled" 0.0;
4915 inherit: "default" 0.0;
4916 color: 128 128 128 0;
4917 }
4918 description { state: "disabled_visible" 0.0;
4919 inherit: "default" 0.0;
4920 color: 128 128 128 128;
4921 }
4922 }
4923 part { name: "elm.swallow.content";
4924 type: SWALLOW;
4925 description { state: "default" 0.0;
4926 fixed: 1 0;
4927 visible: 0;
4928 align: 0.0 0.5;
4929 rel1.to_x: "bg";
4930 rel1.relative: 1.0 0.0;
4931 rel1.offset: 1 1;
4932 rel2.to_x: "bg";
4933 rel2.offset: 1 -2;
4934 rel2.relative: 1.0 1.0;
4935 }
4936 description { state: "visible" 0.0;
4937 inherit: "default" 0.0;
4938 fixed: 1 0;
4939 visible: 1;
4940 aspect: 1.0 1.0;
4941 }
4942 description { state: "disabled" 0.0;
4943 inherit: "default" 0.0;
4944 color: 128 128 128 128;
4945 }
4946 description { state: "disabled_visible" 0.0;
4947 inherit: "default" 0.0;
4948 color: 128 128 128 128;
4949 fixed: 1 0;
4950 visible: 1;
4951 aspect: 1.0 1.0;
4952 }
4953 }
4954 part { name: "elm.text";
4955 type: TEXT;
4956 mouse_events: 0;
4957 scale: 1;
4958 description { state: "default" 0.0;
4959 visible: 0;
4960 rel1.to_x: "elm.swallow.content";
4961 rel1.relative: 1.0 0.0;
4962 rel1.offset: 1 1;
4963 rel2.relative: 1.0 1.0;
4964 rel2.offset: -2 -2;
4965 color: 0 0 0 255;
4966 text {
4967 font: "Sans,Edje-Vera";
4968 size: 10;
4969 min: 0 1;
4970 align: 0.0 0.5;
4971 }
4972 }
4973 description { state: "visible" 0.0;
4974 inherit: "default" 0.0;
4975 visible: 1;
4976 text.min: 1 1;
4977 }
4978 description { state: "disabled" 0.0;
4979 inherit: "default" 0.0;
4980 color: 0 0 0 128;
4981 color3: 0 0 0 0;
4982 }
4983 description { state: "disabled_visible" 0.0;
4984 inherit: "default" 0.0;
4985 color: 0 0 0 128;
4986 color3: 0 0 0 0;
4987 visible: 1;
4988 text.min: 1 1;
4989 }
4990 }
4991 part { name: "events";
4992 type: RECT;
4993 ignore_flags: ON_HOLD;
4994 description { state: "default" 0.0;
4995 color: 0 0 0 0;
4996 }
4997 }
4998 part { name: "disabler";
4999 type: RECT;
5000 description { state: "default" 0.0;
5001 color: 0 0 0 0;
5002 visible: 0;
5003 }
5004 description { state: "disabled" 0.0;
5005 inherit: "default" 0.0;
5006 visible: 1;
5007 }
5008 }
5009 }
5010 programs {
5011 program { name: "click";
5012 signal: "mouse,up,1";
5013 source: "events";
5014 action: SIGNAL_EMIT "elm,action,check,toggle" "";
5015 }
5016 program { name: "check_on";
5017 signal: "elm,state,check,on";
5018 source: "elm";
5019 action: STATE_SET "visible" 0.0;
5020 target: "check";
5021 target: "bg_check";
5022 transition: SINUSOIDAL 0.2;
5023 }
5024 program { name: "check_off";
5025 signal: "elm,state,check,off";
5026 source: "elm";
5027 action: STATE_SET "default" 0.0;
5028 target: "check";
5029 target: "bg_check";
5030 transition: SINUSOIDAL 0.2;
5031 }
5032 program { name: "text_show";
5033 signal: "elm,state,text,visible";
5034 source: "elm";
5035 action: STATE_SET "visible" 0.0;
5036 target: "elm.text";
5037 }
5038 program { name: "text_hide";
5039 signal: "elm,state,text,hidden";
5040 source: "elm";
5041 action: STATE_SET "default" 0.0;
5042 target: "elm.text";
5043 }
5044 program { name: "icon_show";
5045 signal: "elm,state,icon,visible";
5046 source: "elm";
5047 action: STATE_SET "visible" 0.0;
5048 target: "elm.swallow.content";
5049 }
5050 program { name: "icon_hide";
5051 signal: "elm,state,icon,hidden";
5052 source: "elm";
5053 action: STATE_SET "default" 0.0;
5054 target: "elm.swallow.content";
5055 }
5056 program { name: "disable";
5057 signal: "elm,state,disabled";
5058 source: "elm";
5059 action: STATE_SET "disabled" 0.0;
5060 target: "disabler";
5061 after: "disable_text";
5062 }
5063 program { name: "disable_text";
5064 script {
5065 new st[31];
5066 new Float:vl;
5067 get_state(PART:"elm.text", st, 30, vl);
5068 if (!strcmp(st, "visible"))
5069 set_state(PART:"elm.text", "disabled_visible", 0.0);
5070 else
5071 set_state(PART:"elm.text", "disabled", 0.0);
5072
5073 get_state(PART:"elm.swallow.content", st, 30, vl);
5074 if (!strcmp(st, "visible"))
5075 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
5076 else
5077 set_state(PART:"elm.swallow.content", "disabled", 0.0);
5078
5079 get_state(PART:"check", st, 30, vl);
5080 if (!strcmp(st, "visible"))
5081 {
5082 set_state(PART:"check", "disabled_visible", 0.0);
5083 set_state(PART:"bg_check", "disabled_visible", 0.0);
5084 }
5085 else
5086 {
5087 set_state(PART:"check", "disabled", 0.0);
5088 set_state(PART:"bg_check", "disabled", 0.0);
5089 }
5090 }
5091 }
5092 program { name: "enable";
5093 signal: "elm,state,enabled";
5094 source: "elm";
5095 action: STATE_SET "default" 0.0;
5096 target: "disabler";
5097 after: "enable_text";
5098 }
5099 program { name: "enable_text";
5100 script {
5101 new st[31];
5102 new Float:vl;
5103 get_state(PART:"elm.text", st, 30, vl);
5104 if (!strcmp(st, "disabled_visible"))
5105 set_state(PART:"elm.text", "visible", 0.0);
5106 else
5107 set_state(PART:"elm.text", "default", 0.0);
5108
5109 get_state(PART:"elm.swallow.content", st, 30, vl);
5110 if (!strcmp(st, "visible"))
5111 set_state(PART:"elm.swallow.content", "visible", 0.0);
5112 else
5113 set_state(PART:"elm.swallow.content", "default", 0.0);
5114
5115 get_state(PART:"check", st, 30, vl);
5116 if (!strcmp(st, "visible"))
5117 {
5118 set_state(PART:"check", "visible", 0.0);
5119 set_state(PART:"bg_check", "visible", 0.0);
5120 }
5121 else
5122 {
5123 set_state(PART:"check", "default", 0.0);
5124 set_state(PART:"bg_check", "default", 0.0);
5125 }
5126 }
5127 }
5128 }
5129 }
5130
5131
5132 ///////////////////////////////////////////////////////////////////////////////
5133 group { name: "elm/radio/base/default";
5134 parts {
5135 part { name: "bg_radio";
5136 mouse_events: 0;
5137 scale: 1;
5138 description { state: "default" 0.0;
5139 rel1.to: "bg";
5140 rel2.to: "bg";
5141 color: 255 255 255 0;
5142 image.normal: "images/radio_bt0.png";
5143 }
5144 description { state: "visible" 0.0;
5145 inherit: "default" 0.0;
5146 color: 255 255 255 255;
5147 }
5148 }
5149 part { name: "bg";
5150 mouse_events: 0;
5151 scale: 1;
5152 description { state: "default" 0.0;
5153 rel2.relative: 0.0 1.0;
5154 align: 0.0 0.5;
5155 min: 20 18;
5156 max: 20 18;
5157 aspect: 1.0 1.0;
5158 aspect_preference: VERTICAL;
5159 image.normal: "images/radio_bt1.png";
5160 image.border: 9 8 9 8;
5161 }
5162 }
5163 part { name: "radio";
5164 mouse_events: 0;
5165 scale: 1;
5166 description { state: "default" 0.0;
5167 rel1.to: "bg";
5168 rel2.to: "bg";
5169 color: 255 255 255 0;
5170 image.normal: "images/radio_bt2.png";
5171 }
5172 description { state: "visible" 0.0;
5173 inherit: "default" 0.0;
5174 color: 255 255 255 255;
5175 }
5176 }
5177 part { name: "elm.swallow.content";
5178 type: SWALLOW;
5179 description { state: "default" 0.0;
5180 fixed: 1 0;
5181 visible: 0;
5182 align: 0.0 0.5;
5183 color: 0 0 0 0;
5184 rel1.to_x: "bg";
5185 rel1.relative: 1.0 0.0;
5186 rel1.offset: 1 1;
5187 rel2.to_x: "bg";
5188 rel2.relative: 1.0 1.0;
5189 rel2.offset: 2 -2;
5190 }
5191 description { state: "visible" 0.0;
5192 inherit: "default" 0.0;
5193 visible: 1;
5194 color: 255 255 255 255;
5195 aspect: 1.0 1.0;
5196 }
5197 description { state: "disabled" 0.0;
5198 inherit: "default" 0.0;
5199 color: 128 128 128 128;
5200 }
5201 description { state: "disabled_visible" 0.0;
5202 inherit: "default" 0.0;
5203 color: 128 128 128 128;
5204 visible: 1;
5205 aspect: 1.0 1.0;
5206 }
5207 }
5208 part { name: "elm.text";
5209 type: TEXT;
5210 mouse_events: 0;
5211 scale: 1;
5212 description { state: "default" 0.0;
5213 visible: 0;
5214 rel1.to_x: "elm.swallow.content";
5215 rel1.relative: 1.0 0.0;
5216 rel1.offset: 1 1;
5217 rel2.relative: 1.0 1.0;
5218 rel2.offset: -2 -2;
5219 color: 0 0 0 255;
5220 text {
5221 font: "Sans,Edje-Vera";
5222 size: 10;
5223 min: 0 0;
5224 align: 0.0 0.5;
5225 }
5226 }
5227 description { state: "visible" 0.0;
5228 inherit: "default" 0.0;
5229 visible: 1;
5230 text.min: 1 1;
5231 }
5232 description { state: "disabled" 0.0;
5233 inherit: "default" 0.0;
5234 color: 0 0 0 128;
5235 color3: 0 0 0 0;
5236 }
5237 description { state: "disabled_visible" 0.0;
5238 inherit: "default" 0.0;
5239 color: 0 0 0 128;
5240 color3: 0 0 0 0;
5241 visible: 1;
5242 text.min: 1 1;
5243 }
5244 }
5245 part { name: "events";
5246 type: RECT;
5247 ignore_flags: ON_HOLD;
5248 description { state: "default" 0.0;
5249 color: 0 0 0 0;
5250 }
5251 }
5252 part { name: "disabler";
5253 type: RECT;
5254 description { state: "default" 0.0;
5255 color: 0 0 0 0;
5256 visible: 0;
5257 }
5258 description { state: "disabled" 0.0;
5259 inherit: "default" 0.0;
5260 visible: 1;
5261 }
5262 }
5263 }
5264 programs {
5265 program { name: "click";
5266 signal: "mouse,up,1";
5267 source: "events";
5268 action: SIGNAL_EMIT "elm,action,radio,toggle" "";
5269 }
5270 program { name: "radio_on";
5271 signal: "elm,state,radio,on";
5272 source: "elm";
5273 action: STATE_SET "visible" 0.0;
5274 target: "radio";
5275 target: "bg_radio";
5276 transition: SINUSOIDAL 0.2;
5277 }
5278 program { name: "radio_off";
5279 signal: "elm,state,radio,off";
5280 source: "elm";
5281 action: STATE_SET "default" 0.0;
5282 target: "radio";
5283 target: "bg_radio";
5284 transition: SINUSOIDAL 0.4;
5285 }
5286 program { name: "text_show";
5287 signal: "elm,state,text,visible";
5288 source: "elm";
5289 action: STATE_SET "visible" 0.0;
5290 target: "elm.text";
5291 }
5292 program { name: "text_hide";
5293 signal: "elm,state,text,hidden";
5294 source: "elm";
5295 action: STATE_SET "default" 0.0;
5296 target: "elm.text";
5297 }
5298 program { name: "icon_show";
5299 signal: "elm,state,icon,visible";
5300 source: "elm";
5301 action: STATE_SET "visible" 0.0;
5302 target: "elm.swallow.content";
5303 }
5304 program { name: "icon_hide";
5305 signal: "elm,state,icon,hidden";
5306 source: "elm";
5307 action: STATE_SET "default" 0.0;
5308 target: "elm.swallow.content";
5309 }
5310 program { name: "disable";
5311 signal: "elm,state,disabled";
5312 source: "elm";
5313 action: STATE_SET "disabled" 0.0;
5314 target: "disabler";
5315 after: "disable_text";
5316 }
5317 program { name: "disable_text";
5318 script {
5319 new st[31];
5320 new Float:vl;
5321 get_state(PART:"elm.text", st, 30, vl);
5322 if (!strcmp(st, "visible"))
5323 set_state(PART:"elm.text", "disabled_visible", 0.0);
5324 else
5325 set_state(PART:"elm.text", "disabled", 0.0);
5326
5327 get_state(PART:"elm.swallow.content", st, 30, vl);
5328 if (!strcmp(st, "visible"))
5329 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
5330 else
5331 set_state(PART:"elm.swallow.content", "disabled", 0.0);
5332 }
5333 }
5334 program { name: "enable";
5335 signal: "elm,state,enabled";
5336 source: "elm";
5337 action: STATE_SET "default" 0.0;
5338 target: "disabler";
5339 after: "enable_text";
5340 }
5341 program { name: "enable_text";
5342 script {
5343 new st[31];
5344 new Float:vl;
5345 get_state(PART:"elm.text", st, 30, vl);
5346 if (!strcmp(st, "disabled_visible"))
5347 set_state(PART:"elm.text", "visible", 0.0);
5348 else
5349 set_state(PART:"elm.text", "default", 0.0);
5350
5351 get_state(PART:"elm.swallow.content", st, 30, vl);
5352 if (!strcmp(st, "visible"))
5353 set_state(PART:"elm.swallow.content", "visible", 0.0);
5354 else
5355 set_state(PART:"elm.swallow.content", "default", 0.0);
5356 }
5357 }
5358 }
5359 }
4847} 5360}
4848 5361