Beispiel #1
0
GSFrame::GSFrame(wxWindow* parent, const wxString& title)
	: wxFrame(parent, wxID_ANY, title, g_Conf->GSWindow.WindowPos)
	, m_timer_UpdateTitle( this )
{
	SetIcons( wxGetApp().GetIconBundle() );
	SetBackgroundColour( *wxBLACK );

	wxStaticText* label = new wxStaticText( this, wxID_ANY, _("GS Output is Disabled!") );
	m_id_OutputDisabled = label->GetId();
	label->SetFont( wxFont( 20, wxDEFAULT, wxNORMAL, wxBOLD ) );
	label->SetForegroundColour( *wxWHITE );

	AppStatusEvent_OnSettingsApplied();

	GSPanel* gsPanel = new GSPanel( this );
	gsPanel->Show( !EmuConfig.GS.DisableOutput );
	m_id_gspanel = gsPanel->GetId();

	// TODO -- Implement this GS window status window!  Whee.
	// (main concern is retaining proper client window sizes when closing/re-opening the window).
	//m_statusbar = CreateStatusBar( 2 );

	Connect( wxEVT_CLOSE_WINDOW,	wxCloseEventHandler		(GSFrame::OnCloseWindow) );
	Connect( wxEVT_MOVE,			wxMoveEventHandler		(GSFrame::OnMove) );
	Connect( wxEVT_SIZE,			wxSizeEventHandler		(GSFrame::OnResize) );
	Connect( wxEVT_ACTIVATE,		wxActivateEventHandler	(GSFrame::OnActivate) );

	Connect(m_timer_UpdateTitle.GetId(), wxEVT_TIMER, wxTimerEventHandler(GSFrame::OnUpdateTitle) );
}
Beispiel #2
0
Scrubber::~Scrubber()
{
   if (wxTheApp)
      wxTheApp->Disconnect
      (wxEVT_ACTIVATE_APP,
      wxActivateEventHandler(Scrubber::OnActivateOrDeactivateApp), NULL, this);
}
/*****************************************************
**
**   SimpleChildWindow   ---   Constructor
**
******************************************************/
SimpleChildWindow::SimpleChildWindow( wxFrame *parent, Document *doc, const wxSize &size, const bool ismain )
		: ChildWindow( parent, doc, size, ismain )
{
	view = 0;
	Connect( wxEVT_ACTIVATE, wxActivateEventHandler( SimpleChildWindow::OnActivate ));
	Connect( wxEVT_SIZE, wxSizeEventHandler( SimpleChildWindow::OnSize ));
	Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SimpleChildWindow::OnClose ));
}
OptionsBaseDlg2::~OptionsBaseDlg2()
{
    this->Disconnect(wxEVT_ACTIVATE, wxActivateEventHandler(OptionsBaseDlg2::OnActivate), NULL, this);
    this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsBaseDlg2::OnInitDialog), NULL, this);
    m_okButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsBaseDlg2::OnButtonOK), NULL, this);
    m_cancelButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsBaseDlg2::OnButtonCancel), NULL, this);
    m_applyButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsBaseDlg2::OnButtonApply), NULL, this);
    
}
Beispiel #5
0
StagePreview::StagePreview(MenuBarMaker *menuBarMaker)
    : wxFrame(NULL, wxID_ANY, "Preview", wxDefaultPosition, wxDefaultSize,
              wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BORDER | wxMAXIMIZE_BOX)) {
  menuBarMaker_ = menuBarMaker;
  menusInitialized_ = false;
  fileManager_ = new FileManager();
  listener_ = 0;
  previewGfxManager_ = new GfxManager(resourcePath(), false);
  stageName_ = 0;

#ifdef __WINDOWS__
  SetIcon(wxIcon(resourcePath() + BERRYBOTS_ICO, wxBITMAP_TYPE_ICO));

  // The 8-9 point default font size in Windows is much smaller than Mac/Linux.
  wxFont windowFont = GetFont();
  if (windowFont.GetPointSize() <= 9) {
    SetFont(windowFont.Larger());
  }
#elif __WXGTK__
  SetIcon(wxIcon(resourcePath() + BBICON_128, wxBITMAP_TYPE_PNG));
#endif

  mainPanel_ = new wxPanel(this);
  infoSizer_ = new wxStaticBoxSizer(wxVERTICAL, mainPanel_);
  descSizer_ = new wxStaticBoxSizer(wxVERTICAL, mainPanel_);

  wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
  mainSizer->Add(mainPanel_, 0, wxEXPAND);
  wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL);

  wxImage iconImg;
  iconImg.LoadFile(std::string(resourcePath() + BBICON_128).c_str());
  visualPreview_ = new wxStaticBitmap(mainPanel_, wxID_ANY, wxBitmap(iconImg));
  topSizer->Add(visualPreview_, 0, wxALIGN_CENTER);
  topSizer->AddSpacer(8);

  wxBoxSizer *rowSizer = new wxBoxSizer(wxHORIZONTAL);
  rowSizer->Add(infoSizer_, 0, wxEXPAND);
  rowSizer->AddSpacer(4);
  rowSizer->Add(descSizer_, 1, wxEXPAND);
  topSizer->Add(rowSizer, 0, wxEXPAND);

  wxBoxSizer *borderSizer = new wxBoxSizer(wxVERTICAL);
  borderSizer->Add(topSizer, 0, wxALL | wxEXPAND, 12);
  mainPanel_->SetSizerAndFit(borderSizer);
  SetSizerAndFit(mainSizer);

  Connect(this->GetId(), wxEVT_ACTIVATE,
          wxActivateEventHandler(StagePreview::onActivate));
  Connect(this->GetId(), wxEVT_CLOSE_WINDOW,
          wxCommandEventHandler(StagePreview::onClose));

  eventFilter_ = new PreviewEventFilter(this);
  this->GetEventHandler()->AddFilter(eventFilter_);
}
OptionsBaseDlg2::OptionsBaseDlg2(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxDialog(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCrafterx2PVqnInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(mainSizer);
    
    wxBoxSizer* innerSizer = new wxBoxSizer(wxHORIZONTAL);
    
    mainSizer->Add(innerSizer, 1, wxEXPAND, 5);
    
    m_treeBook = new wxTreebook(this, wxID_ANY, wxDefaultPosition, wxSize(500,400), wxBK_DEFAULT);
    m_treeBook->SetFocus();
    
    innerSizer->Add(m_treeBook, 1, wxALL|wxEXPAND, 5);
    
    wxBoxSizer* btnSizer = new wxBoxSizer(wxHORIZONTAL);
    
    mainSizer->Add(btnSizer, 0, wxALL|wxALIGN_CENTER, 10);
    
    m_okButton = new wxButton(this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_okButton->SetDefault();
    
    btnSizer->Add(m_okButton, 0, wxALL|wxALIGN_RIGHT, 5);
    
    m_cancelButton = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    btnSizer->Add(m_cancelButton, 0, wxALL|wxALIGN_RIGHT, 5);
    
    m_applyButton = new wxButton(this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    btnSizer->Add(m_applyButton, 0, wxALL|wxALIGN_RIGHT, 5);
    
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    Centre(wxBOTH);
    // Connect events
    this->Connect(wxEVT_ACTIVATE, wxActivateEventHandler(OptionsBaseDlg2::OnActivate), NULL, this);
    this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsBaseDlg2::OnInitDialog), NULL, this);
    m_okButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsBaseDlg2::OnButtonOK), NULL, this);
    m_cancelButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsBaseDlg2::OnButtonCancel), NULL, this);
    m_applyButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(OptionsBaseDlg2::OnButtonApply), NULL, this);
    
}
Beispiel #7
0
/** ~MemoryGrid
  *
  * Destructor
  */
 MemoryGrid::~MemoryGrid()
{
    Disconnect(MemoryMenuBreakpoint, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnBreakpoint));
    Disconnect(MemoryMenuTemppoint, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnTemppoint));
    Disconnect(MemoryMenuWatchpoint, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnWatchpoint));
    Disconnect(MemoryMenuBlackbox, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnBlackbox));
    Disconnect(MemoryMenuAdvancedpoint, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnAdvancedpoint));
    Disconnect(MemoryMenuPCHere, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnPCHere));
    Disconnect(wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler(MemoryGrid::OnContextMenu), NULL, this);
    Disconnect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(MemoryGrid::OnGridChanged), NULL, this);
    Disconnect(wxEVT_ACTIVATE, wxActivateEventHandler(MemoryGrid::OnActivate), NULL, this);
    GetGridWindow()->Disconnect(wxEVT_MOTION, wxMouseEventHandler(MemoryGrid::OnMotion), NULL, this);
    Disconnect(MemoryToolTipTimer, wxEVT_TIMER, wxTimerEventHandler(MemoryGrid::OnShowToolTip), NULL, this);
}
/// \brief Clean up any resources being used.
MyFrame4::~MyFrame4()
{
    // Disconnect Events
    this->Disconnect( wxEVT_ACTIVATE, wxActivateEventHandler( MyFrame4::MyFrame4OnActivate ) );
    m_grid1->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( MyFrame4::m_grid1OnGridSelectCell ), NULL, this );
    m_comboBox1->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MyFrame4::m_comboBox1OnCombobox ), NULL, this );
    m_comboBox2->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MyFrame4::m_comboBox2OnCombobox ), NULL, this );
    m_comboBox3->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MyFrame4::m_comboBox3OnCombobox ), NULL, this );
    m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button2OnButtonClick ), NULL, this );
    m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button3OnButtonClick ), NULL, this );
    m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button4OnButtonClick ), NULL, this );
    m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button1OnButtonClick ), NULL, this );
    m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button5OnButtonClick ), NULL, this );

}
/// \brief Clean up any resources being used.
MyFrame2::~MyFrame2()
{
	// Disconnect Events
	this->Disconnect( wxEVT_ACTIVATE, wxActivateEventHandler( MyFrame2::MyFrame2OnActivate ) );
	m_grid1->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( MyFrame2::m_grid1OnGridSelectCell ), NULL, this );
	m_textCtrl1->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MyFrame2::m_textCtrl1OnText ), NULL, this );
	m_textCtrl2->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MyFrame2::m_textCtrl2OnText ), NULL, this );
	m_textCtrl3->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MyFrame2::m_textCtrl3OnText ), NULL, this );
	m_textCtrl4->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MyFrame2::m_textCtrl4OnText ), NULL, this );
	m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button2OnButtonClick ), NULL, this );
	m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button3OnButtonClick ), NULL, this );
	m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button4OnButtonClick ), NULL, this );
	m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button1OnButtonClick ), NULL, this );
	m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button5OnButtonClick ), NULL, this );

}
/*****************************************************
**
**   ChildWindow   ---   Constructor
**
******************************************************/
ChildWindow::ChildWindow( wxFrame *parent, Document *document, const wxSize &size, const bool ismain )
		: wxFrame( parent, -1, wxT( "childwindow" ), wxDefaultPosition, size ), doc( document )
{
	isvalid = true;
	ismainwindow = false;
	showEphemFileWarning = false;
	setMainWindow( ismain );
	if ( doc && ! ismain ) doc->addChildWindow( this );
	SetMinSize( wxSize( 200, 200 ));

	Connect( wxEVT_ACTIVATE, wxActivateEventHandler( ChildWindow::OnActivate ));
	Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( ChildWindow::OnMouseWheelEvent ));
	Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ChildWindow::OnClose ));
	Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( ChildWindow::OnKeyDown ));
	Connect( wxEVT_CHAR, wxKeyEventHandler( ChildWindow::OnChar ));
	Connect( wxID_ANY, SHOW_EPHEM_FILE_WARNING, wxCommandEventHandler( ChildWindow::OnEphemFileWarning ));
	Connect( CMD_CHILD_FIRST+1, CMD_CHILD_GRAPHIC_STYLE+100, wxCommandEventHandler( ChildWindow::OnCommand ));
}
Beispiel #11
0
Scrubber::Scrubber(AudacityProject *project)
   : mScrubToken(-1)
   , mScrubStartClockTimeMillis(-1)
   , mScrubHasFocus(false)
   , mScrubSpeedDisplayCountdown(0)
   , mScrubStartPosition(-1)
   , mMaxScrubSpeed(-1.0)
   , mScrubSeekPress(false)
#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
   , mSmoothScrollingScrub(false)
   , mLogMaxScrubSpeed(0)
#endif

   , mProject(project)
{
   if (wxTheApp)
      wxTheApp->Connect
      (wxEVT_ACTIVATE_APP,
      wxActivateEventHandler(Scrubber::OnActivateOrDeactivateApp), NULL, this);
}
Beispiel #12
0
/** MemoryGrid
  *
  * Constructor
  */
MemoryGrid::MemoryGrid(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style) :
wxGrid(parent, id, pos, size, style), timer(this, MemoryToolTipTimer)
{
    last_address = 0x3000;
    highlight = true;
    SetUseNativeColLabels();
    SetDefaultRowSize(12);

    Connect(MemoryMenuBreakpoint, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnBreakpoint));
    Connect(MemoryMenuTemppoint, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnTemppoint));
    Connect(MemoryMenuWatchpoint, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnWatchpoint));
    Connect(MemoryMenuBlackbox, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnBlackbox));
    Connect(MemoryMenuAdvancedpoint, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnAdvancedpoint));
    Connect(MemoryMenuPCHere, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemoryGrid::OnPCHere));
    Connect(wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler(MemoryGrid::OnContextMenu), NULL, this);
    Connect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(MemoryGrid::OnGridChanged), NULL, this);
    Connect(wxEVT_ACTIVATE, wxActivateEventHandler(MemoryGrid::OnActivate), NULL, this);
    GetGridWindow()->Connect(wxEVT_MOTION, wxMouseEventHandler(MemoryGrid::OnMotion), NULL, this);
    Connect(MemoryToolTipTimer, wxEVT_TIMER, wxTimerEventHandler(MemoryGrid::OnShowToolTip), NULL, this);
}
DIALOG_DRC_CONTROL_BASE::~DIALOG_DRC_CONTROL_BASE()
{
	// Disconnect Events
	this->Disconnect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_DRC_CONTROL_BASE::OnActivateDlg ) );
	m_CreateRptCtrl->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnReportCheckBoxClicked ), NULL, this );
	m_BrowseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnButtonBrowseRptFileClick ), NULL, this );
	m_buttonRunDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnStartdrcClick ), NULL, this );
	m_buttonListUnconnected->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnListUnconnectedClick ), NULL, this );
	m_DeleteAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnDeleteAllClick ), NULL, this );
	m_DeleteCurrentMarkerButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnDeleteOneClick ), NULL, this );
	m_Notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_DRC_CONTROL_BASE::OnChangingMarkerList ), NULL, this );
	m_ClearanceListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnLeftDClickClearance ), NULL, this );
	m_ClearanceListBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnMarkerSelectionEvent ), NULL, this );
	m_ClearanceListBox->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnRightUpClearance ), NULL, this );
	m_UnconnectedListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnLeftDClickUnconnected ), NULL, this );
	m_UnconnectedListBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnUnconnectedSelectionEvent ), NULL, this );
	m_UnconnectedListBox->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnRightUpUnconnected ), NULL, this );
	m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this );
	m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnOkClick ), NULL, this );
	
}
Beispiel #14
0
OutputConsole::OutputConsole(const char *title, int style,
                             MenuBarMaker *menuBarMaker)
    : wxFrame(NULL, wxID_ANY, title, wxPoint(50, 50), wxDefaultSize,
              wxDEFAULT_FRAME_STYLE) {
  menuBarMaker_ = menuBarMaker;
  outerSizer_ = new wxBoxSizer(wxVERTICAL);
  output_ = new wxTextCtrl(this, wxID_ANY, "", wxPoint(0, 0),
      wxSize(650, 450), wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP,
      wxDefaultValidator);
  outerSizer_->Add(output_, 1, wxEXPAND);
  style_ = style;
  gfxCheckBox_ = 0;
  abortButton_ = 0;
  if (style != CONSOLE_PLAIN) {
    wxBoxSizer *bottomSizer = new wxBoxSizer(wxHORIZONTAL);
    wxPanel *bottomPanel = new wxPanel(this);
    bottomSizer->AddStretchSpacer(1);
    if (style == CONSOLE_SHIP_STAGE) {
      gfxCheckBox_ = new wxCheckBox(bottomPanel, wxID_ANY, "Enable Gfx");
      bottomSizer->Add(gfxCheckBox_, 0, wxALIGN_RIGHT | wxALL, 4);
    } else if (style == CONSOLE_RUNNER) {
      // On Windows/Mac, it's not picking up the cmd/alt up to hide the hotkey,
      // so just displaying it all the time for now.
#ifdef __WXOSX__
      abortButton_ = new wxButton(bottomPanel, wxID_ANY, "Abo&rt \u2318R");
#elif defined(__WINDOWS__)
      abortButton_ = new wxButton(bottomPanel, wxID_ANY, "Abo&rt  alt-R");
#else
      abortButton_ = new wxButton(bottomPanel, wxID_ANY, "    Abo&rt    ");
#endif
      bottomSizer->Add(abortButton_, 0, wxALIGN_RIGHT | wxALL, 4);
    }
    bottomPanel->SetSizerAndFit(bottomSizer);
    outerSizer_->Add(bottomPanel, 0, wxEXPAND);
  }
  listener_ = 0;
  menusInitialized_ = false;

#ifdef __WINDOWS__
  SetIcon(wxIcon(resourcePath() + BERRYBOTS_ICO, wxBITMAP_TYPE_ICO));
#elif defined(__WXGTK__)
  SetIcon(wxIcon(resourcePath() + BBICON_128, wxBITMAP_TYPE_PNG));
#endif

#ifdef __WXOSX__
  defaultFontSize_ = 12;
#elif defined(__WINDOWS__)
  defaultFontSize_ = 9;
#else
  defaultFontSize_ = 10;
#endif

  fontSize_ = defaultFontSize_;
  output_->SetFont(wxFont(fontSize_, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
                          wxFONTWEIGHT_NORMAL));
  SetSizerAndFit(outerSizer_);


  Connect(this->GetId(), wxEVT_ACTIVATE,
          wxActivateEventHandler(OutputConsole::onActivate));
  Connect(this->GetId(), wxEVT_CLOSE_WINDOW,
          wxCommandEventHandler(OutputConsole::onClose));
  if (style == CONSOLE_SHIP_STAGE) {
    Connect(gfxCheckBox_->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED,
            wxCommandEventHandler(OutputConsole::onCheck));
  } else if (style == CONSOLE_RUNNER) {
    Connect(abortButton_->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
            wxCommandEventHandler(OutputConsole::onAbort));
  }
  
  eventFilter_ = new OutputConsoleEventFilter(this);
  this->GetEventHandler()->AddFilter(eventFilter_);
}
Beispiel #15
0
// ------------------------------------------------------------------------
MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
	: wxFrame(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER) )

	, m_statusbar( *CreateStatusBar(2, 0) )
	, m_background( this, wxID_ANY, wxGetApp().GetLogoBitmap() )

	// All menu components must be created on the heap!

	, m_menubar( *new wxMenuBar() )

	, m_menuCDVD	( *new wxMenu() )
	, m_menuSys		( *new wxMenu() )
	, m_menuConfig	( *new wxMenu() )
	, m_menuMisc	( *new wxMenu() )
	, m_menuDebug	( *new wxMenu() )

	, m_LoadStatesSubmenu( *MakeStatesSubMenu( MenuId_State_Load01, MenuId_State_LoadBackup ) )
	, m_SaveStatesSubmenu( *MakeStatesSubMenu( MenuId_State_Save01 ) )

	, m_MenuItem_Console( *new wxMenuItem( &m_menuMisc, MenuId_Console, _("Show Console"), wxEmptyString, wxITEM_CHECK ) )
	, m_MenuItem_Console_Stdio( *new wxMenuItem( &m_menuMisc, MenuId_Console_Stdio, _("Console to Stdio"), wxEmptyString, wxITEM_CHECK ) )

{
	m_RestartEmuOnDelete = false;

	for( int i=0; i<PluginId_Count; ++i )
		m_PluginMenuPacks[i].Populate( (PluginsEnum_t)i );

	// ------------------------------------------------------------------------
	// Initial menubar setup.  This needs to be done first so that the menu bar's visible size
	// can be factored into the window size (which ends up being background+status+menus)

	//m_menubar.Append( &m_menuBoot,		_("&Boot") );
	m_menubar.Append( &m_menuSys,		_("&System") );
	m_menubar.Append( &m_menuCDVD,		_("CD&VD") );
	m_menubar.Append( &m_menuConfig,	_("&Config") );
	m_menubar.Append( &m_menuMisc,		_("&Misc") );
#ifdef PCSX2_DEVBUILD
	m_menubar.Append( &m_menuDebug,		_("&Debug") );
#endif
	SetMenuBar( &m_menubar );

	// ------------------------------------------------------------------------

	wxSize backsize( m_background.GetSize() );

	wxString wintitle;
	if( PCSX2_isReleaseVersion )
	{
		// stable releases, with a simple title.
		wintitle.Printf( _("%s  %d.%d.%d %s"), pxGetAppName().c_str(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
			SVN_MODS ? _("(modded)") : wxEmptyString
		);
	}
	else
	{
		// beta / development editions, which feature revision number and compile date.
		wintitle.Printf( _("%s  %d.%d.%d.%d%s (svn)  %s"), pxGetAppName().c_str(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
			SVN_REV, SVN_MODS ? L"m" : wxEmptyString, fromUTF8(__DATE__).c_str() );
	}

	SetTitle( wintitle );

	// Ideally the __WXMSW__ port should use the embedded IDI_ICON2 icon, because wxWidgets sucks and
	// loses the transparency information when loading bitmaps into icons.  But for some reason
	// I cannot get it to work despite following various examples to the letter.


	SetIcons( wxGetApp().GetIconBundle() );

	int m_statusbar_widths[] = { (int)(backsize.GetWidth()*0.73), (int)(backsize.GetWidth()*0.25) };
	m_statusbar.SetStatusWidths(2, m_statusbar_widths);
	//m_statusbar.SetStatusText( L"The Status is Good!", 0);
	m_statusbar.SetStatusText( wxEmptyString, 0);

	wxBoxSizer& joe( *new wxBoxSizer( wxVERTICAL ) );
	joe.Add( &m_background );
	SetSizerAndFit( &joe );

	// Use default window position if the configured windowpos is invalid (partially offscreen)
	if( g_Conf->MainGuiPosition == wxDefaultPosition || !pxIsValidWindowPosition( *this, g_Conf->MainGuiPosition) )
		g_Conf->MainGuiPosition = GetScreenPosition();
	else
		SetPosition( g_Conf->MainGuiPosition );

	// Updating console log positions after the main window has been fitted to its sizer ensures
	// proper docked positioning, since the main window's size is invalid until after the sizer
	// has been set/fit.

	InitLogBoxPosition( g_Conf->ProgLogBox );

	// ------------------------------------------------------------------------
	// Some of the items in the System menu are configured by the UpdateCoreStatus() method.
	
	m_menuSys.Append(MenuId_Boot_CDVD,		_("Initializing..."));

	m_menuSys.Append(MenuId_Boot_CDVD2,		_("Initializing..."));

	m_menuSys.Append(MenuId_Boot_ELF,		_("Run ELF..."),
		_("For running raw PS2 binaries directly"));

	m_menuSys.AppendSeparator();
	m_menuSys.Append(MenuId_Sys_SuspendResume,	_("Initializing..."));
	m_menuSys.AppendSeparator();

	//m_menuSys.Append(MenuId_Sys_Close,		_("Close"),
	//	_("Stops emulation and closes the GS window."));

	m_menuSys.Append(MenuId_Sys_LoadStates,	_("Load state"), &m_LoadStatesSubmenu);
	m_menuSys.Append(MenuId_Sys_SaveStates,	_("Save state"), &m_SaveStatesSubmenu);

	m_menuSys.Append(MenuId_EnableBackupStates,	_("Backup before save"),
		wxEmptyString, wxITEM_CHECK);

	m_menuSys.AppendSeparator();

	m_menuSys.Append(MenuId_EnablePatches,	_("Automatic Gamefixes"),
		_("Automatically applies needed Gamefixes to known problematic games"), wxITEM_CHECK);

	m_menuSys.Append(MenuId_EnableCheats,	_("Enable Cheats"),
		wxEmptyString, wxITEM_CHECK);

	m_menuSys.Append(MenuId_EnableWideScreenPatches,	_("Enable Widescreen Patches"),
		wxEmptyString, wxITEM_CHECK);

	m_menuSys.Append(MenuId_EnableHostFs,	_("Enable Host Filesystem"),
		wxEmptyString, wxITEM_CHECK);

	m_menuSys.AppendSeparator();

	m_menuSys.Append(MenuId_Sys_Shutdown,	_("Shutdown"),
		_("Wipes all internal VM states and shuts down plugins."));

	m_menuSys.Append(MenuId_Exit,			_("Exit"),
		AddAppName(_("Closing %s may be hazardous to your health")));


	// ------------------------------------------------------------------------
	wxMenu& isoRecents( wxGetApp().GetRecentIsoMenu() );

	//m_menuCDVD.AppendSeparator();
	m_menuCDVD.Append( MenuId_IsoSelector,	_("Iso Selector"), &isoRecents );
	m_menuCDVD.Append( GetPluginMenuId_Settings(PluginId_CDVD), _("Plugin Menu"), m_PluginMenuPacks[PluginId_CDVD] );

	m_menuCDVD.AppendSeparator();
	m_menuCDVD.Append( MenuId_Src_Iso,		_("Iso"),		_("Makes the specified ISO image the CDVD source."), wxITEM_RADIO );
	m_menuCDVD.Append( MenuId_Src_Plugin,	_("Plugin"),	_("Uses an external plugin as the CDVD source."), wxITEM_RADIO );
	m_menuCDVD.Append( MenuId_Src_NoDisc,	_("No disc"),	_("Use this to boot into your virtual PS2's BIOS configuration."), wxITEM_RADIO );

	//m_menuCDVD.AppendSeparator();
	//m_menuCDVD.Append( MenuId_SkipBiosToggle,_("Enable BOOT2 injection"),
	//	_("Skips PS2 splash screens when booting from Iso or DVD media"), wxITEM_CHECK );

	// ------------------------------------------------------------------------

	m_menuConfig.Append(MenuId_Config_SysSettings,	_("Emulation &Settings") );
	m_menuConfig.Append(MenuId_Config_McdSettings,	_("&Memory cards") );
	m_menuConfig.Append(MenuId_Config_BIOS,			_("&Plugin/BIOS Selector") );
	if (IsDebugBuild) m_menuConfig.Append(MenuId_Config_GameDatabase,	_("Game Database Editor") );
	// Empty menu
	// m_menuConfig.Append(MenuId_Config_Language,		_("Appearance...") );

	m_menuConfig.AppendSeparator();

	m_menuConfig.Append(MenuId_Config_GS,		_("&Video (GS)"),		m_PluginMenuPacks[PluginId_GS]);
	m_menuConfig.Append(MenuId_Config_SPU2,		_("&Audio (SPU2)"),		m_PluginMenuPacks[PluginId_SPU2]);
	m_menuConfig.Append(MenuId_Config_PAD,		_("&Controllers (PAD)"),m_PluginMenuPacks[PluginId_PAD]);
	m_menuConfig.Append(MenuId_Config_DEV9,		_("Dev9"),				m_PluginMenuPacks[PluginId_DEV9]);
	m_menuConfig.Append(MenuId_Config_USB,		_("USB"),				m_PluginMenuPacks[PluginId_USB]);
	m_menuConfig.Append(MenuId_Config_FireWire,	_("Firewire"),			m_PluginMenuPacks[PluginId_FW]);

	//m_menuConfig.AppendSeparator();
	//m_menuConfig.Append(MenuId_Config_Patches,	_("Patches (unimplemented)"),	wxEmptyString);

	m_menuConfig.AppendSeparator();
	m_menuConfig.Append(MenuId_Config_Multitap0Toggle,	_("Multitap 1"),	wxEmptyString, wxITEM_CHECK );
	m_menuConfig.Append(MenuId_Config_Multitap1Toggle,	_("Multitap 2"),	wxEmptyString, wxITEM_CHECK );

	m_menuConfig.AppendSeparator();
	m_menuConfig.Append(MenuId_Config_ResetAll,	_("Clear all settings..."),
		AddAppName(_("Clears all %s settings and re-runs the startup wizard.")));

	// ------------------------------------------------------------------------

	m_menuMisc.Append( &m_MenuItem_Console );
#ifdef __LINUX__
	m_menuMisc.Append( &m_MenuItem_Console_Stdio );
#endif
	//Todo: Though not many people need this one :p
	//m_menuMisc.Append(MenuId_Profiler,			_("Show Profiler"),	wxEmptyString, wxITEM_CHECK);
	//m_menuMisc.AppendSeparator();

	// No dialogs implemented for these yet...
	//m_menuMisc.Append(41, "Patch Browser...", wxEmptyString, wxITEM_NORMAL);
	//m_menuMisc.Append(42, "Patch Finder...", wxEmptyString, wxITEM_NORMAL);

	m_menuMisc.AppendSeparator();

	//Todo:
	//There's a great working "open website" in the about panel. Less clutter by just using that.
	//m_menuMisc.Append(MenuId_Website,			_("Visit Website..."),
	//	_("Opens your web-browser to our favorite website."));
	m_menuMisc.Append(MenuId_About,				_("About...") );

	m_menuMisc.AppendSeparator();
	m_menuMisc.Append( MenuId_ChangeLang,		L"Change Language" ); // Always in English

#ifdef PCSX2_DEVBUILD
	//m_menuDebug.Append(MenuId_Debug_Open,		_("Open Debug Window..."),	wxEmptyString);
	//m_menuDebug.Append(MenuId_Debug_MemoryDump,	_("Memory Dump..."),		wxEmptyString);
	m_menuDebug.Append(MenuId_Debug_Logging,	_("Logging..."),			wxEmptyString);
#endif
	m_MenuItem_Console.Check( g_Conf->ProgLogBox.Visible );

	ConnectMenus();
	Connect( wxEVT_MOVE,			wxMoveEventHandler			(MainEmuFrame::OnMoveAround) );
	Connect( wxEVT_CLOSE_WINDOW,	wxCloseEventHandler			(MainEmuFrame::OnCloseWindow) );
	Connect( wxEVT_SET_FOCUS,		wxFocusEventHandler			(MainEmuFrame::OnFocus) );
	Connect( wxEVT_ACTIVATE,		wxActivateEventHandler		(MainEmuFrame::OnActivate) );

	PushEventHandler( &wxGetApp().GetRecentIsoManager() );
	SetDropTarget( new IsoDropTarget( this ) );

	ApplyCoreStatus();
	ApplySettings();
}
/// \brief Initializes a new instance of the MyFrame4 class.
/// \par parent
/// \par id
/// \par title
/// \par pos
/// \par size
/// \par style
MyFrame4::MyFrame4( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
    this->SetSizeHints( wxDefaultSize, wxDefaultSize );
    this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_SCROLLBAR ) );

    wxGridSizer* gSizer1;
    gSizer1 = new wxGridSizer( 1, 2, 0, 170 );

    m_grid1 = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxSize( 430,570 ), wxHSCROLL|wxWANTS_CHARS );

    // Grid
    m_grid1->CreateGrid( 0, 4 );
    m_grid1->EnableEditing( false );
    m_grid1->EnableGridLines( true );
    m_grid1->EnableDragGridSize( false );
    m_grid1->SetMargins( 0, 0 );

    // Columns
    m_grid1->EnableDragColMove( false );
    m_grid1->EnableDragColSize( true );
    m_grid1->SetColLabelSize( 30 );
    m_grid1->SetColLabelValue( 0, wxT("Id") );
    m_grid1->SetColLabelValue( 1, wxT("Person1") );
    m_grid1->SetColLabelValue( 2, wxT("Relationship") );
    m_grid1->SetColLabelValue( 3, wxT("Person2") );
    m_grid1->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );

    // Rows
    m_grid1->EnableDragRowSize( true );
    m_grid1->SetRowLabelSize( 0 );
    m_grid1->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );

    // Label Appearance

    // Cell Defaults
    m_grid1->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
    gSizer1->Add( m_grid1, 0, wxALL, 5 );

    wxGridSizer* gSizer2;
    gSizer2 = new wxGridSizer( 2, 1, 0, 0 );

    wxStaticBoxSizer* sbSizer1;
    sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Modify:") ), wxVERTICAL );

    wxGridSizer* gSizer3;
    gSizer3 = new wxGridSizer( 2, 1, 0, 0 );

    wxGridSizer* gSizer7;
    gSizer7 = new wxGridSizer( 1, 2, 0, 0 );

    wxGridSizer* gSizer9;
    gSizer9 = new wxGridSizer( 4, 1, 0, 0 );

    m_staticText1 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Person1:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText1->Wrap( -1 );
    gSizer9->Add( m_staticText1, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

    m_staticText2 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Relationship:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText2->Wrap( -1 );
    gSizer9->Add( m_staticText2, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

    m_staticText3 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Person2:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText3->Wrap( -1 );
    gSizer9->Add( m_staticText3, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );


    gSizer7->Add( gSizer9, 1, wxEXPAND, 5 );

    wxGridSizer* gSizer10;
    gSizer10 = new wxGridSizer( 4, 1, 0, 0 );

    m_comboBox1 = new wxComboBox( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
    gSizer10->Add( m_comboBox1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );

    m_comboBox2 = new wxComboBox( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
    gSizer10->Add( m_comboBox2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );

    m_comboBox3 = new wxComboBox( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
    gSizer10->Add( m_comboBox3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );


    gSizer7->Add( gSizer10, 1, wxEXPAND, 5 );


    gSizer3->Add( gSizer7, 1, wxEXPAND, 5 );

    wxGridSizer* gSizer8;
    gSizer8 = new wxGridSizer( 1, 3, 0, 0 );

    m_button2 = new wxButton( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0 );
    gSizer8->Add( m_button2, 1, wxALL|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL, 5 );

    m_button3 = new wxButton( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Edit"), wxDefaultPosition, wxDefaultSize, 0 );
    gSizer8->Add( m_button3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );

    m_button4 = new wxButton( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
    gSizer8->Add( m_button4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );


    gSizer3->Add( gSizer8, 1, wxEXPAND, 5 );


    sbSizer1->Add( gSizer3, 1, wxEXPAND, 5 );


    gSizer2->Add( sbSizer1, 1, wxEXPAND, 5 );

    wxGridSizer* gSizer4;
    gSizer4 = new wxGridSizer( 2, 1, 0, 0 );

    wxStaticBoxSizer* sbSizer2;
    sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Helper:") ), wxVERTICAL );

    wxGridSizer* gSizer6;
    gSizer6 = new wxGridSizer( 1, 2, 0, 0 );

    wxGridSizer* gSizer11;
    gSizer11 = new wxGridSizer( 4, 1, 0, 0 );

    m_staticText4 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("Person1:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText4->Wrap( -1 );
    gSizer11->Add( m_staticText4, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

    m_staticText5 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("Relationship:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText5->Wrap( -1 );
    gSizer11->Add( m_staticText5, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

    m_staticText6 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("Person2:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText6->Wrap( -1 );
    gSizer11->Add( m_staticText6, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );


    gSizer6->Add( gSizer11, 1, wxEXPAND, 5 );

    wxGridSizer* gSizer12;
    gSizer12 = new wxGridSizer( 4, 1, 0, 0 );

    m_staticText7 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText7->Wrap( -1 );
    gSizer12->Add( m_staticText7, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

    m_staticText8 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText8->Wrap( -1 );
    gSizer12->Add( m_staticText8, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

    m_staticText9 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText9->Wrap( -1 );
    gSizer12->Add( m_staticText9, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );


    gSizer6->Add( gSizer12, 1, wxEXPAND, 5 );


    sbSizer2->Add( gSizer6, 1, wxEXPAND, 5 );


    gSizer4->Add( sbSizer2, 1, wxEXPAND, 5 );

    wxGridSizer* gSizer5;
    gSizer5 = new wxGridSizer( 1, 2, 0, 0 );

    m_button1 = new wxButton( this, wxID_ANY, wxT("List"), wxDefaultPosition, wxDefaultSize, 0 );
    gSizer5->Add( m_button1, 1, wxALL|wxALIGN_BOTTOM, 5 );

    m_button5 = new wxButton( this, wxID_ANY, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 );
    gSizer5->Add( m_button5, 1, wxALL|wxALIGN_BOTTOM|wxALIGN_RIGHT, 5 );


    gSizer4->Add( gSizer5, 1, wxEXPAND, 5 );


    gSizer2->Add( gSizer4, 1, wxEXPAND, 5 );


    gSizer1->Add( gSizer2, 1, wxEXPAND, 5 );


    this->SetSizer( gSizer1 );
    this->Layout();

    this->Centre( wxBOTH );

    // Connect Events
    this->Connect( wxEVT_ACTIVATE, wxActivateEventHandler( MyFrame4::MyFrame4OnActivate ) );
    m_grid1->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( MyFrame4::m_grid1OnGridSelectCell ), NULL, this );
    m_comboBox1->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MyFrame4::m_comboBox1OnCombobox ), NULL, this );
    m_comboBox2->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MyFrame4::m_comboBox2OnCombobox ), NULL, this );
    m_comboBox3->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MyFrame4::m_comboBox3OnCombobox ), NULL, this );
    m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button2OnButtonClick ), NULL, this );
    m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button3OnButtonClick ), NULL, this );
    m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button4OnButtonClick ), NULL, this );
    m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button1OnButtonClick ), NULL, this );
    m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame4::m_button5OnButtonClick ), NULL, this );
}
Beispiel #17
0
// --------------------------------------------------------------------------------------
//  ConsoleLogFrame  (implementations)
// --------------------------------------------------------------------------------------
ConsoleLogFrame::ConsoleLogFrame( MainEmuFrame *parent, const wxString& title, AppConfig::ConsoleLogOptions& options )
	: wxFrame(parent, wxID_ANY, title)
	, m_conf( options )
	, m_TextCtrl( *new pxLogTextCtrl(this) )
	, m_timer_FlushUnlocker( this )
	, m_ColorTable( options.FontSize )

	, m_QueueColorSection( L"ConsoleLog::QueueColorSection" )
	, m_QueueBuffer( L"ConsoleLog::QueueBuffer" )
	, m_threadlogger( EnableThreadedLoggingTest ? new ConsoleTestThread() : NULL )
{
	m_CurQueuePos				= 0;
	m_WaitingThreadsForFlush	= 0;
	m_pendingFlushMsg			= false;
	m_FlushRefreshLocked		= false;

	// create Log menu (contains most options)
	wxMenuBar *pMenuBar = new wxMenuBar();
	SetMenuBar( pMenuBar );
	SetIcons( wxGetApp().GetIconBundle() );

	if (0==m_conf.Theme.CmpNoCase(L"Dark"))
	{
		m_ColorTable.SetColorScheme_Dark();
		m_TextCtrl.SetBackgroundColour( wxColor( 0, 0, 0 ) );
	}
	else //if ((0==m_conf.Theme.CmpNoCase("Default")) || (0==m_conf.Theme.CmpNoCase("Light")))
	{
		m_ColorTable.SetColorScheme_Light();
		m_TextCtrl.SetBackgroundColour( wxColor( 230, 235, 242 ) );
	}

	m_TextCtrl.SetDefaultStyle( m_ColorTable[DefaultConsoleColor] );

	// SetDefaultStyle only sets the style of text in the control.  We need to
	// also set the font of the control, so that sizing logic knows what font we use:
	m_TextCtrl.SetFont( m_ColorTable[DefaultConsoleColor].GetFont() );

	wxMenu& menuLog		(*new wxMenu());
	wxMenu& menuAppear	(*new wxMenu());
	wxMenu& menuSources	(*new wxMenu());
	wxMenu& menuFontSizes( menuAppear );

	// create Appearance menu and submenus

	menuFontSizes.Append( MenuId_FontSize_Small,	_("Small"),	_t("Fits a lot of log in a microcosmically small area."),
		wxITEM_RADIO )->Check( options.FontSize == 7 );
	menuFontSizes.Append( MenuId_FontSize_Normal,	_("Normal font"),_t("It's what I use (the programmer guy)."),
		wxITEM_RADIO )->Check( options.FontSize == 8 );
	menuFontSizes.Append( MenuId_FontSize_Large,	_("Large"),	_t("Its nice and readable."),
		wxITEM_RADIO )->Check( options.FontSize == 10 );
	menuFontSizes.Append( MenuId_FontSize_Huge,		_("Huge"),	_t("In case you have a really high res display."),
		wxITEM_RADIO )->Check( options.FontSize == 12 );

	menuFontSizes.AppendSeparator();
	menuFontSizes.Append( MenuId_ColorScheme_Light,	_("Light theme"),	_t("Default soft-tone color scheme."), wxITEM_RADIO );
	menuFontSizes.Append( MenuId_ColorScheme_Dark,	_("Dark theme"),	_t("Classic black color scheme for people who enjoy having text seared into their optic nerves."), wxITEM_RADIO );

	menuAppear.AppendSeparator();
	menuAppear.Append( wxID_ANY, _("Always on Top"),
		_t("When checked the log window will be visible over other foreground windows."), wxITEM_CHECK );

	menuLog.Append(wxID_SAVE,	_("&Save..."),		_("Save log contents to file"));
	menuLog.Append(wxID_CLEAR,	_("C&lear"),		_("Clear the log window contents"));
	menuLog.AppendSeparator();
	menuLog.AppendSubMenu( &menuAppear, _("Appearance") );
	menuLog.AppendSeparator();
	menuLog.Append(wxID_CLOSE,	_("&Close"),		_("Close this log window; contents are preserved"));

	// Source Selection/Toggle menu

	menuSources.Append( MenuId_LogSource_Devel, _("Dev/Verbose"), _("Shows PCSX2 developer logs"), wxITEM_CHECK );
	menuSources.Append( MenuId_LogSource_CDVD_Info, _("CDVD reads"), _("Shows disk read activity"), wxITEM_CHECK );
	
	menuSources.AppendSeparator();

	uint srcnt = ArraySize(ConLogSources);
	for (uint i=0; i<srcnt; ++i)
	{
		if (const BaseTraceLogSource* log = ConLogSources[i])
		{
			menuSources.Append( MenuId_LogSource_Start+i, log->GetName(), log->GetDescription(), wxITEM_CHECK );
			Connect( MenuId_LogSource_Start+i, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(ConsoleLogFrame::OnToggleSource));
		}
		else
			menuSources.AppendSeparator();
	}

	menuSources.AppendSeparator();
	menuSources.Append( MenuId_LogSource_EnableAll,		_("Enable all"),	_("Enables all log source filters.") );
	menuSources.Append( MenuId_LogSource_DisableAll,	_("Disable all"),	_("Disables all log source filters.") );
	menuSources.Append( MenuId_LogSource_SetDefault,	_("Restore Default"), _("Restore default source filters.") );

	pMenuBar->Append(&menuLog,		_("&Log"));
	pMenuBar->Append(&menuSources,	_("&Sources"));

	// status bar for menu prompts
	CreateStatusBar();

	SetSize( wxRect( options.DisplayPosition, options.DisplaySize ) );
	Show( options.Visible );

	// Bind Events:

	Connect( wxID_OPEN,  wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(ConsoleLogFrame::OnOpen)  );
	Connect( wxID_CLOSE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(ConsoleLogFrame::OnClose) );
	Connect( wxID_SAVE,  wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(ConsoleLogFrame::OnSave)  );
	Connect( wxID_CLEAR, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(ConsoleLogFrame::OnClear) );

	Connect( MenuId_FontSize_Small,		MenuId_FontSize_Huge,		wxEVT_COMMAND_MENU_SELECTED,	wxCommandEventHandler( ConsoleLogFrame::OnFontSize ) );
	Connect( MenuId_ColorScheme_Light,	MenuId_ColorScheme_Dark,	wxEVT_COMMAND_MENU_SELECTED,	wxCommandEventHandler( ConsoleLogFrame::OnToggleTheme ) );

	Connect( MenuId_LogSource_Devel,		wxEVT_COMMAND_MENU_SELECTED,	wxCommandEventHandler( ConsoleLogFrame::OnToggleSource ) );
	Connect( MenuId_LogSource_CDVD_Info,	wxEVT_COMMAND_MENU_SELECTED,	wxCommandEventHandler( ConsoleLogFrame::OnToggleCDVDInfo ) );
	Connect( MenuId_LogSource_EnableAll,	wxEVT_COMMAND_MENU_SELECTED,	wxCommandEventHandler( ConsoleLogFrame::OnEnableAllLogging ) );
	Connect( MenuId_LogSource_DisableAll,	wxEVT_COMMAND_MENU_SELECTED,	wxCommandEventHandler( ConsoleLogFrame::OnDisableAllLogging ) );
	Connect( MenuId_LogSource_SetDefault,	wxEVT_COMMAND_MENU_SELECTED,	wxCommandEventHandler( ConsoleLogFrame::OnSetDefaultLogging ) );

	Connect( wxEVT_CLOSE_WINDOW,	wxCloseEventHandler			(ConsoleLogFrame::OnCloseWindow) );
	Connect( wxEVT_MOVE,			wxMoveEventHandler			(ConsoleLogFrame::OnMoveAround) );
	Connect( wxEVT_SIZE,			wxSizeEventHandler			(ConsoleLogFrame::OnResize) );
	Connect( wxEVT_ACTIVATE,		wxActivateEventHandler		(ConsoleLogFrame::OnActivate) );

	Connect( pxEvt_SetTitleText,	wxCommandEventHandler	(ConsoleLogFrame::OnSetTitle) );
	Connect( pxEvt_DockConsole,		wxCommandEventHandler	(ConsoleLogFrame::OnDockedMove) );
	Connect( pxEvt_FlushQueue,		wxCommandEventHandler	(ConsoleLogFrame::OnFlushEvent) );

	Connect( m_timer_FlushUnlocker.GetId(),	wxEVT_TIMER,	wxTimerEventHandler	(ConsoleLogFrame::OnFlushUnlockerTimer) );

	if( m_threadlogger != NULL )
		m_threadlogger->Start();

	OnLoggingChanged();

	if (0==m_conf.Theme.CmpNoCase(L"Dark"))
	{
		pMenuBar->Check(MenuId_ColorScheme_Dark, true);
	}
	else //if ((0==m_conf.Theme.CmpNoCase("Default")) || (0==m_conf.Theme.CmpNoCase("Light")))
	{
		pMenuBar->Check(MenuId_ColorScheme_Light, true);
	}
}
DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* m_MainSizer;
	m_MainSizer = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* m_CommandSizer;
	m_CommandSizer = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticBoxSizer* sbSizerOptions;
	sbSizerOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxHORIZONTAL );
	
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxVERTICAL );
	
	wxFlexGridSizer* fgMinValuesSizer;
	fgMinValuesSizer = new wxFlexGridSizer( 4, 3, 0, 0 );
	fgMinValuesSizer->AddGrowableCol( 1 );
	fgMinValuesSizer->SetFlexibleDirection( wxHORIZONTAL );
	fgMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_ClearanceTitle = new wxStaticText( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Clearance"), wxDefaultPosition, wxDefaultSize, 0 );
	m_ClearanceTitle->Wrap( -1 );
	fgMinValuesSizer->Add( m_ClearanceTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
	
	m_SetClearance = new wxTextCtrl( sbSizerOptions->GetStaticBox(), wxID_ANY, _("By Netclass"), wxDefaultPosition, wxDefaultSize, 0 );
	m_SetClearance->Enable( false );
	
	fgMinValuesSizer->Add( m_SetClearance, 0, wxALL|wxEXPAND, 5 );
	
	
	fgMinValuesSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_TrackMinWidthTitle = new wxStaticText( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Min track width"), wxDefaultPosition, wxDefaultSize, 0 );
	m_TrackMinWidthTitle->Wrap( -1 );
	m_TrackMinWidthTitle->SetToolTip( _("Enter the minimum acceptable value for a track width") );
	
	fgMinValuesSizer->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
	
	m_SetTrackMinWidthCtrl = new wxTextCtrl( sbSizerOptions->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgMinValuesSizer->Add( m_SetTrackMinWidthCtrl, 0, wxALL|wxEXPAND, 5 );
	
	m_TrackMinWidthUnit = new wxStaticText( sbSizerOptions->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
	m_TrackMinWidthUnit->Wrap( -1 );
	m_TrackMinWidthUnit->SetToolTip( _("Enter the minimum acceptable value for a track width") );
	
	fgMinValuesSizer->Add( m_TrackMinWidthUnit, 0, wxALL, 5 );
	
	m_ViaMinTitle = new wxStaticText( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Min via size"), wxDefaultPosition, wxDefaultSize, 0 );
	m_ViaMinTitle->Wrap( -1 );
	m_ViaMinTitle->SetHelpText( _("Enter the minimum acceptable diameter for a standard via") );
	
	fgMinValuesSizer->Add( m_ViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
	
	m_SetViaMinSizeCtrl = new wxTextCtrl( sbSizerOptions->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgMinValuesSizer->Add( m_SetViaMinSizeCtrl, 0, wxALL|wxEXPAND, 5 );
	
	m_ViaMinUnit = new wxStaticText( sbSizerOptions->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
	m_ViaMinUnit->Wrap( -1 );
	m_ViaMinUnit->SetHelpText( _("Enter the minimum acceptable diameter for a standard via") );
	
	fgMinValuesSizer->Add( m_ViaMinUnit, 0, wxALL, 5 );
	
	m_MicroViaMinTitle = new wxStaticText( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Min uVia size"), wxDefaultPosition, wxDefaultSize, 0 );
	m_MicroViaMinTitle->Wrap( -1 );
	m_MicroViaMinTitle->SetToolTip( _("Enter the minimum acceptable diameter for a micro via") );
	
	fgMinValuesSizer->Add( m_MicroViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
	
	m_SetMicroViakMinSizeCtrl = new wxTextCtrl( sbSizerOptions->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgMinValuesSizer->Add( m_SetMicroViakMinSizeCtrl, 0, wxALL|wxEXPAND, 5 );
	
	m_MicroViaMinUnit = new wxStaticText( sbSizerOptions->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
	m_MicroViaMinUnit->Wrap( -1 );
	m_MicroViaMinUnit->SetToolTip( _("Enter the minimum acceptable diameter for a micro via") );
	
	fgMinValuesSizer->Add( m_MicroViaMinUnit, 0, wxALL, 5 );
	
	
	bSizer7->Add( fgMinValuesSizer, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* ReportFileSizer;
	ReportFileSizer = new wxStaticBoxSizer( new wxStaticBox( sbSizerOptions->GetStaticBox(), wxID_ANY, _("Create Report File") ), wxHORIZONTAL );
	
	m_CreateRptCtrl = new wxCheckBox( ReportFileSizer->GetStaticBox(), ID_CHECKBOX_RPT_FILE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_CreateRptCtrl->SetToolTip( _("Enable writing report to this file") );
	
	ReportFileSizer->Add( m_CreateRptCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_RptFilenameCtrl = new wxTextCtrl( ReportFileSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_RptFilenameCtrl->SetToolTip( _("Enter the report filename") );
	m_RptFilenameCtrl->SetMinSize( wxSize( 180,-1 ) );
	
	ReportFileSizer->Add( m_RptFilenameCtrl, 1, wxALL|wxEXPAND, 5 );
	
	m_BrowseButton = new wxButton( ReportFileSizer->GetStaticBox(), ID_BUTTON_BROWSE_RPT_FILE, _("..."), wxDefaultPosition, wxSize( 50,-1 ), 0 );
	ReportFileSizer->Add( m_BrowseButton, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	
	bSizer7->Add( ReportFileSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
	
	
	sbSizerOptions->Add( bSizer7, 1, wxEXPAND, 5 );
	
	
	m_CommandSizer->Add( sbSizerOptions, 1, 0, 5 );
	
	wxBoxSizer* bSizerMessages;
	bSizerMessages = new wxBoxSizer( wxVERTICAL );
	
	m_staticText6 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText6->Wrap( -1 );
	bSizerMessages->Add( m_staticText6, 0, wxRIGHT|wxLEFT, 5 );
	
	m_Messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY );
	m_Messages->SetMinSize( wxSize( 220,-1 ) );
	
	bSizerMessages->Add( m_Messages, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	
	m_CommandSizer->Add( bSizerMessages, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer11;
	bSizer11 = new wxBoxSizer( wxVERTICAL );
	
	m_buttonRunDRC = new wxButton( this, ID_STARTDRC, _("Start DRC"), wxDefaultPosition, wxDefaultSize, 0 );
	m_buttonRunDRC->SetDefault(); 
	m_buttonRunDRC->SetToolTip( _("Start the Design Rule Checker") );
	
	bSizer11->Add( m_buttonRunDRC, 0, wxALL|wxEXPAND, 5 );
	
	m_buttonListUnconnected = new wxButton( this, ID_LIST_UNCONNECTED, _("List Unconnected"), wxDefaultPosition, wxDefaultSize, 0 );
	m_buttonListUnconnected->SetToolTip( _("List unconnected pads or tracks") );
	
	bSizer11->Add( m_buttonListUnconnected, 0, wxALL|wxEXPAND, 5 );
	
	m_DeleteAllButton = new wxButton( this, ID_DELETE_ALL, _("Delete All Markers"), wxDefaultPosition, wxDefaultSize, 0 );
	m_DeleteAllButton->SetToolTip( _("Delete every marker") );
	
	bSizer11->Add( m_DeleteAllButton, 0, wxALL|wxEXPAND, 5 );
	
	m_DeleteCurrentMarkerButton = new wxButton( this, wxID_ANY, _("Delete Current Marker"), wxDefaultPosition, wxDefaultSize, 0 );
	m_DeleteCurrentMarkerButton->SetToolTip( _("Delete the marker selected in the list box below") );
	
	bSizer11->Add( m_DeleteCurrentMarkerButton, 0, wxEXPAND|wxALL, 5 );
	
	
	m_CommandSizer->Add( bSizer11, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	
	m_MainSizer->Add( m_CommandSizer, 0, wxALL|wxEXPAND, 5 );
	
	m_staticTextErrMsg = new wxStaticText( this, wxID_ANY, _("Error Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextErrMsg->Wrap( -1 );
	m_MainSizer->Add( m_staticTextErrMsg, 0, wxALL, 5 );
	
	m_Notebook = new wxNotebook( this, ID_NOTEBOOK1, wxDefaultPosition, wxDefaultSize, 0 );
	m_panelClearanceListBox = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizeClearanceBox;
	bSizeClearanceBox = new wxBoxSizer( wxVERTICAL );
	
	m_ClearanceListBox = new DRCLISTBOX( m_panelClearanceListBox, ID_CLEARANCE_LIST, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); 
	m_ClearanceListBox->SetToolTip( _("MARKERs, double click any to go there in PCB, right click for popup menu") );
	m_ClearanceListBox->SetMinSize( wxSize( -1,80 ) );
	
	bSizeClearanceBox->Add( m_ClearanceListBox, 1, wxALL|wxEXPAND, 5 );
	
	
	m_panelClearanceListBox->SetSizer( bSizeClearanceBox );
	m_panelClearanceListBox->Layout();
	bSizeClearanceBox->Fit( m_panelClearanceListBox );
	m_Notebook->AddPage( m_panelClearanceListBox, _("Problems / Markers"), true );
	m_panelUnconnectedBox = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizerUnconnectedBox;
	bSizerUnconnectedBox = new wxBoxSizer( wxVERTICAL );
	
	m_UnconnectedListBox = new DRCLISTBOX( m_panelUnconnectedBox, ID_UNCONNECTED_LIST, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); 
	m_UnconnectedListBox->SetToolTip( _("A list of unconnected pads, right click for popup menu") );
	
	bSizerUnconnectedBox->Add( m_UnconnectedListBox, 1, wxALL|wxEXPAND, 5 );
	
	
	m_panelUnconnectedBox->SetSizer( bSizerUnconnectedBox );
	m_panelUnconnectedBox->Layout();
	bSizerUnconnectedBox->Fit( m_panelUnconnectedBox );
	m_Notebook->AddPage( m_panelUnconnectedBox, _("Unconnected"), false );
	
	m_MainSizer->Add( m_Notebook, 1, wxEXPAND | wxALL, 5 );
	
	m_sdbSizer1 = new wxStdDialogButtonSizer();
	m_sdbSizer1OK = new wxButton( this, wxID_OK );
	m_sdbSizer1->AddButton( m_sdbSizer1OK );
	m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
	m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
	m_sdbSizer1->Realize();
	
	m_MainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 );
	
	
	this->SetSizer( m_MainSizer );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_ACTIVATE, wxActivateEventHandler( DIALOG_DRC_CONTROL_BASE::OnActivateDlg ) );
	m_CreateRptCtrl->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnReportCheckBoxClicked ), NULL, this );
	m_BrowseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnButtonBrowseRptFileClick ), NULL, this );
	m_buttonRunDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnStartdrcClick ), NULL, this );
	m_buttonListUnconnected->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnListUnconnectedClick ), NULL, this );
	m_DeleteAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnDeleteAllClick ), NULL, this );
	m_DeleteCurrentMarkerButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnDeleteOneClick ), NULL, this );
	m_Notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_DRC_CONTROL_BASE::OnChangingMarkerList ), NULL, this );
	m_ClearanceListBox->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnLeftDClickClearance ), NULL, this );
	m_ClearanceListBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnMarkerSelectionEvent ), NULL, this );
	m_ClearanceListBox->Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnRightUpClearance ), NULL, this );
	m_UnconnectedListBox->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnLeftDClickUnconnected ), NULL, this );
	m_UnconnectedListBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnUnconnectedSelectionEvent ), NULL, this );
	m_UnconnectedListBox->Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnRightUpUnconnected ), NULL, this );
	m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this );
	m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnOkClick ), NULL, this );
}
/// \brief Initializes a new instance of the MyFrame2 class.
/// \par parent
/// \par id
/// \par title
/// \par pos
/// \par size
/// \par style
MyFrame2::MyFrame2( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_SCROLLBAR ) );

	wxGridSizer* gSizer1;
	gSizer1 = new wxGridSizer( 1, 2, 0, 170 );

	m_grid1 = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxSize( 430,570 ), wxHSCROLL|wxVSCROLL );

	// Grid
	m_grid1->CreateGrid( 0, 5 );
	m_grid1->EnableEditing( false );
	m_grid1->EnableGridLines( true );
	m_grid1->EnableDragGridSize( false );
	m_grid1->SetMargins( 0, 0 );

	// Columns
	m_grid1->EnableDragColMove( false );
	m_grid1->EnableDragColSize( true );
	m_grid1->SetColLabelSize( 30 );
	m_grid1->SetColLabelValue( 0, wxT("Id") );
	m_grid1->SetColLabelValue( 1, wxT("Name") );
	m_grid1->SetColLabelValue( 2, wxT("Mothername") );
	m_grid1->SetColLabelValue( 3, wxT("Location") );
	m_grid1->SetColLabelValue( 4, wxT("Birthdate") );
	m_grid1->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );

	// Rows
	m_grid1->EnableDragRowSize( true );
	m_grid1->SetRowLabelSize( 0 );
	m_grid1->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );

	// Label Appearance

	// Cell Defaults
	m_grid1->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
	gSizer1->Add( m_grid1, 0, wxALL, 5 );

	wxGridSizer* gSizer2;
	gSizer2 = new wxGridSizer( 2, 1, 0, 0 );

	wxStaticBoxSizer* sbSizer1;
	sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Modify:") ), wxVERTICAL );

	wxGridSizer* gSizer3;
	gSizer3 = new wxGridSizer( 2, 1, 0, 0 );

	wxGridSizer* gSizer5;
	gSizer5 = new wxGridSizer( 1, 2, 0, 0 );

	wxGridSizer* gSizer7;
	gSizer7 = new wxGridSizer( 4, 1, 0, 0 );

	m_staticText1 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText1->Wrap( -1 );
	gSizer7->Add( m_staticText1, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

	m_staticText2 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Mothername:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText2->Wrap( -1 );
	gSizer7->Add( m_staticText2, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

	m_staticText3 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Location:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText3->Wrap( -1 );
	gSizer7->Add( m_staticText3, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

	m_staticText4 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Birthdate:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	gSizer7->Add( m_staticText4, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );


	gSizer5->Add( gSizer7, 1, wxEXPAND, 5 );

	wxGridSizer* gSizer8;
	gSizer8 = new wxGridSizer( 4, 1, 0, 0 );

	m_textCtrl1 = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	gSizer8->Add( m_textCtrl1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );

	m_textCtrl2 = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	gSizer8->Add( m_textCtrl2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );

	m_textCtrl3 = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	gSizer8->Add( m_textCtrl3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );

	m_textCtrl4 = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	gSizer8->Add( m_textCtrl4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );


	gSizer5->Add( gSizer8, 1, wxEXPAND, 5 );


	gSizer3->Add( gSizer5, 1, wxEXPAND, 5 );

	wxGridSizer* gSizer6;
	gSizer6 = new wxGridSizer( 1, 3, 0, 0 );

	m_button2 = new wxButton( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0 );
	gSizer6->Add( m_button2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );

	m_button3 = new wxButton( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Edit"), wxDefaultPosition, wxDefaultSize, 0 );
	gSizer6->Add( m_button3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );

	m_button4 = new wxButton( sbSizer1->GetStaticBox(), wxID_ANY, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
	gSizer6->Add( m_button4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );


	gSizer3->Add( gSizer6, 1, wxEXPAND, 5 );


	sbSizer1->Add( gSizer3, 1, wxEXPAND, 5 );


	gSizer2->Add( sbSizer1, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );

	wxGridSizer* gSizer4;
	gSizer4 = new wxGridSizer( 1, 2, 0, 0 );

	m_button1 = new wxButton( this, wxID_ANY, wxT("List"), wxDefaultPosition, wxDefaultSize, 0 );
	gSizer4->Add( m_button1, 1, wxALL|wxALIGN_BOTTOM, 5 );

	m_button5 = new wxButton( this, wxID_ANY, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 );
	gSizer4->Add( m_button5, 1, wxALL|wxALIGN_BOTTOM|wxALIGN_RIGHT, 5 );


	gSizer2->Add( gSizer4, 1, wxEXPAND, 5 );


	gSizer1->Add( gSizer2, 1, wxEXPAND, 5 );


	this->SetSizer( gSizer1 );
	this->Layout();

	this->Centre( wxBOTH );

	// Connect Events
	this->Connect( wxEVT_ACTIVATE, wxActivateEventHandler( MyFrame2::MyFrame2OnActivate ) );
	m_grid1->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( MyFrame2::m_grid1OnGridSelectCell ), NULL, this );
	m_textCtrl1->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MyFrame2::m_textCtrl1OnText ), NULL, this );
	m_textCtrl2->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MyFrame2::m_textCtrl2OnText ), NULL, this );
	m_textCtrl3->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MyFrame2::m_textCtrl3OnText ), NULL, this );
	m_textCtrl4->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MyFrame2::m_textCtrl4OnText ), NULL, this );
	m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button2OnButtonClick ), NULL, this );
	m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button3OnButtonClick ), NULL, this );
	m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button4OnButtonClick ), NULL, this );
	m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button1OnButtonClick ), NULL, this );
	m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MyFrame2::m_button5OnButtonClick ), NULL, this );
}