Cleanup formatting.
This commit is contained in:
parent
17c9f7c61f
commit
ad1e8ebda8
|
@ -59,7 +59,6 @@ wxBitmap COLOR_SWATCH::MakeBitmap( COLOR4D aColor, COLOR4D aBackground, wxSize a
|
|||
COLOR4D black;
|
||||
bool rowCycle;
|
||||
|
||||
|
||||
if( aCheckerboardBackground.GetBrightness() > 0.4 )
|
||||
{
|
||||
white = COLOR4D::WHITE;
|
||||
|
@ -214,9 +213,9 @@ void COLOR_SWATCH::setupEvents()
|
|||
}
|
||||
|
||||
|
||||
void COLOR_SWATCH::rePostEvent( wxEvent& aEvt )
|
||||
void COLOR_SWATCH::rePostEvent( wxEvent& aEvent )
|
||||
{
|
||||
wxPostEvent( this, aEvt );
|
||||
wxPostEvent( this, aEvent );
|
||||
}
|
||||
|
||||
|
||||
|
@ -232,14 +231,14 @@ static void sendSwatchChangeEvent( COLOR_SWATCH& aSender )
|
|||
}
|
||||
|
||||
|
||||
void COLOR_SWATCH::SetSwatchColor( COLOR4D aColor, bool sendEvent )
|
||||
void COLOR_SWATCH::SetSwatchColor( COLOR4D aColor, bool aSendEvent )
|
||||
{
|
||||
m_color = aColor;
|
||||
|
||||
wxBitmap bm = MakeBitmap( m_color, m_background, m_size, m_checkerboardSize, m_checkerboardBg );
|
||||
m_swatch->SetBitmap( bm );
|
||||
|
||||
if( sendEvent )
|
||||
if( aSendEvent )
|
||||
sendSwatchChangeEvent( *this );
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ wxDEFINE_EVENT( EVT_INTERACTIVE_CHOICE, wxCommandEvent );
|
|||
wxColour FOOTPRINT_CHOICE::m_grey( 0x808080 );
|
||||
|
||||
|
||||
FOOTPRINT_CHOICE::FOOTPRINT_CHOICE( wxWindow* aParent, int aId )
|
||||
: wxOwnerDrawnComboBox( aParent, aId, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
FOOTPRINT_CHOICE::FOOTPRINT_CHOICE( wxWindow* aParent, int aId ) :
|
||||
wxOwnerDrawnComboBox( aParent, aId, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
/* n */ 0, /* choices */ nullptr, wxCB_READONLY ),
|
||||
m_last_selection( 0 )
|
||||
{
|
||||
|
@ -200,7 +200,9 @@ void FOOTPRINT_CHOICE::TryVetoSelect( wxCommandEvent& aEvent, bool aInner )
|
|||
wxString text = SafeGetString( sel );
|
||||
|
||||
if( text == "" )
|
||||
{
|
||||
SetSelectionEither( aInner, m_last_selection );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_last_selection = sel;
|
||||
|
|
|
@ -100,16 +100,9 @@ void FOOTPRINT_PREVIEW_WIDGET::OnStatusChange( FOOTPRINT_STATUS aStatus )
|
|||
{
|
||||
switch( aStatus )
|
||||
{
|
||||
case FPS_NOT_FOUND:
|
||||
SetStatusText( _( "Footprint not found" ) );
|
||||
break;
|
||||
|
||||
case FPS_LOADING:
|
||||
SetStatusText( _( "Loading..." ) );
|
||||
break;
|
||||
|
||||
case FPS_READY:
|
||||
ClearStatus();
|
||||
case FPS_NOT_FOUND: SetStatusText( _( "Footprint not found" ) ); break;
|
||||
case FPS_LOADING: SetStatusText( _( "Loading..." ) ); break;
|
||||
case FPS_READY: ClearStatus(); break;
|
||||
}
|
||||
|
||||
Refresh();
|
||||
|
|
|
@ -144,7 +144,8 @@ WX_PROGRESS_REPORTER::WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& a
|
|||
( aCanAbort ? wxPD_CAN_ABORT : 0 ) |
|
||||
wxPD_ELAPSED_TIME )
|
||||
#if wxCHECK_VERSION( 3, 1, 0 )
|
||||
,m_appProgressIndicator( aParent )
|
||||
,
|
||||
m_appProgressIndicator( aParent )
|
||||
#endif
|
||||
{
|
||||
#if wxCHECK_VERSION( 3, 1, 0 )
|
||||
|
@ -181,8 +182,8 @@ bool WX_PROGRESS_REPORTER::updateUI()
|
|||
|
||||
GAUGE_PROGRESS_REPORTER::GAUGE_PROGRESS_REPORTER( wxWindow* aParent, int aNumPhases ) :
|
||||
PROGRESS_REPORTER( aNumPhases ),
|
||||
wxGauge( aParent, wxID_ANY, 1000, wxDefaultPosition, wxDefaultSize,
|
||||
wxGA_HORIZONTAL, wxDefaultValidator, wxGaugeNameStr )
|
||||
wxGauge( aParent, wxID_ANY, 1000, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL,
|
||||
wxDefaultValidator, wxGaugeNameStr )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
|
||||
SPLIT_BUTTON::SPLIT_BUTTON( wxWindow* aParent, wxWindowID aId, const wxString& aLabel,
|
||||
const wxPoint& aPos, const wxSize& aSize )
|
||||
: wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL, "DropDownButton" ),
|
||||
const wxPoint& aPos, const wxSize& aSize ) :
|
||||
wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL, "DropDownButton" ),
|
||||
m_label( aLabel )
|
||||
{
|
||||
m_colorNormal = GetForegroundColour();
|
||||
|
@ -67,7 +67,8 @@ SPLIT_BUTTON::~SPLIT_BUTTON()
|
|||
void SPLIT_BUTTON::SetMinSize( const wxSize& aSize )
|
||||
{
|
||||
m_unadjustedMinSize = aSize;
|
||||
wxPanel::SetMinSize( wxSize( aSize.GetWidth() + m_arrowButtonWidth + m_widthPadding, aSize.GetHeight() ) );
|
||||
wxPanel::SetMinSize( wxSize( aSize.GetWidth() + m_arrowButtonWidth + m_widthPadding,
|
||||
aSize.GetHeight() ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -138,7 +139,9 @@ void SPLIT_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent )
|
|||
wxEvtHandler* pEventHandler = GetEventHandler();
|
||||
wxASSERT( pEventHandler );
|
||||
|
||||
pEventHandler->CallAfter( [=]() {
|
||||
pEventHandler->CallAfter(
|
||||
[=]()
|
||||
{
|
||||
wxCommandEvent evt( wxEVT_BUTTON, this->GetId() );
|
||||
evt.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent( evt );
|
||||
|
@ -207,8 +210,10 @@ void SPLIT_BUTTON::OnPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
|||
wxMemoryDC mdc( m_bitmap );
|
||||
|
||||
r1.x = ( width - m_bitmap.GetWidth() ) / 2;
|
||||
|
||||
if( r1.x < 0 )
|
||||
r1.x = 0;
|
||||
|
||||
r1.y += ( size.GetHeight() - m_bitmap.GetHeight() ) / 2;
|
||||
|
||||
dc.Blit( wxPoint( r1.x, r1.y ), m_bitmap.GetSize(), &mdc, wxPoint( 0, 0 ), wxCOPY, true );
|
||||
|
|
|
@ -26,19 +26,12 @@ BEGIN_EVENT_TABLE( STEPPED_SLIDER, wxSlider )
|
|||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
STEPPED_SLIDER::STEPPED_SLIDER(
|
||||
wxWindow* aParent,
|
||||
wxWindowID aId,
|
||||
int aValue,
|
||||
int aMinValue,
|
||||
int aMaxValue,
|
||||
const wxPoint& aPos,
|
||||
const wxSize& aSize,
|
||||
long aStyle,
|
||||
const wxValidator& aValidator,
|
||||
const wxString& aName )
|
||||
:wxSlider( aParent, aId, aValue, aMinValue, aMaxValue,
|
||||
aPos, aSize, aStyle, aValidator, aName ),
|
||||
STEPPED_SLIDER::STEPPED_SLIDER( wxWindow* aParent, wxWindowID aId, int aValue, int aMinValue,
|
||||
int aMaxValue, const wxPoint& aPos, const wxSize& aSize,
|
||||
long aStyle, const wxValidator& aValidator,
|
||||
const wxString& aName ) :
|
||||
wxSlider( aParent, aId, aValue, aMinValue, aMaxValue, aPos, aSize, aStyle, aValidator,
|
||||
aName ),
|
||||
m_step( 1 )
|
||||
{}
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
#include <widgets/text_ctrl_eval.h>
|
||||
|
||||
TEXT_CTRL_EVAL::TEXT_CTRL_EVAL( wxWindow* aParent, wxWindowID aId, const wxString& aValue,
|
||||
const wxPoint& aPos, const wxSize& aSize, long aStyle, const wxValidator& aValidator,
|
||||
const wxString& aName )
|
||||
: wxTextCtrl( aParent, aId, aValue, aPos, aSize, aStyle | wxTE_PROCESS_ENTER, aValidator,
|
||||
const wxPoint& aPos, const wxSize& aSize, long aStyle,
|
||||
const wxValidator& aValidator, const wxString& aName ) :
|
||||
wxTextCtrl( aParent, aId, aValue, aPos, aSize, aStyle | wxTE_PROCESS_ENTER, aValidator,
|
||||
aName ),
|
||||
m_eval( EDA_UNITS::UNSCALED )
|
||||
{
|
||||
|
|
|
@ -35,9 +35,8 @@
|
|||
|
||||
wxDEFINE_EVENT( DELAY_FOCUS, wxCommandEvent );
|
||||
|
||||
UNIT_BINDER::UNIT_BINDER( EDA_DRAW_FRAME* aParent,
|
||||
wxStaticText* aLabel, wxWindow* aValue, wxStaticText* aUnitLabel,
|
||||
bool allowEval ) :
|
||||
UNIT_BINDER::UNIT_BINDER( EDA_DRAW_FRAME* aParent, wxStaticText* aLabel, wxWindow* aValue,
|
||||
wxStaticText* aUnitLabel, bool allowEval ) :
|
||||
m_frame( aParent ),
|
||||
m_label( aLabel ),
|
||||
m_value( aValue ),
|
||||
|
@ -315,9 +314,13 @@ double UNIT_BINDER::GetDoubleValue()
|
|||
value = textEntry->GetValue();
|
||||
}
|
||||
else if( staticText )
|
||||
{
|
||||
value = staticText->GetLabel();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double displayValue = DoubleValueFromString( m_units, value, m_dataType );
|
||||
return m_originTransforms.FromDisplay( displayValue, m_coordType );
|
||||
|
|
|
@ -82,7 +82,7 @@ void WIDGET_SAVE_RESTORE::Add( wxNotebook& ctrl, long& dest )
|
|||
|
||||
void WIDGET_SAVE_RESTORE::ReadConfigFromControls()
|
||||
{
|
||||
for( auto& ctrl : m_ctrls )
|
||||
for( WIDGET_SAVE_RESTORE::WIDGET_CTRL_T& ctrl : m_ctrls )
|
||||
{
|
||||
switch( ctrl.m_type )
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ void WIDGET_SAVE_RESTORE::RestoreConfigToControls()
|
|||
if( !m_valid )
|
||||
return;
|
||||
|
||||
for( auto& ctrl : m_ctrls )
|
||||
for( WIDGET_SAVE_RESTORE::WIDGET_CTRL_T& ctrl : m_ctrls )
|
||||
{
|
||||
switch( ctrl.m_type )
|
||||
{
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
/**
|
||||
* Set the current swatch color directly.
|
||||
*/
|
||||
void SetSwatchColor( KIGFX::COLOR4D aColor, bool sendEvent );
|
||||
void SetSwatchColor( KIGFX::COLOR4D aColor, bool aSendEvent );
|
||||
|
||||
/**
|
||||
* Sets the color that will be chosen with the "Reset to Default" button in the chooser
|
||||
|
@ -116,7 +116,7 @@ private:
|
|||
/**
|
||||
* Pass unwanted events on to listeners of this object
|
||||
*/
|
||||
void rePostEvent( wxEvent& aEvt );
|
||||
void rePostEvent( wxEvent& aEvent );
|
||||
|
||||
KIGFX::COLOR4D m_color;
|
||||
KIGFX::COLOR4D m_background;
|
||||
|
|
Loading…
Reference in New Issue