Beispiel #1
0
void
MainForm::ShowAboutPopup() {
	if (__pPopupAbout == null) {
		// lazy loading (not on form initialization)
		__pPopupAbout = new Popup();
		__pPopupAbout->Construct("IDP_ABOUT");
		__pButtonAboutClose = static_cast<Button *>(__pPopupAbout->GetControl("IDC_ABOUT_BUTTON"));
		__pButtonAboutClose->SetActionId(ID_BUTTON_ABOUTCLOSE);
		__pButtonAboutClose->AddActionEventListener(*this);
		EditArea *pEditAreaAbout = static_cast<EditArea *>(__pPopupAbout->GetControl("IDC_ABOUT_EDITAREA"));
		pEditAreaAbout->SetKeypadEnabled(false);
		pEditAreaAbout->SetCursorPosition(0);
	}
	__pPopupAbout->SetShowState(true);
	__pPopupAbout->Show();
}
Beispiel #2
0
bool Information::ShowPopup(Form * parent)
{
	String titleid = L"IDS_FORM_";
	titleid.Append(__type);
	String title = Utils::GetString(titleid);
	//                IDS_INFORMATION_DICTIONARY
	String textid = L"IDS_INFORMATION_";
	textid.Append(__type);
	String text = Utils::GetString(textid);

	__pParentForm = parent;
	result result = Construct(L"IDP_INFORMATION");

	SetTitleText(title);

	__chkNoShowMore = static_cast<CheckButton *> (GetControl("IDC_NOSHOWMORE"));
	if (__chkNoShowMore)
	{
		bool checked = false;
		SetupCheckbox(checked);
		__chkNoShowMore->SetSelected(checked);
	}

	EditArea *peaText = static_cast<EditArea *> (GetControl("IDC_TEXT"));
	if (peaText)
	{
		peaText->SetText(text);
		peaText->SetEnabled(false);
		peaText->SetCursorPosition(0);
	}

	Button *pbtnCancel = static_cast<Button *> (GetControl("IDC_BTN_CANCEL"));
	if (pbtnCancel)
	{
		pbtnCancel->AddActionEventListener(*this);
		pbtnCancel->SetActionId(ID_BTN_CANCEL);
	}

	SetShowState(true);
	Show();
	return result;
}
Beispiel #3
0
void
EditPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
	SceneManager* pSceneManager = SceneManager::GetInstance();
	AppAssert(pSceneManager);

	switch(actionId)
	{
	case 1:
	{
		String	  *tmp_string;
		Boolean	  *tmp_highlight;
		int i;

		if(onHighlightStart == true)
		{
			for(i=0; i<arr_text_element_highlight.GetCount(); i++)
			{
				tmp_highlight = static_cast <Boolean *> (arr_text_element_highlight.GetAt(i));
				tmp_string = static_cast< String *> (arr_text_element.GetAt(i));
				if(tmp_highlight->ToBool() == true)
				{
					popup_edit_string.Append(*tmp_string);
					arr_text_element_highlight.SetAt(new Boolean(false), i);
					end_index = i;
				}


			}

			select_index_edit.x = start_index;
			select_index_edit.y = end_index;
		}

		else
		{
			for(i=select_index_edit.x; i<=select_index_edit.y - select_index_edit.y; i++)
			{
				tmp_string = static_cast< String *> (arr_text_element.GetAt(i));

				popup_edit_string.Append(*tmp_string);

			}
		}

		onHighlightStart = false;


		real_position_end = 0;
	    popup = new Popup;

	        popup->Construct(false, Dimension(600,800));

	        popup->SetPosition(60,30);

	        popup->SetColor(Color(246,246,246,255));



	        Label *label_ori, *label_edit, *label_explain;



	        label_ori = new Label;

	        label_ori->Construct(Rectangle(30,20,100,40), L"원문");

	        popup_ori_area = new EditArea();

	        popup_ori_area->Construct(Rectangle(50, 60, 500, 150),INPUT_STYLE_OVERLAY);

	        popup_ori_area->SetKeypadEnabled(false);

	        popup_ori_area->SetColor(EDIT_STATUS_NORMAL, Color(216,216,216,255));
	        popup_ori_area->SetColor(EDIT_STATUS_PRESSED, Color(216,216,216,255));
	        popup_ori_area->SetColor(EDIT_STATUS_HIGHLIGHTED, Color(216,216,216,255));

	        popup_ori_area->SetText(popup_edit_string);

	        popup->AddControl(popup_ori_area);

	        popup->AddControl(label_ori);



	        label_edit = new Label;

	        label_edit->Construct(Rectangle(30,220,280,40), L"글을 수정해주세요");

	        popup_edit_area = new EditArea();

	        popup_edit_area->Construct(Rectangle(50, 270, 500, 150),INPUT_STYLE_OVERLAY);
	        popup_edit_area->SetFocus();

	        popup_edit_area->SetText(popup_edit_string);
	        popup_edit_area->SetColor(EDIT_STATUS_NORMAL, Color(255,255,255,255));
	        popup_edit_area->SetColor(EDIT_STATUS_PRESSED , Color(255,255,255,255));
	        popup_edit_area->SetColor(EDIT_STATUS_HIGHLIGHTED, Color(255,255,255,255));
	        popup_edit_area->AddKeyEventListener(*this);

	        popup->AddControl(popup_edit_area);

	        popup->AddControl(label_edit);



	        label_explain = new Label;

	        label_explain->Construct(Rectangle(30,430,200,40), L"피드백 설명");

	        popup_explain = new EditArea();

	        popup_explain->Construct(Rectangle(50, 480, 500, 150),INPUT_STYLE_OVERLAY);
	        popup_explain->SetColor(EDIT_STATUS_HIGHLIGHTED, Color(255,255,255,255));
	        popup_explain->SetColor(EDIT_STATUS_PRESSED, Color(255,255,255,255));
	        popup_explain->SetColor(EDIT_STATUS_NORMAL, Color(255,255,255,255));



	        popup->AddControl(popup_explain);

	        popup->AddControl(label_explain);



	        Button* pCloseButton = new Button();

	        pCloseButton->Construct(Rectangle(20, 630, 250, 80), L"Close Popup");

	        pCloseButton->SetActionId(2);

	        pCloseButton->AddActionEventListener(*this);



	        // Adds the button to the popup

	        popup->AddControl(pCloseButton);



	        Button* CompletionButton = new Button();

	        CompletionButton->Construct(Rectangle(20, 630, 250, 80), L"Completion");

	        CompletionButton->SetActionId(3);

	        CompletionButton->AddActionEventListener(*this);

        // Adds the button to the popup
       // popup->AddControl(CompletionButton);





        // 원문의 단어와 첨삭본의 단어의 개수를 구한다.
		arr_ori_word.RemoveAll();
		arr_edit_word.RemoveAll();

        EditWord *tmp_word;
        int tmp_length = 0;
        for(i=start_index; i<=end_index; i++)
        {
			tmp_string = static_cast< String *> (arr_text_element.GetAt(i));
			tmp_word = new EditWord;
			tmp_word->word = *tmp_string;
			tmp_word->start_index = tmp_length;
			AppLog("tmp_word->start_index : %d", tmp_word->start_index);
			tmp_length += tmp_word->word.GetLength();
			tmp_word->end_index = tmp_length;
			arr_ori_word.Add(*tmp_word);
			//arr_text_element_editing_mark.Add(new Integer(NONE));
        }

        edit_area_length = popup_edit_string.GetLength();


        draw_timer.Cancel();
        ShowPopup();


        break;
	}
	case 2:
	{
		int i;
		Integer *tmp_int;
		String *tmp_str;
		Integer *tmp_check;
		Point	*tmp_point;



		Attached_decision();
		SyncText();
		TextCorrecting();


		if(popup_explain->GetTextLength() > 0){
			AppLog("cont %S", popup_explain->GetText().GetPointer());

			arr_memo.SetAt(new String(popup_explain->GetText()), start_index);
		}

		for(i=start_index; i<=end_index; i++)
		{
			//AppLog("cont %d", tmp_string2->GetLength());
			arr_binding_start_and_end.SetAt(new Point(start_index, end_index), i);
		}

		/*EditWord tmp_word;
		for(i = 0; i < arr_ori_word.GetCount(); i++)
		{
			tmp_int = arr_text_element_editing_mark.GetAt(i);
			if(tmp_int == 3)
				AppLog("attach : %S, index : %d", tmp_word.word.GetPointer(), tmp_word.start_index);
		}
		for(i = 0; i < arr_edit_word.GetCount(); i++)
		{
			tmp_int = arr_text_element_editing_mark.GetAt(i);
			if(tmp_int == 3)
				AppLog("attach : %S, index : %d", tmp_word.word.GetPointer(), tmp_word.start_index);
		}*/

		for(i = 0; i < arr_text_element.GetCount(); i++)
		{
			tmp_int = static_cast< Integer *> (arr_text_element_editing_mark.GetAt(i));
			tmp_str = static_cast< String *> (arr_text_element.GetAt(i));
			tmp_check = static_cast< Integer *> (arr_insert_check.GetAt(i));
			tmp_point = static_cast< Point *> (arr_binding_start_and_end.GetAt(i));

			if(tmp_int->value == 3)
				AppLog("attach : %S", tmp_str->GetPointer());
			else if(tmp_int->value == 2)
				AppLog("modify : %S", tmp_str->GetPointer());
			else if(tmp_int->value == 1)
				AppLog("delete : %S", tmp_str->GetPointer());
			/*else if(tmp_bool->GetTrue() == true)
			{
				tmp_str = static_cast< String *> (arr_text_insert.GetAt(i));
				AppLog("insert : %S", tmp_str->GetPointer());
			}*/
		}




		HidePopup();
		popup_edit_string.Clear();
		popup->Destroy();
		break;
	}
	case 10:
	{
	    popup = new Popup;

	    popup->Construct(false, Dimension(600,400));

	    popup->SetPosition(60,500);

	    Button *button = new Button;
	    button->Construct(Rectangle(20,200,260, 150), L"삭제합니다");
	    button->SetActionId(11);
	    button->AddActionEventListener(*this);

	    Button *button2 = new Button;
	    button2->Construct(Rectangle(300,200,260, 150), L"아니오");
	    button2->SetActionId(12);
	    button2->AddActionEventListener(*this);

	    popup->AddControl(button);
	    popup->AddControl(button2);
        ShowPopup();

	}
	break;
	case 11:
	{

		for(int i=select_index_edit.x; i<=select_index_edit.y; i++)
		{

			arr_insert_check.SetAt(new Integer(0), i);
			arr_text_insert.SetAt(new String(" "), i);
			arr_text_element_highlight.SetAt(new Boolean(false), i);
			arr_text_element_editing_mark.SetAt(new Integer(0), i);
			arr_binding_start_and_end.SetAt(new Point(1000,1000), i);
			arr_memo.SetAt(new String("0"), i);
		}
		HidePopup();
		popup->Destroy();
	}
	break;
	case 12:
	{
		HidePopup();
		popup->Destroy();
	}
	break;

	case 90:
	{
		Button *button = new Button;
	    popup = new Popup;
	    AppLog("goood!!!");
	    popup->Construct(true, Dimension(600,800));
	    draw_timer.Cancel();
	    popup->SetPosition(60,60);

	    popup->SetTitleText(L"Ellen Page님의 글");

	    button->Construct(Rectangle(550,200,50,50),"닫");
	    button->SetActionId(91);
	    button->AddActionEventListener(*this);

	    EditArea *eng = new EditArea;

	    eng->Construct(Rectangle(0, 0, 550, 800),INPUT_STYLE_OVERLAY);
	    eng->SetKeypadEnabled(false);
	    eng->SetText(Eng);
	    eng->SetColor(EDIT_STATUS_HIGHLIGHTED, Color(255,255,255,255));
	    eng->SetColor(EDIT_STATUS_PRESSED, Color(255,255,255,255));
	    eng->SetColor(EDIT_STATUS_NORMAL, Color(255,255,255,255));

	    popup->SetColor(Color(255,255,255,255));

	    popup->AddControl(button);
	    popup->AddControl(eng);

	    ShowPopup();
	    break;

	}
	case 91:
	{
		HidePopup();
		popup->Destroy();
		break;
	}
	}
}