2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "gl-ui-util.h"
19 #include "gl-button.h"
20 #include "gl-strings.h"
22 #define GL_BUT_NAME_DELETE GL_STR_DELETE
23 #define GL_BUT_NAME_CANCEL GL_STR_CANCEL
24 #define GL_BUT_NAME_DONE GL_STR_DONE
26 /*******************************************************
27 ** Prototype : _gl_but_create_but
28 ** Description : Create button
29 ** Input : Evas_Object *parent
30 ** Input : gl_but_mode mode
31 ** Input : const char *style
38 ** 1.Date : 2011/06/10
40 ** Modification : Created function
42 *********************************************************/
43 Evas_Object *_gl_but_create_but(Evas_Object *parent, gl_but_mode mode, const char *style)
45 gl_dbg("Button mode: %d", mode);
46 Evas_Object *btn = NULL;
48 btn = elm_button_add(parent);
50 elm_object_focus_allow_set(btn, EINA_FALSE);
51 elm_object_style_set(btn, style);
52 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND,
54 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.5);
58 elm_object_text_set(btn, GL_BUT_NAME_DELETE);
61 elm_object_text_set(btn, GL_BUT_NAME_CANCEL);
64 elm_object_text_set(btn, GL_BUT_NAME_DONE);
67 elm_object_text_set(btn, GL_STR_SHARE);
71 elm_object_text_set(btn, GL_STR_MORE);
73 case GL_BUT_ROTATE_LEFT:
74 elm_object_text_set(btn, GL_STR_ROTATE_LEFT);
76 case GL_BUT_ROTATE_RIGHT:
77 elm_object_text_set(btn, GL_STR_ROTATE_RIGHT);
84 evas_object_show(btn);
88 Evas_Object *_gl_but_create_but_popup(Evas_Object *parent, const char *text, But_Smart_Cb cb_func, const void *data)
90 Evas_Object *btn = NULL;
91 GL_CHECK_NULL(parent);
93 gl_dbg("Button text: %s", text);
95 btn = elm_button_add(parent);
97 elm_object_text_set(btn, text);
100 evas_object_smart_callback_add(btn, "clicked", cb_func, data);