Loading include/wxPcbStruct.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -542,7 +542,15 @@ public: void ReCreateMicrowaveVToolbar(); void ReCreateMicrowaveVToolbar(); void ReCreateOptToolbar(); void ReCreateOptToolbar(); void ReCreateMenuBar(); void ReCreateMenuBar(); PCB_LAYER_BOX_SELECTOR* ReCreateLayerBox( wxAuiToolBar* parent ); /** * Re create the layer Box by clearing the old list, and building * le new one, from the new layers names and cole layers * @param aForceResizeToolbar = true to resize the parent toolbar * false if not needed (mainly in parent toolbar creation, * or when the layers names are not modified) */ void ReCreateLayerBox( bool aForceResizeToolbar = true ); /** /** * Function OnModify * Function OnModify Loading pcbnew/class_pcb_layer_box_selector.cpp +4 −9 Original line number Original line Diff line number Diff line Loading @@ -51,10 +51,8 @@ void PCB_LAYER_BOX_SELECTOR::Resync() static DECLARE_LAYERS_HOTKEY( layerhk ); static DECLARE_LAYERS_HOTKEY( layerhk ); // Tray to fix a minimum width fot the BitmapComboBox // Tray to fix a minimum width fot the BitmapComboBox int minwidth, h; int minwidth = 80, h; wxClientDC dc( GetParent() ); // The DC for "this" is not always initialized wxClientDC dc( GetParent() ); // The DC for "this" is not always initialized wxString dummyText( wxT("XXXXXXXXXXXX") ); dc.GetTextExtent ( dummyText, &minwidth, &h ); #define BM_SIZE 14 #define BM_SIZE 14 for( LAYER_NUM i = FIRST_LAYER; i < NB_LAYERS; ++i ) for( LAYER_NUM i = FIRST_LAYER; i < NB_LAYERS; ++i ) Loading Loading @@ -83,14 +81,11 @@ void PCB_LAYER_BOX_SELECTOR::Resync() Append( layername, layerbmp, (void*)(intptr_t) layerid ); Append( layername, layerbmp, (void*)(intptr_t) layerid ); int w; int w; dc.GetTextExtent ( layername, &w, &h ); dc.GetTextExtent ( layername, &w, &h ); minwidth = std::max( minwidth, w ); minwidth = std::max( minwidth, w ); } } minwidth += BM_SIZE + 12; // Take in account the bitmap size and margins minwidth += BM_SIZE + 35; // Take in account the bitmap size and margins wxLogMessage( "minw %d min %d", minwidth, GetMinClientSize().x ); SetMinClientSize( wxSize( minwidth, -1 ) ); // SetMinClientSize( wxSize( minwidth, -1 ) ); Layout(); } } Loading pcbnew/class_pcb_layer_widget.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -341,7 +341,7 @@ void PCB_LAYER_WIDGET::ReFill() void PCB_LAYER_WIDGET::OnLayerColorChange( LAYER_NUM aLayer, EDA_COLOR_T aColor ) void PCB_LAYER_WIDGET::OnLayerColorChange( LAYER_NUM aLayer, EDA_COLOR_T aColor ) { { myframe->GetBoard()->SetLayerColor( aLayer, aColor ); myframe->GetBoard()->SetLayerColor( aLayer, aColor ); myframe->ReCreateLayerBox( NULL ); myframe->ReCreateLayerBox( false ); myframe->GetCanvas()->Refresh(); myframe->GetCanvas()->Refresh(); } } Loading pcbnew/dialogs/dialog_layers_setup.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -560,7 +560,7 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event ) } } m_Parent->OnModify(); m_Parent->OnModify(); m_Parent->ReCreateLayerBox( NULL ); m_Parent->ReCreateLayerBox(); m_Parent->ReFillLayerWidget(); m_Parent->ReFillLayerWidget(); EndModal( wxID_OK ); EndModal( wxID_OK ); Loading pcbnew/files.cpp +2 −3 Original line number Original line Diff line number Diff line Loading @@ -141,7 +141,7 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event ) fn.SetExt( PcbFileExtension ); fn.SetExt( PcbFileExtension ); GetBoard()->SetFileName( fn.GetFullPath() ); GetBoard()->SetFileName( fn.GetFullPath() ); UpdateTitle(); UpdateTitle(); ReCreateLayerBox( NULL ); ReCreateLayerBox(); } } break; break; Loading Loading @@ -396,8 +396,7 @@ bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend, // Update info shown by the horizontal toolbars // Update info shown by the horizontal toolbars GetBoard()->SetCurrentNetClass( NETCLASS::Default ); GetBoard()->SetCurrentNetClass( NETCLASS::Default ); ReFillLayerWidget(); ReFillLayerWidget(); ReCreateLayerBox(); ReCreateLayerBox( NULL ); // upate the layer widget to match board visibility states, both layers and render columns. // upate the layer widget to match board visibility states, both layers and render columns. syncLayerVisibilities(); syncLayerVisibilities(); Loading Loading
include/wxPcbStruct.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -542,7 +542,15 @@ public: void ReCreateMicrowaveVToolbar(); void ReCreateMicrowaveVToolbar(); void ReCreateOptToolbar(); void ReCreateOptToolbar(); void ReCreateMenuBar(); void ReCreateMenuBar(); PCB_LAYER_BOX_SELECTOR* ReCreateLayerBox( wxAuiToolBar* parent ); /** * Re create the layer Box by clearing the old list, and building * le new one, from the new layers names and cole layers * @param aForceResizeToolbar = true to resize the parent toolbar * false if not needed (mainly in parent toolbar creation, * or when the layers names are not modified) */ void ReCreateLayerBox( bool aForceResizeToolbar = true ); /** /** * Function OnModify * Function OnModify Loading
pcbnew/class_pcb_layer_box_selector.cpp +4 −9 Original line number Original line Diff line number Diff line Loading @@ -51,10 +51,8 @@ void PCB_LAYER_BOX_SELECTOR::Resync() static DECLARE_LAYERS_HOTKEY( layerhk ); static DECLARE_LAYERS_HOTKEY( layerhk ); // Tray to fix a minimum width fot the BitmapComboBox // Tray to fix a minimum width fot the BitmapComboBox int minwidth, h; int minwidth = 80, h; wxClientDC dc( GetParent() ); // The DC for "this" is not always initialized wxClientDC dc( GetParent() ); // The DC for "this" is not always initialized wxString dummyText( wxT("XXXXXXXXXXXX") ); dc.GetTextExtent ( dummyText, &minwidth, &h ); #define BM_SIZE 14 #define BM_SIZE 14 for( LAYER_NUM i = FIRST_LAYER; i < NB_LAYERS; ++i ) for( LAYER_NUM i = FIRST_LAYER; i < NB_LAYERS; ++i ) Loading Loading @@ -83,14 +81,11 @@ void PCB_LAYER_BOX_SELECTOR::Resync() Append( layername, layerbmp, (void*)(intptr_t) layerid ); Append( layername, layerbmp, (void*)(intptr_t) layerid ); int w; int w; dc.GetTextExtent ( layername, &w, &h ); dc.GetTextExtent ( layername, &w, &h ); minwidth = std::max( minwidth, w ); minwidth = std::max( minwidth, w ); } } minwidth += BM_SIZE + 12; // Take in account the bitmap size and margins minwidth += BM_SIZE + 35; // Take in account the bitmap size and margins wxLogMessage( "minw %d min %d", minwidth, GetMinClientSize().x ); SetMinClientSize( wxSize( minwidth, -1 ) ); // SetMinClientSize( wxSize( minwidth, -1 ) ); Layout(); } } Loading
pcbnew/class_pcb_layer_widget.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -341,7 +341,7 @@ void PCB_LAYER_WIDGET::ReFill() void PCB_LAYER_WIDGET::OnLayerColorChange( LAYER_NUM aLayer, EDA_COLOR_T aColor ) void PCB_LAYER_WIDGET::OnLayerColorChange( LAYER_NUM aLayer, EDA_COLOR_T aColor ) { { myframe->GetBoard()->SetLayerColor( aLayer, aColor ); myframe->GetBoard()->SetLayerColor( aLayer, aColor ); myframe->ReCreateLayerBox( NULL ); myframe->ReCreateLayerBox( false ); myframe->GetCanvas()->Refresh(); myframe->GetCanvas()->Refresh(); } } Loading
pcbnew/dialogs/dialog_layers_setup.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -560,7 +560,7 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event ) } } m_Parent->OnModify(); m_Parent->OnModify(); m_Parent->ReCreateLayerBox( NULL ); m_Parent->ReCreateLayerBox(); m_Parent->ReFillLayerWidget(); m_Parent->ReFillLayerWidget(); EndModal( wxID_OK ); EndModal( wxID_OK ); Loading
pcbnew/files.cpp +2 −3 Original line number Original line Diff line number Diff line Loading @@ -141,7 +141,7 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event ) fn.SetExt( PcbFileExtension ); fn.SetExt( PcbFileExtension ); GetBoard()->SetFileName( fn.GetFullPath() ); GetBoard()->SetFileName( fn.GetFullPath() ); UpdateTitle(); UpdateTitle(); ReCreateLayerBox( NULL ); ReCreateLayerBox(); } } break; break; Loading Loading @@ -396,8 +396,7 @@ bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend, // Update info shown by the horizontal toolbars // Update info shown by the horizontal toolbars GetBoard()->SetCurrentNetClass( NETCLASS::Default ); GetBoard()->SetCurrentNetClass( NETCLASS::Default ); ReFillLayerWidget(); ReFillLayerWidget(); ReCreateLayerBox(); ReCreateLayerBox( NULL ); // upate the layer widget to match board visibility states, both layers and render columns. // upate the layer widget to match board visibility states, both layers and render columns. syncLayerVisibilities(); syncLayerVisibilities(); Loading