Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
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);
}
Exemplo n.º 3
0
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;
}