コード例 #1
0
	virtual void ShowRightClickMenu( int mx, int my )
	{
		IFacePoserToolWindow *tool = GetSelectedTool();
		if ( !tool )
			return;

		mxWindow *toolw = tool->GetMxWindow();
		if ( !toolw )
			return;

		mxPopupMenu *pop = new mxPopupMenu();
		Assert( pop );

		bool isVisible = toolw->isVisible();
		bool isLocked = tool->IsLocked();

		pop->add( isVisible ? "Hide" : "Show", IDC_TOOL_TOGGLEVISIBILITY );
		pop->add( isLocked ? "Unlock" : "Lock", IDC_TOOL_TOGGLELOCK );

		// Convert click position
		POINT pt;
		pt.x = mx;
		pt.y = my;

		/*
		ClientToScreen( (HWND)getHandle(), &pt );
		ScreenToClient( (HWND)g_MDLViewer->getHandle(), &pt );
		*/

		// Convert coordinate space
		pop->popup( this, pt.x, pt.y );
	}
コード例 #2
0
	virtual int	handleEvent( mxEvent *event )
	{
		int iret = 0;
		switch ( event->event )
		{
		case mxEvent::Action:
			{
				iret = 1;
				switch ( event->action )
				{
				default:
					iret = 0;
					break;
				case IDC_TOOL_TOGGLEVISIBILITY:
					{
						IFacePoserToolWindow *tool = GetSelectedTool();
						if ( tool )
						{
							mxWindow *toolw = tool->GetMxWindow();
							if ( toolw )
							{
								toolw->setVisible( !toolw->isVisible() );
								g_MDLViewer->UpdateWindowMenu();
							}
						}
					}
					break;
				case IDC_TOOL_TOGGLELOCK:
					{
						IFacePoserToolWindow *tool = GetSelectedTool();
						if ( tool )
						{
							tool->ToggleLockedState();
						}
					}
					break;
				}
			}
			break;
		default:
			break;
		}
		if ( iret )
			return iret;
		return BaseClass::handleEvent( event );
	}
コード例 #3
0
void ExternalToolsDialog::OnEventHook(wxCommandEvent& event)
{
    ExternalTool* tool = GetSelectedTool();
    if (tool != NULL)
    {
        tool->SetEvent(m_externalEvents[m_eventHookList->GetSelection()]);
    }
}
コード例 #4
0
void ExternalToolsDialog::OnInitialDirectoryTextBoxChanged(wxCommandEvent& event)
{
    ExternalTool* tool = GetSelectedTool();
    if (tool != NULL)
    {
        tool->SetInitialDirectory(m_initialDirectoryTextBox->GetValue());
    }
}
コード例 #5
0
void ExternalToolsDialog::OnArgumentsTextBoxChanged(wxCommandEvent& event)
{
    ExternalTool* tool = GetSelectedTool();
    if (tool != NULL)
    {
        tool->SetArguments(m_argumentsTextBox->GetValue());
    }
}
コード例 #6
0
void ExternalToolsDialog::OnTitleTextBoxChanged(wxCommandEvent& event)
{

    ExternalTool* tool = GetSelectedTool();

    if (tool != NULL)
    {

        tool->SetTitle(m_titleTextBox->GetValue());
        int selectedItem = m_listBox->GetSelection();

        m_listBox->Delete(selectedItem);
        m_listBox->Insert(tool->GetTitle(), selectedItem);
        m_listBox->SetSelection(selectedItem);

    }

}
コード例 #7
0
	void	HandleWindowSelect( void )
	{
		extern double realtime;
		IFacePoserToolWindow *tool = GetSelectedTool();
		if ( !tool )
			return;

		bool doubleclicked = false;

		double curtime = realtime;
		int clickedItem = getSelectedIndex();

		if ( clickedItem == m_nLastSelected )
		{
			if ( curtime < m_flLastSelectedTime + WINDOW_DOUBLECLICK_TIME )
			{
				doubleclicked = true;
			}
		}

		m_flLastSelectedTime = curtime;
		m_nLastSelected = clickedItem;

		mxWindow *toolw = tool->GetMxWindow();
		if ( !toolw )
			return;

		if ( doubleclicked )
		{
			toolw->setVisible( !toolw->isVisible() );
			m_flLastSelectedTime = -1;
		}

		if ( !toolw->isVisible() )
		{
			return;
		}

		// Move window to front
		HWND wnd = (HWND)tool->GetMxWindow()->getHandle();
		SetFocus( wnd );
		SetWindowPos( wnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
	}