result
ShoppingListTab1::OnInitializing(void)
{
	result r = E_SUCCESS;

	pItemContext = new (std::nothrow) ListContextItem();
	pItemContext->Construct();
	pItemContext->AddElement(ID_CNTX_BTN_DELETE, "Delete");

	// Layout setting
	const Form* pForm = dynamic_cast< Form* >(GetParent());
	if (pForm)
	{
		RelativeLayout* pRelativeLayout = dynamic_cast< RelativeLayout* >(pForm->GetLandscapeLayoutN());
		if (pRelativeLayout)
		{
			pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
			pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
			delete pRelativeLayout;
		}
		pRelativeLayout = dynamic_cast< RelativeLayout* >(pForm->GetPortraitLayoutN());
		if (pRelativeLayout)
		{		
			pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
			pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
			delete pRelativeLayout;
		}
	}

	pListview1 = static_cast<ListView*>(GetControl(IDC_LISTVIEW1));
	if(pListview1)
	{
		pListview1->AddListViewItemEventListener(*this);
		pListview1->SetItemProvider(*this);
	}

	theTableLists.SetRowBulder(this);

	GetLists();


	return r;
}
Пример #2
0
result UsersPanel::Construct(const Tizen::Graphics::Rectangle & rect) {
	result r = E_SUCCESS;
	String searchFriendsText;
	_pLetterNav = new HashMap();
	_pLetterNav->Construct(70);

	RelativeLayout layout;
	r = layout.Construct();
	TryCatch(r == E_SUCCESS, , "Failed layout.Construct");

	r = Panel::Construct(layout, rect, GROUP_STYLE_NONE);
	TryCatch(r == E_SUCCESS, , "Failed Panel::Construct");

	_pIUserSelectedListeners = new ArrayList();
	r = _pIUserSelectedListeners->Construct(1);
	TryCatch(r == E_SUCCESS, , "Failed _pIUserSelectedListeners->Construct");

	_pSearchBar = new SearchBar();
	_pSearchBar->Construct(Rectangle(0, 0, rect.width, 90));
	TryCatch(r == E_SUCCESS, , "Failed _pIUserSelectedListeners->Construct");

	VKUApp::GetInstance()->GetAppResource()->GetString(L"IDS_SEARCH_FRIENDS", searchFriendsText);
	_pSearchBar->SetGuideText(searchFriendsText);
	_pSearchBar->AddSearchBarEventListener(*this);
	_pSearchBar->AddTextEventListener(*this);

	_pTableView = new GroupedTableView();
	_pTableView->Construct(Rectangle(0, 0, rect.width, rect.height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL);
	TryCatch(r == E_SUCCESS, , "Failed _pTableView->Construct");
//	r = _pTableView->SetFastScrollIndex(L"abcdefghijklmnopqrstuvwxyzабвгдежзиклмнопрстуфхцчшщ", false);
	TryCatch(r == E_SUCCESS, , "Failed _pTableView->SetFastScrollIndex");
	_pTableView->SetItemProvider(this);
	_pTableView->AddFastScrollListener(*this);
	_pTableView->AddGroupedTableViewItemEventListener(*this);

	r = AddControl(_pSearchBar);
	TryCatch(r == E_SUCCESS, , "Failed AddControl _pSearchBar");
	r = AddControl(_pTableView);
	TryCatch(r == E_SUCCESS, , "Failed AddControl _pTableView");

	layout.SetRelation(*_pSearchBar, this, RECT_EDGE_RELATION_TOP_TO_TOP);
	layout.SetHorizontalFitPolicy(*_pSearchBar, FIT_POLICY_PARENT);

	layout.SetRelation(*_pTableView, _pSearchBar, RECT_EDGE_RELATION_TOP_TO_BOTTOM);
	layout.SetVerticalFitPolicy(*_pTableView, FIT_POLICY_PARENT);
	layout.SetHorizontalFitPolicy(*_pTableView, FIT_POLICY_PARENT);

	_pCurrentModel = null;

	return r;
CATCH:
	AppLogException("UsersPanel::Construct is failed. %s", GetErrorMessage(r));
	return r;
}
Пример #3
0
result
ProjectGiraffeTab4::OnInitializing(void)
{
	result r = E_SUCCESS;

	// Layout setting
	const Form* pForm = dynamic_cast<Form*>(GetParent());
	RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(pForm->GetLandscapeLayoutN());
	pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
	pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
	delete pRelativeLayout;
	pRelativeLayout = dynamic_cast<RelativeLayout*>(pForm->GetPortraitLayoutN());
	pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
	pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
	delete pRelativeLayout;

	User::currentUser()->addListener(this);

	return r;
}
Пример #4
0
result
ProjectGiraffeTab1::OnInitializing(void)
{
	result r = E_SUCCESS;

	// Layout setting
	const Form* pForm = dynamic_cast<Form*>(GetParent());
	Rectangle formBounds = pForm->GetClientAreaBounds();
	RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(pForm->GetLandscapeLayoutN());
	pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
	pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
	delete pRelativeLayout;
	pRelativeLayout = dynamic_cast<RelativeLayout*>(pForm->GetPortraitLayoutN());
	pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
	pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
	delete pRelativeLayout;

	// Create tableView
	_tableView = new TableView();
	_tableView->Construct(Rectangle(0,0,formBounds.width, formBounds.height), \
			true, TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
	_tableView->SetItemProvider(this);
	_tableView->AddTableViewItemEventListener(*this);
	AddControl(*_tableView);


	_items = new (std::nothrow) ArrayList();

	_pValueList = new (std::nothrow) LinkedList();

	_pJsonKeyList = new (std::nothrow) ArrayList();
	_pJsonKeyList->Construct();
	_isArray = 0;
	_loadingPopupThread =  new (std::nothrow) LoadingPopupThread();
	//_loadingPopupThread->Construct();

	return r;
}
result VKUDialogsPanel::OnInitializing(void) {
	result r = E_SUCCESS;

	// Layout setting
	const Form* pForm = dynamic_cast<Form*>(GetParent());
	RelativeLayout* pRelativeLayout =
			dynamic_cast<RelativeLayout*>(pForm->GetLandscapeLayoutN());
	pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
	pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
	delete pRelativeLayout;
	pRelativeLayout =
			dynamic_cast<RelativeLayout*>(pForm->GetPortraitLayoutN());
	pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
	pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
	delete pRelativeLayout;

	pDialogTableView = static_cast<TableView*>(GetControl(IDC_TABLEVIEW_DIALOGS));


	_searchBar = static_cast<SearchBar*>(GetControl(IDC_SEARCHBAR1));
	_searchBar->AddSearchBarEventListener(*pProvider);
	_searchBar->AddTextEventListener(*pProvider);

	Panel * pPullToRefreshBar = dynamic_cast<Panel *>(GetControl(IDC_PANEL_PULL_PROGRESS));

	pProvider->Construct(pDialogTableView);
	pDialogTableView->SetItemProvider(pProvider);
	pDialogTableView->AddTableViewItemEventListener(*pProvider);

	pProvider->LoadData();

	_pullToRefresh.Construct(pDialogTableView, pPullToRefreshBar, this, PULL_TO_REFRESH_DIRECTION_TOP);
	SetPropagatedTouchEventListener(&_pullToRefresh);

	return r;
}