DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE()
{
	// Disconnect Events
	this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnUpdateUI ) );
	m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSizeGrid ), NULL, this );
	m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddField ), NULL, this );
	m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnMoveUp ), NULL, this );
	m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnMoveDown ), NULL, this );
	m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteField ), NULL, this );
	m_SymbolNameCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameKillFocus ), NULL, this );
	m_SymbolNameCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameText ), NULL, this );
	m_aliasListBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSelectAlias ), NULL, this );
	m_addAliasButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddAlias ), NULL, this );
	m_deleteAliasButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteAlias ), NULL, this );
	m_aliasGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSizeAliasGrid ), NULL, this );
	m_AliasNameCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAliasNameKillFocus ), NULL, this );
	m_AliasNameCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAliasNameText ), NULL, this );
	m_FootprintFilterListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnFilterDClick ), NULL, this );
	m_FootprintFilterListBox->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditFootprintFilter ), NULL, this );
	m_addFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddFootprintFilter ), NULL, this );
	m_editFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditFootprintFilter ), NULL, this );
	m_deleteFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteFootprintFilter ), NULL, this );
	m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditSpiceModel ), NULL, this );
	m_stdSizerButtonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelButtonClick ), NULL, this );

}
示例#2
0
void cbAuiNotebook::ResetTabCtrlEvents()
{
    for (size_t i = 0; i < m_TabCtrls.GetCount(); ++i)
    {
#if !wxCHECK_VERSION(3, 0, 0)
        m_TabCtrls[i]->Disconnect(wxEVT_MOTION, wxMouseEventHandler(cbAuiNotebook::OnMotion));
        m_TabCtrls[i]->Connect(wxEVT_MOTION ,   wxMouseEventHandler(cbAuiNotebook::OnMotion));
#endif
        m_TabCtrls[i]->Disconnect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(cbAuiNotebook::OnTabCtrlDblClick));
        m_TabCtrls[i]->Connect(wxEVT_LEFT_DCLICK,    wxMouseEventHandler(cbAuiNotebook::OnTabCtrlDblClick));
        m_TabCtrls[i]->Disconnect(wxEVT_SIZE,        wxSizeEventHandler(cbAuiNotebook::OnResize));
        m_TabCtrls[i]->Connect(wxEVT_SIZE,           wxSizeEventHandler(cbAuiNotebook::OnResize));
        m_TabCtrls[i]->Disconnect(wxEVT_MOUSEWHEEL,  wxMouseEventHandler(cbAuiNotebook::OnTabCtrlMouseWheel));
#ifdef __WXMSW__
        m_TabCtrls[i]->Disconnect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(cbAuiNotebook::OnEnterTabCtrl));
        m_TabCtrls[i]->Disconnect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(cbAuiNotebook::OnLeaveTabCtrl));
#endif
        if (GetPageCount() > 1)
        {
            if (s_AllowMousewheel)
                m_TabCtrls[i]->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(cbAuiNotebook::OnTabCtrlMouseWheel));
#ifdef __WXMSW__
            m_TabCtrls[i]->Connect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(cbAuiNotebook::OnEnterTabCtrl));
            m_TabCtrls[i]->Connect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(cbAuiNotebook::OnLeaveTabCtrl));
#endif
        }
    }
}
示例#3
0
void wxSFControlShape::SetControl(wxWindow *ctrl, bool fit)
{
    if( m_pControl ) m_pControl->Reparent( m_pPrevParent );

    m_pControl = ctrl;

    if( m_pControl )
    {
        m_pPrevParent = ctrl->GetParent();

        if( m_pParentManager )
        {
            wxSFShapeCanvas *pCanvas = ((wxSFDiagramManager*)m_pParentManager)->GetShapeCanvas();

            // reparent GUI control if necessary
            if( pCanvas && ( (wxWindow*)pCanvas != m_pPrevParent ) ) m_pControl->Reparent( (wxWindow*)pCanvas );

            // redirect mouse events to the event sink for their delayed processing
            m_pControl->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
            m_pControl->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
            m_pControl->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
            m_pControl->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
            m_pControl->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
            m_pControl->Connect(wxEVT_RIGHT_DCLICK, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
            m_pControl->Connect(wxEVT_MOTION, wxMouseEventHandler(EventSink::_OnMouseMove), NULL, m_pEventSink);
            m_pControl->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(EventSink::_OnKeyDown), NULL, m_pEventSink);
            m_pControl->Connect(wxEVT_SIZE, wxSizeEventHandler(EventSink::_OnSize), NULL, m_pEventSink);
        }

        if( fit ) UpdateShape();

        UpdateControl();
    }
}
示例#4
0
wxFlatButtonBase::wxFlatButtonBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC9ED9InitBitmapResources();
        bBitmapLoaded = true;
    }
    
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    Centre(wxBOTH);
    // Connect events
    this->Connect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(wxFlatButtonBase::OnEnterWindow), NULL, this);
    this->Connect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(wxFlatButtonBase::OnLeaveWindow), NULL, this);
    this->Connect(wxEVT_PAINT, wxPaintEventHandler(wxFlatButtonBase::OnPaint), NULL, this);
    this->Connect(wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(wxFlatButtonBase::OnEraseBackground), NULL, this);
    this->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(wxFlatButtonBase::OnLeftDown), NULL, this);
    this->Connect(wxEVT_SIZE, wxSizeEventHandler(wxFlatButtonBase::OnSize), NULL, this);
    this->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(wxFlatButtonBase::OnLeftDClick), NULL, this);
    this->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(wxFlatButtonBase::OnLeftUp), NULL, this);
    
}
DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aPad ) :
    DIALOG_PAD_PROPERTIES_BASE( aParent ),
    m_OrientValidator( 1, &m_OrientValue )
{
    m_canUpdate  = false;
    m_parent     = aParent;
    m_currentPad = aPad;        // aPad can be NULL, if the dialog is called
                                // from the footprint editor to set default pad setup

    m_board      = m_parent->GetBoard();

    m_OrientValidator.SetRange( -360.0, 360.0 );
    m_PadOrientCtrl->SetValidator( m_OrientValidator );
    m_OrientValidator.SetWindow( m_PadOrientCtrl );

    m_padMaster  = &m_parent->GetDesignSettings().m_Pad_Master;
    m_dummyPad   = new D_PAD( (MODULE*) NULL );

    if( aPad )
        *m_dummyPad = *aPad;
    else    // We are editing a "master" pad, i.e. a template to create new pads
        *m_dummyPad = *m_padMaster;

    // Show the X and Y axis. It is usefull because pad shape can have an offset
    // or be a complex shape.
    m_axisOrigin = new KIGFX::ORIGIN_VIEWITEM( KIGFX::COLOR4D(0.0, 0.0, 0.8, 1.0),
                                               KIGFX::ORIGIN_VIEWITEM::CROSS,
                                               Millimeter2iu( 0.2 ),
                                               VECTOR2D( m_dummyPad->GetPosition() ) );
    m_axisOrigin->SetDrawAtZero( true );

    if( m_parent->IsGalCanvasActive() )
    {
        m_panelShowPadGal->UseColorScheme( m_board->GetColorsSettings() );
        m_panelShowPadGal->SwitchBackend( m_parent->GetGalCanvas()->GetBackend() );
        m_panelShowPadGal->Show();
        m_panelShowPad->Hide();
        m_panelShowPadGal->GetView()->Add( m_dummyPad );
        m_panelShowPadGal->GetView()->Add( m_axisOrigin );
        m_panelShowPadGal->StartDrawing();
        Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PROPERTIES::OnResize ) );
    }
    else
    {
        m_panelShowPad->Show();
        m_panelShowPadGal->Hide();
    }

    initValues();
    TransferDataToWindow();

    m_sdbSizerOK->SetDefault();
    m_PadNumCtrl->SetFocus();
    m_canUpdate = true;

    FixOSXCancelButtonIssue();

    // Now all widgets have the size fixed, call FinishDialogSettings
    FinishDialogSettings();
}
示例#6
0
GEUIDialog::GEUIDialog(wxWindow *pparent, wxWindowID id, wxAuiManager *auimgr, int tbitem, gecomapi_pi *ppi)
      :wxPanel(pparent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, _T("GoogleEarth"))
{
      pPlugIn = ppi;
      LogDebugMessage(_T("Constructing the GE plugin window"));
      m_pauimgr = auimgr;
      m_toolbar_item_id = tbitem;
      m_ballowStart = false;
      m_bshouldcatchup = true;
      m_bbusy = false;

      m_pfocusedwindow = FindFocus();
      GEParentHwnd = NULL;

      this->SetSizeHints( wxDefaultSize, wxDefaultSize );

      itemBoxSizer = new wxBoxSizer(wxVERTICAL);
      SetSizerAndFit(itemBoxSizer);

      m_panel1 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	itemBoxSizer->Add( m_panel1, 1, wxEXPAND | wxALL, 5 );

      itemBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
      itemBoxSizer->Add(itemBoxSizer1, 0, wxEXPAND);

      m_cbConnected = new wxCheckBox( this, wxID_ANY, _("Connected to chart viewport"), wxDefaultPosition, wxDefaultSize, 0 );
	itemBoxSizer1->Add( m_cbConnected, 0, wxALIGN_RIGHT|wxALL, 10 );

      m_buttonSave = new wxButton( this, wxID_ANY, _("Save view..."), wxDefaultPosition, wxDefaultSize, 0 );
      itemBoxSizer1->Add( m_buttonSave, 0, wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 );
	
	this->Layout();
	
	this->Centre( wxBOTH );

      Connect(this->GetId(), wxEVT_SIZE, wxSizeEventHandler(GEUIDialog::OnSize));
      Connect(this->GetId(), wxEVT_SHOW, wxShowEventHandler(GEUIDialog::OnShow));
      
      app = NULL;

      m_bgeisuseable = false;
      m_binitializing = false;
      m_bclosed = false;
      m_bisfollowingboat = false;

      //LogDebugMessage(_T("GE plugin window created, going to start GE"));
      //GEInitialize();
      m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GEUIDialog::SaveView ), NULL, this );
      m_cbConnected->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GEUIDialog::ConnectedClicked ), NULL, this );

      ConnectToGE();

      m_stopwatch.Start();
      m_stopwatch_boat.Start();
      m_pPositions = new PositionsList();
      m_sEnvelopeKmlFilename = wxStandardPaths::Get().GetTempDir() + _T("\\gecomapi.kml");
      m_sLiveKmlFilename = wxStandardPaths::Get().GetTempDir() + _T("\\gecomapilive.kml");

      m_pdialog = new GESaveViewDlgImpl(this,  wxID_ANY, _("Save view"), wxDefaultPosition, wxSize( -1,-1 ), wxDEFAULT_DIALOG_STYLE );
}
示例#7
0
GRIBUIDialogBase::~GRIBUIDialogBase()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GRIBUIDialogBase::OnClose ) );
	this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( GRIBUIDialogBase::OnSize ) );
	m_bpPrev->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnPrev ), NULL, this );
	m_cRecordForecast->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( GRIBUIDialogBase::OnRecordForecast ), NULL, this );
	m_bpNext->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnNext ), NULL, this );
	m_bpNow->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnNow ), NULL, this );
	m_bpOpenFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnOpenFile ), NULL, this );
	m_bpSettings->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnSettings ), NULL, this );
	m_bpRequest->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnRequest ), NULL, this );
	m_tbPlayStop->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnPlayStop ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_sTimeline->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( GRIBUIDialogBase::OnTimeline ), NULL, this );
	m_cbWind->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbWindScat->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbWave->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbCurrent->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbWindGust->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbPressure->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbPrecipitation->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbCloud->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbAirTemperature->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	m_cbSeaTemperature->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( GRIBUIDialogBase::OnCBAny ), NULL, this );
	
}
示例#8
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) );
}
示例#9
0
void SpectraDocumentFrame::ConnectEventHandlers(void)
{
	Connect(
		wxID_CLOSE,
		wxEVT_COMMAND_MENU_SELECTED,
		wxCommandEventHandler(SpectraDocumentFrame::DoClose)
	);
	Connect(
		wxID_ADD,
		wxEVT_COMMAND_MENU_SELECTED,
		wxCommandEventHandler(SpectraDocumentFrame::DoDuplicate)
	);
	Connect(
		wxEVT_CLOSE_WINDOW,
		wxCloseEventHandler(SpectraDocumentFrame::OnClose)
	);
	Connect(
		wxEVT_SYS_COLOUR_CHANGED,
		wxSysColourChangedEventHandler(SpectraDocumentFrame::OnSysColorChange)
	);
	Connect(
		wxEVT_MOTION,
		wxMouseEventHandler(SpectraDocumentFrame::OnMouseMotionEvent)
	);
	Connect(
		wxEVT_MOUSEWHEEL,
		wxMouseEventHandler(SpectraDocumentFrame::OnMouseWheelEvent)
	);
	Connect(
		wxEVT_SIZE,
		wxSizeEventHandler(SpectraDocumentFrame::OnResize)
	);
}
示例#10
0
void WindowPosition::disconnect(wxTopLevelWindow* window)
{
	_window = nullptr;

	window->Disconnect(wxEVT_SIZE, wxSizeEventHandler(WindowPosition::onResize), nullptr, this);
	window->Disconnect(wxEVT_MOVE, wxMoveEventHandler(WindowPosition::onMove), nullptr, this);
}
示例#11
0
wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title,
		wxWindow * Child)
{
	wxFrame * Frame = new wxFrame(this, Id, Title,
			wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE);

	Child->Reparent(Frame);

	wxBoxSizer * m_MainSizer = new wxBoxSizer(wxHORIZONTAL);

	m_MainSizer->Add(Child, 1, wxEXPAND);

	Frame->Connect(wxID_ANY, wxEVT_CLOSE_WINDOW,
		wxCloseEventHandler(CFrame::OnFloatingPageClosed),
		(wxObject*)0, this);

	if (Id == IDM_CONSOLEWINDOW_PARENT)
	{
		Frame->Connect(wxID_ANY, wxEVT_SIZE,
			wxSizeEventHandler(CFrame::OnFloatingPageSize),
			(wxObject*)0, this);
	}

	// Main sizer
	Frame->SetSizer(m_MainSizer);
	// Minimum frame size
	Frame->SetMinSize(wxSize(200, 200));
	Frame->Show();
	return Frame;
}
DIALOG_TEMPLATE_SELECTOR::DIALOG_TEMPLATE_SELECTOR( wxWindow* aParent ) :
    DIALOG_TEMPLATE_SELECTOR_BASE( aParent )
{
    m_htmlWin->SetPage( _( "<html><h1>Template Selector</h1></html>" ) );
    m_notebook->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_TEMPLATE_SELECTOR::onNotebookResize ), NULL, this );
    m_selectedWidget = NULL;
}
示例#13
0
void wxSFControlShape::OnBeginDrag(const wxPoint& pos)
{
	wxUnusedVar( pos );
	
    m_PrevFill = m_Fill;
    m_Fill = m_ModFill;

    if( m_pParentManager )
    {
        wxSFShapeCanvas *pCanvas = ((wxSFDiagramManager*)m_pParentManager)->GetShapeCanvas();

        if( pCanvas )
        {
            m_nPrevStyle = pCanvas->GetStyle();
            pCanvas->RemoveStyle(wxSFShapeCanvas::sfsDND);
        }
    }

    if( m_pControl )
    {
        m_pControl->Hide();
        m_pControl->Disconnect(wxEVT_SIZE, wxSizeEventHandler(EventSink::_OnSize), NULL, m_pEventSink);
    }
	
	wxSFShapeBase::OnBeginDrag(pos);
}
示例#14
0
/*****************************************************
**
**   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 ));
}
示例#15
0
TimeLogChart::TimeLogChart(wxWindow *parent, int id, const wxString& title):
    wxPanel(parent, id), m_title(title)
{
    InitDefaults();
    SetDoubleBuffered(true);
    Connect(wxEVT_PAINT, wxPaintEventHandler(TimeLogChart::OnPaint));
    Connect(wxEVT_SIZE, wxSizeEventHandler(TimeLogChart::OnSize));
}
ConfirmDialog::~ConfirmDialog()
{
	// Disconnect Events
	m_choiceProject->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfirmDialog::OnProjectChoice ), NULL, this );
	m_gridMetadata->Disconnect( wxEVT_SIZE, wxSizeEventHandler( ConfirmDialog::OnSize ), NULL, this );
	m_buttonLaunch->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfirmDialog::OnLaunch ), NULL, this );
	m_linkProjNotFound->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( ConfirmDialog::OnProjectNotFoundClicked ), NULL, this );
}
GUIFrame::~GUIFrame() {

	this->GetParent()->Show(true);
	this->GetParent()->SetFocus();

	// Disconnect Events
	this->Disconnect(wxEVT_SIZE, wxSizeEventHandler( GUIFrame::OnSizeChange ));
	ImageField->Disconnect(wxEVT_LEAVE_WINDOW,
			wxMouseEventHandler( GUIFrame::OnLeftImageField ), NULL, this);
	ImageField->Disconnect(wxEVT_LEFT_DOWN,
			wxMouseEventHandler( GUIFrame::OnLeftMousePressed ), NULL, this);
	ImageField->Disconnect(wxEVT_LEFT_UP,
			wxMouseEventHandler( GUIFrame::OnLeftMouseRelease ), NULL, this);
	ImageField->Disconnect(wxEVT_MOTION,
			wxMouseEventHandler( GUIFrame::OnImageMotion ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_TOP,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_BOTTOM,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_LINEUP,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_LINEDOWN,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_PAGEUP,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_PAGEDOWN,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_THUMBTRACK,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_THUMBRELEASE,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_CHANGED,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ColorSlider->Disconnect(wxEVT_SCROLL_CHANGED,
			wxScrollEventHandler( GUIFrame::OnColorSlider ), NULL, this);
	ZoomButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler( GUIFrame::OnZoom ), NULL, this);
	OriginalImageButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler( GUIFrame::OnOriginal ), NULL, this);
	ObjectComboBox->Disconnect(wxEVT_COMMAND_TEXT_UPDATED,
			wxCommandEventHandler( GUIFrame::OnComboSelect ), NULL, this);
	CrateButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler( GUIFrame::OnCrateButton ), NULL, this);
	NoRotationCheckBox->Disconnect(wxEVT_LEFT_DOWN,
			wxMouseEventHandler( GUIFrame::NoRotation ), NULL, this);
	NextObjectButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler( GUIFrame::OnNextObjectButton ), NULL, this);
	SkipButton->Disconnect(wxEVT_LEFT_DOWN,
			wxMouseEventHandler( GUIFrame::OnSkip ), NULL, this);
	ResetButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler( GUIFrame::OnReset ), NULL, this);
	DoneButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED,
			wxCommandEventHandler( GUIFrame::OnDoneButton ), NULL, this);
	ZoomBox_radioBtn->Disconnect(wxEVT_LEFT_DOWN,
			wxMouseEventHandler( GUIFrame::OnZoomChange ), NULL, this);
	ZoomCheckBox->Disconnect(wxEVT_LEFT_DOWN,
			wxMouseEventHandler( GUIFrame::OnZoomChange ), NULL, this);
}
示例#18
0
ItemEditorFrameUI::~ItemEditorFrameUI()
{
	// Disconnect Events
	m_ItemListCtrl->Disconnect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( ItemEditorFrameUI::OnItemListColClick ), NULL, this );
	m_ItemListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( ItemEditorFrameUI::OnItemListDeselected ), NULL, this );
	m_ItemListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( ItemEditorFrameUI::OnItemListRightClick ), NULL, this );
	m_ItemListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( ItemEditorFrameUI::OnItemListSelected ), NULL, this );
	m_ItemTypeChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnItemTypeChoice ), NULL, this );
	m_NewItemButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnNewItemButton ), NULL, this );
	m_ModifyButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnModifyItem ), NULL, this );
	m_ItemNameTextCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_ItemNameTextCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_CDTimeTCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_CDTimeTCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_BuyCastSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_BuyCastSpin->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_SellCastSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_SellCastSpin->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_MaxSoltNumSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_MaxSoltNumSpin->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_IconCBox->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_AddIconButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_DelIconButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_ModifyIconButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_HelpStrTCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_HelpStrTCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_PMListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( ItemEditorFrameUI::OnPMListDeselected ), NULL, this );
	m_PMListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( ItemEditorFrameUI::OnPMListSelected ), NULL, this );
	m_PMAddButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMAddClick ), NULL, this );
	m_PMRemoveButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMRemoveClick ), NULL, this );
	m_PMModifyButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMModifyClick ), NULL, this );
	m_EquipValSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EquipValSpin->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EquipSoltChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_button17->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnChioceModelClick ), NULL, this );
	m_button18->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnModelNameRemove ), NULL, this );
	m_ScaleTCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_ScaleTCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EditModelCBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnEditModelCheck ), NULL, this );
	m_WeaponTypeChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_ERASE_BACKGROUND, wxEraseEventHandler( ItemEditorFrameUI::OnDraw ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( ItemEditorFrameUI::OnKeyDown ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MIDDLE_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MOTION, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MIDDLE_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_SIZE, wxSizeEventHandler( ItemEditorFrameUI::OnDrawPanelResize ), NULL, this );
	
}
示例#19
0
    ExampleFrame(
      wxApp& app,
      wxWindow* parent,
      const wxString& title,
      ExampleInfoDisplay* info_disp,
      wxGLContext* context)
      : wxFrame(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize)
      , info_display(info_disp)
      , main_panel(
          new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize))
      , gl_canvas(
          new ExampleGLCanvas((wxEvtHandler*)this, (wxWindow*)main_panel))
      , gl_context(context)
      , frame_no(0)
      , fps_frame_no(0)
      , fps_time(0.0)
      , prim_count(0.0)
      , idle_call_count(0) {
        assert(info_display);
        assert(gl_canvas);
        assert(gl_context);

        wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
        main_panel->SetClientSize(800, 600);
        main_sizer->Add(main_panel, 1, wxEXPAND);

        wxStatusBar* status_bar = new wxStatusBar(this);
        main_sizer->Add(status_bar, 0, wxEXPAND);

        wxBoxSizer* gl_sizer = new wxBoxSizer(wxVERTICAL);
        gl_sizer->Add(gl_canvas, 1, wxEXPAND);
        main_panel->SetSizer(gl_sizer);

        SetSize(
          main_panel->GetSize().GetWidth(),
          main_panel->GetSize().GetHeight() +
            status_bar->GetSize().GetHeight());
        SetSizer(main_sizer);
        Layout();
        Show();

        gl_context->SetCurrent(*gl_canvas);

        // TODO: this won't work very well in "UNICODE" builds
        oglplus::ExampleParams params(app.argc, (char**)app.argv);
        example = oglplus::makeExample(params);
        os_clock.reset();

        HandleResize();

        Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(ExampleFrame::OnClose));
        Connect(wxEVT_MOTION, wxMouseEventHandler(ExampleFrame::OnMouseEvent));
        Connect(wxEVT_SIZE, wxSizeEventHandler(ExampleFrame::OnResize));
        SetExtraStyle(wxWS_EX_PROCESS_IDLE);
        wxIdleEvent::SetMode(wxIDLE_PROCESS_SPECIFIED);
        Connect(wxEVT_IDLE, wxIdleEventHandler(ExampleFrame::OnIdle));
    }
示例#20
0
CWindowStateManager::CWindowStateManager(wxTopLevelWindow* pWindow)
{
	m_pWindow = pWindow;

	m_lastMaximized = false;

	m_pWindow->Connect(wxID_ANY, wxEVT_SIZE, wxSizeEventHandler(CWindowStateManager::OnSize), 0, this);
	m_pWindow->Connect(wxID_ANY, wxEVT_MOVE, wxMoveEventHandler(CWindowStateManager::OnMove), 0, this);
}
示例#21
0
//------------------------------------------------------------------------------
//          custom grid implementation
//------------------------------------------------------------------------------
CustomGrid::CustomGrid( wxWindow *parent, wxWindowID id, const wxPoint &pos,
					   const wxSize &size, long style,
					   const wxString &name )
  : wxGrid( parent, id, pos, size, style, name )
{
    //create grid
    SetTable( new wxGridStringTable(0, 0), true, wxGridSelectRows );
    //some general settings
    EnableEditing( false );
    EnableGridLines( true );
    EnableDragGridSize( false );
    SetMargins( 0, 0 );
    EnableDragColMove( false );
    EnableDragColSize( false );
    EnableDragRowSize( false );
    //init rows pref
    wxFileConfig *pConf = GetOCPNConfigObject();
    if (pConf) {
        pConf->SetPath(_T("/Settings/GRIB"));
        m_IsDigit = pConf->Read(_T("GribDataTableRowPref"), _T("XXX"));
    }
    if( m_IsDigit.Len() != wxString(_T("XXX")).Len() ) m_IsDigit = _T("XXX");
    //create structure for all numerical rows
    for( unsigned int i = 0; i < m_IsDigit.Len(); i++ ){
        m_NumRow.push_back(wxNOT_FOUND);
        m_NumRowVal.push_back(std::vector <double>());
    }
    //init labels attr
    wxFont labelfont = GetOCPNGUIScaledFont_PlugIn( _T("Dialog") ).MakeBold();
    SetLabelFont(labelfont);
    wxColour colour;
    GetGlobalColor(_T("DILG0"), &colour);
    SetLabelBackgroundColour(colour);
    //set row label size
    int w;
    GetTextExtent( _T("Ab"), &w, NULL, 0, 0, &labelfont);
    double x = (double)w * 6.5;
    SetRowLabelSize((int)x);
    //colour settings
    GetGlobalColor(_T("GREEN1"), &m_greenColour);
    GetGlobalColor(_T("DILG1"), &m_greyColour);

#ifdef __WXOSX__
    m_bLeftDown = false;
#endif

    //connect events at dialog level
    Connect(wxEVT_SCROLLWIN_THUMBTRACK, wxScrollEventHandler( CustomGrid::OnScroll ), NULL, this );
    Connect(wxEVT_SIZE, wxSizeEventHandler( CustomGrid::OnResize ), NULL, this );
    Connect(wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( CustomGrid::OnLabeClick ), NULL, this );
    //connect events at grid level
    GetGridWindow()->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler( CustomGrid::OnMouseEvent ), NULL, this );
    GetGridWindow()->Connect(wxEVT_LEFT_UP, wxMouseEventHandler( CustomGrid::OnMouseEvent ), NULL, this );
    GetGridWindow()->Connect(wxEVT_MOTION, wxMouseEventHandler( CustomGrid::OnMouseEvent ), NULL, this );
    //timer event
    m_tRefreshTimer.Connect(wxEVT_TIMER, wxTimerEventHandler( CustomGrid::OnRefreshTimer ), NULL, this);
}
示例#22
0
MyFrame::~MyFrame()
{
    // and disconnect it to prevent accessing already deleted m_textWindow in
    // the size event handler if it's called during destruction
    Disconnect(wxEVT_SIZE, wxSizeEventHandler(MyFrame::OnSize));

    // also prevent its use as log target
    delete wxLog::SetActiveTarget(NULL);
}
示例#23
0
Render::Render(wxWindow* parent) : wxPanel(parent,
	wxID_ANY, wxPoint(), wxSize(100, 100)),
	mMapView(NULL), mWindow(NULL), mViewport(NULL), mActive(true)
{
	// Create Ogre render window.
	Ogre::NameValuePairList params;

	params["externalWindowHandle"] =
		Ogre::StringConverter::toString((size_t)GetHandle());

	Ogre::ConfigFile config;
	config.load("Ogre.cfg");

	if (config.getSetting("Render System") == "Direct3D9 Rendering Subsystem")
	{
		std::string aa = config.getSetting("Anti aliasing", "Direct3D9 Rendering Subsystem");
		std::string vs = config.getSetting("VSync", "Direct3D9 Rendering Subsystem");

		if (aa == "None") params["FSAA"] = "0";
		else if (aa == "Level 2") params["FSAA"] = "2";
		else if (aa == "Level 4") params["FSAA"] = "4";

		if (vs == "Yes") params["vsync"] = "1";
		else params["vsync"] = "0";
	}
	else if (config.getSetting("Render System") == "OpenGL Rendering Subsystem")
	{
		params["FSAA"] = config.getSetting("FSAA", "OpenGL Rendering Subsystem", "0");
		std::string vs = config.getSetting("VSync", "OpenGL Rendering Subsystem");

		if (vs == "Yes") params["vsync"] = "1";
		else params["vsync"] = "0";
	}

	// Create render window (Ogre).
	mWindow = Ogre::Root::getSingleton().createRenderWindow("3d-city", 1600, 1200, false, &params);
	mWindow->setActive(false);

	Ogre::Root::getSingleton().addFrameListener(this);

	// Connect events to wxWidgets window.
	Connect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(Render::onEnterWindow), NULL, this);
	Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(Render::onLeftDown), NULL, this);
	Connect(wxEVT_LEFT_UP, wxMouseEventHandler(Render::onLeftUp), NULL, this);
	Connect(wxEVT_MOTION, wxMouseEventHandler(Render::onMotion), NULL, this);
	Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(Render::onRightDown), NULL, this);
	Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(Render::onRightUp), NULL, this);
	Connect(wxEVT_SIZE, wxSizeEventHandler(Render::onSize), NULL, this);
	Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(Render::onWheel), NULL, this);

	// Set background colour to black.
	SetBackgroundColour(wxColour(0, 0, 0));

	// Start rendering.
	start();
}
示例#24
0
CVideoControlSoft::CVideoControlSoft(wxWindow* parent, wxWindowID id, CWindowMain * windowMain, IVideoInterface * eventPlayer)
: CWindowOpenGLMain("CVideoControl",parent, id)
{
	renderBitmapOpenGL = new Regards::Video::CRenderBitmapInterfaceOpenGL(this);
    printf("CVideoControl initialisation \n");
    
#ifdef WIN32
    renderBitmapOpenGL->Init(this);
#endif  

#ifndef __APPLE__
    int argc = 1;
    char* argv[1] ={wxString((wxTheApp->argv)[0]).char_str()};
    glutInit(&argc, argv);  
#endif

	widthVideo = 0;
	heightVideo = 0;
	subtilteUpdate = false;
	threadVideo = nullptr;
	volumeStart = 64;
	old_width = 0;
	old_height = 0;
	pause = false;
	config = nullptr;
	angle = 0;
	flipV = false;
    newVideo = true;
	flipH = false;
	videoEnd = false;
	exit = false;
	quitWindow = false;
    videoStart = false;
    videoRenderStart = false;
	pictureSubtitle = nullptr;
	video_aspect_ratio = 0.0;
	config = CParamInit::getInstance();
    Connect(wxEVT_PAINT, wxPaintEventHandler(CVideoControlSoft::OnPaint));
    Connect(wxEVT_SIZE, wxSizeEventHandler(CVideoControlSoft::OnSize));
    Connect(EVENT_ENDVIDEOTHREAD, wxCommandEventHandler(CVideoControlSoft::EndVideoThread));
    Connect(EVENT_VIDEOSTART, wxCommandEventHandler(CVideoControlSoft::VideoStart));
	Connect(wxEVT_IDLE, wxIdleEventHandler(CVideoControlSoft::OnIdle));
	Connect(EVENT_VIDEOROTATION, wxCommandEventHandler(CVideoControlSoft::VideoRotation));
    Connect(wxEVENT_VIDEOREFRESH, wxCommandEventHandler(CVideoControlSoft::OnRefresh));
    fpsTimer = new wxTimer(this, TIMER_FPS);
	Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(CVideoControlSoft::OnRButtonDown));
    Connect(TIMER_FPS, wxEVT_TIMER, wxTimerEventHandler(CVideoControlSoft::OnShowFPS), nullptr, this);
	pause = false;
	videoEnd = true;
	this->windowMain = windowMain;
	this->eventPlayer = eventPlayer;
	openCLEngine = nullptr;
	openclContext = nullptr;
	openclEffectYUV = nullptr;
	
}
示例#25
0
//----------------------------------------------------------------
void FailureInfoDialog::ConnectEvents()
/**
 * \brief
 **/
{
	this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(FailureInfoDialog::OnClose));
	this->Connect(wxEVT_SIZE, wxSizeEventHandler(FailureInfoDialog::OnSize));
	m_buttonclose->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
        wxCommandEventHandler(FailureInfoDialog::OnButtonCloseClick), NULL, this);
}
示例#26
0
UppPackageViewWindow::UppPackageViewWindow(wxWindow* parent, wxWindowID id)
    : wxScrolledCanvas( parent, id, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL|wxFULL_REPAINT_ON_RESIZE, _("packageview") )
{
    //SetBackgroundStyle(wxBG_STYLE_COLOUR);
    SetBackgroundColour(*wxWHITE);
    SetScrollRate(20,20);
    Connect(wxEVT_PAINT, wxPaintEventHandler(UppPackageViewWindow::OnPaint), NULL, this);
    Connect(wxEVT_SIZE, wxSizeEventHandler(UppPackageViewWindow::OnSize), NULL, this);
    m_fitting = false;
}
ContenedorHerramientas::ContenedorHerramientas(wxWindow* pPadre) : wxControl(pPadre, -1, wxDefaultPosition, wxDefaultSize)//wxScrolledWindow(pPadre, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL)
{
        Hide();
        SetMinSize(wxSize(300, -1));
        Connect(wxEVT_SIZE, wxSizeEventHandler(ContenedorHerramientas::OnSize));
        m_pSizer = new wxBoxSizer(wxVERTICAL);
        this->SetSizer(m_pSizer);
        m_pSizer->Fit(this);
        Layout();
}
示例#28
0
DisAsmFrame::DisAsmFrame(PPCThread& cpu)
	: wxFrame(NULL, wxID_ANY, "DisAsm")
	, CPU(cpu)
{
	exit = false;
	count = 0;
	wxBoxSizer& s_panel( *new wxBoxSizer(wxVERTICAL) );
	wxBoxSizer& s_b_panel( *new wxBoxSizer(wxHORIZONTAL) );

	m_disasm_list = new wxListView(this);

	wxButton& b_fprev	= *new wxButton(this, wxID_ANY, L"<<");
	wxButton& b_prev	= *new wxButton(this, wxID_ANY, L"<");
	wxButton& b_next	= *new wxButton(this, wxID_ANY, L">");
	wxButton& b_fnext	= *new wxButton(this, wxID_ANY, L">>");

	wxButton& b_dump	= *new wxButton(this, wxID_ANY, L"Dump code");

	wxButton& b_setpc	= *new wxButton(this, wxID_ANY, L"Set PC");

	s_b_panel.Add(&b_fprev);
	s_b_panel.Add(&b_prev);
	s_b_panel.AddSpacer(5);
	s_b_panel.Add(&b_next);
	s_b_panel.Add(&b_fnext);
	s_b_panel.AddSpacer(8);
	s_b_panel.Add(&b_dump);

	s_panel.Add(&s_b_panel);
	s_panel.Add(&b_setpc);
	s_panel.Add(m_disasm_list);

	m_disasm_list->InsertColumn(0, "PC");
	m_disasm_list->InsertColumn(1, "ASM");

	m_disasm_list->SetColumnWidth( 0, 50 );

	for(uint i=0; i<LINES_OPCODES; ++i) m_disasm_list->InsertItem(i, -1);

	SetSizerAndFit( &s_panel );

	SetSize(50, 660);

	Connect( wxEVT_SIZE, wxSizeEventHandler(DisAsmFrame::OnResize) );

	m_app_connector.Connect(m_disasm_list->GetId(), wxEVT_MOUSEWHEEL, wxMouseEventHandler(DisAsmFrame::MouseWheel), (wxObject*)0, this);

	Connect(b_prev.GetId(),  wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::Prev));
	Connect(b_next.GetId(),  wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::Next));
	Connect(b_fprev.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::fPrev));
	Connect(b_fnext.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::fNext));
	Connect(b_setpc.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::SetPc));

	Connect(b_dump.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::Dump));
}
示例#29
0
DIALOG_RESCUE_EACH_BASE::~DIALOG_RESCUE_EACH_BASE()
{
	// Disconnect Events
	this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_RESCUE_EACH_BASE::OnDialogResize ) );
	m_ListOfConflicts->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_RESCUE_EACH_BASE::OnConflictSelect ), NULL, this );
	m_componentViewOld->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_RESCUE_EACH_BASE::OnHandleCachePreviewRepaint ), NULL, this );
	m_componentViewNew->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_RESCUE_EACH_BASE::OnHandleLibraryPreviewRepaint ), NULL, this );
	m_btnNeverShowAgain->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_RESCUE_EACH_BASE::OnNeverShowClick ), NULL, this );
	m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_RESCUE_EACH_BASE::OnCancelClick ), NULL, this );
	
}
示例#30
0
/*****************************************************
**
**   SheetWidget   ---   Constructor
**
******************************************************/
SheetWidget::SheetWidget( wxWindow *parent, ChartProperties *props, SheetConfig *scfg, WriterConfig *wcfg, ColorConfig *ccfg )
: BasicSheetWidget( parent, props, scfg, wcfg, ccfg )
{
	writer = new DcSheetWriter( sheet, getSheetConfig(), writercfg, colorcfg );
	init();
	setWidgetOptions( WO_EXPORT_GRAPHIC );
	minxright = 300;

	Connect( wxEVT_SIZE, wxSizeEventHandler( SheetWidget::OnSize ));
	Connect( CMD_FIRST+1, CMD_GRAPHIC_STYLE+30, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SheetWidget::OnChildCommand ));
}