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

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

parent b8a0ab4c
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -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 );
+11 −0
Original line number Diff line number Diff line
@@ -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();
+1 −1
Original line number Diff line number Diff line
@@ -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 );
	
+1 −1
Original line number Diff line number Diff line
@@ -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>