Beispiel #1
0
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);
	}
}
Beispiel #2
0
void BMCategoriesForm::UpdateState()
{
  ListView * pList = static_cast<ListView *>(GetControl(IDC_LISTVIEW, true));
  pList->UpdateList();

  Header* pHeader = GetHeader();

  ButtonItem buttonItem;
  buttonItem.Construct(BUTTON_ITEM_STYLE_TEXT, ID_EDIT);
  buttonItem.SetText(m_bEditState ? GetString(IDS_DONE): GetString(IDS_EDIT));

  pHeader->SetButton(BUTTON_POSITION_RIGHT, buttonItem);
  Invalidate(true);
}
Beispiel #3
0
result
UserProfileForm::OnInitializing(void)
{
	BaseForm::OnInitializing();

	AppResource* pAppResource = Application::GetInstance()->GetAppResource();
	__pLeftItemBitmap = pAppResource->GetBitmapN(L"facebook_icon1.png");

	ButtonItem  buttonLeftItem;
	buttonLeftItem.Construct(BUTTON_ITEM_STYLE_ICON,NULL);
	buttonLeftItem.SetIcon(BUTTON_ITEM_STATUS_NORMAL, __pLeftItemBitmap);

	Header* pHeader = GetHeader();
	pHeader->SetStyle(HEADER_STYLE_TITLE);
	pHeader->SetButton(BUTTON_POSITION_LEFT, buttonLeftItem);
	pHeader->SetTitleText(L"Your Profile Page");


	result r = E_SUCCESS;

	//Read Access Token

	Registry reg;
	r = reg.Construct(L"/Home/FacebookReg.ini", false );
	String token;
	String section = L"Facebook";
	String entry = L"AccessToken";
	r = reg.GetValue(section, entry , token);
	if(r == E_SUCCESS)
		AppLog("token is %ls",token.GetPointer());
	else
		AppLog("Reading failed: %s", GetErrorMessage(r));
	__accessToken =token;

	String profileurl;
	profileurl.Append(L"https://graph.facebook.com/me?");
	profileurl.Append(L"access_token=");
	profileurl.Append(__accessToken);
	SendRequestGet(profileurl);

	return r;
}