Example #1
0
bool wxGenericComboCtrl::PerformAction(const wxControlAction& action,
                                       long numArg,
                                       const wxString& strArg)
{
    bool processed = false;
    if ( action == wxACTION_COMBOBOX_POPUP )
    {
        if ( !IsPopupShown() )
        {
            ShowPopup();

            processed = true;
        }
    }
    else if ( action == wxACTION_COMBOBOX_DISMISS )
    {
        if ( IsPopupShown() )
        {
            HidePopup();

            processed = true;
        }
    }

    if ( !processed )
    {
        // pass along
        return wxControl::PerformAction(action, numArg, strArg);
    }

    return true;
}
Example #2
0
void KDialogP::OnAutoHidePopup(void * pParam)
{
	// 停止TIMER
	m_ctAutoHidePopup.StopTimer();
	OnPopupAutoHide();
	// 隐藏POPUP
	HidePopup();
}
Example #3
0
void KDialogP::OnDeactivated()
{
	// EnableScreenDraw处理叠加层显示错误
	EnableScreenDraw(FALSE);
	HidePopup();
	EnableScreenDraw(TRUE);
	OnPopupCancel(NULL);
}
void CGrammarBuilderComplxConDlg::OnMouseMoveDatatblctrlcomplexconcepts(short Button, short Shift, long X, long Y) 
{
	int nFirstVisibleRow,nRow,nRows,nTableTop,nTableLeft,x,y,nWidth,nHeight;
	static float left, top, right, bottom;
	CRect rect;
	BOOL B;
	CString T,strPopupText;
	LPRECT lpRect;
	LPPOINT lpPoint;
	CPoint pt;
	CSize sizeText;
	CWnd* pWnd;
	CDC* pDC;

	lpRect=▭
	lpPoint=&pt;
	if (X>left && X<right && Y>top && Y<bottom) return;  //if mouse still in same region, don't redisplay popup window
	if (m_bPopupVisible) HidePopup();
	pWnd=&m_datatblComplexConcepts;
	pWnd->GetWindowRect(rect);                 //get location of table
	nTableTop=rect.top;                                  //get top of table
	nTableLeft=rect.left;                                //get left side of table
	nFirstVisibleRow=m_datatblComplexConcepts.GetRowSet().GetFirstVisible(paneTop);
	pWnd=&m_recPopup;
	pDC=pWnd->GetDC();
	nRows=m_datatblComplexConcepts.GetRowSet().GetCount();
	for (nRow=nFirstVisibleRow;nRow<nRows;nRow++) 
	{
		B=m_datatblComplexConcepts.GetCellSet().GetItem(nRow,1).GetRect(paneLeftTop,&left,&top,&right,&bottom);  //get concept cell
		if (B)       //if cell is visible
		{
			rect=CRect((int) left, (int) top, (int) right, (int) bottom);
			if (X>left && X<right && Y>top && Y<bottom)      //if mouse over cell
			{
				T=m_datatblComplexConcepts.GetRowSet().GetItem(nRow).GetLabel();
				nRow=_wtoi(T);      //get the concept's true row
				nRow--;
				strPopupText=m_pDoc->GetComplexConceptsSpelloutRuleComment(m_nSyntacticCategory,nRow);  //get this rule's comment
				if (strPopupText.GetLength()>0)
				{
					strPopupText=FormatSamplePopup(strPopupText,&nWidth,&nHeight);  //break text into multiple lines if necessary
					x=(int)left-20;
					if (x+nWidth>700) x=(int)(left-nWidth+100);
					if (x<10) x=10;
					y=(int)bottom+30-nHeight;
					if (y<10) y=10;
					pWnd=&m_recPopup;
					pWnd->MoveWindow(x,y,nWidth,nHeight);
					m_recPopup.SetSel(0,-1);   //delete the previous text
					m_recPopup.SetWindowText(strPopupText);
					pWnd->ShowWindow(SW_SHOW);
					m_bPopupVisible=TRUE;
				}
				return;
			}
		}
	}
}
Example #5
0
void DropDownBase::OnDropButton( wxCommandEvent &WXUNUSED(event))
{
    if (m_popupWin && m_popupWin->m_ignore_popup)
    {
        m_popupWin->m_ignore_popup = false;
        return;
    }

    if (IsPopupShown())
        HidePopup();
    else
        ShowPopup();
}
Example #6
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;
	}
	}
}
Example #7
0
HBOOL KDialogP::DoMessage(HMessage* msg)
{
	HBOOL bRet = false;

	bRet = HDialogBase::DoMessage(msg);

	switch( (HINT)msg->msgtype )
	{
	case VWM_SERVER_UPDATE_TEMPERATURE:
		{
			UpdateTemperature();
		}
		break;

	case VWM_SERVER_UPDATE_TIME:
		{
			OnAutoUpdateTime(NULL);
		}
		break;
	case VWM_SERVER_UPDATE_ITEM_STATUS:
		{
			UpdateHeadDevIcon();
		}
		break;
	case VWM_SERVER_KEY_ROTATE:
		{
			// 更新音量
			if (eKEY_VOL == msg->wParam)
			{
				UpdateVolumeBar();
			}
		}
		break;
	case KMSG_WND_ACTIVE:		// 窗体激活
		{
			// 窗口激活更新Head信息
			UpdateTemperature();
			UpdateVolumeBar();
			UpdateHeadDevIcon();
			OnAutoUpdateTime(NULL);

			if( PT_OKCANCEL == m_uPopupType )
			{
				HidePopup();
				OnPopupCancel(NULL);
			}

			if( m_uThemeMode != GetCurThemeMode() )
			{
				EnableUpdateRect(false);
				ChangeTheme(GetCurThemeMode());
				m_uThemeMode = GetCurThemeMode();
				EnableUpdateRect(true);
			}
			else
			{
				EnableUpdateRect(false);
				ChangePopupStyle();
				EnableUpdateRect(true);
			}
			ClearUpdateRect();

			bRet = true;
		}
		break;
	case WM_WINDOWPOSCHANGED:
		{
			LPWINDOWPOS lpWindowPos = reinterpret_cast<LPWINDOWPOS>(msg->lParam);
			if( NULL != lpWindowPos )
			{
				if( SWP_SHOWWINDOW == (lpWindowPos->flags & SWP_SHOWWINDOW) )
				{
					if( m_uThemeMode != GetCurThemeMode() )
					{
						EnableUpdateRect(false);
						ChangeTheme(GetCurThemeMode());
						m_uThemeMode = GetCurThemeMode();
						EnableUpdateRect(true);

						ClearUpdateRect();
					}
				}
			}
		}
		break;
	case KMSG_LBBUTTONDOWN:		// 按下
		{
			if( TRUE == bRet )
			{
				g_bIsCanDoHardKey = false;
			}
		}
		break;
	case KMSG_LBBUTTONUP:		// 释放按下
		{
			g_bIsCanDoHardKey = true;
		}
		break;
	default:
		break;
	}

	return bRet;
}