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 @@
#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 )
{
......@@ -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 )
{
EndModal( m_modified );
......
......@@ -19,10 +19,21 @@ private:
bool m_modified;
PAGE_INFO m_user_size; ///< instantiated just to get the size
static wxSize s_LastSize; ///< last position and size
static wxPoint s_LastPos;
public:
DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent );
~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:
/// Initialises member variables
void initDialog();
......
......@@ -201,7 +201,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind
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 );
......
......@@ -746,7 +746,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="1">
<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