diff --git a/3d-viewer/3d_canvas.cpp b/3d-viewer/3d_canvas.cpp index b6c1c4a620..dc3a0bb12d 100644 --- a/3d-viewer/3d_canvas.cpp +++ b/3d-viewer/3d_canvas.cpp @@ -54,7 +54,6 @@ enum onrclick_id { */ BEGIN_EVENT_TABLE( Pcb3D_GLCanvas, wxGLCanvas ) -EVT_SIZE( Pcb3D_GLCanvas::OnSize ) EVT_PAINT( Pcb3D_GLCanvas::OnPaint ) EVT_CHAR( Pcb3D_GLCanvas::OnChar ) EVT_MOUSE_EVENTS( Pcb3D_GLCanvas::OnMouseEvent ) @@ -67,7 +66,7 @@ END_EVENT_TABLE() Pcb3D_GLCanvas::Pcb3D_GLCanvas( WinEDA3D_DrawFrame* parent, const wxWindowID id, int* gl_attrib ) : wxGLCanvas( parent, id, - wxPoint( -1, -1 ), wxSize( -1, -1 ), 0, wxT( "Pcb3D_glcanvas" ), gl_attrib ) + wxPoint( -1, -1 ), wxSize( -1, -1 ), wxFULL_REPAINT_ON_RESIZE ) /*************************************************************************/ { m_init = FALSE; @@ -479,36 +478,20 @@ void Pcb3D_GLCanvas::OnPaint( wxPaintEvent& event ) /*************************************************/ { wxPaintDC dc( this ); + // Set the OpenGL viewport according to the client size of this canvas. + // This is done here rather than in a wxSizeEvent handler because our + // OpenGL rendering context (and thus viewport setting) is used with + // multiple canvases: If we updated the viewport in the wxSizeEvent + // handler, changing the size of one canvas causes a viewport setting that + // is wrong when next another canvas is repainted. + const wxSize ClientSize = GetClientSize(); -#ifndef __WXMOTIF__ - if( !GetContext() ) - return; -#endif + glViewport(0, 0, ClientSize.x, ClientSize.y); Redraw(); event.Skip(); } -/*****************************************************/ -void Pcb3D_GLCanvas::OnSize( wxSizeEvent& event ) -/*****************************************************/ -{ - int w, h; - // set GL viewport (not called by wxGLCanvas::OnSize on all platforms...) - // this is also necessary to update the context on some platforms - wxGLCanvas::OnSize( event ); - - GetClientSize( &w, &h ); -#ifndef __WXMOTIF__ - if( GetContext() ) -#endif - { - glViewport( 0, 0, (GLint) w, (GLint) h ); - } - - event.Skip(); -} - /***********************************************************/ void Pcb3D_GLCanvas::OnEraseBackground( wxEraseEvent& event ) diff --git a/3d-viewer/3d_viewer.h b/3d-viewer/3d_viewer.h index 5970831a1d..e4cc103a72 100644 --- a/3d-viewer/3d_viewer.h +++ b/3d-viewer/3d_viewer.h @@ -87,7 +87,6 @@ public: void ClearLists(); void OnPaint(wxPaintEvent& event); - void OnSize(wxSizeEvent& event); void OnEraseBackground(wxEraseEvent& event); void OnChar(wxKeyEvent& event); void OnMouseEvent(wxMouseEvent& event); diff --git a/cvpcb/listboxes.cpp b/cvpcb/listboxes.cpp index 46caf77c9e..9ef2ed078a 100644 --- a/cvpcb/listboxes.cpp +++ b/cvpcb/listboxes.cpp @@ -540,7 +540,7 @@ FOOTPRINT* GetModuleDescrByName( const wxString& FootprintName, { footprint = *i; - if( *footprint->m_Module == FootprintName ) + if( footprint->m_Module == FootprintName ) return footprint; } diff --git a/eeschema/dialog_edit_label.cpp b/eeschema/dialog_edit_label.cpp index 15acf0a27f..55fb99f697 100644 --- a/eeschema/dialog_edit_label.cpp +++ b/eeschema/dialog_edit_label.cpp @@ -47,8 +47,6 @@ void DialogLabelEditor::init() { wxString msg; - SetFont( *g_DialogFont ); - m_TextLabel->SetValue( m_CurrentText->m_Text ); m_TextLabel->SetFocus(); @@ -133,3 +131,13 @@ void DialogLabelEditor::OnButtonCANCEL_Click( wxCommandEvent& event ) m_Parent->DrawPanel->MouseToCursorSchema(); EndModal( -1 ); } + +/*! + * wxTE_PROCESS_ENTER event handler for m_TextLabel + */ + +void DialogLabelEditor::onEnterKey( wxCommandEvent& event ) +{ + TextPropertiesAccept( event ); +} + diff --git a/eeschema/dialog_edit_label.h b/eeschema/dialog_edit_label.h index 000c166238..60b1acd436 100644 --- a/eeschema/dialog_edit_label.h +++ b/eeschema/dialog_edit_label.h @@ -16,8 +16,6 @@ private: WinEDA_SchematicFrame * m_Parent; SCH_TEXT * m_CurrentText; - void init(); - protected: // these are protected so that the static ShowModally() gets used. DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText); @@ -36,7 +34,8 @@ public: static int ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText ); private: - void OnInitDialog( wxInitDialogEvent& event ); + void init( ); + void onEnterKey( wxCommandEvent& event ); void OnButtonOKClick( wxCommandEvent& event ); void OnButtonCANCEL_Click( wxCommandEvent& event ); void TextPropertiesAccept( wxCommandEvent& event ); diff --git a/eeschema/dialog_edit_label_base.cpp b/eeschema/dialog_edit_label_base.cpp index 9d745b984c..c41b491bee 100644 --- a/eeschema/dialog_edit_label_base.cpp +++ b/eeschema/dialog_edit_label_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 7 2008) +// C++ code generated with wxFormBuilder (version Apr 16 2008) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -23,7 +23,7 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, m_staticText1->Wrap( -1 ); bSizer2->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_TextLabel = new wxTextCtrl( this, wxID_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_TextLabel = new wxTextCtrl( this, wxID_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_TextLabel->SetToolTip( _("Enter the text to be used within the schematic") ); bSizer2->Add( m_TextLabel, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); @@ -82,6 +82,7 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, this->Layout(); // Connect Events + m_TextLabel->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::onEnterKey ), NULL, this ); m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnButtonOKClick ), NULL, this ); m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnButtonCANCEL_Click ), NULL, this ); } @@ -89,6 +90,7 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, DialogLabelEditor_Base::~DialogLabelEditor_Base() { // Disconnect Events + m_TextLabel->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::onEnterKey ), NULL, this ); m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnButtonOKClick ), NULL, this ); m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnButtonCANCEL_Click ), NULL, this ); } diff --git a/eeschema/dialog_edit_label_base.fbp b/eeschema/dialog_edit_label_base.fbp index f5b18b4c98..07f54d2c09 100644 --- a/eeschema/dialog_edit_label_base.fbp +++ b/eeschema/dialog_edit_label_base.fbp @@ -37,10 +37,6 @@ Text Editor - - wxFILTER_NONE - wxDefaultValidator - @@ -110,10 +106,6 @@ - - wxFILTER_NONE - wxDefaultValidator - @@ -162,13 +154,9 @@ protected - + wxTE_PROCESS_ENTER Enter the text to be used within the schematic - - wxFILTER_NONE - wxDefaultValidator - @@ -196,7 +184,7 @@ - + onEnterKey @@ -236,10 +224,6 @@ wxRA_SPECIFY_COLS - - wxFILTER_NONE - wxDefaultValidator - @@ -294,10 +278,6 @@ wxRA_SPECIFY_COLS - - wxFILTER_NONE - wxDefaultValidator - @@ -352,10 +332,6 @@ wxRA_SPECIFY_COLS - - wxFILTER_NONE - wxDefaultValidator - @@ -420,10 +396,6 @@ - - wxFILTER_NONE - wxDefaultValidator - @@ -475,10 +447,6 @@ - - wxFILTER_NONE - wxDefaultValidator - @@ -545,10 +513,6 @@ - - wxFILTER_NONE - wxDefaultValidator - @@ -601,10 +565,6 @@ - - wxFILTER_NONE - wxDefaultValidator - diff --git a/eeschema/dialog_edit_label_base.h b/eeschema/dialog_edit_label_base.h index cc462652d6..6cfbaf3493 100644 --- a/eeschema/dialog_edit_label_base.h +++ b/eeschema/dialog_edit_label_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 7 2008) +// C++ code generated with wxFormBuilder (version Apr 16 2008) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -50,12 +50,12 @@ class DialogLabelEditor_Base : public wxDialog wxButton* m_buttonCANCEL; // Virtual event handlers, overide them in your derived class + virtual void onEnterKey( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonOKClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonCANCEL_Click( wxCommandEvent& event ){ event.Skip(); } public: - DialogLabelEditor_Base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 600,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DialogLabelEditor_Base(); diff --git a/kicad/buildmnu.cpp b/kicad/buildmnu.cpp index 752196ced5..62ae03826b 100644 --- a/kicad/buildmnu.cpp +++ b/kicad/buildmnu.cpp @@ -257,34 +257,29 @@ void WinEDA_MainFrame::RecreateBaseHToolbar() SetToolBar( m_HToolBar ); // Set up toolbar - m_HToolBar->AddTool( ID_NEW_PROJECT, wxBitmap( new_project_xpm ), - wxNullBitmap, FALSE, -1, -1, (wxObject*) NULL, + m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, wxBitmap( new_project_xpm ), _( "Start a new project" ) ); // Load project - m_HToolBar->AddTool( ID_LOAD_PROJECT, wxBitmap( open_project_xpm ), - wxNullBitmap, FALSE, -1, -1, (wxObject*) NULL, + m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString, wxBitmap( open_project_xpm ), _( "Load existing project" ) ); // Save project - m_HToolBar->AddTool( ID_SAVE_PROJECT, wxBitmap( save_project_xpm ), - wxNullBitmap, FALSE, -1, -1, (wxObject*) NULL, + m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString, wxBitmap( save_project_xpm ), _( "Save current project" ) ); // Separator m_HToolBar->AddSeparator(); // Save and archive files - m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxBitmap( zip_xpm ), - wxNullBitmap, FALSE, -1, -1, (wxObject*) NULL, + m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString, wxBitmap( zip_xpm ), _( "Archive all project files" ) ); // Tooltip // Separator m_HToolBar->AddSeparator(); // Refresh project tree - m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxBitmap( reload_xpm ), - wxNullBitmap, FALSE, -1, -1, (wxObject*) NULL, + m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString, wxBitmap( reload_xpm ), _( "Refresh project tree" ) ); m_HToolBar->Realize(); // Create m_HToolBar diff --git a/kicad/treeprj_frame.cpp b/kicad/treeprj_frame.cpp index 63ccd74c5c..d7e7775e5f 100644 --- a/kicad/treeprj_frame.cpp +++ b/kicad/treeprj_frame.cpp @@ -985,7 +985,7 @@ void WinEDA_PrjFrame::OnRight( wxTreeEvent& Event ) { // Grrrr! wxMenu does not have any copy constructor !! (do it by hand) wxMenuItem* src = list[i]; - wxString label = src->GetText(); + wxString label = src->GetLabel(); // for obscure reasons, the & is translated into _ ... so replace it label.Replace( wxT( "_" ), wxT( "&" ), true );