コード例 #1
0
ファイル: ShareMenu.cpp プロジェクト: SciDev030/badaget
bool
ShareMenu::Initialize(Point loadPoint, String& content, bool isLink)
{
	result r = E_SUCCESS;

	__shareContent.SetCapacity(content.GetCapacity());
	__shareContent = content;

	__isLink = isLink;

	__pBTOppClient = null;

	if((r = Construct(Point(loadPoint), CONTEXT_MENU_STYLE_LIST)) != E_SUCCESS)
	{
		AppLog("ShareMenu create Failed %s", GetErrorMessage(r));
		return false;
	}

	String message, email, bluetooth;
	AppResource *pAppResource = Application::GetInstance()->GetAppResource();

	pAppResource->GetString(L"IDS_MESSAGE", message);
	pAppResource->GetString(L"IDS_EMAIL", email);
	pAppResource->GetString(L"IDS_BLUETOOTH", bluetooth);

	AddItem(message, ID_MESSAGE);
	AddItem(email, ID_EMAIL);
	AddItem(bluetooth, ID_BLUETOOTH);
	AddActionEventListener(*this);

	return true;

}
コード例 #2
0
ファイル: JMChattControl.cpp プロジェクト: JunminLee/Winwin
void JMChattControl::DrawChattDataImage(Canvas* pCanvas, stCHATT_DATA* pChattData)
{
	Rectangle rtTextBox, rtText, rtTime;
	AppResource* pAppResource = Application::GetInstance()->GetAppResource();

	rtTextBox = ChangeRightRectangleToNormal(pChattData->rtElementBox);
	rtTextBox.y = 0;


	if( !pChattData->bISend ) {

		DrawYouPhotoAndName(pCanvas, pChattData, rtTextBox);
		rtTextBox.y += __stScreenInfo.nYouNameHeight;
	}


	DrawElementBackAndTime(pCanvas, pChattData, rtTextBox);

	pChattData->pBitmapImage = pAppResource->GetBitmapN(L"voice_pb1.png");
	AppLog("ffffffffff");
	if( pChattData->pBitmapImage ) {

		rtText = GetImageBoxArea(rtTextBox);

		pCanvas->DrawBitmap(rtText, *pChattData->pBitmapImage );
	}
}
コード例 #3
0
Osp::Ui::Controls::ListItemBase* Form1::CreateItem(int itemIndex, int itemWidth) {

    String text;
    text.Format(100, L"SimpleItem #%d", itemIndex);

	AppResource * res = Application::GetInstance()->GetAppResource();
	Bitmap * pBitmap = res->GetBitmapN(L"itemicon.png",
			                           BITMAP_PIXEL_FORMAT_ARGB8888);

	SimpleItem * pItem = new SimpleItem();

	pItem->Construct(Dimension(itemWidth, 100), LIST_ANNEX_STYLE_DETAILED);
	pItem->SetElement(text, pBitmap);

	ListContextItem* pItemContext = new ListContextItem();
	pItemContext->Construct();
	pItemContext->AddElement(0, "Call");
	pItemContext->AddElement(1, "Send SMS");
	pItemContext->AddElement(2, "Send e-mail");

	pItem->SetContextItem(pItemContext);

	delete pBitmap;

    return pItem;

}
コード例 #4
0
ファイル: CategoryItemForm.cpp プロジェクト: Vizantiec/Bada
bool
CategoryItemForm::Initialize(String t, String d)
{
	TabsForm::Initialize(FORM_STYLE_INDICATOR | FORM_STYLE_TEXT_TAB | FORM_STYLE_TITLE | FORM_STYLE_FOOTER, TabsForm::CATEGORY_TAB);

	SetTitleText(t);
	dir = d;

	AppResource* pAppResource = Application::GetInstance()->GetAppResource();
	__pFooter = TabsForm::GetFooter();
	__pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_ICON);
	__pFooter->AddActionEventListener(*this);
	__pFooter->SetBackButton();
	SetFormBackEventListener(this);

	ButtonItem buttonItem;
	buttonItem.Construct(BUTTON_ITEM_STYLE_TEXT, SOFTKEY_INFO);
	buttonItem.SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pAppResource->GetBitmapN(L"info.png"));
	buttonItem.SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pAppResource->GetBitmapN(L"info_p.png"));
	__pFooter->SetButton(BUTTON_POSITION_LEFT, buttonItem);

	/*SetSoftkeyEnabled(SOFTKEY_1,true);
	SetSoftkeyText(SOFTKEY_1, Helper::GetTraslation("IDS_BACK"));
	SetSoftkeyActionId(SOFTKEY_1, SOFTKEY_BACK);
	AddSoftkeyActionListener(SOFTKEY_1, *this);*/

	return true;
}
コード例 #5
0
ファイル: MainForm.cpp プロジェクト: istvank/MensaDD
result
MainForm::RetrieveMenu(Day day) {
	result r = E_SUCCESS;

	String emptyText;
	AppResource *pAppResource = Application::GetInstance()->GetAppResource();
	pAppResource->GetString("IDS_LOADING", emptyText);
	__pListFood->SetTextOfEmptyList(emptyText);
	__pListFood->RequestRedraw();

	currentDay = day;

	String strReq(L"http://www.studentenwerk-dresden.de/feeds/speiseplan.rss");

	switch (day) {
	case Tomorrow:
		strReq.Append("?tag=morgen");
		break;
	default:
		break;
	}

	__pMenuParser->RetrieveFeed(strReq, *this);

	return r;
}
コード例 #6
0
ファイル: JMChattControl.cpp プロジェクト: JunminLee/Winwin
void JMChattControl::ReDrawFeedback()
{
			AppResource* pAppResource = Application::GetInstance()->GetAppResource();
			feed_back->SetNormalBackgroundBitmap(*pAppResource->GetBitmapN(L"voice_feedback2.png"));
			feed_back->SetPressedBackgroundBitmap(*pAppResource->GetBitmapN(L"voice_feedback2.png"));
			feed_back->Draw();
}
コード例 #7
0
void
CreateProfileForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
	SceneManager* pSceneManager = SceneManager::GetInstance();
	AppAssert(pSceneManager);

	switch (actionId)
	{
	case ID_BUTTON_SAVE:
		if (__pProfileNameEditField->GetText().IsEmpty())
		{
			int doModal;
			MessageBox messageBox;
			String getError, getProfileNameError;
			AppResource * pAppResource = Application::GetInstance()->GetAppResource();
			pAppResource->GetString(IDS_PROFILE_NAME_ERROR, getProfileNameError);
			pAppResource->GetString(IDS_ERROR, getError);
			messageBox.Construct(getError, getProfileNameError, MSGBOX_STYLE_OK, 0);
			messageBox.ShowAndWait(doModal);
		}
		else
		{
			pSceneManager->GoBackward(BackwardSceneTransition());

			ProfileListForm *pProfileListForm = static_cast< ProfileListForm* >(Application::GetInstance()->GetAppFrame()->GetFrame()->GetControl(FORM_LIST));
			if (pProfileListForm != NULL) {
			    long long id;
				DateTime startDateTime, dueDateTime;

			    Tizen::System::SystemTime::GetTicks(id);
				startDateTime.SetValue(__pStartEditDate->GetYear(),
						__pStartEditDate->GetMonth(),
						__pStartEditDate->GetDay(),
						__pStartEditTime->GetHour(),
						__pStartEditTime->GetMinute(),
						0);
				dueDateTime.SetValue(__pDueEditDate->GetYear(),
						__pDueEditDate->GetMonth(),
						__pDueEditDate->GetDay(),
						__pDueEditTime->GetHour(),
						__pDueEditTime->GetMinute(),
						0);
				_profile_t_ profileSave = { id, __pProfileNameEditField->GetText(), startDateTime, dueDateTime, __latitude, __longitude, __pVolumeSlider->GetValue(),
						__pWifiCheckButton->IsSelected()?1:0,
						__pDescriptionEditField->GetText() };

				pProfileListForm->SaveUsingmodeProfile(profileSave);	//Create
			}
		}
		break;
	case ID_LOCATION_BUTTON:
		pSceneManager->GoForward(ForwardSceneTransition(SCENE_LOCATION));
		break;
	default:
		break;
	}
}
コード例 #8
0
bool LiveBoardRequest::validate(){
	AppResource* appRes = Application::GetInstance()->GetAppResource();
	_errors.RemoveAll();
	bool validate = true;
	if(_station == null){
		validate = false;
		String error;
		appRes->GetString(L"ERROR_STATION", error);
		_errors.Add(error);
	}
	return validate;
}
コード例 #9
0
void
ConstellationForm::Update(void) {
	__pConstelList ->RemoveAllItems();
	Osp::Base::Collection::IEnumerator* constNames = SkyCanvas::getConstellations()->GetEnumeratorN();
	String emptyString;
	__pConstelList -> AddItem(&emptyString, &emptyString, null, null, null);
	while (constNames -> MoveNext() == E_SUCCESS) {
		String* constNameAbbr = (String*) constNames -> GetCurrent();
		String constName;
		AppResource* appResource = Application::GetInstance()->GetAppResource();
		appResource->GetString(*constNameAbbr, constName);
		__pConstelList -> AddItem(&constName, &constName, null, null, null);
	}
}
コード例 #10
0
ファイル: MainForm.cpp プロジェクト: istvank/MensaDD
void
MainForm::CreateContextMenuDay(void) {
	String captionToday;
	String captionTomorrow;
	AppResource *pAppResource = Application::GetInstance()->GetAppResource();
	pAppResource->GetString("IDS_TODAY", captionToday);
	pAppResource->GetString("IDS_TOMORROW", captionTomorrow);

	__pContextMenuDay = new ContextMenu();
	__pContextMenuDay->Construct(Point(405, 105), CONTEXT_MENU_STYLE_LIST);
	__pContextMenuDay->AddItem(captionToday, ID_CONTEXT_TODAY);
	__pContextMenuDay->AddItem(captionTomorrow, ID_CONTEXT_TOMORROW);
	__pContextMenuDay->AddActionEventListener(*this);
}
コード例 #11
0
ファイル: MainForm.cpp プロジェクト: istvank/MensaDD
void
MainForm::CreateOptionMenu(void) {
	String captionAbout;
	AppResource *pAppResource = Application::GetInstance()->GetAppResource();
	pAppResource->GetString("IDS_ABOUT", captionAbout);

	__pOptionMenu = new OptionMenu();
	__pOptionMenu->Construct();
	__pOptionMenu->AddItem(captionAbout, ID_OPTIONMENU_ABOUT);
	__pOptionMenu->AddActionEventListener(*this);

	SetOptionkeyActionId(ID_OPTIONMENU);
	AddOptionkeyActionListener(*this);
}
コード例 #12
0
RoundedAvatar::RoundedAvatar(const AvatarType & type, const PlaceholderType & placeholderType) {
	CONSTRUCT(L"RoundedAvatar");
	result r = E_SUCCESS;

	_pUserJson = null;
	pAvatar = null;
	AppResource* pAppResource = VKUApp::GetInstance()->GetAppResource();
	String bitmapName = L"thumbnail_list.png", placeholderBitmapName;

	switch (type) {
	case AVATAR_NORMAL:
		bitmapName = L"thumbnail_list.png";
		break;
	case AVATAR_UNREAD:
		bitmapName = L"thumbnail_list_unread.png";
		break;
	case HEADER_BLUE:
		bitmapName = L"thumbnail_header.png";
		break;
	case BUBBLE_IN:
		bitmapName = L"thumbnail_bubble_in.png";
		break;
	case BUBBLE_OUT:
		bitmapName = L"thumbnail_bubble_out.png";
		break;
	}

	switch (placeholderType) {
	case PLACEHOLDER_USER:
		placeholderBitmapName = L"no_photo_user.png";
		break;

	case PLACEHOLDER_CHAT:
		placeholderBitmapName = L"no_photo_group.png";
		break;
	}

	pAvatarRounding = pAppResource->GetBitmapN(bitmapName, BITMAP_PIXEL_FORMAT_ARGB8888);
	pAvatarPlaceholder = pAppResource->GetBitmapN(placeholderBitmapName, BITMAP_PIXEL_FORMAT_ARGB8888);

	TryCatch(GetLastResult() == E_SUCCESS, r = GetLastResult(), "Failed GetBitmapN thumbnail_grouped_list");

	SetLastResult(r);
	return;
CATCH:
	AppLogException("RoundedAvatar is failed.", GetErrorMessage(r));
	SetLastResult(r);
	return;
}
コード例 #13
0
ファイル: Chatting.cpp プロジェクト: JunminLee/Winwin
void Chatting::CreateChattControl() {
	Rectangle rtCtrl = Rectangle(0, 0, 720, 1124);

	AppResource* pAppResource = Application::GetInstance()->GetAppResource();
	Bitmap* iconImage=pAppResource->GetBitmapN(L"s-face1.png");


	__pChattControl = new JMChattControl();
	__pChattControl->Initialize(rtCtrl, L"IronMan", iconImage, L"TESTMAN",
			iconImage);
	AddControl(*__pChattControl);
	__pChattControl->SetBackgroundColor(Color(240,240,240));
	//Bitmap* strBackImageFile = pAppResource->GetBitmapN(L"tizen.png");
	//__pChattControl->SetBackImage(strBackImageFile);
}
コード例 #14
0
result ItemForm::OnDraw(void) {
	result r = E_SUCCESS;

	Canvas* pCanvas = GetCanvasN();
	Rectangle rt = pCanvas->GetBounds();

	Application * app = Application::GetInstance();
	AppResource * res = app->GetAppResource();
	Bitmap * pBitmap = res->GetBitmapN(L"form_bg.png", BITMAP_PIXEL_FORMAT_ARGB8888);
	pCanvas->DrawBitmap(rt, *pBitmap);
	delete pBitmap;
	delete pCanvas;

	return r;

}
コード例 #15
0
ファイル: HeaderForm.cpp プロジェクト: iRail/BeTrains.Bada
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;
}
コード例 #16
0
ファイル: CommentItem.cpp プロジェクト: JunminLee/Winwin
void
CommentItem::Initialize(String name, String time, String comment, String bitmap_path)
{
	Font font;
    font.Construct(FONT_STYLE_PLAIN, 25);

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

	enriched_text1 = new EnrichedText();
	enriched_text2 = new EnrichedText();
	enriched_text3 = new EnrichedText();

	enriched_text1->Construct(Dimension(400,30));
	enriched_text1->SetTextWrapStyle(TEXT_WRAP_CHARACTER_WRAP);
	enriched_text1->SetTextAbbreviationEnabled(true);

	enriched_text2->Construct(Dimension(500,30));
	enriched_text2->SetTextWrapStyle(TEXT_WRAP_CHARACTER_WRAP);
	enriched_text2->SetTextAbbreviationEnabled(true);

	enriched_text3->Construct(Dimension(150,30));
	enriched_text3->SetTextWrapStyle(TEXT_WRAP_CHARACTER_WRAP);
	enriched_text3->SetTextAbbreviationEnabled(true);

	text_element_name = new TextElement();
	text_element_time = new TextElement();
	text_element_comment = new TextElement();


	text_element_name->Construct(name);
	text_element_time->Construct(time);
	text_element_comment->Construct(comment);

	text_element_name->SetFont(font);
	text_element_time->SetFont(font);
	text_element_time->SetTextColor(Color(200,200,200,255));
	text_element_comment->SetFont(font);

	enriched_text1->Add(*text_element_name);
	enriched_text2->Add(*text_element_comment);
	enriched_text3->Add(*text_element_time);

//	this->RequestRedraw(true);

}
コード例 #17
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;
}
コード例 #18
0
ファイル: MainForm.cpp プロジェクト: istvank/MensaDD
void
MainForm::OnParsingFailure(String &error) {
	String title;
	String text;
	String emptyText;
	AppResource *pAppResource = Application::GetInstance()->GetAppResource();
	pAppResource->GetString("IDS_APPNAME", title);
	pAppResource->GetString("IDS_FAILURE", text);
	pAppResource->GetString("IDS_ERROR", emptyText);

	__pListFood->SetTextOfEmptyList(emptyText);
	__pListFood->RequestRedraw();

	MessageBox *pMessageBox = new MessageBox();
	pMessageBox->Construct(title, text, MSGBOX_STYLE_OK );
	pMessageBox->Show();
	delete pMessageBox;

	StopLoadingAnimation();
}
コード例 #19
0
ファイル: MainForm.cpp プロジェクト: istvank/MensaDD
void
MainForm::CreateLoadingAnimation() {
	AppResource *pAppResource = Application::GetInstance()->GetAppResource();

	Bitmap *pBitmap1 = pAppResource->GetBitmapN("/progressingblue/progressing00.png");
	Bitmap *pBitmap2 = pAppResource->GetBitmapN("/progressingblue/progressing01.png");
	Bitmap *pBitmap3 = pAppResource->GetBitmapN("/progressingblue/progressing02.png");
	Bitmap *pBitmap4 = pAppResource->GetBitmapN("/progressingblue/progressing03.png");
	Bitmap *pBitmap5 = pAppResource->GetBitmapN("/progressingblue/progressing04.png");
	Bitmap *pBitmap6 = pAppResource->GetBitmapN("/progressingblue/progressing05.png");
	Bitmap *pBitmap7 = pAppResource->GetBitmapN("/progressingblue/progressing06.png");
	Bitmap *pBitmap8 = pAppResource->GetBitmapN("/progressingblue/progressing07.png");

	// Create AnimationFrames
	long duration = 500 / 8;
	AnimationFrame *pAniFrame1 = new AnimationFrame(*pBitmap1, duration);
	AnimationFrame *pAniFrame2 = new AnimationFrame(*pBitmap2, duration);
	AnimationFrame *pAniFrame3 = new AnimationFrame(*pBitmap3, duration);
	AnimationFrame *pAniFrame4 = new AnimationFrame(*pBitmap4, duration);
	AnimationFrame *pAniFrame5 = new AnimationFrame(*pBitmap5, duration);
	AnimationFrame *pAniFrame6 = new AnimationFrame(*pBitmap6, duration);
	AnimationFrame *pAniFrame7 = new AnimationFrame(*pBitmap7, duration);
	AnimationFrame *pAniFrame8 = new AnimationFrame(*pBitmap8, duration);

	__animationFrameList.Construct();
	__animationFrameList.Add(*pAniFrame1);
	__animationFrameList.Add(*pAniFrame2);
	__animationFrameList.Add(*pAniFrame3);
	__animationFrameList.Add(*pAniFrame4);
	__animationFrameList.Add(*pAniFrame5);
	__animationFrameList.Add(*pAniFrame6);
	__animationFrameList.Add(*pAniFrame7);
	__animationFrameList.Add(*pAniFrame8);

	__pAnimation = new Animation();
	__pAnimation->Construct(Rectangle(212,372,56,56), __animationFrameList);
	__pAnimation->SetRepeatCount(10000);
	//__pAnimation->AddAnimationEventListener(*this);
	__pAnimation->SetShowState(false);
	AddControl(*__pAnimation);
}
コード例 #20
0
MessageBubble::MessageBubble() {
	CONSTRUCT(L"MessageBubble");

	result r = E_SUCCESS;
	message = null;

	AppResource* pAppResource = VKUApp::GetInstance()->GetAppResource();

	pBubbleIn = pAppResource->GetBitmapN(L"bubble_in.#.png");
	TryCatch(GetLastResult() == E_SUCCESS, r = GetLastResult(), "Failed GetBitmapN bubble_in");

	pBubbleOut = pAppResource->GetBitmapN(L"bubble_out.#.png");
	TryCatch(GetLastResult() == E_SUCCESS, r = GetLastResult(), "Failed GetBitmapN bubble_out");

	SetLastResult(r);
	return;

CATCH:
	AppLogException("$${Function:MessageBubble} is failed.", GetErrorMessage(r));
	return;
}
コード例 #21
0
void
StarForm::Update(Osp::Base::Collection::IList* starsList) {
	__pStarsList ->RemoveAllItems();
	Osp::Base::Collection::IEnumerator* starNames = starsList ->GetEnumeratorN();
	String emptyString;
	__pStarsList -> AddItem(&emptyString, &emptyString, null, null, null);
	while (starNames -> MoveNext() == E_SUCCESS) {
		String starName;
		String* starNameAbbr = (String*) starNames -> GetCurrent();
		String constAcronym;
		String constName;
		String starConstAcronym;
		String greekLetter;

		starNameAbbr -> SubString(0, 3, greekLetter);
		starNameAbbr -> SubString(4, 3, constAcronym);
		starNameAbbr -> SubString(0, 7, starConstAcronym);

		AppResource* appResource = Application::GetInstance()->GetAppResource();
		appResource->GetString(starConstAcronym, starName);
		appResource->GetString(constAcronym, constName);

		starName.Append(" (");
		starName.Append(GetGreek(greekLetter));
		starName.Append(" ");
		starName.Append(constName);
		starName.Append(")");

		Osp::Graphics::Bitmap* bitmapButtonPressed;
		Osp::App::AppResource* pAppResource = Osp::App::Application::GetInstance()->GetAppResource();
		bitmapButtonPressed = pAppResource -> GetBitmapN(L"ButtonPressed.png");

		__pStarsList -> AddItem(&starName, null, bitmapButtonPressed, bitmapButtonPressed, null);

	}
}
コード例 #22
0
ファイル: InfoForm.cpp プロジェクト: Vizantiec/Bada
result
InfoForm::OnInitializing(void)
{
	Rectangle rect = this->GetClientAreaBounds();

	result r = E_SUCCESS;
	TabsForm::OnInitializing();

	AppResource *pAppResource = Application::GetInstance()->GetAppResource();
	Bitmap* _bitmap;

	CategoryList = new CustomList();
	CategoryList->Construct(Rectangle(0, 0, this->GetWidth(), rect.height), CUSTOM_LIST_STYLE_NORMAL);
	CategoryList->SetBackgroundColor(Color(239,239,239));
	CategoryList->AddCustomItemEventListener(*this);

	// Category element format
	pCustomListItemFormat = new CustomListItemFormat();
	pCustomListItemFormat->Construct();
	pCustomListItemFormat->AddElement(LIST_ELEMENT_IMG, Rectangle(Retina::GetInt(5), Retina::GetInt(5), Retina::GetInt(65), Retina::GetInt(65)));
	pCustomListItemFormat->AddElement(LIST_ELEMENT_DESC, Rectangle(Retina::GetInt(75), Retina::GetInt(5), Retina::GetInt(180), Retina::GetInt(120)),
		Retina::GetInt(12), Color(151,151,151), Osp::Ui::Controls::SYSTEM_COLOR_LIST_ITEM_PRESSED_TEXT);

	CreateArray();

	int i=0;
	// Adds an item to the CustomList
	while(__pProducts[i][0]->GetLength() == 12)
	{
		CustomListItem * newItem = new CustomListItem();

		newItem->Construct(Retina::GetInt(75));
		newItem->SetItemFormat(*pCustomListItemFormat);
		int k=0;
		Integer::Parse(*__pProducts[i][1], k);

		switch (k)
		{
			case 451549:
			case 451431:
				newItem->SetElement(LIST_ELEMENT_DESC, Helper::GetTraslation("IDS_SPACESHUFFLE"));
				_bitmap = pAppResource->GetBitmapN(L"Ikonka_512.png");
				break;
			case 53471:
				newItem->SetElement(LIST_ELEMENT_DESC, Helper::GetTraslation("IDS_UCONVERTOR"));
				_bitmap = pAppResource->GetBitmapN(L"uc_icon2.png");
				break;
			case 287131:
			case 287177:
			case 232222:
			case 279563:
				newItem->SetElement(LIST_ELEMENT_DESC, Helper::GetTraslation("IDS_sCalc"));
				_bitmap = pAppResource->GetBitmapN(L"scalc_icon.png");
				break;
		}
		newItem->SetElement(LIST_ELEMENT_IMG, *_bitmap, _bitmap);
		CategoryList->AddItem(*newItem, i);
		i++;
	}

	this->AddControl(*CategoryList);

	return r;
}
コード例 #23
0
ファイル: JMChattControl.cpp プロジェクト: JunminLee/Winwin
void JMChattControl::AddDataFeedback(DateTime timeSend, String contents, bool bIsend, bool bRedraw)
{

	isfeedback = true;
	AppResource* pAppResource = Application::GetInstance()->GetAppResource();

	if( IsChangedDate(timeSend) )
	{

			AddDataDate(timeSend);
	}
	stCHATT_DATA* pChattData = new stCHATT_DATA;
	Color colorText;
	String strText;

	strText.Append(L"\"");
	strText.Append(contents);
	strText.Append(L"\"");
	strText.Append(L" 이 표현좀 읽어줘 ~");

	pChattData->isImage=false;

		pChattData->nDataType = DATA_TYPE_TEXT;

		pChattData->timeSend = timeSend;

		pChattData->bISend = bIsend;

		pChattData->pBitmapImage = null;

		pChattData->pBitmapCapture = null;


		if( bIsend )
			colorText = __stScreenInfo.colorTextI;

		else
			colorText = __stScreenInfo.colorTextYou;


		pChattData->pEnrichedText = StringToEnrichedText(strText, colorText);

		pChattData->rtElementBox.y = __stScreenInfo.nTotalElementHeight + __stScreenInfo.nElementGapY;
		pChattData->rtElementBox.height = pChattData->pEnrichedText->GetHeight() + __stScreenInfo.nTextBoxInsideGap * 2 + 50;
		pChattData->rtElementBox.width = 428;

		if( bIsend )
		{

			pChattData->rtElementBox.x = (pChattData->rtElementBox.width + __stScreenInfo.nTextBoxMarginI) * -1;
		}

		else {

			pChattData->rtElementBox.x = __stScreenInfo.nTextBoxMarginYou;

			pChattData->rtElementBox.y += __stScreenInfo.nYouNameHeight;

			__stScreenInfo.nTotalElementHeight += __stScreenInfo.nYouNameHeight + 100;
		}

		feed_back = new Button();
		feed_back->Construct(Rectangle(pChattData->rtElementBox.x-1, pChattData->rtElementBox.y+ pChattData->rtElementBox.height - 60, 432,  110));
		feed_back->SetNormalBackgroundBitmap(*pAppResource->GetBitmapN(L"voice_feedback1.png"));
		feed_back->SetPressedBackgroundBitmap(*pAppResource->GetBitmapN(L"voice_feedback1.png"));
		AddControl(feed_back);

		__pArrayChattData->Add(*(Object*)pChattData);


		__stScreenInfo.nTotalElementHeight += (pChattData->rtElementBox.height + __stScreenInfo.nElementGapY);

		__stScreenInfo.nViewAreaBottom = __stScreenInfo.nTotalElementHeight;


	if( bRedraw )
		this->RequestRedraw();

}
コード例 #24
0
ファイル: SettingForm.cpp プロジェクト: JunminLee/Winwin
result
SettingForm::OnInitializing(void)
{
	result r = E_SUCCESS;

	// TODO: Add your initialization code here
	FooterItem footerItem[5];
	AppResource* pAppResource = Application::GetInstance()->GetAppResource();

	Image inActivation_Image[5];
	String inActivation_Path[5];

	Image Activation_Image[5];
	String Activation_Path[5];

	for(int i=0; i<5; i++)
	{
		inActivation_Image[i].Construct();
		inActivation_Path[i] = App::GetInstance()->GetAppResourcePath();

		Activation_Image[i].Construct();
		Activation_Path[i] = App::GetInstance()->GetAppResourcePath();
	}

	inActivation_Path[0] += L"screen-density-xhigh/TimeLine_InAct.png";
	Activation_Path[0] += L"screen-density-xhigh/TimeLine_Act.png";

	footerItem[0].Construct(ID_FOOTER_ITEM1);

	footerItem[0].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[0].DecodeN(inActivation_Path[0], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[0].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[0].DecodeN(Activation_Path[0], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[1] += L"screen-density-xhigh/Chatting_InAct.png";
	Activation_Path[1] += L"screen-density-xhigh/Chatting_Act.png";

	footerItem[1].Construct(ID_FOOTER_ITEM2);

	footerItem[1].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[1].DecodeN(inActivation_Path[1], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[1].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[1].DecodeN(Activation_Path[1], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[2] += L"screen-density-xhigh/PartnerList_InAct.png";
	Activation_Path[2] += L"screen-density-xhigh/PartnerList_Act.png";

	footerItem[2].Construct(ID_FOOTER_ITEM3);

	footerItem[2].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[2].DecodeN(inActivation_Path[2], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[2].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[2].DecodeN(Activation_Path[2], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[3] += L"screen-density-xhigh/PartnerResearch_InAct.png";
	Activation_Path[3] += L"screen-density-xhigh/PartnerResearch_Act.png";

	footerItem[3].Construct(ID_FOOTER_ITEM4);

	footerItem[3].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[3].DecodeN(inActivation_Path[3], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[3].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[3].DecodeN(Activation_Path[3], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[4] += L"screen-density-xhigh/Setting_InAct.png";
	Activation_Path[4] += L"screen-density-xhigh/Setting_Act.png";

	footerItem[4].Construct(ID_FOOTER_ITEM5);

	footerItem[4].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	inActivation_Image[4].DecodeN(inActivation_Path[4], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[4].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	Activation_Image[4].DecodeN(Activation_Path[4], BITMAP_PIXEL_FORMAT_ARGB8888));

	Label* pLabel;
	pLabel = new Label();

	pLabel->Construct(Rectangle(0,0,this->GetWidth(),this->GetHeight()),L"");
	AppLog("%d ,,,,%d", this->GetWidth(),this->GetHeight());
	pLabel->SetBackgroundBitmap(*pAppResource->GetBitmapN(L"fakepicture.png"));
	pLabel->Draw();

	AddControl(pLabel);
	Footer* pFooter = GetFooter();
	if (pFooter)
	{
		pFooter->AddActionEventListener(*this);
	}

	pFooter->AddItem(footerItem[0]);
	pFooter->AddItem(footerItem[1]);
	pFooter->AddItem(footerItem[2]);
	pFooter->AddItem(footerItem[3]);
	pFooter->AddItem(footerItem[4]);
	// Setup back event listener
	SetFormBackEventListener(this);

	// Get a button via resource ID

	return r;
}
コード例 #25
0
ファイル: Note.cpp プロジェクト: JunminLee/Winwin
result

Note::OnInitializing(void)

{

	result r = E_SUCCESS;

// TODO: Add your initialization code here



	AppResource* pAppResource = Application::GetInstance()->GetAppResource();

	head = new Panel();

	head->Construct(Rectangle(0, 0, this->GetWidth(), 96));

	head->SetBackgroundColor(Color(0, 181, 238, 255));

	button_note_word = new Button();

	button_note_word->Construct(Rectangle(32, 31, 136, 33));

	button_note_word->SetNormalBackgroundBitmap(
			*pAppResource->GetBitmapN(L"note_word_button.png"));

	button_note_word->AddActionEventListener(*this);

	button_note_word->SetActionId(50);
//
	AppLog("11");
	button_garbage_can = new Button();

	button_garbage_can->Construct(Rectangle(539, 20, 38, 51));

	button_garbage_can->SetNormalBackgroundBitmap(
			*pAppResource->GetBitmapN(L"garbage_can.png"));

	button_garbage_can->AddActionEventListener(*this);

	button_garbage_can->SetActionId(51);

	button_flag = new Button();

	button_flag->Construct(Rectangle(646, 29, 38, 43));

	button_flag->SetNormalBackgroundBitmap(
			*pAppResource->GetBitmapN(L"flag_button.png"));

	button_flag->AddActionEventListener(*this);

	button_flag->SetActionId(52);

	head->AddControl(button_note_word);

	head->AddControl(button_garbage_can);

	head->AddControl(button_flag);

// Setup back event listener

	SetFormBackEventListener(this);

// Get a button via resource ID

	//image_panel->Construct(Rectangle(96,0,this->GetWidth(), 500));
	//image_panel->

	del_check = false;

	word[0] = L"Aove";
	word[1] = L"He can only learn";
	word[2] = L"to love by loving.";
	word[3] = L"bove";
	word[4] = L"ce can only learn";
	word[5] = L"do love by loving.";
	word[6] = L"eove";
	word[7] = L"fe can only learn";
	word[8] = L"go love by loving.";
	word[9] = L"hove";
	word[10] = L"ye can only learn";
	word[11] = L"uo love by loving.";
	word[12] = L"iove";
	word[13] = L"ze can only learn";
	word[14] = L"vo love by loving.";
	word[15] = L"move";
	word[16] = L"le can only learn";
	word[17] = L"po love by loving.";
	word[18] = L"oove";
	word[19] = L"te can only learn";
	word[20] = L"ro love by loving.";
	word[21] = L"dove";
	word[22] = L"se can only learn";
	word[23] = L"ao love by loving.";
	word[24] = L"aove";
	word[25] = L"fe can only learn";
	word[26] = L"jo love by loving.";



    // Creates an instance of SearchBar
	serach_field = new EditField;

	serach_field->Construct(Rectangle(10, 110, this->GetWidth()-20, 50),EDIT_FIELD_STYLE_NORMAL,INPUT_STYLE_OVERLAY );
	serach_field->AddTextEventListener(*this);
	serach_field->SetBackgroundBitmap(EDIT_STATUS_NORMAL, *pAppResource->GetBitmapN(L"search_bar.png"));
	serach_field->SetBackgroundBitmap(EDIT_STATUS_PRESSED, *pAppResource->GetBitmapN(L"search_bar.png"));
	serach_field->SetBackgroundBitmap(EDIT_STATUS_HIGHLIGHTED, *pAppResource->GetBitmapN(L"search_bar.png"));

	TimelineTableView = new TableView();

	TimelineTableView->Construct(
			Rectangle(0, 170, GetClientAreaBounds().width,
					GetClientAreaBounds().height - 96), true,
					TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT  );

	TimelineTableView->SetItemProvider(this);
	//TimelineTableView->SetBackgroundColor(Color(246,246,246,255));

	TimelineTableView->AddTableViewItemEventListener(*this);

	// Adds the TableView to the form


	AddControl(TimelineTableView);


	// Adds the TableView to the form
	AddControl(serach_field);
	AddControl(head);

	result_word_cnt = 27;

	for(int i=0; i<result_word_cnt; i++)
		result_word[i] = word[i];

	return r;

}
コード例 #26
0
result FeedsListItem::Construct(int width, String & title, String & categories, String & about) {
    Dimension dimension = Dimension(width, ITEM_HEIGHT);
    ListAnnexStyle annexStyle = LIST_ANNEX_STYLE_DETAILED;
    int contentWidth = width - ListItemBase::GetAnnexWidth(annexStyle);

    result r = CustomItem::Construct(dimension, annexStyle);

    Application * app = Application::GetInstance();
    AppResource * res = app->GetAppResource();

    pRowIcon = res->GetBitmapN(L"row-icon.png",
                               BITMAP_PIXEL_FORMAT_ARGB8888);

    pRowSeparatorBitmap = res->GetBitmapN(L"separator.png",
                                          BITMAP_PIXEL_FORMAT_ARGB8888);

    Rectangle icoDim = Rectangle(ITEM_LEFT_MARGIN,
                                 0,
                                 ICON_DIMENSION,
                                 ICON_DIMENSION);

    Rectangle titleDim = Rectangle(ITEM_LEFT_MARGIN + ICON_DIMENSION,
                                   0,
                                   contentWidth - ICON_DIMENSION - ITEM_LEFT_MARGIN,
                                   ITEM_HEIGHT / 3);

    Rectangle categoriesDim = Rectangle(titleDim.x,
                                        titleDim.y + titleDim.height,
                                        titleDim.width,
                                        titleDim.height);

    Rectangle aboutDim = Rectangle(categoriesDim.x,
                                   categoriesDim.y + categoriesDim.height,
                                   categoriesDim.width,
                                   categoriesDim.height);

    Rectangle separatorDim = Rectangle(0,
                                       ITEM_HEIGHT - pRowSeparatorBitmap->GetHeight(),
                                       width,
                                       pRowSeparatorBitmap->GetHeight());

    AddElement(titleDim,
               TITLE_ELM_ID,
               title,
               28,
               Color::COLOR_WHITE,
               Color::COLOR_BLACK,
               Color::COLOR_BLACK,
               true);

    AddElement(categoriesDim,
               CATEGORIES_ELM_ID,
               categories,
               22,
               Color::COLOR_GREY,
               Color::COLOR_BLACK,
               Color::COLOR_BLACK,
               true);

    AddElement(aboutDim,
               ABOUT_ELM_ID,
               about,
               18,
               Color::COLOR_GREY,
               Color::COLOR_BLACK,
               Color::COLOR_BLACK,
               true);

    AddElement(separatorDim,
               SEPARATOR_ELM_ID,
               *pRowSeparatorBitmap,
               pRowSeparatorBitmap,
               pRowSeparatorBitmap);

    return r;
}
コード例 #27
0
result MessageDocElement::Construct(const Tizen::Graphics::Rectangle & rect, JsonObject * docObject, int out) {
	result r = E_SUCCESS;

	_pDocObject = docObject->CloneN();

	RelativeLayout layout;
	layout.Construct();

	AppResource* pAppResource = VKUApp::GetInstance()->GetAppResource();

	String docName;
	JsonParseUtils::GetString(*docObject, L"title", docName);

	int size;
	JsonParseUtils::GetInteger(*docObject, L"size", size);

	r = Panel::Construct(layout, rect);
	r = SetSize(Dimension(rect.width, rect.height));

	const String filename = (out == 1) ? L"doc_out.#.png" : L"doc_in.#.png";

	_pBitmap = pAppResource->GetBitmapN(filename);
//	TryCatch(GetLastResult() == E_SUCCESS, r = GetLastResult(), "Failed pAppResource->GetBitmapN");

	_pIcon = new LocalImageView();
	_pIcon->Construct(Rectangle(0, 0, 72, 72), L"icon_document.png");

	r = AddControl(_pIcon);

	Label *docLabel = new Label();
	docLabel->Construct(Rectangle(0, 0, rect.width-72, 35), docName);
	docLabel->SetMargin(0, 0);
	docLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
	docLabel->SetTextConfig(30, LABEL_TEXT_STYLE_BOLD);

	r = AddControl(docLabel);

	Label *sizeLabel = new Label();
	sizeLabel->Construct(Rectangle(0, 0, rect.width-72, 30), GetSizeString(size));
	sizeLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
	sizeLabel->SetTextConfig(25, LABEL_TEXT_STYLE_NORMAL);
	sizeLabel->SetMargin(0, 0);

	r = AddControl(sizeLabel);

	layout.SetRelation(*_pIcon, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
	layout.SetCenterAligned(*_pIcon, CENTER_ALIGN_VERTICAL);
	layout.SetMargin(*_pIcon, 0, 0, 0, 0);

	layout.SetRelation(*docLabel, this, RECT_EDGE_RELATION_TOP_TO_TOP);
	layout.SetRelation(*docLabel, this, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
	layout.SetRelation(*docLabel, _pIcon, RECT_EDGE_RELATION_LEFT_TO_RIGHT);
	layout.SetMargin(*docLabel, 0, 10, 10, 0);
	layout.SetHorizontalFitPolicy(*docLabel, FIT_POLICY_CONTENT);

	layout.SetRelation(*sizeLabel, docLabel, RECT_EDGE_RELATION_TOP_TO_BOTTOM);
	layout.SetRelation(*sizeLabel, _pIcon, RECT_EDGE_RELATION_LEFT_TO_RIGHT);
	layout.SetMargin(*sizeLabel, 0, 10, 5, 0);
	layout.SetHorizontalFitPolicy(*sizeLabel, FIT_POLICY_CONTENT);

	SetSize(Dimension(rect.width, 90));

	SetPropagatedTouchEventListener(this);

	return r;
}
コード例 #28
0
ファイル: EditPanel.cpp プロジェクト: JunminLee/Winwin
result
EditPanel::OnDraw()
{
	int i;
	Rectangle *tmp_rect;
	Rectangle *tmp_rect2;
	String	  *tmp_string;
	Boolean	  *tmp_highlight;
	Integer	  *tmp_int;
	String	  *tmp_insert_str;
	Integer   *tmp_check;
	Point	*tmp_point;
	Font font;
	String	  *tmp_string2;


    font.Construct(FONT_STYLE_PLAIN, 30);

	AppResource* pAppResource = Application::GetInstance()->GetAppResource();

	Canvas *pCanvas = this->GetCanvasN();
	pCanvas->SetFont(font);


	//pCanvas->DrawBitmap(Rectangle(0,0,this->GetWidth(), 855), *(pAppResource->GetBitmapN(L"EditPanel_background.png")));
	//pCanvas->FillRectangle(Color(246,246,246,255), Rectangle(0,0,this->GetWidth(), tmp_client_rect.height-497));
	//pCanvas->FillRectangle(Color(255,255,255,255), Rectangle(0,0,this->GetWidth()-60, tmp_client_rect.height));

	for(i=0; i<arr_text_element.GetCount(); i++)
	{
		tmp_rect = static_cast< Rectangle* > (arr_text_element_rect.GetAt(i));
		tmp_string = static_cast< String *> (arr_text_element.GetAt(i));
		tmp_highlight = static_cast <Boolean *> (arr_text_element_highlight.GetAt(i));
		tmp_int = static_cast< Integer *> (arr_text_element_editing_mark.GetAt(i));
		tmp_check = static_cast< Integer *> (arr_insert_check.GetAt(i));
		tmp_insert_str = static_cast< String *> (arr_text_insert.GetAt(i));
		tmp_point = static_cast< Point *> (arr_binding_start_and_end.GetAt(i));
		tmp_rect2 = static_cast< Rectangle* > (arr_memo_rect.GetAt(i));
		tmp_string2 = static_cast< String *> (arr_memo.GetAt(i));
/*		if(tmp_rect->height < 0 || tmp_rect->y > tmp_client_rect.height-497)
		{

		}
		else*/
		{
			if(tmp_point->x < 1000)
			{
				pCanvas->FillRectangle(Color(255,248,209,255),Rectangle(*tmp_rect));
				if(tmp_string2->GetLength() > 1)
				{

					pCanvas->FillRectangle(Color(240,200,209,255),Rectangle(*tmp_rect2));
				}
			}

			if(tmp_highlight->ToBool() == true)
			{
				pCanvas->DrawText(Point(tmp_rect->x, tmp_rect->y), *tmp_string, Color(0,255,0,150));
			}
			else
			{
				pCanvas->DrawText(Point(tmp_rect->x, tmp_rect->y), *tmp_string);
			}



			if(tmp_int->value == 2)
			{

				pCanvas->FillRectangle(Color(0,187,237,255), Rectangle(tmp_rect->x, tmp_rect->y+15, tmp_rect->width, 5));
				pCanvas->DrawText(Point(tmp_rect->x, tmp_rect->y + tmp_rect->height), *tmp_insert_str, Color(0,187,237,255));

			}
			if(tmp_int->value == 3)
			{
				pCanvas->FillRectangle(Color(0,187,237,200), Rectangle(tmp_rect->x, tmp_rect->y+15, tmp_rect->width, 5));
				//pCanvas->DrawText(Point(tmp_rect->x, tmp_rect->y + tmp_rect->height), *tmp_insert_str, Color(0,255,0,0));
			}
			else if(tmp_int->value == 1)
			{
				pCanvas->FillRectangle(Color(0,187,237,255), Rectangle(tmp_rect->x, tmp_rect->y+15, tmp_rect->width, 5));
			}
			else if(tmp_check->value == 1)
			{
				pCanvas->DrawBitmap(Rectangle(tmp_rect->x-15, tmp_rect->y+15, 30 , 15), *pAppResource->GetBitmapN(L"attach_mark.png"));
				pCanvas->DrawText(Point(tmp_rect->x-(tmp_insert_str->GetLength()/2), tmp_rect->y + tmp_rect->height), *tmp_insert_str, Color(0,255,0,255));
			}
			else if(tmp_check->value == 2)
			{
				pCanvas->DrawBitmap(Rectangle(tmp_rect->x-15, tmp_rect->y+15, 30 , 15), *pAppResource->GetBitmapN(L"attach_mark.png"));
				pCanvas->DrawText(Point(tmp_rect->x-(tmp_insert_str->GetLength()/2), tmp_rect->y + tmp_rect->height), *tmp_insert_str, Color(0,255,0,255));
				tmp_insert_str = static_cast< String *> (arr_text_insert.GetAt(i+1));
				pCanvas->DrawBitmap(Rectangle(tmp_rect->x-15, tmp_rect->y+15, 30 , 15), *pAppResource->GetBitmapN(L"attach_mark.png"));
				pCanvas->DrawText(Point(tmp_rect->x-(tmp_insert_str->GetLength()/2), tmp_rect->y + tmp_rect->height), *tmp_insert_str, Color(0,255,0,255));
			}
			else if(tmp_check->value == 3)
			{
				tmp_insert_str = static_cast< String *> (arr_text_insert.GetAt(i+1));
				pCanvas->DrawBitmap(Rectangle(tmp_rect->x-15, tmp_rect->y+15, 30 , 15), *pAppResource->GetBitmapN(L"attach_mark.png"));
				pCanvas->DrawText(Point(tmp_rect->x-(tmp_insert_str->GetLength()/2), tmp_rect->y + tmp_rect->height), *tmp_insert_str, Color(0,255,0,255));
			}
			pCanvas->DrawRectangle(*tmp_rect);
		}
	}

	if(onHighlightStart == true)
	{
		pCanvas->FillRectangle(Color(100,100,255,255), cur_start_rect);
		pCanvas->FillRectangle(Color(100,100,255,255), cur_end_rect);
	}


}
コード例 #29
0
ファイル: EditPanel.cpp プロジェクト: JunminLee/Winwin
bool
EditPanel::Construct(String content, bool me)
{

	AppResource* pAppResource = Application::GetInstance()->GetAppResource();


	select_index_edit = Point(1000,1000);
	int i;
	int current_y = 0;
	int current_x = 40;
	Rectangle *tmp_rect;
    Dimension		tmp_dim;
    String			tmp_str;
    wchar_t			tmp_char;
	Font font;
    font.Construct(FONT_STYLE_PLAIN, 30);

  //  this->SetBackgroundColor(Color(100,100,100,255));

    ori_word_cnt = 0;
    edt_word_cnt = 0;

    scroll_state = 1;
	str_content = L"이용수 위원장은 협상팀과 함께 지난 4일 출국해 6일 귀국했고 곧바로 7일 브리핑을 하는 셈이다. 큰 틀에서 이미 판 마르바이크 감독과 합의가 이루어진 것으로 예상할 수 있는 대목이다. 판 마르바이크 감독과의 교감이 없었다면 굳이 브리핑을 할 이유가 없으며 다른 후보자들을 두고 조기 귀국할 이유 역시 없기 때문이다. 사실상 판 마르바이크 감독과의 세부적인 조율만을 남겨놓고 있다는 전망이 나오고 있는 이유다. 이미 네덜란드 언론에서도 판 마르바이크 감독이 한국와의 협상이 진행중이라는 보도가 나온 만큼 대한축구협회가 판 마르바이크 감독에게 관심을 보이고 있다는 사실은 더 이상 비밀이 아니다. 7일 열리는 브리핑을 통해 한국 축구대표팀 차기 감독의 윤곽이 드러날지 기대된다.";
	Eng = L"Chairman of the past four days to leave the water six days he returned with the negotiating team and that the briefing is Shem 7 days straight. It is to be expected that the agreement made ​​board director and Marquez already big frame bike passage. Without sympathetic because of the dry plate bike coach no reason to doubt why the briefing dare not leave the other candidates to return home early. The only reason that comes the prospect that detailed coordination and supervision left on the bike virtually dry plate. It is not a secret that there already seems to plate dry bike in Dutch media director for the Football Association as from the reports of the negotiations with South Korea coach underway dry plate is no longer interested in bikes. Briefing paper is expected to be revealed over the seven days of the South Korea national football team will open the outline next coach.";
	bool		start_blank_check = false;

	for(i=0; i<str_content.GetLength(); i++)
	{
		str_content.GetCharAt(i, tmp_char);
		if(tmp_char == ' ' && start_blank_check == false)
		{

		}
		else
		{
			start_blank_check = true;
			tmp_str.Append(tmp_char);
			if(tmp_char == ' ' && (i+1) < str_content.GetLength())
			{
				str_content.GetCharAt(i+1,tmp_char);
				if(tmp_char != ' ')
				{
					font.GetTextExtent(tmp_str, tmp_str.GetLength(), tmp_dim);
					arr_text_element.Add(new String(tmp_str));

					if(current_x + tmp_dim.width > 650)
					{
						current_x = 40;
						current_y += (STRIATION_SPACING);
					}
					arr_text_element_highlight.Add(new Boolean(false));
					arr_text_element_rect.Add(new Rectangle(current_x, current_y, tmp_dim.width ,STRIATION_SPACING/2));
					arr_text_element_editing_mark.Add(new Integer(NONE));
					arr_insert_check.Add(new Integer(0));
					arr_text_insert.Add(new String(""));
					arr_binding_start_and_end.Add(new Point(1000,1000));
					arr_memo_rect.Add(new Rectangle(current_x - 20,current_y + STRIATION_SPACING/2, 40, 40));
					arr_memo.Add(new String("0"));
					current_x += tmp_dim.width;
					ori_word_cnt++;
					tmp_str.Clear();
				}
			}
			else if(i == str_content.GetLength()-1)
			{
				font.GetTextExtent(tmp_str, tmp_str.GetLength(), tmp_dim);
				arr_text_element.Add(new String(tmp_str));

				if(current_x + tmp_dim.width > 650)
				{
					current_x = 70;
					current_y += (STRIATION_SPACING);
				}
				arr_text_element_highlight.Add(new Boolean(false));
				arr_text_element_rect.Add(new Rectangle(current_x, current_y, tmp_dim.width ,STRIATION_SPACING/2));
				arr_memo_rect.Add(new Rectangle(current_x - 20,current_y + STRIATION_SPACING/2, 40, 40));
				arr_text_element_editing_mark.Add(new Integer(NONE));
				arr_insert_check.Add(new Integer(0));
				arr_text_insert.Add(new String("0"));
				arr_binding_start_and_end.Add(new Point(1000,1000));
				arr_memo.Add(new String(0));
				current_x += tmp_dim.width;
				ori_word_cnt++;
				tmp_str.Clear();
			}

		}
	}



	cur_label = new Label;

	cur_label->Construct(Rectangle(65,176,31,19), " ");
	cur_label->SetBackgroundBitmap(*pAppResource->GetBitmapN(L"edit_background_cursor.png"));





	onHighlightStart = false;


    contextMenu = new ContextMenu();
    contextMenu->Construct(Point(50, 50), CONTEXT_MENU_STYLE_GRID, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD );
    contextMenu->SetFocusable(true);
    contextMenu->AddItem(L"첨삭하기", 1);
    contextMenu->AddActionEventListener(*this);

    contextMenu2 = new ContextMenu();
    contextMenu2->Construct(Point(50, 50), CONTEXT_MENU_STYLE_GRID, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD );
    contextMenu2->SetFocusable(true);
    contextMenu2->AddItem(L"첨삭수정", 1);
    contextMenu2->AddItem(L"첨삭삭제", 10);
    contextMenu2->AddActionEventListener(*this);

    onContextMenu = false;


    for(i=0; i<200; i++)
    {
    	plus[i] = 0;
    	minus[i] = 0;
    }

    plus_cnt = 0;
    minus_cnt = 0;


	AppLog("success!");

	Panel::Construct(Rectangle(0,0,650,current_y+50));
	AddControl(contextMenu);
	AddControl(contextMenu2);
	this->AddTouchEventListener(*this);
	//this->AddScrollEventListener(*this);


	draw_timer.Construct(*this);
	return true;
}
コード例 #30
0
ファイル: PartnerListForm.cpp プロジェクト: JunminLee/Winwin
result
PartnerListForm::OnInitializing(void)
{
	result r = E_SUCCESS;




	// TODO: Add your initialization code here
	FooterItem footerItem[5];
	AppResource* pAppResource = Application::GetInstance()->GetAppResource();

	Image inActivation_Image[5];
	String inActivation_Path[5];

	Image Activation_Image[5];
	String Activation_Path[5];

	for(int i=0; i<5; i++)
	{
		inActivation_Image[i].Construct();
		inActivation_Path[i] = App::GetInstance()->GetAppResourcePath();

		Activation_Image[i].Construct();
		Activation_Path[i] = App::GetInstance()->GetAppResourcePath();
	}

	inActivation_Path[0] += L"screen-density-xhigh/TimeLine_InAct.png";
	Activation_Path[0] += L"screen-density-xhigh/TimeLine_Act.png";

	footerItem[0].Construct(ID_FOOTER_ITEM1);

	footerItem[0].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[0].DecodeN(inActivation_Path[0], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[0].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[0].DecodeN(Activation_Path[0], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[1] += L"screen-density-xhigh/Chatting_InAct.png";
	Activation_Path[1] += L"screen-density-xhigh/Chatting_Act.png";

	footerItem[1].Construct(ID_FOOTER_ITEM2);

	footerItem[1].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[1].DecodeN(inActivation_Path[1], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[1].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[1].DecodeN(Activation_Path[1], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[2] += L"screen-density-xhigh/PartnerList_InAct.png";
	Activation_Path[2] += L"screen-density-xhigh/PartnerList_Act.png";

	footerItem[2].Construct(ID_FOOTER_ITEM3);

	footerItem[2].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	inActivation_Image[2].DecodeN(inActivation_Path[2], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[2].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	Activation_Image[2].DecodeN(Activation_Path[2], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[3] += L"screen-density-xhigh/PartnerResearch_InAct.png";
	Activation_Path[3] += L"screen-density-xhigh/PartnerResearch_Act.png";

	footerItem[3].Construct(ID_FOOTER_ITEM4);

	footerItem[3].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[3].DecodeN(inActivation_Path[3], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[3].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[3].DecodeN(Activation_Path[3], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[4] += L"screen-density-xhigh/Setting_InAct.png";
	Activation_Path[4] += L"screen-density-xhigh/Setting_Act.png";

	footerItem[4].Construct(ID_FOOTER_ITEM5);
	footerItem[4].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[4].DecodeN(inActivation_Path[4], BITMAP_PIXEL_FORMAT_ARGB8888));
	footerItem[4].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[4].DecodeN(Activation_Path[4], BITMAP_PIXEL_FORMAT_ARGB8888));


	Footer* pFooter = GetFooter();
	if (pFooter)
	{
		pFooter->AddActionEventListener(*this);
	}


	head = new Panel();

	head->Construct(Rectangle(0,0, this->GetWidth(), 96));
	head->SetBackgroundColor(Color(0,181,238,255));


	head_center = new Button();
	head_center->Construct(Rectangle(257, 32, 206, 40));
	head_center->SetNormalBackgroundBitmap(*(pAppResource->GetBitmapN(L"partnerList2.png")));

	head_left = new Button();
	head_left->Construct(Rectangle(37, 22, 62, 56));
	head_left->SetNormalBackgroundBitmap(*(pAppResource->GetBitmapN(L"friend_plz.png")));
	head_left->SetActionId(ID_LIST_PARTNER_LEFT);
	head_left->AddActionEventListener(*this);


	head_right = new Button();
	head_right->Construct(Rectangle(646, 29, 38, 43));
	head_right->SetNormalBackgroundBitmap(*(pAppResource->GetBitmapN(L"flag_partner.png")));
	head_right->SetActionId(ID_LIST_PARTNER_RIGHT);
	head_right->AddActionEventListener(*this);

	this->AddControl(head);
	this->AddControl(head_center);
	this->AddControl(head_left);
	this->AddControl(head_right);

	pFooter->AddItem(footerItem[0]);
	pFooter->AddItem(footerItem[1]);
	pFooter->AddItem(footerItem[2]);
	pFooter->AddItem(footerItem[3]);
	pFooter->AddItem(footerItem[4]);
	// Setup back event listener
	SetFormBackEventListener(this);
	CreateGroupedListView();


	String check_name;





	p.Initial(L"Black Widow",L"s-face7.png", L"nationalflag.png","한국" , "축구, 배구", L"hobby.png", L"Eng", 3 );
	ArrPartnerItem.Add(p);
	CheckGorupComponent();

	p.Initial(L"Captain Amerian",L"s-face6.png",L"nationalflag.png","한국","축구, 배구", L"hobby.png", L"Eng", 3);
	ArrPartnerItem.Add(p);
	CheckGorupComponent();

	p.Initial(L"Hawk Eye",L"s-face2.png",L"nationalflag.png","한국","독서", L"hobby.png", L"Eng", 3);
	ArrPartnerItem.Add(p);
	CheckGorupComponent();

	p.Initial(L"Hulk",L"s-face5.png",L"nationalflag.png","한국","공부, 토론", L"hobby.png", L"Eng", 3);
	ArrPartnerItem.Add(p);
	CheckGorupComponent();

	p.Initial(L"Iron Man",L"s-face1.png",L"nationalflag.png","한국","랩, 노래", L"hobby.png", L"Eng", 3);
	ArrPartnerItem.Add(p);
	CheckGorupComponent();

	p.Initial(L"Nick Fury",L"s-face4.png",L"nationalflag.png","한국","족구, 테니스", L"hobby.png", L"Eng", 3);
	ArrPartnerItem.Add(p);
	CheckGorupComponent();

	p.Initial(L"Thor",L"s-face3.png",L"nationalflag.png","한국","헬스", L"hobby.png", L"Eng", 3);
	ArrPartnerItem.Add(p);
	CheckGorupComponent();



	return r;
}