Ejemplo n.º 1
0
void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event)
{
	// Override event
	event.Veto();

	wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject();

	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOG_WINDOW)
		ToggleLogWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOG_CONFIG_WINDOW)
		ToggleLogConfigWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_REGISTER_WINDOW)
		g_pCodeWindow->ToggleRegisterWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_WATCH_WINDOW)
		g_pCodeWindow->ToggleWatchWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_BREAKPOINT_WINDOW)
		g_pCodeWindow->ToggleBreakPointWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_JIT_WINDOW)
		g_pCodeWindow->ToggleJitWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_MEMORY_WINDOW)
		g_pCodeWindow->ToggleMemoryWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_SOUND_WINDOW)
		g_pCodeWindow->ToggleSoundWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_VIDEO_WINDOW)
		g_pCodeWindow->ToggleVideoWindow(false);
}
Ejemplo n.º 2
0
// Notebooks
// ---------------------
void CFrame::ClosePages()
{
	ToggleLogWindow(false);
	ToggleLogConfigWindow(false);
	ToggleConsole(false);
	if (g_pCodeWindow)
	{
		g_pCodeWindow->ToggleCodeWindow(false);
		g_pCodeWindow->ToggleRegisterWindow(false);
		g_pCodeWindow->ToggleBreakPointWindow(false);
		g_pCodeWindow->ToggleMemoryWindow(false);
		g_pCodeWindow->ToggleJitWindow(false);
		g_pCodeWindow->ToggleSoundWindow(false);
		g_pCodeWindow->ToggleVideoWindow(false);
	}
}
Ejemplo n.º 3
0
void CFrame::OnPaneClose(wxAuiManagerEvent& event)
{
	event.Veto();

	wxAuiNotebook * nb = (wxAuiNotebook*)event.pane->window;
	if (!nb) return;

	if (!g_pCodeWindow)
	{
		if (nb->GetPage(0)->GetId() == IDM_LOGWINDOW ||
				nb->GetPage(0)->GetId() == IDM_LOGCONFIGWINDOW ||
				nb->GetPage(0)->GetId() == IDM_CONSOLEWINDOW)
		{
			// Closing a pane containing the logwindow or a console closes both
			SConfig::GetInstance().m_InterfaceConsole = false;
			SConfig::GetInstance().m_InterfaceLogWindow = false;
			SConfig::GetInstance().m_InterfaceLogConfigWindow = false;
			ToggleConsole(false);
			ToggleLogWindow(false);
			ToggleLogConfigWindow(false);
		}
	}
	else
	{
		if (GetNotebookCount() == 1)
		{
			wxMessageBox(_("At least one pane must remain open."),
					_("Notice"), wxOK, this);
		}
		else if (nb->GetPageCount() != 0 && !nb->GetPageText(0).IsSameAs(wxT("<>")))
		{
			wxMessageBox(_("You can't close panes that have pages in them."),
					_("Notice"), wxOK, this);
		}
		else
		{
			// Detach and delete the empty notebook
			event.pane->DestroyOnClose(true);
			m_Mgr->ClosePane(*event.pane);
		}
	}

	m_Mgr->Update();
}
Ejemplo n.º 4
0
void CFrame::OnToggleWindow(wxCommandEvent& event)
{
	bool bShow = GetMenuBar()->IsChecked(event.GetId());

	switch(event.GetId())
	{
		case IDM_LOGWINDOW:
			if (!g_pCodeWindow)
				SConfig::GetInstance().m_InterfaceLogWindow = bShow;
			ToggleLogWindow(bShow);
			break;
		case IDM_LOGCONFIGWINDOW:
			if (!g_pCodeWindow)
				SConfig::GetInstance().m_InterfaceLogConfigWindow = bShow;
			ToggleLogConfigWindow(bShow);
			break;
		case IDM_CONSOLEWINDOW:
			if (!g_pCodeWindow)
				SConfig::GetInstance().m_InterfaceConsole = bShow;
			ToggleConsole(bShow);
			break;
		case IDM_REGISTERWINDOW:
			g_pCodeWindow->ToggleRegisterWindow(bShow);
			break;
		case IDM_BREAKPOINTWINDOW:
			g_pCodeWindow->ToggleBreakPointWindow(bShow);
			break;
		case IDM_MEMORYWINDOW:
			g_pCodeWindow->ToggleMemoryWindow(bShow);
			break;
		case IDM_JITWINDOW:
			g_pCodeWindow->ToggleJitWindow(bShow);
			break;
		case IDM_SOUNDWINDOW:
			g_pCodeWindow->ToggleSoundWindow(bShow);
			break;
		case IDM_VIDEOWINDOW:
			g_pCodeWindow->ToggleVideoWindow(bShow);
			break;
	}
}
Ejemplo n.º 5
0
CFrame::CFrame(wxFrame* parent,
		wxWindowID id,
		const wxString& title,
		const wxPoint& pos,
		const wxSize& size,
		bool _UseDebugger,
		bool _BatchMode,
		bool ShowLogWindow,
		long style)
	: CRenderFrame(parent, id, title, pos, size, style)
	, g_pCodeWindow(NULL), g_NetPlaySetupDiag(NULL), g_CheatsWindow(NULL)
	, m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL)
	, m_GameListCtrl(NULL), m_Panel(NULL)
	, m_RenderFrame(NULL), m_RenderParent(NULL)
	, m_LogWindow(NULL), m_LogConfigWindow(NULL)
	, m_FifoPlayerDlg(NULL), UseDebugger(_UseDebugger)
	, m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false)
	, m_bGameLoading(false)
{
	for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
		bFloatWindow[i] = false;

	if (ShowLogWindow) SConfig::GetInstance().m_InterfaceLogWindow = true;

	// Give it a console early to show potential messages from this onward
	ConsoleListener *Console = LogManager::GetInstance()->GetConsoleListener();
	if (SConfig::GetInstance().m_InterfaceConsole) Console->Open();

	// Start debugging maximized
	if (UseDebugger) this->Maximize(true);
	// Debugger class
	if (UseDebugger)
	{
		g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, IDM_CODEWINDOW);
		LoadIniPerspectives();
		g_pCodeWindow->Load();
	}

	// Create toolbar bitmaps
	InitBitmaps();

	// Give it a status bar
	SetStatusBar(CreateStatusBar(2, wxST_SIZEGRIP, ID_STATUSBAR));
	if (!SConfig::GetInstance().m_InterfaceStatusbar)
		GetStatusBar()->Hide();

	// Give it a menu bar
	CreateMenu();

	// ---------------
	// Main panel
	// This panel is the parent for rendering and it holds the gamelistctrl
	m_Panel = new CPanel(this, IDM_MPANEL);

	m_GameListCtrl = new CGameListCtrl(m_Panel, LIST_CTRL,
			wxDefaultPosition, wxDefaultSize,
			wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT);

	wxBoxSizer *sizerPanel = new wxBoxSizer(wxHORIZONTAL);
	sizerPanel->Add(m_GameListCtrl, 1, wxEXPAND | wxALL);
	m_Panel->SetSizer(sizerPanel);
	// ---------------

	// Manager
	m_Mgr = new wxAuiManager(this, wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);

	m_Mgr->AddPane(m_Panel, wxAuiPaneInfo()
			.Name(_T("Pane 0")).Caption(_T("Pane 0")).PaneBorder(false)
			.CaptionVisible(false).Layer(0).Center().Show());
	if (!g_pCodeWindow)
		m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo()
				.Name(_T("Pane 1")).Caption(_("Logging")).CaptionVisible(true)
				.Layer(0).FloatingSize(wxSize(600, 350)).CloseButton(true).Hide());
	AuiFullscreen = m_Mgr->SavePerspective();

	// Create toolbar
	RecreateToolbar();
	if (!SConfig::GetInstance().m_InterfaceToolbar) DoToggleToolbar(false);

	m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW);
	m_LogWindow->Hide();
	m_LogWindow->Disable();

	g_TASInputDlg = new TASInputDlg(this);
	Movie::SetInputManip(TASManipFunction);

	State::SetOnAfterLoadCallback(OnAfterLoadCallback);

	// Setup perspectives
	if (g_pCodeWindow)
	{
		// Load perspective
		DoLoadPerspective();
	}
	else
	{
		if (SConfig::GetInstance().m_InterfaceLogWindow)
			ToggleLogWindow(true);
		if (SConfig::GetInstance().m_InterfaceLogConfigWindow)
			ToggleLogConfigWindow(true);
		if (SConfig::GetInstance().m_InterfaceConsole)
			ToggleConsole(true);
	}

	// Show window
	Show();

	// Commit
	m_Mgr->Update();

	#ifdef _WIN32
		SetToolTip(wxT(""));
		GetToolTip()->SetAutoPop(25000);
	#endif

	#if defined(HAVE_XRANDR) && HAVE_XRANDR
		m_XRRConfig = new X11Utils::XRRConfiguration(X11Utils::XDisplayFromHandle(GetHandle()),
				X11Utils::XWindowFromHandle(GetHandle()));
	#endif

	// -------------------------
	// Connect event handlers

	m_Mgr->Bind(wxEVT_AUI_RENDER, &CFrame::OnManagerResize, this);
	// ----------

	// Update controls
	UpdateGUI();
}