Esempio n. 1
0
// Default activation behaviour - set the focus for the first child
// subwindow found.
void wxFrame::OnActivate(wxActivateEvent& event)
{
    if ( !event.GetActive() )
    {
       // remember the last focused child if it is our child
        m_winLastFocused = FindFocus();

        // so we NULL it out if it's a child from some other frame
        wxWindow *win = m_winLastFocused;
        while ( win )
        {
            if ( win->IsTopLevel() )
            {
                if ( win != this )
                    m_winLastFocused = NULL;

                break;
            }

            win = win->GetParent();
        }

        event.Skip();
    }
    else
    {
        // restore focus to the child which was last focused
        wxWindow *parent = m_winLastFocused
            ? m_winLastFocused->GetParent()
            : NULL;

        if (parent == NULL)
            parent = this;

        wxSetFocusToChild(parent, &m_winLastFocused);

        if (m_frameMenuBar != NULL)
        {
            m_frameMenuBar->MacInstallMenuBar();
        }
        else
        {
            wxFrame *tlf = wxDynamicCast( wxTheApp->GetTopWindow(), wxFrame );
            if (tlf != NULL)
            {
                // Trying top-level frame membar
                if (tlf->GetMenuBar())
                    tlf->GetMenuBar()->MacInstallMenuBar();
            }
        }
    }
}
Esempio n. 2
0
void CBOINCGUIApp::OnActivateApp(wxActivateEvent& event) {
#ifdef __WXMAC__
    // Make sure any modal dialog (such as Attach Wizard) ends up in front.
    if (IsModalDialogDisplayed()) {
        event.Skip();
        return;
    }
#endif

    if (event.GetActive()) {
        if (m_pEventLog && !m_pEventLog->IsIconized()) {
            m_pEventLog->Raise();
        }
        if (m_pFrame) {
            m_pFrame->Raise();
        }
#ifdef __WXMAC__
        ShowInterface();
#endif
    }
    event.Skip();
}
Esempio n. 3
0
void
AppFrame::OnActivate(wxActivateEvent &ev)
{
	if (ev.GetActive()) {
		_mainpanel->get_keyboard().set_enabled (true);
	}
	else {
		_mainpanel->get_keyboard().set_enabled (false);
	}

	ev.Skip();
	
}
Esempio n. 4
0
void wxHtmlHelpFrame::OnActivate(wxActivateEvent& event)
{
    // This saves one mouse click when using the
    // wxHTML for context sensitive help systems
#ifndef __WXGTK__
    // NB: wxActivateEvent is a bit broken in wxGTK
    //     and is sometimes sent when it should not be
    if (event.GetActive() && m_HtmlHelpWin)
        m_HtmlHelpWin->GetHtmlWindow()->SetFocus();
#endif

    event.Skip();
}
Esempio n. 5
0
void CBOINCGUIApp::OnActivateApp(wxActivateEvent& event) {
#ifdef __WXMAC__
    // We don't call Hide() or Show(false) for the main frame
    // under wxCocoa 2.9.5 because it bounces the Dock icon
    // (as in notification.)  We work around this by moving
    // the main window/frame off screen when displaying the
    // CDlgAbout modal dialog while the main window is hidden
    // by CTaskBarIcon::OnAbout().
    if (m_pFrame) {
        if (event.GetActive()) {
            if (!m_bAboutDialogIsOpen) {
                m_pFrame->MoveFrameOnScreen();
            }
        } else {
            m_pFrame->SaveFramePosition();
        }
    }

    // Make sure any modal dialog (such as Attach Wizard) ends up in front.
    if (IsModalDialogDisplayed()) {
        event.Skip();
        return;
    }
#endif

    if (event.GetActive()) {
        if (m_pEventLog && !m_pEventLog->IsIconized()) {
            m_pEventLog->Raise();
        }
        if (m_pFrame) {
            m_pFrame->Raise();
        }
#ifdef __WXMAC__
        ShowInterface();
#endif
    }
    event.Skip();
}
Esempio n. 6
0
// Default activation behaviour - set the focus for the first child
// subwindow found.
void wxFrame::OnActivate(wxActivateEvent& event)
{
    if ( !event.GetActive() )
    {
       // remember the last focused child if it is our child
        m_winLastFocused = FindFocus();

        // so we NULL it out if it's a child from some other frame
        wxWindow *win = m_winLastFocused;
        while ( win )
        {
            if ( win->IsTopLevel() )
            {
                if ( win != this )
                {
                    m_winLastFocused = NULL;
                }

                break;
            }

            win = win->GetParent();
        }

        event.Skip();
    }
    else
    {
        // restore focus to the child which was last focused
        wxWindow *parent = m_winLastFocused ? m_winLastFocused->GetParent()
                                            : NULL;
        if ( !parent )
        {
            parent = this;
        }

        wxSetFocusToChild(parent, &m_winLastFocused);

        if ( m_frameMenuBar != NULL )
        {
            m_frameMenuBar->MacInstallMenuBar() ;
        }
        else if (wxTheApp->GetTopWindow() && wxTheApp->GetTopWindow()->IsKindOf(CLASSINFO(wxFrame)))
        {
            // Trying toplevel frame menbar
            if( ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar() )
                ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar()->MacInstallMenuBar();
         }
    }
}
Esempio n. 7
0
void CodeBlocksApp::OnAppActivate(wxActivateEvent& event)
{
    // allow others to process this event
    event.Skip();

    if (s_Loading)
        return; // still loading; we can't possibly be interested for this event ;)

    Manager *manager = Manager::Get();
    if (!manager || manager->IsAppShuttingDown())
        return;

    // Activation & De-Activation event
    CodeBlocksEvent cbEvent;
    if (event.GetActive())
        cbEvent.SetEventType(cbEVT_APP_ACTIVATED);
    else
        cbEvent.SetEventType(cbEVT_APP_DEACTIVATED);
    Manager::Get()->ProcessEvent(cbEvent);

    if (!event.GetActive())
        return;

    // fix for bug #18007: In batch build mode the following is not needed
    if (  !m_Batch
        && Manager::Get()->GetEditorManager()
        && Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/check_modified_files"), true))
    {
        // for some reason a mouse up event doesn't make it into scintilla (scintilla bug)
        // therefore the workaround is not to directly call the editorManager, but
        // take a detour through an event
        // the bug is when the file has been offered to reload, no matter what answer you
        // give the mouse is in a selecting mode, adding/removing things to it's selection as you
        // move it around
        // so : idEditorManagerCheckFiles, EditorManager::OnCheckForModifiedFiles just exist for this workaround
        wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, idEditorManagerCheckFiles);
        wxPostEvent(Manager::Get()->GetEditorManager(), evt);
        cbProjectManagerUI *prjManUI = m_Frame->GetProjectManagerUI();
        if (prjManUI)
            static_cast<ProjectManagerUI*>(prjManUI)->CheckForExternallyModifiedProjects();
    }
    cbEditor* ed = Manager::Get()->GetEditorManager()
                 ? Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor() : nullptr;
    if (ed)
    {
        // hack for linux: without it, the editor loses the caret every second activate o.O
        Manager::Get()->GetEditorManager()->GetNotebook()->SetFocus();
        ed->GetControl()->SetFocus();
    }
}
Esempio n. 8
0
/* MainWindow::onActivate
 * Called when the window is activated
 *******************************************************************/
void MainWindow::onActivate(wxActivateEvent& e)
{
	if (!e.GetActive() || this->IsBeingDeleted())
	{
		e.Skip();
		return;
	}

	// Get current tab
	wxWindow* page = stc_tabs->GetPage(stc_tabs->GetSelection());

	// If start page is selected, refresh it
	if (page && page->GetName() == "startpage")
	{
		createStartPage(false);
		SetStatusText("", 1);
		SetStatusText("", 2);
	}

	// Check open directory archives for changes on the file system
	panel_archivemanager->checkDirArchives();

	e.Skip();
}
Esempio n. 9
0
void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event)
{
    if ( event.GetActive() )
    {
        // We get WM_ACTIVATE before being restored from iconized state, so we
        // can be still iconized here. In this case, avoid restoring the focus
        // as it doesn't work anyhow and we will do when we're really restored.
        if ( m_iconized )
        {
            event.Skip();
            return;
        }

        // restore focus to the child which was last focused unless one of our
        // children already has it (the frame having focus on itself does not
        // count, if only because this would be always the case for an MDI
        // child frame as the MDI parent sets focus to it before it's
        // activated)
        wxLogTrace(wxT("focus"), wxT("wxTLW %p activated."), m_hWnd);

        wxWindow* const winFocus = FindFocus();
        if ( winFocus == this || !IsDescendant(winFocus) )
            DoRestoreLastFocus();
    }
    else // deactivating
    {
        DoSaveLastFocus();

        wxLogTrace(wxT("focus"),
                   wxT("wxTLW %p deactivated, last focused: %p."),
                   m_hWnd,
                   m_winLastFocused ? GetHwndOf(m_winLastFocused) : NULL);

        event.Skip();
    }
}
Esempio n. 10
0
/* MainWindow::onActivate
 * Called when the window is activated
 *******************************************************************/
void MainWindow::onActivate(wxActivateEvent& e)
{
	if (!e.GetActive() || this->IsBeingDeleted() || App::isExiting())
	{
		e.Skip();
		return;
	}

	// Get current tab
	if (stc_tabs->GetPageCount())
	{
		wxWindow* page = stc_tabs->GetPage(stc_tabs->GetSelection());

		// If start page is selected, refresh it
		if (page && page->GetName() == "startpage")
		{
			createStartPage(false);
			SetStatusText("", 1);
			SetStatusText("", 2);
		}
	}

	e.Skip();
}
Esempio n. 11
0
void EDA_3D_VIEWER::OnActivate( wxActivateEvent &event )
{
    wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnActivate" ) );

    if( m_canvas )
    {
        // Reload data if 3D frame shows a board,
        // because it can be changed since last frame activation
        if( m_canvas->IsReloadRequestPending() )
            m_canvas->Request_refresh();

        // Activates again the focus of the canvas so it will catch mouse and key events
        m_canvas->SetFocus();
    }

    event.Skip();    // required under wxMAC
}
Esempio n. 12
0
void wxPropertySheetDialog::OnActivate(wxActivateEvent& event)
{
#if defined(__SMARTPHONE__)
    // Attempt to focus the choice control: not yet working, but might
    // be a step in the right direction. OnActivate overrides the default
    // handler in toplevel.cpp that sets the focus for the first child of
    // of the dialog (the choicebook).
    if (event.GetActive())
    {
        wxChoicebook* choiceBook = wxDynamicCast(GetBookCtrl(), wxChoicebook);
        if (choiceBook)
            choiceBook->SetFocus();
    }
    else
#endif
        event.Skip();
}
Esempio n. 13
0
File: App.cpp Progetto: brho/xword
// Handle timer starting and stopping logic
void
MyApp::OnActivate(wxActivateEvent & evt)
{
    // MyFrame will NULL this pointer when it is destroyed
    if (m_frame != NULL)
    {
        // The frame will handle starting the timer
        if (! evt.GetActive())
        {
            wxLogDebug(_T("App Deactivate"));
            wxLogDebug(_T("Stopping timer."));
            m_frame->OnAppDeactivate();
        }
    }

    evt.Skip();
}
Esempio n. 14
0
//------------------------------------------------------------------------------
//void OnActivate(wxActivateEvent &event)
//------------------------------------------------------------------------------
void GmatMdiChildFrame::OnActivate(wxActivateEvent &event)
{
   #ifdef DEBUG_ACTIVATE
   MessageInterface::ShowMessage
      (wxT("GmatMdiChildFrame::OnActivate() entered, title='%s', mItemType=%d\n"),
       GetTitle().c_str(), mItemType);
   #endif
   
   // update both edit and animation tools
   #ifdef DEBUG_UPDATE_GUI_ITEM
   MessageInterface::ShowMessage
      (wxT("GmatMdiChildFrame()::OnActivate calling UpdateGuiItem()\n"));
   #endif
   UpdateGuiItem(1, 1);
   
   relativeZOrder = maxZOrder++;
   #ifdef DEBUG_ACTIVATE
   MessageInterface::ShowMessage
      (wxT("GmatMdiChildFrame::OnActivate() setting zOrder for %s to %d, and maxZOrder set to %d\n"),
       GetTitle().c_str(), relativeZOrder, maxZOrder);
   #endif
   event.Skip();
}
Esempio n. 15
0
// --------
// Events
void CFrame::OnActive(wxActivateEvent& event)
{
	if (Core::GetState() == Core::CORE_RUN || Core::GetState() == Core::CORE_PAUSE)
	{
		if (event.GetActive() && event.GetEventObject() == m_RenderFrame)
		{
#ifdef __WXMSW__
			::SetFocus((HWND)m_RenderParent->GetHandle());
#else
			m_RenderParent->SetFocus();
#endif
			
			if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor &&
					Core::GetState() == Core::CORE_RUN)
				m_RenderParent->SetCursor(wxCURSOR_BLANK);
		}
		else
		{
			if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
				m_RenderParent->SetCursor(wxNullCursor);
		}
	}
	event.Skip();
}
Esempio n. 16
0
	void WizardFrame::OnActivate (wxActivateEvent& event)
	{
		Gui->SetActiveFrame (this);
		event.Skip();
	}
Esempio n. 17
0
/*bool CGraphView::LoadDiagramLayout(wxExprDatabase *pdb)
{
	// Clear old graph
	m_diag.DeleteAllShapes();
	
	if(m_pGraphDescriptor==NULL) {
		Refresh(true);
		return true;
	}

	if(!m_diag.SerializeFromDatabase(pdb))
		return false;
	
	// Set up event handlers
	int i,count=m_diag.GetShapeList()->GetCount();
	for(i=0;i<count;i++) {
		wxShape *shape=(wxShape *)(m_diag.GetShapeList()->Item(i)->GetData());
		shape->SetEventHandler(new CGraphEventHandler(shape->GetEventHandler(),shape,m_pGraphDescriptor));
		shape->SetFont(m_fntText);
	}

	
	pdb->BeginFind();
	wxExpr *expr=pdb->FindClauseByFunctor("graphview");
	
	long gw,gh,sx,sy;
	expr->GetAttributeValue("gw",gw);
	expr->GetAttributeValue("gh",gh);
	expr->GetAttributeValue("sx",sx);
	expr->GetAttributeValue("sy",sy);
	
	SetScrollbars(1,1,gw,gh,sx,sy,false);
	Refresh(true);

	return true;
}


bool CGraphView::SaveDiagramLayout(wxExprDatabase *pdb)
{
	int gw,gh,sx,sy;
	GetVirtualSize(&gw,&gh);
	GetViewStart(&sx,&sy);

	pdb->ClearDatabase();
	m_diag.SerializeToDatabase(pdb);

	wxExpr *expr=new wxExpr("graphview");
	expr->AddAttributeValue("gw",(long)gw);
	expr->AddAttributeValue("gh",(long)gh);
	expr->AddAttributeValue("sx",(long)sx);
	expr->AddAttributeValue("sy",(long)sy);
	
	pdb->Append(expr);

	return true;
}
*/
void CGraphView::OnActivate(wxActivateEvent &event)
{
	UpdateCursor();
	event.Skip();
}
void wxCodeCompletionBoxManager::OnAppActivate(wxActivateEvent& event)
{
    event.Skip();
    DestroyCCBox();
}
//****************************************************
void 
myWnd_EditBackground::EvtActivate( wxActivateEvent& evt )
{
	evt.Skip();
}
void EDA_DRAW_PANEL::OnActivate( wxActivateEvent& event )
{
    m_canStartBlock = -1;   // Block Command can't start
    event.Skip();
}
void wxCodeCompletionBoxManager::OnAppActivate(wxActivateEvent& event)
{
    event.Skip();
    CallAfter(&wxCodeCompletionBox::DoDestroy);
}
Esempio n. 22
0
void AudacityProject::OnActivate(wxActivateEvent & event)
{
   SetActiveProject(this);

   event.Skip();
}
Esempio n. 23
0
File: mdi.cpp Progetto: beanhome/dev
void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
{
    event.Skip();
}
Esempio n. 24
0
void CDlgEventLog::OnActivate(wxActivateEvent& event) {
    bool isActive = event.GetActive();
    if (isActive) wxGetApp().SetEventLogWasActive(true);
    event.Skip();
}
Esempio n. 25
0
void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
{
    event.Skip();   // required under wxMAC
}
Esempio n. 26
0
/** OnActivate
  *
  *
  */
void MemoryGrid::OnActivate(wxActivateEvent& event)
{
    SelectLocation(last_address);
    event.Skip();
}
void CodeCompletionManager::OnAppActivated(wxActivateEvent& e)
{
    e.Skip();
}
void CodeCompletionManager::OnAppActivated(wxActivateEvent& e)
{
    e.Skip();
    DoUpdateCompilationDatabase();
}