本文整理汇总了C++中Header::AddItem方法的典型用法代码示例。如果您正苦于以下问题:C++ Header::AddItem方法的具体用法?C++ Header::AddItem怎么用?C++ Header::AddItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Header
的用法示例。
在下文中一共展示了Header::AddItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitializing
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;
}
示例2: GetHeader
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);
}
示例3: GetHeader
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;
}