void BaseWordForm::PrepareHeader() { Header *header = GetHeader(); if (header) { if (!__pICHeader) __pICHeader = Utils::GetBitmapN("ic_header.png"); header->SetTitleIcon(__pICHeader); header->RemoveAllButtons(); header->RemoveAllItems(); if (__pContextMenu) { ButtonItem btnMenu; btnMenu.Construct(BUTTON_ITEM_STYLE_ICON, ID_MENU); btnMenu.SetIcon(BUTTON_ITEM_STATUS_NORMAL, Utils::GetBitmapN(L"ic_menu.png")); header->SetButton(BUTTON_POSITION_RIGHT, btnMenu); } // ButtonItem btnAddWord; // btnAddWord.Construct(BUTTON_ITEM_STYLE_ICON, ID_ADD_WORD); // //btnAddWord.SetText(GetString("IDS_ADD_WORD_BUTTON")); // btnAddWord.SetIcon(BUTTON_ITEM_STATUS_NORMAL, Utils::GetBitmap(L"ic_add_word.png")); // HeaderItem headerItem1; // header->SetTitleText("voc4u"); // header->SetButton(BUTTON_POSITION_RIGHT, btnAddWord); // header->PlayWaitingAnimation(HEADER_ANIMATION_POSITION_BUTTON_LEFT); header->SetTitleText("Voc4u"); header->AddActionEventListener(*this); } }
result HeaderForm::OnInitializing(int index) { result r = E_SUCCESS; headerIndex = index; /* * I18N */ String routePlanner = "Routeplanner"; String liveboard = "Liveboard"; AppResource* appRes = Application::GetInstance()->GetAppResource(); appRes->GetString(L"HEADER_ROUTEPLANNER", routePlanner); appRes->GetString(L"HEADER_LIVEBOARD", liveboard); /* * set OrientationListener */ this->SetOrientation(ORIENTATION_AUTOMATIC); this->AddOrientationEventListener(*this); // set header Header* headerObj = this->GetHeader(); headerObj->SetStyle(HEADER_STYLE_SEGMENTED); // Liveboard header HeaderItem liveBoardHeaderItem; liveBoardHeaderItem.Construct(HEADER_ID_LIVEBOARD); liveBoardHeaderItem.SetText(liveboard); liveBoardHeaderItem.SetActionId(this->ACTION_HEADER_ID_LIVEBOARD); // routePlanner header HeaderItem routePlannerHeaderItem; routePlannerHeaderItem.Construct(HEADER_ID_ROUTE_PLANNER); routePlannerHeaderItem.SetText(routePlanner); routePlannerHeaderItem.SetActionId(this->ACTION_HEADER_ID_ROUTE_PLANNER); /* * create HeaderItems */ headerObj->AddItem(routePlannerHeaderItem); headerObj->AddItem(liveBoardHeaderItem); headerObj->SetItemSelected(index); /* * add header action listener */ headerObj->AddActionEventListener(*this); return r; }
void OverlayKeypadForm::OnKeypadOpened(Control& source) { Header* pHeader = GetHeader(); HeaderItem doneItem; HeaderItem cancelItem; doneItem.Construct(ID_BUTTON_DONE); doneItem.SetText("Done"); cancelItem.Construct(ID_BUTTON_CANCEL); cancelItem.SetText("Cancel"); pHeader->SetStyle(HEADER_STYLE_BUTTON); pHeader->AddItem(doneItem); pHeader->AddItem(cancelItem); pHeader->AddActionEventListener(*this); }
result ShoppingListMainForm::OnInitializing(void) { result r = E_SUCCESS; Header* pHeader = GetHeader(); if (pHeader) { pHeader->AddActionEventListener(*this); } SetFormBackEventListener(this); SetFormMenuEventListener(this); pOptionMenu = new (std::nothrow) OptionMenu(); pOptionMenu->Construct(); pOptionMenu->AddItem(L"Add a new list", ID_OPTION_ADD); pOptionMenu->AddActionEventListener(*this); pOptionMenu->SetShowState(false); return r; }
result EventListForm::OnInitializing(void) { result r = E_SUCCESS; Header* pHeader = GetHeader(); AppAssert(pHeader); DateTime today; String formattedString; SystemTime::GetCurrentTime(WALL_TIME, today); __pLocaleCalendar = Tizen::Locales::Calendar::CreateInstanceN(CALENDAR_GREGORIAN); __pLocaleCalendar->SetTime(today); DateTimeFormatter* pDateFormatter = DateTimeFormatter::CreateDateFormatterN(DATE_TIME_STYLE_DEFAULT); String customizedPattern = L"dd MMM yyyy"; pDateFormatter->ApplyPattern(customizedPattern); pDateFormatter->Format(*__pLocaleCalendar, formattedString); HeaderItem headerDaily; headerDaily.Construct(ID_HEADER_DAILY); headerDaily.SetText(L"일"); HeaderItem headerMonthly; headerMonthly.Construct(ID_HEADER_MONTHLY); headerMonthly.SetText(L"월"); pHeader->SetStyle(HEADER_STYLE_SEGMENTED_WITH_TITLE); pHeader->SetTitleText(formattedString); pHeader->AddItem(headerDaily); pHeader->AddItem(headerMonthly); pHeader->AddActionEventListener(*this); Footer* pFooter = GetFooter(); AppAssert(pFooter); pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT); FooterItem footerCreate; footerCreate.Construct(ID_FOOTER_CREATE); footerCreate.SetText(L"일정 생성"); pFooter->AddItem(footerCreate); SetFormBackEventListener(this); pFooter->AddActionEventListener(*this); Tizen::Ui::Controls::Button* pPreviousButton = new (std::nothrow) Button(); pPreviousButton->Construct(Rectangle(0, 0, GetClientAreaBounds().width / 2, 72), L"이전"); pPreviousButton->SetActionId(ID_BUTTON_PREV); pPreviousButton->AddActionEventListener(*this); AddControl(pPreviousButton); Tizen::Ui::Controls::Button* pNextButton = new (std::nothrow) Button(); pNextButton->Construct(Rectangle(GetClientAreaBounds().width / 2, 0, GetClientAreaBounds().width / 2, 72), L"다음"); pNextButton->SetActionId(ID_BUTTON_NEXT); pNextButton->AddActionEventListener(*this); AddControl(pNextButton); __pGroupedListView = new (std::nothrow) GroupedListView(); __pGroupedListView->Construct(Rectangle(0, 72, GetClientAreaBounds().width, GetClientAreaBounds().height - 72), GROUPED_LIST_VIEW_STYLE_INDEXED, true, SCROLL_STYLE_FADE_OUT); __pGroupedListView->SetTextOfEmptyList(L"일정 없음"); __pGroupedListView->SetItemProvider(*this); __pGroupedListView->AddGroupedListViewItemEventListener(*this); __pGroupedListView->SetItemDividerColor(Tizen::Graphics::Color::GetColor(COLOR_ID_BLACK)); AddControl(__pGroupedListView); LocaleManager localeManager; localeManager.Construct(); __timeZone = localeManager.GetSystemTimeZone(); return r; }