2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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.
17 #include <Elementary.h>
27 #include <app-res-defines.h>
28 #include "SortCtxPopup.h"
30 const char *sorttext[] = {
39 const char *sortbtnids[] = {
48 void CSortCtxPopup::t_OnConfiguration(void)
50 t_SetList(sorttext, ARRAY_SIZE(sorttext), (int)CInfo::SortType(),
51 CCtxPopup::TOPBTN_SORT, sortbtnids,
52 POSITION_SORT_POPUP_X, POSITION_SORT_POPUP_Y,
53 FBR_STYLE_HOVER_ENTRY,
54 FBR_STYLE_HOVER_CTXPOPUP, FBR_STYLE_HOVER_CTXPOPUP, FBR_STYLE_HOVER_CTXPOPUP);
57 void CSortCtxPopup::t_OnBtnClicked(Evas_Object* obj, void* ev)
63 const char *id = (const char*)evas_object_data_get(obj, BTN_ID);
70 int arrsize = ARRAY_SIZE(sortbtnids);
71 for (i = 0; i < arrsize; i++) {
72 if (sortbtnids[i] && !strcmp(sortbtnids[i], id)) {
78 if (index == -1 || index == CInfo::SortType())
81 CInfo::SetSortType(index);
82 CCtxPopup::t_OnBtnClicked(obj, ev);
84 Destroy(); //_destroy_ctxpopup(bd);
87 const char* CSortCtxPopup::SortText(int index)
89 return sorttext[index];