Better support of mixed states in Line Style dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/5249
This commit is contained in:
parent
1558e63c0e
commit
b0a09b782d
|
@ -29,6 +29,7 @@
|
|||
#include <pgm_base.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <widgets/color_swatch.h>
|
||||
|
||||
const int BUTT_COLOR_MINSIZE_X = 32;
|
||||
const int BUTT_COLOR_MINSIZE_Y = 20;
|
||||
|
@ -64,9 +65,9 @@ DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE( SCH_EDIT_FRAME* aParent,
|
|||
SetInitialFocus( m_lineWidth );
|
||||
|
||||
for( auto& typeEntry : lineTypeNames )
|
||||
{
|
||||
m_typeCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) );
|
||||
}
|
||||
|
||||
m_typeCombo->Append( INDETERMINATE_ACTION );
|
||||
|
||||
m_sdbSizerOK->SetDefault();
|
||||
|
||||
|
@ -80,10 +81,10 @@ bool DIALOG_EDIT_LINE_STYLE::TransferDataToWindow()
|
|||
auto first_stroke_item = m_strokeItems.front();
|
||||
|
||||
if( std::all_of( m_strokeItems.begin() + 1, m_strokeItems.end(),
|
||||
[&]( const SCH_ITEM* r )
|
||||
{
|
||||
return r->GetPenWidth() == first_stroke_item->GetPenWidth();
|
||||
} ) )
|
||||
[&]( const SCH_ITEM* r )
|
||||
{
|
||||
return r->GetPenWidth() == first_stroke_item->GetPenWidth();
|
||||
} ) )
|
||||
{
|
||||
m_width.SetValue( first_stroke_item->GetPenWidth() );
|
||||
}
|
||||
|
@ -93,119 +94,51 @@ bool DIALOG_EDIT_LINE_STYLE::TransferDataToWindow()
|
|||
}
|
||||
|
||||
if( std::all_of( m_strokeItems.begin() + 1, m_strokeItems.end(),
|
||||
[&]( const SCH_ITEM* r )
|
||||
{
|
||||
return r->GetStroke().GetColor() == first_stroke_item->GetStroke().GetColor();
|
||||
} ) )
|
||||
[&]( const SCH_ITEM* r )
|
||||
{
|
||||
return r->GetStroke().GetColor() == first_stroke_item->GetStroke().GetColor();
|
||||
} ) )
|
||||
{
|
||||
setColor( first_stroke_item->GetStroke().GetColor() );
|
||||
m_colorSwatch->SetSwatchColor( first_stroke_item->GetStroke().GetColor(), false );
|
||||
}
|
||||
else
|
||||
{
|
||||
setColor( COLOR4D::UNSPECIFIED );
|
||||
m_colorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
|
||||
}
|
||||
|
||||
if( std::all_of( m_strokeItems.begin() + 1, m_strokeItems.end(),
|
||||
[&]( const SCH_ITEM* r )
|
||||
{
|
||||
return r->GetStroke().GetType() == first_stroke_item->GetStroke().GetType();
|
||||
} ) )
|
||||
[&]( const SCH_ITEM* r )
|
||||
{
|
||||
return r->GetStroke().GetType() == first_stroke_item->GetStroke().GetType();
|
||||
} ) )
|
||||
{
|
||||
int style = static_cast<int>( first_stroke_item->GetStroke().GetType() );
|
||||
wxCHECK_MSG( style < (int)lineTypeNames.size(), false,
|
||||
"Line type for first line is not found in the type lookup map" );
|
||||
"Line type for first line is not found in the type lookup map" );
|
||||
m_typeCombo->SetSelection( style );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_typeCombo->SetSelection( wxNOT_FOUND );
|
||||
m_typeCombo->SetStringSelection( INDETERMINATE_ACTION );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_LINE_STYLE::onColorButtonClicked( wxCommandEvent& event )
|
||||
{
|
||||
COLOR4D newColor = COLOR4D::UNSPECIFIED;
|
||||
DIALOG_COLOR_PICKER dialog( this, m_selectedColor, false );
|
||||
|
||||
if( dialog.ShowModal() == wxID_OK )
|
||||
newColor = dialog.GetColor();
|
||||
|
||||
if( m_selectedColor == newColor )
|
||||
return;
|
||||
|
||||
setColor( newColor );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_LINE_STYLE::updateColorButton( COLOR4D& aColor )
|
||||
{
|
||||
wxMemoryDC iconDC;
|
||||
|
||||
|
||||
if( aColor == COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
m_colorButton->SetBitmap( KiBitmap( question_mark_xpm ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxBitmap bitmap( std::max( m_colorButton->GetSize().x, BUTT_COLOR_MINSIZE_X ),
|
||||
std::max( m_colorButton->GetSize().y, BUTT_COLOR_MINSIZE_Y ) );
|
||||
|
||||
iconDC.SelectObject( bitmap );
|
||||
iconDC.SetPen( *wxBLACK_PEN );
|
||||
|
||||
wxBrush brush( aColor.ToColour() );
|
||||
iconDC.SetBrush( brush );
|
||||
|
||||
// Paint the full bitmap in aColor:
|
||||
iconDC.SetBackground( brush );
|
||||
iconDC.Clear();
|
||||
|
||||
m_colorButton->SetBitmap( bitmap );
|
||||
}
|
||||
|
||||
m_colorButton->Refresh();
|
||||
|
||||
Refresh( false );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_LINE_STYLE::resetDefaults( wxCommandEvent& event )
|
||||
{
|
||||
m_width.SetValue( 0 );
|
||||
setColor( COLOR4D::UNSPECIFIED );
|
||||
m_colorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
|
||||
|
||||
SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( m_strokeItems.front() );
|
||||
// This isn't quite right: they really want to set each stroke to the stroke set by the
|
||||
// netclass (if any).
|
||||
m_typeCombo->SetSelection( 0 );
|
||||
|
||||
wxCHECK( item, /* void */ );
|
||||
|
||||
auto typeIt = lineTypeNames.find( item->GetStroke().GetType() );
|
||||
wxCHECK_RET( typeIt != lineTypeNames.end(),
|
||||
"Default line type not found line dialogs line type lookup map" );
|
||||
|
||||
m_typeCombo->SetSelection( static_cast<int>( typeIt->first ) );
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_LINE_STYLE::setColor( const COLOR4D& aColor )
|
||||
{
|
||||
m_selectedColor = aColor;
|
||||
|
||||
if( aColor == COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
COLOR4D defaultColor = Pgm().GetSettingsManager().GetColorSettings()->GetColor(
|
||||
m_strokeItems.front()->GetLayer() );
|
||||
updateColorButton( defaultColor );
|
||||
}
|
||||
else
|
||||
updateColorButton( m_selectedColor );
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow()
|
||||
{
|
||||
PICKED_ITEMS_LIST pickedItems;
|
||||
|
@ -225,12 +158,11 @@ bool DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow()
|
|||
strokeItem->SetStroke( stroke );
|
||||
}
|
||||
|
||||
if( m_typeCombo->GetSelection() != wxNOT_FOUND )
|
||||
int selection = m_typeCombo->GetSelection();
|
||||
|
||||
if( selection < (int)lineTypeNames.size() )
|
||||
{
|
||||
stroke = strokeItem->GetStroke();
|
||||
int selection = m_typeCombo->GetSelection();
|
||||
wxCHECK_MSG( selection < (int)lineTypeNames.size(), false,
|
||||
"Selected line type index exceeds size of line type lookup map" );
|
||||
|
||||
auto it = lineTypeNames.begin();
|
||||
std::advance( it, selection );
|
||||
|
@ -240,7 +172,7 @@ bool DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow()
|
|||
}
|
||||
|
||||
stroke = strokeItem->GetStroke();
|
||||
stroke.SetColor( m_selectedColor );
|
||||
stroke.SetColor( m_colorSwatch->GetSwatchColor() );
|
||||
strokeItem->SetStroke( stroke );
|
||||
|
||||
m_frame->UpdateItem( strokeItem );
|
||||
|
|
|
@ -45,14 +45,9 @@ private:
|
|||
SCH_EDIT_FRAME* m_frame;
|
||||
std::deque<SCH_ITEM*> m_strokeItems;
|
||||
|
||||
UNIT_BINDER m_width;
|
||||
COLOR4D m_selectedColor;
|
||||
UNIT_BINDER m_width;
|
||||
|
||||
void resetDefaults( wxCommandEvent& event ) override;
|
||||
void onColorButtonClicked( wxCommandEvent& aEvent ) override;
|
||||
|
||||
void setColor( const COLOR4D& aColor );
|
||||
void updateColorButton( COLOR4D& aColor );
|
||||
};
|
||||
|
||||
#endif // __dialog_edit_line_style__
|
||||
|
|
|
@ -5,12 +5,13 @@
|
|||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "widgets/color_swatch.h"
|
||||
|
||||
#include "dialog_edit_line_style_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BEGIN_EVENT_TABLE( DIALOG_EDIT_LINE_STYLE_BASE, DIALOG_SHIM )
|
||||
EVT_BUTTON( idColorBtn, DIALOG_EDIT_LINE_STYLE_BASE::_wxFB_onColorButtonClicked )
|
||||
EVT_BUTTON( wxID_APPLY, DIALOG_EDIT_LINE_STYLE_BASE::_wxFB_resetDefaults )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
@ -29,43 +30,51 @@ DIALOG_EDIT_LINE_STYLE_BASE::DIALOG_EDIT_LINE_STYLE_BASE( wxWindow* parent, wxWi
|
|||
|
||||
m_staticTextWidth = new wxStaticText( this, wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextWidth->Wrap( -1 );
|
||||
fgSizerGeneral->Add( m_staticTextWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||
fgSizerGeneral->Add( m_staticTextWidth, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 3 );
|
||||
|
||||
m_lineWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
|
||||
fgSizerGeneral->Add( m_lineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
||||
fgSizerGeneral->Add( m_lineWidth, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 3 );
|
||||
|
||||
m_staticWidthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticWidthUnits->Wrap( -1 );
|
||||
m_staticWidthUnits->SetMinSize( wxSize( 40,-1 ) );
|
||||
|
||||
fgSizerGeneral->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||
fgSizerGeneral->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 3 );
|
||||
|
||||
m_staticTextColor = new wxStaticText( this, wxID_ANY, _("Color:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextColor->Wrap( -1 );
|
||||
fgSizerGeneral->Add( m_staticTextColor, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
fgSizerGeneral->Add( m_staticTextColor, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_colorButton = new wxBitmapButton( this, idColorBtn, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
|
||||
m_panel1 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer2;
|
||||
bSizer2 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_colorButton->SetBitmap( wxNullBitmap );
|
||||
fgSizerGeneral->Add( m_colorButton, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 3 );
|
||||
m_colorSwatch = new COLOR_SWATCH( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer2->Add( m_colorSwatch, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
|
||||
|
||||
m_panel1->SetSizer( bSizer2 );
|
||||
m_panel1->Layout();
|
||||
bSizer2->Fit( m_panel1 );
|
||||
fgSizerGeneral->Add( m_panel1, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 2 );
|
||||
|
||||
|
||||
fgSizerGeneral->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_staticTextStyle = new wxStaticText( this, wxID_ANY, _("Style:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextStyle->Wrap( -1 );
|
||||
fgSizerGeneral->Add( m_staticTextStyle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
fgSizerGeneral->Add( m_staticTextStyle, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_typeCombo = new wxBitmapComboBox( this, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||
m_typeCombo->SetMinSize( wxSize( 140,-1 ) );
|
||||
m_typeCombo->SetMinSize( wxSize( 240,-1 ) );
|
||||
|
||||
fgSizerGeneral->Add( m_typeCombo, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
||||
fgSizerGeneral->Add( m_typeCombo, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 3 );
|
||||
|
||||
|
||||
mainSizer->Add( fgSizerGeneral, 1, wxEXPAND|wxALL, 5 );
|
||||
mainSizer->Add( fgSizerGeneral, 1, wxEXPAND|wxALL, 10 );
|
||||
|
||||
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
mainSizer->Add( m_staticline, 0, wxEXPAND | wxALL, 5 );
|
||||
mainSizer->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
|
@ -76,7 +76,7 @@
|
|||
<property name="vgap">0</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -137,7 +137,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -201,7 +201,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -262,7 +262,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -322,10 +322,10 @@
|
|||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -336,31 +336,23 @@
|
|||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">Load From File; </property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">idColorBtn</property>
|
||||
<property name="label">MyButton</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@ -368,30 +360,90 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_colorButton</property>
|
||||
<property name="name">m_panel1</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">onColorButtonClicked</event>
|
||||
<property name="window_style">wxBORDER_SIMPLE|wxTAB_TRAVERSAL</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer2</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="CustomControl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="class">COLOR_SWATCH</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="construction"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="declaration"></property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="include"></property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_colorSwatch</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="settings"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">COLOR_SWATCH; widgets/color_swatch.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
@ -406,7 +458,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -467,7 +519,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapComboBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -503,7 +555,7 @@
|
|||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">140,-1</property>
|
||||
<property name="minimum_size">240,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_typeCombo</property>
|
||||
<property name="pane_border">1</property>
|
||||
|
@ -534,7 +586,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class COLOR_SWATCH;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
|
@ -18,14 +20,11 @@
|
|||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/bmpcbox.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/bmpcbox.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -39,21 +38,16 @@ class DIALOG_EDIT_LINE_STYLE_BASE : public DIALOG_SHIM
|
|||
private:
|
||||
|
||||
// Private event handlers
|
||||
void _wxFB_onColorButtonClicked( wxCommandEvent& event ){ onColorButtonClicked( event ); }
|
||||
void _wxFB_resetDefaults( wxCommandEvent& event ){ resetDefaults( event ); }
|
||||
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
idColorBtn = 1000
|
||||
};
|
||||
|
||||
wxStaticText* m_staticTextWidth;
|
||||
wxTextCtrl* m_lineWidth;
|
||||
wxStaticText* m_staticWidthUnits;
|
||||
wxStaticText* m_staticTextColor;
|
||||
wxBitmapButton* m_colorButton;
|
||||
wxPanel* m_panel1;
|
||||
COLOR_SWATCH* m_colorSwatch;
|
||||
wxStaticText* m_staticTextStyle;
|
||||
wxBitmapComboBox* m_typeCombo;
|
||||
wxStaticLine* m_staticline;
|
||||
|
@ -63,7 +57,6 @@ class DIALOG_EDIT_LINE_STYLE_BASE : public DIALOG_SHIM
|
|||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void onColorButtonClicked( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void resetDefaults( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue