Loading change_log.txt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -6,6 +6,11 @@ email address. 2007-Nov-11 UPDATE Geoff Harland <gharlandau@yahoo.com.au> 2007-Nov-11 UPDATE Geoff Harland <gharlandau@yahoo.com.au> ================================================================================ ================================================================================ + eeschema & pcbnew & gerbview * The "Colors" dialog box has been enhanced; the distance between adjacent controls now increases (and in both horizontal and vertical directions) when that dialog is resized. And the "Cancel" button is no longer centre- justified; it is now right-justifed instead. + eeschema + eeschema * A wxStdDialogButtonSizer is now used within the "EESchema Colors" dialog box, * A wxStdDialogButtonSizer is now used within the "EESchema Colors" dialog box, meaning that the sequence of the "OK", "Cancel", and "Apply" buttons within meaning that the sequence of the "OK", "Cancel", and "Apply" buttons within Loading common/selcolor.cpp +44 −58 Original line number Original line Diff line number Diff line /****************/ /****************/ /* SETCOLOR.CPP */ /* SELCOLOR.CPP */ /****************/ /****************/ /* Affichage et selection de la palette des couleurs disponibles /* Affichage et selection de la palette des couleurs disponibles * dans une frame * dans une frame Loading @@ -16,7 +16,7 @@ enum colors_id { enum colors_id { ID_COLOR_BLACK = 2000, // ID_COLOR_ = ID_COLOR_BLACK a ID_COLOR_BLACK + 31 ID_COLOR_BLACK = 2000 // ID_COLOR_ = ID_COLOR_BLACK a ID_COLOR_BLACK + 31 }; }; Loading Loading @@ -73,17 +73,18 @@ int color; WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow *parent, WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow *parent, const wxPoint& framepos, int OldColor ): const wxPoint& framepos, int OldColor ): wxDialog( parent, -1, _("Colors"), framepos, wxDefaultSize, wxDialog( parent, -1, _("Colors"), framepos, wxDefaultSize, DIALOG_STYLE ) wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER ) /*******************************************************************/ /*******************************************************************/ { { wxBoxSizer* OuterBoxSizer = NULL; wxBoxSizer* OuterBoxSizer = NULL; wxBoxSizer* MainBoxSizer = NULL; wxBoxSizer* MainBoxSizer = NULL; wxBoxSizer* ColumnBoxSizer = NULL; wxFlexGridSizer* FlexColumnBoxSizer = NULL; wxBoxSizer* RowBoxSizer = NULL; wxBitmapButton* BitmapButton = NULL; wxBitmapButton* BitmapButton = NULL; wxStaticText* text = NULL; wxStaticText* Label = NULL; wxStaticLine* line = NULL; wxStaticLine* Line = NULL; wxStdDialogButtonSizer* StdDialogButtonSizer = NULL; wxButton* Button = NULL; wxButton* Button = NULL; int ii, butt_ID, buttcolor; int ii, butt_ID, buttcolor; int w = 20, h = 20; int w = 20, h = 20; bool ColorFound = false; bool ColorFound = false; Loading @@ -92,26 +93,31 @@ bool ColorFound = false; SetReturnCode( -1 ); SetReturnCode( -1 ); OuterBoxSizer = new wxBoxSizer(wxVERTICAL); OuterBoxSizer = new wxBoxSizer(wxVERTICAL); SetSizer(OuterBoxSizer); SetSizer(OuterBoxSizer); MainBoxSizer = new wxBoxSizer(wxHORIZONTAL); MainBoxSizer = new wxBoxSizer(wxHORIZONTAL); OuterBoxSizer->Add(MainBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5); OuterBoxSizer->Add(MainBoxSizer, 1, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); for( ii = 0; ColorRefs[ii].m_Name != NULL; ii++ ) for( ii = 0; ColorRefs[ii].m_Name != NULL; ii++ ) { { // Provide a separate column for every eight buttons (and // Provide a separate column for every eight buttons (and their associated text // their associated text strings) // strings), so provide a FlexGrid Sizer with eight rows and two columns. if( ii % 8 == 0 ) if( ii % 8 == 0 ) { { ColumnBoxSizer = new wxBoxSizer(wxVERTICAL); FlexColumnBoxSizer = new wxFlexGridSizer(8, 2, 0, 0); MainBoxSizer->Add(ColumnBoxSizer, 0, wxALIGN_TOP|wxTOP, 5); // Specify that all of the rows can be expanded. for( int ii = 0; ii < 8; ii++ ) { FlexColumnBoxSizer->AddGrowableRow(ii); } } // Provide a sizer for each button and its associated text string // Specify that the second column can also be expanded. RowBoxSizer = new wxBoxSizer(wxHORIZONTAL); FlexColumnBoxSizer->AddGrowableCol(1); ColumnBoxSizer->Add(RowBoxSizer, 0, wxALIGN_LEFT, 5); MainBoxSizer->Add(FlexColumnBoxSizer, 1, wxGROW|wxTOP, 5); } butt_ID = ID_COLOR_BLACK + ii; butt_ID = ID_COLOR_BLACK + ii; wxMemoryDC iconDC; wxMemoryDC iconDC; Loading @@ -134,7 +140,7 @@ bool ColorFound = false; BitmapButton = new wxBitmapButton( this, butt_ID, ButtBitmap, BitmapButton = new wxBitmapButton( this, butt_ID, ButtBitmap, wxDefaultPosition, wxSize( w, h ) ); wxDefaultPosition, wxSize( w, h ) ); RowBoxSizer->Add(BitmapButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxBOTTOM, 5); FlexColumnBoxSizer->Add(BitmapButton, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxBOTTOM, 5); // Set focus to this button if its color matches the // Set focus to this button if its color matches the // color which had been selected previously (for // color which had been selected previously (for Loading @@ -145,9 +151,9 @@ bool ColorFound = false; BitmapButton->SetFocus(); BitmapButton->SetFocus(); } } text = new wxStaticText( this, -1, ColorRefs[ii].m_Name, Label = new wxStaticText( this, -1, ColorRefs[ii].m_Name, wxDefaultPosition, wxDefaultSize, 0 ); wxDefaultPosition, wxDefaultSize, 0 ); RowBoxSizer->Add(text, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); FlexColumnBoxSizer->Add(Label, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); } } // Provide a Cancel button as well, so that this dialog // Provide a Cancel button as well, so that this dialog Loading @@ -155,37 +161,17 @@ bool ColorFound = false; // (and also provide a horizontal static line to separate // (and also provide a horizontal static line to separate // that button from all of the other buttons). // that button from all of the other buttons). line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); Line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); OuterBoxSizer->Add(line, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); OuterBoxSizer->Add(Line, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); #if 0 BottomBoxSizer = new wxBoxSizer(wxHORIZONTAL); OuterBoxSizer->Add(BottomBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); Button = new wxButton( this, wxID_OK, _( "OK" ), wxDefaultPosition, wxDefaultSize, 0 ); StdDialogButtonSizer = new wxStdDialogButtonSizer; Button->SetForegroundColour( *wxRED ); OuterBoxSizer->Add(StdDialogButtonSizer, 0, wxGROW|wxALL, 10); BottomBoxSizer->Add(Button, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); Button = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); Button = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); Button->SetForegroundColour( *wxBLUE ); Button->SetForegroundColour( *wxBLUE ); BottomBoxSizer->Add(Button, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); StdDialogButtonSizer->AddButton(Button); // Dialog boxes usually contain both an "OK" button and a "Cancel" button (and sometimes // also contain an "Apply" button). The previous code implements an additional sizer // (to contain such buttons), then installs that sizer into the outermost sizer, then // implements "OK" and "Cancel" buttons, and then installs those buttons into that sizer. // // However, as this particular dialog does not contain an "OK" button (nor an "Apply" // button), it is not necessary to provide an additional sizer to contain (just) a // "Cancel" button; that button can be installed directly into the outermost sizer // instead. (Note that a value of 10 has been specified for the margin surrounding that // button; that provides the same outcome as specifying the customary value of 5 for both // that button, and the BottomBoxSizer that it would otherwise be installed within.) #endif Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ), wxDefaultPosition, wxDefaultSize, 0 ); StdDialogButtonSizer->Realize(); Button->SetForegroundColour( *wxBLUE ); OuterBoxSizer->Add(Button, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 10); // Set focus to the Cancel button if the currently selected color // Set focus to the Cancel button if the currently selected color // does not match any of the colors provided by this dialog box. // does not match any of the colors provided by this dialog box. Loading Loading
change_log.txt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -6,6 +6,11 @@ email address. 2007-Nov-11 UPDATE Geoff Harland <gharlandau@yahoo.com.au> 2007-Nov-11 UPDATE Geoff Harland <gharlandau@yahoo.com.au> ================================================================================ ================================================================================ + eeschema & pcbnew & gerbview * The "Colors" dialog box has been enhanced; the distance between adjacent controls now increases (and in both horizontal and vertical directions) when that dialog is resized. And the "Cancel" button is no longer centre- justified; it is now right-justifed instead. + eeschema + eeschema * A wxStdDialogButtonSizer is now used within the "EESchema Colors" dialog box, * A wxStdDialogButtonSizer is now used within the "EESchema Colors" dialog box, meaning that the sequence of the "OK", "Cancel", and "Apply" buttons within meaning that the sequence of the "OK", "Cancel", and "Apply" buttons within Loading
common/selcolor.cpp +44 −58 Original line number Original line Diff line number Diff line /****************/ /****************/ /* SETCOLOR.CPP */ /* SELCOLOR.CPP */ /****************/ /****************/ /* Affichage et selection de la palette des couleurs disponibles /* Affichage et selection de la palette des couleurs disponibles * dans une frame * dans une frame Loading @@ -16,7 +16,7 @@ enum colors_id { enum colors_id { ID_COLOR_BLACK = 2000, // ID_COLOR_ = ID_COLOR_BLACK a ID_COLOR_BLACK + 31 ID_COLOR_BLACK = 2000 // ID_COLOR_ = ID_COLOR_BLACK a ID_COLOR_BLACK + 31 }; }; Loading Loading @@ -73,17 +73,18 @@ int color; WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow *parent, WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow *parent, const wxPoint& framepos, int OldColor ): const wxPoint& framepos, int OldColor ): wxDialog( parent, -1, _("Colors"), framepos, wxDefaultSize, wxDialog( parent, -1, _("Colors"), framepos, wxDefaultSize, DIALOG_STYLE ) wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER ) /*******************************************************************/ /*******************************************************************/ { { wxBoxSizer* OuterBoxSizer = NULL; wxBoxSizer* OuterBoxSizer = NULL; wxBoxSizer* MainBoxSizer = NULL; wxBoxSizer* MainBoxSizer = NULL; wxBoxSizer* ColumnBoxSizer = NULL; wxFlexGridSizer* FlexColumnBoxSizer = NULL; wxBoxSizer* RowBoxSizer = NULL; wxBitmapButton* BitmapButton = NULL; wxBitmapButton* BitmapButton = NULL; wxStaticText* text = NULL; wxStaticText* Label = NULL; wxStaticLine* line = NULL; wxStaticLine* Line = NULL; wxStdDialogButtonSizer* StdDialogButtonSizer = NULL; wxButton* Button = NULL; wxButton* Button = NULL; int ii, butt_ID, buttcolor; int ii, butt_ID, buttcolor; int w = 20, h = 20; int w = 20, h = 20; bool ColorFound = false; bool ColorFound = false; Loading @@ -92,26 +93,31 @@ bool ColorFound = false; SetReturnCode( -1 ); SetReturnCode( -1 ); OuterBoxSizer = new wxBoxSizer(wxVERTICAL); OuterBoxSizer = new wxBoxSizer(wxVERTICAL); SetSizer(OuterBoxSizer); SetSizer(OuterBoxSizer); MainBoxSizer = new wxBoxSizer(wxHORIZONTAL); MainBoxSizer = new wxBoxSizer(wxHORIZONTAL); OuterBoxSizer->Add(MainBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5); OuterBoxSizer->Add(MainBoxSizer, 1, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); for( ii = 0; ColorRefs[ii].m_Name != NULL; ii++ ) for( ii = 0; ColorRefs[ii].m_Name != NULL; ii++ ) { { // Provide a separate column for every eight buttons (and // Provide a separate column for every eight buttons (and their associated text // their associated text strings) // strings), so provide a FlexGrid Sizer with eight rows and two columns. if( ii % 8 == 0 ) if( ii % 8 == 0 ) { { ColumnBoxSizer = new wxBoxSizer(wxVERTICAL); FlexColumnBoxSizer = new wxFlexGridSizer(8, 2, 0, 0); MainBoxSizer->Add(ColumnBoxSizer, 0, wxALIGN_TOP|wxTOP, 5); // Specify that all of the rows can be expanded. for( int ii = 0; ii < 8; ii++ ) { FlexColumnBoxSizer->AddGrowableRow(ii); } } // Provide a sizer for each button and its associated text string // Specify that the second column can also be expanded. RowBoxSizer = new wxBoxSizer(wxHORIZONTAL); FlexColumnBoxSizer->AddGrowableCol(1); ColumnBoxSizer->Add(RowBoxSizer, 0, wxALIGN_LEFT, 5); MainBoxSizer->Add(FlexColumnBoxSizer, 1, wxGROW|wxTOP, 5); } butt_ID = ID_COLOR_BLACK + ii; butt_ID = ID_COLOR_BLACK + ii; wxMemoryDC iconDC; wxMemoryDC iconDC; Loading @@ -134,7 +140,7 @@ bool ColorFound = false; BitmapButton = new wxBitmapButton( this, butt_ID, ButtBitmap, BitmapButton = new wxBitmapButton( this, butt_ID, ButtBitmap, wxDefaultPosition, wxSize( w, h ) ); wxDefaultPosition, wxSize( w, h ) ); RowBoxSizer->Add(BitmapButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxBOTTOM, 5); FlexColumnBoxSizer->Add(BitmapButton, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxBOTTOM, 5); // Set focus to this button if its color matches the // Set focus to this button if its color matches the // color which had been selected previously (for // color which had been selected previously (for Loading @@ -145,9 +151,9 @@ bool ColorFound = false; BitmapButton->SetFocus(); BitmapButton->SetFocus(); } } text = new wxStaticText( this, -1, ColorRefs[ii].m_Name, Label = new wxStaticText( this, -1, ColorRefs[ii].m_Name, wxDefaultPosition, wxDefaultSize, 0 ); wxDefaultPosition, wxDefaultSize, 0 ); RowBoxSizer->Add(text, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); FlexColumnBoxSizer->Add(Label, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); } } // Provide a Cancel button as well, so that this dialog // Provide a Cancel button as well, so that this dialog Loading @@ -155,37 +161,17 @@ bool ColorFound = false; // (and also provide a horizontal static line to separate // (and also provide a horizontal static line to separate // that button from all of the other buttons). // that button from all of the other buttons). line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); Line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); OuterBoxSizer->Add(line, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); OuterBoxSizer->Add(Line, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); #if 0 BottomBoxSizer = new wxBoxSizer(wxHORIZONTAL); OuterBoxSizer->Add(BottomBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); Button = new wxButton( this, wxID_OK, _( "OK" ), wxDefaultPosition, wxDefaultSize, 0 ); StdDialogButtonSizer = new wxStdDialogButtonSizer; Button->SetForegroundColour( *wxRED ); OuterBoxSizer->Add(StdDialogButtonSizer, 0, wxGROW|wxALL, 10); BottomBoxSizer->Add(Button, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); Button = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); Button = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); Button->SetForegroundColour( *wxBLUE ); Button->SetForegroundColour( *wxBLUE ); BottomBoxSizer->Add(Button, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); StdDialogButtonSizer->AddButton(Button); // Dialog boxes usually contain both an "OK" button and a "Cancel" button (and sometimes // also contain an "Apply" button). The previous code implements an additional sizer // (to contain such buttons), then installs that sizer into the outermost sizer, then // implements "OK" and "Cancel" buttons, and then installs those buttons into that sizer. // // However, as this particular dialog does not contain an "OK" button (nor an "Apply" // button), it is not necessary to provide an additional sizer to contain (just) a // "Cancel" button; that button can be installed directly into the outermost sizer // instead. (Note that a value of 10 has been specified for the margin surrounding that // button; that provides the same outcome as specifying the customary value of 5 for both // that button, and the BottomBoxSizer that it would otherwise be installed within.) #endif Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ), wxDefaultPosition, wxDefaultSize, 0 ); StdDialogButtonSizer->Realize(); Button->SetForegroundColour( *wxBLUE ); OuterBoxSizer->Add(Button, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 10); // Set focus to the Cancel button if the currently selected color // Set focus to the Cancel button if the currently selected color // does not match any of the colors provided by this dialog box. // does not match any of the colors provided by this dialog box. Loading