Commit 2b394c7c authored by Dick Hollenbeck's avatar Dick Hollenbeck

dialog_page_settings needed right border space, retain last dialog size and position

parent b8a0ab4c
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
#include <dialog_page_settings.h> #include <dialog_page_settings.h>
// dialog should remember its previous screen position and size
wxPoint DIALOG_PAGES_SETTINGS::s_LastPos( -1, -1 );
wxSize DIALOG_PAGES_SETTINGS::s_LastSize;
void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event ) void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event )
{ {
...@@ -163,6 +167,35 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -163,6 +167,35 @@ void DIALOG_PAGES_SETTINGS::initDialog()
} }
bool DIALOG_PAGES_SETTINGS::Show( bool show )
{
bool ret;
if( show )
{
ret = DIALOG_PAGES_SETTINGS_BASE::Show( show );
if( s_LastPos.x != -1 )
{
SetSize( s_LastPos.x, s_LastPos.y, s_LastSize.x, s_LastSize.y, 0 );
}
else
{
// Do nothing: last position not yet saved.
}
}
else
{
// Save the dialog's position before hiding
s_LastPos = GetPosition();
s_LastSize = GetSize();
ret = DIALOG_PAGES_SETTINGS_BASE::Show( show );
}
return ret;
}
void DIALOG_PAGES_SETTINGS::OnCloseWindow( wxCloseEvent& event ) void DIALOG_PAGES_SETTINGS::OnCloseWindow( wxCloseEvent& event )
{ {
EndModal( m_modified ); EndModal( m_modified );
......
...@@ -19,10 +19,21 @@ private: ...@@ -19,10 +19,21 @@ private:
bool m_modified; bool m_modified;
PAGE_INFO m_user_size; ///< instantiated just to get the size PAGE_INFO m_user_size; ///< instantiated just to get the size
static wxSize s_LastSize; ///< last position and size
static wxPoint s_LastPos;
public: public:
DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ); DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent );
~DIALOG_PAGES_SETTINGS(); ~DIALOG_PAGES_SETTINGS();
/**
* Function Show
* overloads the wxDialog::Show() function so it can position the
* dialog at its remembered size and position.
*/
bool Show( bool show );
private: private:
/// Initialises member variables /// Initialises member variables
void initDialog(); void initDialog();
......
...@@ -201,7 +201,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind ...@@ -201,7 +201,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind
RightColumnSizer->Add( Comment4Sizer, 1, wxEXPAND, 5 ); RightColumnSizer->Add( Comment4Sizer, 1, wxEXPAND, 5 );
bUpperSizerH->Add( RightColumnSizer, 1, wxEXPAND, 5 ); bUpperSizerH->Add( RightColumnSizer, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bUpperSizerH, 1, wxEXPAND, 5 ); bMainSizer->Add( bUpperSizerH, 1, wxEXPAND, 5 );
......
...@@ -746,7 +746,7 @@ ...@@ -746,7 +746,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="1"> <object class="wxFlexGridSizer" expanded="1">
<property name="cols">1</property> <property name="cols">1</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment