From 1e6a46528d999c2c5cdf700a4a754ee2b2fa2403 Mon Sep 17 00:00:00 2001 From: stambaughw Date: Fri, 1 May 2009 19:46:52 +0000 Subject: [PATCH] Removed non-standard dialog UI control text colors missed in last commit. --- eeschema/pinedit-dialog.cpp | 6 +- eeschema/pinedit-dialog.pjd | 8 +- pcbnew/dialog_copper_zones_base.cpp | 5 -- pcbnew/dialog_copper_zones_base.fbp | 6 +- pcbnew/dialog_pcb_text_properties.cpp | 103 +++++++++++++------------- 5 files changed, 59 insertions(+), 69 deletions(-) diff --git a/eeschema/pinedit-dialog.cpp b/eeschema/pinedit-dialog.cpp index 07dcdbda09..9a266b53ab 100644 --- a/eeschema/pinedit-dialog.cpp +++ b/eeschema/pinedit-dialog.cpp @@ -135,7 +135,7 @@ bool WinEDA_PinPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const w void WinEDA_PinPropertiesFrame::CreateControls() { ////@begin WinEDA_PinPropertiesFrame content construction - // Generated by DialogBlocks, 24/04/2009 14:24:14 (unregistered) + // Generated by DialogBlocks, 01/05/2009 16:19:57 (unregistered) WinEDA_PinPropertiesFrame* itemDialog1 = this; @@ -161,7 +161,6 @@ void WinEDA_PinPropertiesFrame::CreateControls() wxStaticBox* itemStaticBoxSizer9Static = new wxStaticBox(itemDialog1, wxID_ANY, _(" Pin Options :")); wxStaticBoxSizer* itemStaticBoxSizer9 = new wxStaticBoxSizer(itemStaticBoxSizer9Static, wxVERTICAL); - itemStaticBoxSizer9Static->SetForegroundColour(wxColour(64, 0, 128)); itemBoxSizer3->Add(itemStaticBoxSizer9, 0, wxGROW|wxALL, 5); wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL); @@ -214,7 +213,6 @@ void WinEDA_PinPropertiesFrame::CreateControls() m_PinOrientStrings.Add(_("Down")); m_PinOrient = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Pin Orient:"), wxDefaultPosition, wxDefaultSize, m_PinOrientStrings, 1, wxRA_SPECIFY_COLS ); m_PinOrient->SetSelection(0); - m_PinOrient->SetForegroundColour(wxColour(41, 84, 84)); itemBoxSizer17->Add(m_PinOrient, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL); @@ -243,7 +241,6 @@ void WinEDA_PinPropertiesFrame::CreateControls() m_PinShapeStrings.Add(_("low out")); m_PinShape = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Pin Shape:"), wxDefaultPosition, wxDefaultSize, m_PinShapeStrings, 1, wxRA_SPECIFY_COLS ); m_PinShape->SetSelection(0); - m_PinShape->SetForegroundColour(wxColour(0, 64, 0)); itemBoxSizer28->Add(m_PinShape, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxArrayString m_PinElectricalTypeStrings; @@ -259,7 +256,6 @@ void WinEDA_PinPropertiesFrame::CreateControls() m_PinElectricalTypeStrings.Add(_("Open emit")); m_PinElectricalType = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Electrical Type:"), wxDefaultPosition, wxDefaultSize, m_PinElectricalTypeStrings, 1, wxRA_SPECIFY_COLS ); m_PinElectricalType->SetSelection(0); - m_PinElectricalType->SetForegroundColour(wxColour(68, 68, 34)); itemBoxSizer28->Add(m_PinElectricalType, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); ////@end WinEDA_PinPropertiesFrame content construction diff --git a/eeschema/pinedit-dialog.pjd b/eeschema/pinedit-dialog.pjd index dd0b2a142f..c38b57d585 100644 --- a/eeschema/pinedit-dialog.pjd +++ b/eeschema/pinedit-dialog.pjd @@ -673,7 +673,7 @@ " Pin Options :" "" "" - "400080" + "" "" 0 1 @@ -1519,7 +1519,7 @@ "" "" "" - "295454" + "" "" 0 1 @@ -1794,7 +1794,7 @@ "" "" "" - "004000" + "" "" 0 1 @@ -1858,7 +1858,7 @@ "" "" "" - "444422" + "" "" 0 1 diff --git a/pcbnew/dialog_copper_zones_base.cpp b/pcbnew/dialog_copper_zones_base.cpp index fc5a264999..6bb0b7f8f9 100644 --- a/pcbnew/dialog_copper_zones_base.cpp +++ b/pcbnew/dialog_copper_zones_base.cpp @@ -148,20 +148,15 @@ dialog_copper_zone_base::dialog_copper_zone_base( wxWindow* parent, wxWindowID i m_RightBoxSizer = new wxBoxSizer( wxVERTICAL ); m_ExportSetupButton = new wxButton( this, wxID_BUTTON_EXPORT, _("Export Setup to other zones"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ExportSetupButton->SetForegroundColour( wxColour( 51, 111, 40 ) ); m_ExportSetupButton->SetToolTip( _("Export this zone setup to all other copper zones") ); m_RightBoxSizer->Add( m_ExportSetupButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_OkButton = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); m_OkButton->SetDefault(); - m_OkButton->SetForegroundColour( wxColour( 140, 49, 47 ) ); - m_RightBoxSizer->Add( m_OkButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_ButtonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ButtonCancel->SetForegroundColour( wxColour( 45, 38, 155 ) ); - m_RightBoxSizer->Add( m_ButtonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); diff --git a/pcbnew/dialog_copper_zones_base.fbp b/pcbnew/dialog_copper_zones_base.fbp index 454a06481e..9d2de55420 100644 --- a/pcbnew/dialog_copper_zones_base.fbp +++ b/pcbnew/dialog_copper_zones_base.fbp @@ -919,7 +919,7 @@ 0 1 - 51,111,40 + 0 wxID_BUTTON_EXPORT @@ -971,7 +971,7 @@ 1 1 - 140,49,47 + 0 wxID_OK @@ -1023,7 +1023,7 @@ 0 1 - 45,38,155 + 0 wxID_CANCEL diff --git a/pcbnew/dialog_pcb_text_properties.cpp b/pcbnew/dialog_pcb_text_properties.cpp index 113af185c0..e6196d0680 100644 --- a/pcbnew/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialog_pcb_text_properties.cpp @@ -43,24 +43,23 @@ public: private: - void OnOkClick( wxCommandEvent& event ); - void OnCancelClick( wxCommandEvent& event ); + void OnOkClick( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE( WinEDA_TextPCBPropertiesFrame, wxDialog ) -EVT_BUTTON( wxID_OK, WinEDA_TextPCBPropertiesFrame::OnOkClick ) -EVT_BUTTON( wxID_CANCEL, WinEDA_TextPCBPropertiesFrame::OnCancelClick ) + EVT_BUTTON( wxID_OK, WinEDA_TextPCBPropertiesFrame::OnOkClick ) + EVT_BUTTON( wxID_CANCEL, WinEDA_TextPCBPropertiesFrame::OnCancelClick ) END_EVENT_TABLE() -/******************************************************************************/ void WinEDA_PcbFrame::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC ) -/*******************************************************************************/ { DrawPanel->m_IgnoreMouseEvents = TRUE; - WinEDA_TextPCBPropertiesFrame* frame = new WinEDA_TextPCBPropertiesFrame( this, TextPCB, DC ); + WinEDA_TextPCBPropertiesFrame* frame = + new WinEDA_TextPCBPropertiesFrame( this, TextPCB, DC ); frame->ShowModal(); frame->Destroy(); DrawPanel->MouseToCursorSchema(); @@ -68,14 +67,14 @@ void WinEDA_PcbFrame::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC ) } -/************************************************************************************/ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* parent, - TEXTE_PCB* TextPCB, wxDC* DC ) : - wxDialog( parent, -1, _( "TextPCB properties" ), wxDefaultPosition, wxSize( 390, 340 ) ) -/************************************************************************************/ + TEXTE_PCB* TextPCB, + wxDC* DC ) : + wxDialog( parent, -1, _( "TextPCB properties" ), wxDefaultPosition, + wxSize( 390, 340 ) ) { - wxButton* Button; - BOARD* board = parent->GetBoard(); + wxButton* Button; + BOARD* board = parent->GetBoard(); m_Parent = parent; @@ -96,37 +95,38 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p /* Creation des boutons de commande */ Button = new wxButton( this, wxID_OK, _( "OK" ) ); - Button->SetForegroundColour( *wxRED ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Button->SetDefault(); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); - Button->SetForegroundColour( *wxBLUE ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); m_Name = new WinEDA_EnterText( this, _( "Text:" ), - TextPCB->m_Text, - LeftBoxSizer, wxSize( 200, 60 ),true ); + TextPCB->m_Text, + LeftBoxSizer, wxSize( 200, 60 ), true ); m_Name->SetFocus(); m_Name->SetSelection( -1, -1 ); m_TxtSizeCtrl = new WinEDA_SizeCtrl( this, _( "Size" ), TextPCB->m_Size, - g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); + g_UnitMetric, LeftBoxSizer, + m_Parent->m_InternalUnits ); m_TxtWidthCtlr = new WinEDA_ValueCtrl( this, _( "Width" ), TextPCB->m_Width, - g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); + g_UnitMetric, LeftBoxSizer, + m_Parent->m_InternalUnits ); m_TxtPosCtrl = new WinEDA_PositionCtrl( this, _( "Position" ), TextPCB->m_Pos, - g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits ); + g_UnitMetric, LeftBoxSizer, + m_Parent->m_InternalUnits ); m_SelLayerBox = new WinEDAChoiceBox( this, ID_TEXTPCB_SELECT_LAYER, wxDefaultPosition, wxDefaultSize ); MiddleBoxSizer->Add( m_SelLayerBox, 0, wxGROW | wxALL, 5 ); - for( int layer=0; layerAppend( board->GetLayerName( layer ) ); } @@ -134,11 +134,13 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p m_SelLayerBox->SetSelection( TextPCB->GetLayer() ); - static const wxString orient_msg[4] = { - wxT( "0" ), wxT( "90" ), wxT( "180" ), wxT( "-90" ) }; + static const wxString orient_msg[4] = + { + wxT( "0" ), wxT( "90" ), wxT( "180" ), wxT( "-90" ) + }; - m_Orient = new wxRadioBox( this, -1, _( "Orientation" ), - wxDefaultPosition, wxSize( -1, -1 ), 4, orient_msg, + m_Orient = new wxRadioBox( this, -1, _( "Orientation" ), wxDefaultPosition, + wxSize( -1, -1 ), 4, orient_msg, 1, wxRA_SPECIFY_COLS ); MiddleBoxSizer->Add( m_Orient, 0, wxGROW | wxALL, 5 ); @@ -162,21 +164,21 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p } wxString display_msg[2] = { _( "Normal" ), _( "Mirror" ) }; - m_Mirror = new wxRadioBox( this, -1, _( "Display" ), - wxDefaultPosition, wxSize( -1, -1 ), 2, display_msg, + m_Mirror = new wxRadioBox( this, -1, _( "Display" ), wxDefaultPosition, + wxSize( -1, -1 ), 2, display_msg, 1, wxRA_SPECIFY_COLS ); if( TextPCB->m_Mirror ) m_Mirror->SetSelection( 1 ); MiddleBoxSizer->Add( m_Mirror, 0, wxGROW | wxALL, 5 ); - int style = 0; - if (CurrentTextPCB->m_Italic ) + int style = 0; + if( CurrentTextPCB->m_Italic ) style = 1; wxString style_msg[] = { _( "Normal" ), _( "Italic" ) }; - m_Style = new wxRadioBox( this, -1, _( "Style" ), - wxDefaultPosition, wxSize( -1, -1 ), 2, style_msg, - 1, wxRA_SPECIFY_COLS ); - m_Style->SetSelection(style); + m_Style = new wxRadioBox( this, -1, _( "Style" ), wxDefaultPosition, + wxSize( -1, -1 ), 2, style_msg, + 1, wxRA_SPECIFY_COLS ); + m_Style->SetSelection( style ); MiddleBoxSizer->Add( m_Style, 0, wxGROW | wxALL, 5 ); GetSizer()->Fit( this ); @@ -184,27 +186,24 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p } -/**********************************************************************/ -void WinEDA_TextPCBPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) ) -/**********************************************************************/ +void WinEDA_TextPCBPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED( event ) ) { - EndModal( -1 ); + EndModal( wxID_CANCEL ); } -/**************************************************************************************/ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event ) -/**************************************************************************************/ { - // test for acceptable values for parameters: - wxSize newsize = m_TxtSizeCtrl->GetValue(); - if ( newsize.x < TEXTS_MIN_SIZE ) +// test for acceptable values for parameters: + wxSize newsize = m_TxtSizeCtrl->GetValue(); + + if( newsize.x < TEXTS_MIN_SIZE ) newsize.x = TEXTS_MIN_SIZE; - if ( newsize.y < TEXTS_MIN_SIZE ) + if( newsize.y < TEXTS_MIN_SIZE ) newsize.y = TEXTS_MIN_SIZE; - if ( newsize.x > TEXTS_MAX_WIDTH ) + if( newsize.x > TEXTS_MAX_WIDTH ) newsize.x = TEXTS_MAX_WIDTH; - if ( newsize.y > TEXTS_MAX_WIDTH ) + if( newsize.y > TEXTS_MAX_WIDTH ) newsize.y = TEXTS_MAX_WIDTH; if( m_DC ) // Erase old text on screen @@ -216,14 +215,15 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event ) { CurrentTextPCB->m_Text = m_Name->GetValue(); } - CurrentTextPCB->m_Pos = m_TxtPosCtrl->GetValue(); - CurrentTextPCB->m_Size = newsize; + CurrentTextPCB->m_Pos = m_TxtPosCtrl->GetValue(); + CurrentTextPCB->m_Size = newsize; + + CurrentTextPCB->m_Width = m_TxtWidthCtlr->GetValue(); - CurrentTextPCB->m_Width = m_TxtWidthCtlr->GetValue(); // test for acceptable values for parameters: - int max_tickness = min( CurrentTextPCB->m_Size.x, CurrentTextPCB->m_Size.y); + int max_tickness = min( CurrentTextPCB->m_Size.x, CurrentTextPCB->m_Size.y ); max_tickness /= 4; - if ( CurrentTextPCB->m_Width > max_tickness) + if( CurrentTextPCB->m_Width > max_tickness ) CurrentTextPCB->m_Width = max_tickness; CurrentTextPCB->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false; @@ -233,9 +233,8 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event ) if( m_DC ) // Display new text { - CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_OR ); + CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_OR ); } m_Parent->GetScreen()->SetModify(); EndModal( 1 ); } -