Browse Source

Try to fix initial widgets size calculations on KDE, when using notebooks in dialogs

pull/3/merge
jean-pierre charras 10 years ago
parent
commit
1ab1dca46c
  1. 1
      3d-viewer/3d_cache/dialogs/panel_prev_model.cpp
  2. 5
      common/dialog_shim.cpp
  3. 4
      pcbnew/dialogs/dialog_drc.cpp
  4. 3
      pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp
  5. 9
      pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h
  6. 2
      pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp
  7. 2
      pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp
  8. 1
      pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h
  9. 3
      pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp
  10. 9
      pcbnew/dialogs/dialog_edit_module_for_Modedit.h
  11. 2
      pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp
  12. 2
      pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp
  13. 1
      pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h

1
3d-viewer/3d_cache/dialogs/panel_prev_model.cpp

@ -290,7 +290,6 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, S3D_CACHE* aCacheManager ) :
}
SetSizerAndFit( mainBox );
Centre();
return;
}

5
common/dialog_shim.cpp

@ -107,6 +107,11 @@ void DIALOG_SHIM::FinishDialogSettings()
// SetSizeHints fixes the minimal size of sizers in the dialog
// (SetSizeHints calls Fit(), so no need to call it)
GetSizer()->SetSizeHints( this );
wxSizeEvent event;
event.SetSize( GetSize() );
wxPostEvent( this, event );
// the default position, when calling the first time the dlg
Center();
}

4
pcbnew/dialogs/dialog_drc.cpp

@ -51,9 +51,7 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent ) :
InitValues();
GetSizer()->SetSizeHints( this );
Centre();
FinishDialogSettings();
}

3
pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp

@ -87,8 +87,7 @@ DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent
m_LastSelected3DShapeIndex = 0;
m_OrientValue = 0;
GetSizer()->SetSizeHints( this );
Centre();
Layout();
}

9
pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h

@ -92,6 +92,15 @@ private:
void ModuleOrientEvent( wxCommandEvent& event );
void Cfg3DPath( wxCommandEvent& event );
void OnInitDlg( wxInitDialogEvent& event )
{
// Call the default wxDialog handler of a wxInitDialogEvent
TransferDataToWindow();
// Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();
}
bool TransferDataToWindow();
bool TransferDataFromWindow();
};

2
pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp

@ -364,6 +364,7 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare
m_GeneralBoxSizer->Fit( this );
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnInitDlg ) );
m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditReference ), NULL, this );
m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditValue ), NULL, this );
m_OrientCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ModuleOrientEvent ), NULL, this );
@ -380,6 +381,7 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare
DIALOG_MODULE_BOARD_EDITOR_BASE::~DIALOG_MODULE_BOARD_EDITOR_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnInitDlg ) );
m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditReference ), NULL, this );
m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditValue ), NULL, this );
m_OrientCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ModuleOrientEvent ), NULL, this );

2
pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp

@ -67,7 +67,7 @@
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnInitDialog">OnInitDlg</event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>

1
pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h

@ -115,6 +115,7 @@ class DIALOG_MODULE_BOARD_EDITOR_BASE : public DIALOG_SHIM
wxButton* m_sdbSizerStdButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnEditReference( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEditValue( wxCommandEvent& event ) { event.Skip(); }
virtual void ModuleOrientEvent( wxCommandEvent& event ) { event.Skip(); }

3
pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp

@ -81,8 +81,7 @@ DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR( FOOTPRINT_EDIT_FRAME*
m_NoteBook->SetSelection( m_page );
m_sdbSizerStdButtonsOK->SetDefault();
GetSizer()->SetSizeHints( this );
Centre();
Layout();
}

9
pcbnew/dialogs/dialog_edit_module_for_Modedit.h

@ -75,6 +75,15 @@ private:
void OnCancelClick( wxCommandEvent& event );
void OnOkClick( wxCommandEvent& event );
void Cfg3DPath( wxCommandEvent& event );
void OnInitDlg( wxInitDialogEvent& event )
{
// Call the default wxDialog handler of a wxInitDialogEvent
TransferDataToWindow();
// Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();
}
};

2
pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp

@ -298,6 +298,7 @@ DIALOG_MODULE_MODULE_EDITOR_BASE::DIALOG_MODULE_MODULE_EDITOR_BASE( wxWindow* pa
this->Layout();
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_MODULE_MODULE_EDITOR_BASE::OnInitDlg ) );
m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_MODULE_EDITOR_BASE::OnEditReference ), NULL, this );
m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_MODULE_EDITOR_BASE::OnEditValue ), NULL, this );
m_3D_ShapeNameListBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_MODULE_EDITOR_BASE::On3DShapeNameSelected ), NULL, this );
@ -313,6 +314,7 @@ DIALOG_MODULE_MODULE_EDITOR_BASE::DIALOG_MODULE_MODULE_EDITOR_BASE( wxWindow* pa
DIALOG_MODULE_MODULE_EDITOR_BASE::~DIALOG_MODULE_MODULE_EDITOR_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_MODULE_MODULE_EDITOR_BASE::OnInitDlg ) );
m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_MODULE_EDITOR_BASE::OnEditReference ), NULL, this );
m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_MODULE_EDITOR_BASE::OnEditValue ), NULL, this );
m_3D_ShapeNameListBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_MODULE_EDITOR_BASE::On3DShapeNameSelected ), NULL, this );

2
pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp

@ -67,7 +67,7 @@
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnInitDialog">OnInitDlg</event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>

1
pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h

@ -99,6 +99,7 @@ class DIALOG_MODULE_MODULE_EDITOR_BASE : public DIALOG_SHIM
wxButton* m_sdbSizerStdButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnEditReference( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEditValue( wxCommandEvent& event ) { event.Skip(); }
virtual void On3DShapeNameSelected( wxCommandEvent& event ) { event.Skip(); }

Loading…
Cancel
Save