Ejemplo n.º 1
0
void DisplayVariableDlg::DoUpdateSize(bool performClean)
{
    if ( m_dragging ) {
        wxRect curect = GetScreenRect();
        curect.SetBottomRight( ::wxGetMousePosition() );
        if ( curect.GetHeight() <= 100 || curect.GetWidth() <= 100 ) {
            if ( performClean ) {
                m_dragging = false;
                if ( m_panelStatusBar->HasCapture() ) {
                    m_panelStatusBar->ReleaseMouse();
                }
                wxSetCursor( wxNullCursor );
            }
            return;
        }

#ifdef __WXMSW__
        wxWindowUpdateLocker locker(clMainFrame::Get());
#endif

        SetSize( curect );
        if ( performClean ) {
            m_dragging = false;
            if ( m_panelStatusBar->HasCapture() ) {
                m_panelStatusBar->ReleaseMouse();
            }
            wxSetCursor( wxNullCursor );
        }
    }
}
Ejemplo n.º 2
0
// Begin 'context help mode'
bool wxContextHelp::BeginContextHelp(wxWindow* win)
{
    if (!win)
        win = wxTheApp->GetTopWindow();
    if (!win)
        return false;

    wxCursor cursor(wxCURSOR_QUESTION_ARROW);
    wxCursor oldCursor = win->GetCursor();
    win->SetCursor(cursor);

#ifdef __WXMAC__
    wxSetCursor(cursor);
#endif

    m_status = false;

#ifdef __WXMOTIF__
    wxPushOrPopEventHandlers(this, win, true);
#else
    win->PushEventHandler(new wxContextHelpEvtHandler(this));
#endif

    win->CaptureMouse();

    EventLoop();

    win->ReleaseMouse();

#ifdef __WXMOTIF__
    wxPushOrPopEventHandlers(this, win, false);
#else
    win->PopEventHandler(true);
#endif

    win->SetCursor(oldCursor);

#ifdef __WXMAC__
    wxSetCursor(wxNullCursor);
#endif

    if (m_status)
    {
        wxPoint pt;
        wxWindow* winAtPtr = wxFindWindowAtPointer(pt);

#if 0
        if (winAtPtr)
        {
            printf("Picked %s (%d)\n", winAtPtr->GetName().c_str(),
                   winAtPtr->GetId());
        }
#endif

        if (winAtPtr)
            DispatchEvent(winAtPtr, pt);
    }

    return true;
}
Ejemplo n.º 3
0
void ScopedBusyCursor::SetManualBusyCursor( BusyCursorType busytype )
{
	switch( busytype )
	{
		case Cursor_NotBusy:	wxSetCursor( wxNullCursor ); break;
		case Cursor_KindaBusy:	wxSetCursor( StockCursors.GetArrowWait() ); break;
		case Cursor_ReallyBusy:	wxSetCursor( *wxHOURGLASS_CURSOR ); break;
	}
}
Ejemplo n.º 4
0
void WebFrame::OnIdle(wxIdleEvent& WXUNUSED(evt))
{
    if(m_browser->IsBusy())
    {
        wxSetCursor(wxCURSOR_ARROWWAIT);
        m_toolbar->EnableTool(m_toolbar_stop->GetId(), true);
    }
    else
    {
        wxSetCursor(wxNullCursor);
        m_toolbar->EnableTool(m_toolbar_stop->GetId(), false);
    }
}
Ejemplo n.º 5
0
void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event)
{
    TreeNode *pNode = GetNode(event);
    bool bExpanding = event.GetEventType() == wxEVT_TREE_ITEM_EXPANDING;

    // expansion might take some time
    wxSetCursor(*wxHOURGLASS_CURSOR);
    wxLogStatus(wxT("Working..."));
    wxYield();  // to give the status line a chance to refresh itself
    m_restoreStatus = true;   // some time later...

    if ( pNode->IsKey() )
    {
        if ( bExpanding )
        {
            // expanding: add subkeys/values
            if ( !pNode->OnExpand() )
                return;
        }
        else
        {
            // collapsing: clean up
            pNode->OnCollapse();
        }
    }
}
Ejemplo n.º 6
0
void CCamFrame::OnInitMenuPopup( wxMenuEvent& event )
{
	// Before anything else let's set Document::Current and DocView::Current properly...
	// Menus will either work on no document or the selected document. So the most useful
	// thing to do is to set Current to Selected.
	Document::GetSelected()->SetCurrent();
	DocView::GetSelected()->SetCurrent();

	wxSetCursor( *wxSTANDARD_CURSOR );

PORTNOTE( "other", "Removed usage of bSysMent from OnInitMenuPopup" )
#if !defined(EXCLUDE_FROM_XARALX)
	if (bSysMenu)
	{
		CMDIFrameWnd::OnInitMenuPopup(pMenu, n, bSysMenu);
		// bug fix 2996 
		if(FullScreenMode)
		{
			pMenu->EnableMenuItem(SC_MOVE,MF_GRAYED);
			pMenu->EnableMenuItem(SC_SIZE,MF_GRAYED);
			pMenu->EnableMenuItem(SC_MAXIMIZE,MF_GRAYED);
		}
	}
	else
#endif
	if( !UpdateMenu( event.GetMenu() ) )
		event.Skip();
}
Ejemplo n.º 7
0
void LLDBTooltip::OnStatusBarLeftDown(wxMouseEvent& event)
{
    m_dragging = true;
#ifndef __WXGTK__
    wxSetCursor(wxCURSOR_SIZING);
#endif
    m_panelStatus->CaptureMouse();
}
Ejemplo n.º 8
0
void RegTreeCtrl::OnIdle(wxIdleEvent& WXUNUSED(event))
{
    if ( m_restoreStatus )
    {
        // restore it after OnItemExpanding()
        wxLogStatus(wxT("Ok"));
        wxSetCursor(*wxSTANDARD_CURSOR);

        m_restoreStatus = false;
    }
}
Ejemplo n.º 9
0
void wxEndBusyCursor()
{
    if (--gs_busyCount > 0)
        return;

    wxSetCursor( gs_savedCursor );
    gs_savedCursor = wxNullCursor;

    if (wxTheApp)
        wxTheApp->ProcessIdle();
}
Ejemplo n.º 10
0
// Set the cursor to the busy cursor for all windows
void wxBeginBusyCursor(const wxCursor *cursor)
{
    if (gs_wxBusyCursorCount++ == 0)
    {
        gMacStoredActiveCursor = gMacCurrentCursor;
        cursor->MacInstall();

        wxSetCursor(*cursor);
    }
    //else: nothing to do, already set
}
Ejemplo n.º 11
0
// Restore cursor to normal
void wxEndBusyCursor()
{
    wxCHECK_RET( gs_wxBusyCursorCount > 0,
        wxT("no matching wxBeginBusyCursor() for wxEndBusyCursor()") );

    if (--gs_wxBusyCursorCount == 0)
    {
        gMacStoredActiveCursor.MacInstall();
        gMacStoredActiveCursor = wxNullCursor;

        wxSetCursor(wxNullCursor);
    }
}
Ejemplo n.º 12
0
void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) )
{
    if (gs_busyCount++ > 0)
        return;

    wxASSERT_MSG( !gs_savedCursor.Ok(),
                  wxT("forgot to call wxEndBusyCursor, will leak memory") );

    gs_savedCursor = g_globalCursor;

    wxSetCursor( wxCursor(wxCURSOR_WATCH) );

    if (wxTheApp)
        wxTheApp->ProcessIdle();
}
Ejemplo n.º 13
0
void CRenderWnd::OnEnter( wxMouseEvent &event )
{
	TRACEUSER( "Luke", _T("OnEnter %p\n"), event.GetEventObject() );
	
//	if( event.GetEventObject() != m_pFrame )
//		return;
	
	wxPoint				pt( event.GetPosition() );
	wxSetCursorEvent	CursorEvent( pt.x, pt.y );
	m_pView->OnSetCursor( CursorEvent );
	if( CursorEvent.HasCursor() )
	{
		wxSetCursor( CursorEvent.GetCursor() );
	}
}
Ejemplo n.º 14
0
/*********************************************************************************************
>	afx_msg void CRenderWnd::OnMouseMove(UINT32, CPoint)

	Author:		Justin_Flude (Xara Group Ltd) <*****@*****.**>
	Created:	ages ago
	Inputs:		Not used.
	Outputs:	-
	Returns:	-
	Purpose:	Passes the mouse message on to the parent CCamView via a call to
				CRenderWnd::PassMsgToParent().
	Errors:		-
	Scope:	    Protected
	SeeAlso:    CRenderWnd::PassMsgToParent(); CCamView::OnMouseMove()

**********************************************************************************************/ 
void CRenderWnd::OnMouseMove( wxMouseEvent &event )
{
	if (m_pView)
		m_pView->OnMouseMove( event );
	
#if defined(__WXGTK__)
	wxSetCursorEvent	CursorEvent( event.m_x, event.m_y );
	OnSetCursor( CursorEvent );
	if( CursorEvent.HasCursor() )
	{
		// The window cursor seems to be ignored, but is needed for
		// CaptureMouse to work
		wxSetCursor( CursorEvent.GetCursor() );
		SetCursor( CursorEvent.GetCursor() );
	}
#endif
}
Ejemplo n.º 15
0
void DisplayVariableDlg::DoCleanUp()
{
    if (m_debugger && m_mainVariableObject.IsEmpty() == false) {
        m_debugger->DeleteVariableObject(m_mainVariableObject);
    }
    m_gdbId2Item.clear();
    m_gdbId2ItemLeaf.clear();
    m_mainVariableObject = wxT("");
    m_variableName = wxT("");
    m_expression = wxT("");
    m_itemOldValue.Clear();
    m_dragging = false;
    m_editDlgIsUp = false;
    if ( m_panelStatusBar->HasCapture() ) {
        m_panelStatusBar->ReleaseMouse();
    }
    wxSetCursor( wxNullCursor );
}
Ejemplo n.º 16
0
void LLDBTooltip::DoUpdateSize(bool performClean)
{
    if(m_dragging) {
        wxRect curect = GetScreenRect();
        curect.SetBottomRight(::wxGetMousePosition());
        if(curect.GetHeight() > 100 && curect.GetWidth() > 100) {
#ifdef __WXMSW__
            wxWindowUpdateLocker locker(EventNotifier::Get()->TopFrame());
#endif
            SetSize(curect);
        }
    }

    if(performClean) {
        m_dragging = false;
        if(m_panelStatus->HasCapture()) {
            m_panelStatus->ReleaseMouse();
        }
#ifndef __WXGTK__
        wxSetCursor(wxNullCursor);
#endif
    }
}
Ejemplo n.º 17
0
void MainWindow::OnLinkTo(wxCommandEvent& event)
{
	if(listWorlds.size()>0)
	{
		int id=event.GetId();
		wxTreeItemId itemId = tree->GetSelection();
		NodeTree *itemData = itemId.IsOk() ? (NodeTree *) tree->GetItemData(itemId):NULL;
		

		if(itemData->pointer.positionableentity)
		{
			simuWorld=itemData->getSimu();
			if (id==ID_LINKTO)
			{
				state=1;
				wxSetCursor(wxCURSOR_POINT_LEFT);
				simuWorld->SetEntityToLink(itemData->pointer.positionableentity);
				wxLogStatus(wxT("Select Item(Link to)"));
				id=NULL;
			}

			if (id==ID_UNLINK)
			{
				if (showLinks==true) tree->EraseMarks(itemData);
				itemData->pointer.positionableentity->LinkTo(NULL); //Deslinkar
				if(GetTreeStructureState()==true) 
				{
					simuWorld->InitializeItemsVectors();
					tree->UpdateTree(simuWorld);
					tree->showTreeStructure(true);
				}
				wxLogStatus(wxT("Unlink done"));
				state=0;
			}
		}


		if (id==ID_SHOWLINKS)
		{
			showLinks=treeToolbar->GetToolState(id);
			if(showLinks) 
			{
				tree->setShowLinks(true);
				treeToolbar->EnableTool(ID_TREESTRUCTURE,false);
			}
			else
			{
				tree->setShowLinks(false);
				treeToolbar->EnableTool(ID_TREESTRUCTURE,true);
			}
		}


		if (id==ID_TREESTRUCTURE)
		{
			treeStruc=treeToolbar->GetToolState(id);
			if(treeStruc)
			{
				tree->showTreeStructure(true);
				treeToolbar->EnableTool(ID_SHOWLINKS,false);
			}
			else
			{
				tree->showTreeStructure(false);
				treeToolbar->EnableTool(ID_SHOWLINKS,true);
			}
		}
	}
}
Ejemplo n.º 18
0
        void SplitterWindow2::setSashCursor() {
			if (dragging() || m_sash->HitTest(m_sash->ScreenToClient(wxGetMousePosition())) != wxHT_WINDOW_OUTSIDE)
				wxSetCursor(sizeCursor());
			else
				wxSetCursor(wxCursor(wxCURSOR_ARROW));
        }
Ejemplo n.º 19
0
void DisplayVariableDlg::OnTipLeftDown(wxMouseEvent& event)
{
    m_dragging = true;
    wxSetCursor( wxCURSOR_SIZENWSE );
    m_panelStatusBar->CaptureMouse();
}