- script {
- public button_state = NOTI_BUTTON_STATE_ENABLED;
- }
- parts {
- part { name: "button_image";
- type: IMAGE;
- mouse_events: 1;
- scale: 1;
- description {
- state: "default" 0.0;
- min: 145 59;
- fixed: 1 1;
- rel1 {
- relative: 0.0 0.0;
- }
- rel2 {
- relative: 1.0 1.0;
- }
- image {
- normal: "quick_standard_btn_nor.png";
- border: 10 10 0 0;
- }
- }
- description { state: "clicked" 0.0;
- inherit: "default" 0.0;
- image {
- normal: "quick_standard_btn_press.png";
- border: 10 10 0 0;
- }
- }
- description { state: "disabled" 0.0;
- inherit: "default" 0.0;
- }
- description { state: "focused" 0.0;
- inherit: "default" 0.0;
- }
- }
- part { name: "elm.text.rect";
- type: RECT;
- mouse_events: 0;
- scale: 1;
- description { state: "default" 0.0;
- visible: 0;
- fixed: 1 1;
- align: 0.5 0.5;
- rel1 {
- relative: 0.05 0.05;
- to: "button_image";
- }
- rel2 {
- relative: 0.95 0.95;
- to: "button_image";
- }
- }
- }
- part { name: "elm.text";
- type: TEXTBLOCK;
- mouse_events: 0;
- scale: 1;
- multiline: 1;
- description { state: "default" 0.0;
- visible: 0;
- fixed: 1 1;
- color: 149 148 148 255;
- rel1 {
- to: "elm.text.rect";
- }
- rel2 {
- to: "elm.text.rect";
- }
- text {
- style: "button_text";
- size: 28;
- align: 0.5 0.5;
- fit: 1 1;
- size_range: 22 28;
- }
- }
- description { state: "visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- min: 1 1;
- }
- description { state: "clicked" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- min: 1 1;
- color: 255 255 255 255;
- }
- description { state: "disabled" 0.0;
- inherit: "default" 0.0;
- color: 0 0 0 128;
- }
- description { state: "disabled_visible" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- min: 1 1;
- }
- description { state: "focused" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- min: 1 1;
- color: 255 255 255 255;
- }
- }
- part { name: "over1";
- mouse_events: 0;
- description { state: "default" 0.0;
- rel2.relative: 1.0 0.5;
- }
- }
- part { name: "over2";
- mouse_events: 1;
- repeat_events: 1;
- ignore_flags: ON_HOLD;
- description { state: "default" 0.0;
- rel1.to: "button_image";
- rel2.to: "button_image";
- }
- }
- part { name: "over3";
- mouse_events: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- rel1.to: "button_image";
- rel2.to: "button_image";
- color: 0 0 0 0;
- }
- }
- part { name: "disabler";
- type: RECT;
- description { state: "default" 0.0;
- rel1.to: "button_image";
- rel2.to: "button_image";
- color: 0 0 0 0;
- visible: 0;
- }
- description { state: "disabled" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- }
- programs {
- program { name: "button_click";
- signal: "mouse,down,1";
- source: "over2";
- action: SIGNAL_EMIT "elm,action,press" "";
- after: "button_click_anim";
- }
- program { name: "button_click_anim";
- action: STATE_SET "clicked" 0.0;
- target: "button_image";
- target: "elm.text";
- }
- program { name: "button_unpress";
- action: SIGNAL_EMIT "elm,action,unpress" "";
- }
- program { name: "button_mouseout_clicked";
- signal: "mouse,up,1";
- source: "over3";
- script {
- new st[31];
- new Float:vl;
- get_state(PART:"elm.text", st, 30, vl);
- if (!strcmp(st, "clicked") || !strcmp(st, "focused"))
- {
- emit("elm,action,default,text,set", "");
- set_state(PART:"elm.text", "visible", 0.0);
- }
- if(get_int(button_state) != NOTI_BUTTON_STATE_DISABLED)
- {
- set_state(PART:"button_image", "default", 0.0);
- }
- }
- after: button_unpress;
- }
- program { name: "button_unclick3";
- signal: "mouse,clicked,1";
- source: "over2";
- action: SIGNAL_EMIT "elm,action,click" "";
- }
- program { name: "text_show";
- signal: "elm,state,text,visible";
- source: "elm";
- script {
- if(get_int(button_state) != NOTI_BUTTON_STATE_DISABLED)
- set_state(PART:"elm.text", "visible", 0.0);
- else
- set_state(PART:"elm.text", "disabled_visible", 0.0);
- }
- }
- program { name: "text_hide";
- signal: "elm,state,text,hidden";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.text";
- }