/* * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved * * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ group { "elm/multibuttonentry/event/default"; inherit_only: 1; parts { rect { "event"; mouse; repeat; desc { "default"; color: 0 0 0 0; rel.to: "base"; } desc { "disabled"; inherit: "default"; hid; } } } programs { program { "pressed"; signal: "mouse,down,1"; source: "event"; action: SIGNAL_EMIT "elm,action,press" ""; after: "on_pressed"; } program { "unpressed"; signal: "mouse,up,1"; source: "event"; action: SIGNAL_EMIT "elm,action,unpress" ""; after: "on_unpressed"; } program { "clicked"; signal: "mouse,clicked,1"; source: "event"; after: "on_clicked"; } } } group { "elm/multibuttonentry/base/template"; { inherit_only: 1; mouse; //only event part can have mouse events. //data.item: "horizontal_pad" 0 0 //horizontal padding size between MBE's item. //data.item: "vertical_pad" 0 0 //vertical padding size between MBE's item. parts { /* Base part for MBE */ spacer { "base"; desc { "default"; } } /* Box swallow part */ swallow { "box.swallow"; desc { "default"; rel.to: "base"; } } } /* Inherit event parts */ inherit: "elm/multibuttonentry/event/default"; program_remove: "pressed"; program_remove: "unpressed"; programs { /* Program for pressed effect */ program { "on_clicked"; } } } group { "elm/multibuttonentry/base/default"; nomouse; data.item: "horizontal_pad" MULTIBUTTONENTRY_BOX_HORIZONTAL_PAD_INC; data.item: "vertical_pad" MULTIBUTTONENTRY_BOX_VERTICAL_PAD_INC; parts { rect { "base"; scale; desc { "default"; color_class: "multibuttonentry/default/bg"; } } spacer { "padding_top_left"; scale; desc{ "default"; min: MULTIBUTTONENTRY_WIDTH_PAD_INC MULTIBUTTONENTRY_HEIGHT_PAD_INC; fixed: 1 1; rel1.to: "base"; rel2 { to: "base"; relative: 0.0 0.0; } align: 0.0 0.0; } } spacer { "padding_bottom_right"; scale; desc { "default"; min: MULTIBUTTONENTRY_WIDTH_PAD_INC MULTIBUTTONENTRY_BOTTOM_HEIGHT_PAD_INC; fixed: 1 1; rel1 { to: "base"; relative: 1.0 1.0; } rel2.to: "base"; align: 1.0 1.0; } } swallow { "box.swallow"; mouse; desc { "default"; rel1 { relative: 1.0 1.0; to: "padding_top_left"; } rel2 { relative: 0.0 0.0; to: "padding_bottom_right"; } } } } inherit: "elm/multibuttonentry/event/default"; program_remove: "pressed"; program_remove: "unpressed"; programs { program { "on_clicked"; action: SIGNAL_EMIT "elm,action,click" ""; } } } //Legacy. This is not using in Tizen 3.0 group { "elm/multibuttonentry/guidetext/default"; nomouse; styles { style { name: "multibuttonentry_guide_style"; base: "font=Tizen:weight=Normal font_size="MULTIBUTTONENTRY_GUIDE_TEXT_SIZE_INC" color=#00000091 wrap=char"; tag: "br" "\n"; tag: "ps" "ps"; tag: "hilight" "+ font_weight=Bold"; tag: "b" "+ font_weight=Bold"; tag: "tab" "\t"; } } parts { spacer { "base"; scale; desc { "default"; } } textblock { "elm.text"; scale; desc { "default"; min: 0 MULTIBUTTONENTRY_ITEM_HEIGHT_INC; text.style: "multibuttonentry_guide_style"; rel.to: "base"; } desc { "hidden"; inherit: "default"; vis; } } } programs { program { "show"; signal: "elm,state,guidetext,show"; source: "elm"; action: STATE_SET "default"; target: "elm.text"; } program { "hide"; signal: "elm,state,guidetext,hide"; source: "elm"; action: STATE_SET "hidden"; target: "elm.text"; } } } group { "elm/multibuttonentry/btn/default"; nomouse; images.image: "core_contact_div.png" COMP; images.image: "core_navi_press.#.png" COMP; images.image: "core_focus_round.#.png" COMP; images.image: "focus_ef.#.png" COMP; styles { style { name: "multibuttonentry_btn_text_style"; base: "font=Tizen:weight=SemiBold font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFF color_class=multibuttonentry_item/default/text text_class=tizen ellipsis=1.0"; } style { name: "multibuttonentry_btn_pressed_text_style"; base: "font=Tizen:weight=SemiBold font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFF color_class=multibuttonentry_item/default/text_pressed text_class=tizen ellipsis=1.0"; } style { name: "multibuttonentry_btn_disabled_text_style"; base: "font=Tizen:weight=SemiBold font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFF color_class=multibuttonentry_item/default/text_disabled text_class=tizen ellipsis=1.0"; } } data { item: "access_highlight" "on"; } parts { spacer { "base"; scale; desc { "default"; min: 0 MULTIBUTTONENTRY_ITEM_HEIGHT_INC; max: -1 MULTIBUTTONENTRY_ITEM_HEIGHT_INC; } } image { "divider"; scale; desc { "default"; min: MULTIBUTTONENTRY_DIVIDER_SIZE_INC; max: MULTIBUTTONENTRY_DIVIDER_SIZE_INC; fixed: 1 1; align: 1.0 0.6; image.normal: "core_contact_div.png"; color_class: "multibuttonentry_item/default/divider"; rel1 { to: "base"; relative: 1.0 0.0; } rel2 { to: "base"; relative: 1.0 1.0; } } desc { "hidden"; inherit: "default"; hid; } } spacer { "padding_divider_right"; scale; desc { "default"; min: MULTIBUTTONENTRY_DIVIERR_LEFT_PADDING_SIZE_INC; max: MULTIBUTTONENTRY_DIVIERR_LEFT_PADDING_SIZE_INC; fixed: 1 1; align: 1.0 0.5; rel1 { to_x: "divider"; relative: 0.0 0.0; } rel2 { to_x: "divider"; relative: 0.0 1.0; } } } image { "bg"; scale; desc{ "default"; fixed: 1 1; image.normal: "core_navi_press.#.png"; rel1.to: "padding_left"; rel2.to: "padding_right"; color_class: "multibuttonentry_item/default/bg"; } desc{ "pressed"; inherit: "default"; color_class: "multibuttonentry_item/default/effect"; } } textblock { "elm.btn.text"; multiline: 0; scale; desc{ "default"; text { style: "multibuttonentry_btn_text_style"; min: 1 1; } rel1 { relative: 0.0 0.0; to: "base"; } rel2 { relative: 0.0 1.0; to: "padding_divider_right"; } hid; } } textblock { "text"; multiline: 0; scale; desc { "default"; text { style: "multibuttonentry_btn_text_style"; text_source: "elm.btn.text"; min: 0 1; } rel1 { relative: 0.0 0.0; to: "base"; } rel2 { relative: 0.0 1.0; to: "padding_divider_right"; } } desc { "pressed"; inherit: "default"; text.style: "multibuttonentry_btn_pressed_text_style"; } desc { "disabled"; inherit: "default"; text.style: "multibuttonentry_btn_disabled_text_style"; } } spacer { "padding_left"; scale; desc { "default"; min: MULTIBUTTONENTRY_LEFT_TOP_PADDNG_SIZE_INC; max: MULTIBUTTONENTRY_LEFT_TOP_PADDNG_SIZE_INC; fixed: 1 1; align: 1.0 1.0; rel1 { to: "text"; relative: 0.0 0.0; } rel2 { to: "text"; relative: 0.0 0.0; } } } spacer { "padding_right"; scale; desc { "default"; min: MULTIBUTTONENTRY_BOTTOM_DOWN_PADDNG_SIZE_INC; max: MULTIBUTTONENTRY_BOTTOM_DOWN_PADDNG_SIZE_INC; fixed: 1 1; align: 1.0 0.0; rel1 { to: "padding_divider_right"; relative: 1.0 1.0; } rel2 { to: "padding_divider_right"; relative: 1.0 1.0; } } } image { "focus_round"; scale; desc { "default"; fixed: 1 1; image.normal: "core_focus_round.#.png"; color_class: "multibuttonentry_item/default/border"; rel1.to: "padding_left"; rel2.to: "padding_right"; hid; } desc { "focused"; inherit: "default"; vis; } desc { "unfocused"; inherit: "default"; } } image { "highlight"; desc { "default"; image.normal: "focus_ef.#.png"; color: 0 218 230 100; fill.smooth: 0; rel1.to: "focus_round"; rel2.to: "focus_round"; hid; } desc { "visible"; inherit: "default"; vis; } } } inherit: "elm/multibuttonentry/event/default"; parts { rect { "event"; mouse; desc { "default"; rel1.to: "bg"; rel2.to: "bg"; color: 0 0 0 0; } } } script { public disabled = 0; } programs { program { "on_pressed"; script { if (get_int(disabled) == 0) { set_state(PART:"bg", "pressed", 0.0); set_state(PART:"text", "pressed", 0.0); } } } program { "on_unpressed"; script { if (get_int(disabled) == 0) { set_state(PART:"bg", "default", 0.0); set_state(PART:"text", "default", 0.0); } } } program { "enabled"; signal: "elm,state,enabled"; source: "elm"; script { set_state(PART:"text", "default", 0.0); set_int(disabled , 0); } } program { "disabled"; signal: "elm,state,disabled"; source: "elm"; script { new st[31]; new Float: vl; get_state(PART:"focus_round", st, 30, vl); if (!strcmp(st, "focused")) set_state(PART:"focus_round", "default", 0.0); set_state(PART:"text", "disabled", 0.0); set_int(disabled , 1); } } program { "divider_hide"; signal: "elm,state,shrink,on"; source: "elm"; action: STATE_SET "hidden"; target: "divider"; } program { "divider_show"; signal: "elm,state,shrink,off"; source: "elm"; action: STATE_SET "default"; target: "divider"; } program { "edge_image_default"; signal: "elm,state,default"; source: "elm"; action: STATE_SET "default"; target: "focus_round"; } program { "edge_image_focused"; signal: "elm,state,focused"; source: "elm"; action: STATE_SET "focused"; target: "focus_round"; } program { "edge_image_unfocused"; signal: "elm,state,unfocused"; source: "elm"; action: STATE_SET "unfocused"; target: "focus_round"; } program { "on_clicked"; script { if (get_int(disabled) == 0) { emit("elm,action,click", ""); } } after: "touch_snd"; } program { "touch_snd"; action: RUN_PLUGIN "touch_sound" ; } program { "show_access_highlight"; signal: "elm,action,access_highlight,show"; source: "elm"; action: STATE_SET "visible"; target: "highlight"; } program { "hide_access_highlight"; signal: "elm,action,access_highlight,hide"; source: "elm"; action: STATE_SET "default"; target: "highlight"; } } } group { "elm/multibuttonentry/number/default"; nomouse; styles { style { name: "multibuttonentry_number_text_style"; base: "font=Tizen:weight=Light font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFF color_class=multibuttonentry/default/text_count text_class=tizen"; } } parts { spacer { "base"; scale; desc { "default"; } } spacer { "padding_left"; scale; desc { "default"; min: MULTIBUTTONENTRY_LABEL_PAD_INC 0; fixed: 1 0; rel1.to: "base"; rel2 { to: "base"; relative: 0.0 1.0; } align: 0.0 0.5; } } textblock { "elm.text"; scale; desc { "default"; min: 0 MULTIBUTTONENTRY_ITEM_HEIGHT_INC; text { style: "multibuttonentry_number_text_style"; min: 1 0; } rel1 { relative: 1.0 0.0; to: "padding_left"; } rel2.to: "base"; } } } } group { "elm/multibuttonentry/label/default"; nomouse; styles { style { name: "multibuttonentry_label_style"; base: "font=Tizen:weight=Light font_size="MULTIBUTTONENTRY_LABEL_TEXT_SIZE_INC" color=#FFF color_class=multibuttonentry/default/text_label text_class=tizen wrap=char"; tag: "br" "\n"; tag: "ps" "ps"; tag: "hilight" "+ font_weight=Bold"; tag: "b" "+ font_weight=Bold"; tag: "tab" "\t"; } } parts { spacer { "base"; scale; desc { "default"; } } spacer { "padding_right"; scale; desc{ "default"; min: MULTIBUTTONENTRY_LABEL_PAD_INC 0; fixed: 1 0; rel1.relative: 1.0 0.0; align: 1.0 0.5; } } textblock { "elm.text"; scale; desc { "default"; min: 0 MULTIBUTTONENTRY_ITEM_HEIGHT_INC; text { style: "multibuttonentry_label_style"; min: 1 0; } rel1.to: "base"; rel2 { relative: 0.0 1.0; to: "padding_right"; } } } } }