UNIT_BINDERize eeschema's plot and text edit dialogs.
(cherry picked from commit 298ea70)
This commit is contained in:
parent
e4d9366fe4
commit
06bf958bf1
|
@ -41,6 +41,21 @@ namespace numEval
|
|||
|
||||
} /* namespace numEval */
|
||||
|
||||
|
||||
#define VAR 1
|
||||
#define ASSIGN 2
|
||||
#define SEMCOL 3
|
||||
#define PLUS 4
|
||||
#define MINUS 5
|
||||
#define UNIT 6
|
||||
#define DIVIDE 7
|
||||
#define MULT 8
|
||||
#define ENDS 9
|
||||
#define VALUE 10
|
||||
#define PARENL 11
|
||||
#define PARENR 12
|
||||
|
||||
|
||||
NUMERIC_EVALUATOR::NUMERIC_EVALUATOR( EDA_UNITS_T aUnits, bool aUseMils )
|
||||
{
|
||||
struct lconv* lc = localeconv();
|
||||
|
|
|
@ -30,11 +30,9 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <common.h>
|
||||
#include <base_units.h>
|
||||
#include <kiway.h>
|
||||
#include <confirm.h>
|
||||
|
||||
#include <general.h>
|
||||
#include <sch_base_frame.h>
|
||||
#include <sch_component.h>
|
||||
#include <class_libentry.h>
|
||||
|
@ -78,7 +76,8 @@ EDA_TEXT_VJUSTIFY_T IntToEdaTextVertJustify( int aVertJustify )
|
|||
|
||||
DIALOG_EDIT_ONE_FIELD::DIALOG_EDIT_ONE_FIELD( SCH_BASE_FRAME* aParent, const wxString& aTitle,
|
||||
const EDA_TEXT* aTextItem ) :
|
||||
DIALOG_LIB_EDIT_TEXT_BASE( aParent )
|
||||
DIALOG_LIB_EDIT_TEXT_BASE( aParent ),
|
||||
m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true, 0 )
|
||||
{
|
||||
SetTitle( aTitle );
|
||||
|
||||
|
@ -101,8 +100,8 @@ void DIALOG_EDIT_ONE_FIELD::init()
|
|||
{
|
||||
wxString msg;
|
||||
|
||||
m_TextValue->SetFocus();
|
||||
SCH_BASE_FRAME* parent = static_cast<SCH_BASE_FRAME*>( GetParent() );
|
||||
SetInitialFocus( m_TextValue );
|
||||
SCH_BASE_FRAME* parent = GetParent();
|
||||
m_TextValue->SetValidator( SCH_FIELD_VALIDATOR(
|
||||
parent->IsType( FRAME_SCH_LIB_EDITOR ),
|
||||
m_fieldId, &m_text ) );
|
||||
|
@ -112,20 +111,7 @@ void DIALOG_EDIT_ONE_FIELD::init()
|
|||
m_CommonUnit->Show( false );
|
||||
|
||||
// Show the footprint selection dialog if this is the footprint field.
|
||||
if( m_fieldId == FOOTPRINT )
|
||||
{
|
||||
m_TextValueSelectButton->Show();
|
||||
m_TextValueSelectButton->Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_TextValueSelectButton->Hide();
|
||||
m_TextValueSelectButton->Disable();
|
||||
}
|
||||
|
||||
msg = m_TextSizeText->GetLabel() + ReturnUnitSymbol();
|
||||
m_TextSizeText->SetLabel( msg );
|
||||
|
||||
m_TextValueSelectButton->Show( m_fieldId == FOOTPRINT );
|
||||
|
||||
// Value fields of power components cannot be modified. This will grey out
|
||||
// the text box and display an explanation.
|
||||
|
@ -171,15 +157,13 @@ bool DIALOG_EDIT_ONE_FIELD::TransferDataToWindow()
|
|||
{
|
||||
if( m_text.find_first_of( '?' ) != m_text.npos )
|
||||
{
|
||||
m_TextValue->SetSelection( m_text.find_first_of( '?' ),
|
||||
m_text.find_last_of( '?' ) + 1 );
|
||||
m_TextValue->SetSelection( m_text.find_first_of( '?' ), m_text.find_last_of( '?' ) + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString num = m_text;
|
||||
|
||||
while( !num.IsEmpty() && ( !isdigit( num.Last() ) ||
|
||||
!isdigit( num.GetChar( 0 ) ) ) )
|
||||
while( !num.IsEmpty() && ( !isdigit( num.Last() ) || !isdigit( num.GetChar( 0 ) ) ) )
|
||||
{
|
||||
if( !isdigit( num.Last() ) )
|
||||
num.RemoveLast();
|
||||
|
@ -187,8 +171,7 @@ bool DIALOG_EDIT_ONE_FIELD::TransferDataToWindow()
|
|||
num = num.Right( num.Length() - 1);
|
||||
}
|
||||
|
||||
m_TextValue->SetSelection( m_text.Find( num ),
|
||||
m_text.Find( num ) + num.Length() );
|
||||
m_TextValue->SetSelection( m_text.Find( num ), m_text.Find( num ) + num.Length() );
|
||||
|
||||
if( num.IsEmpty() )
|
||||
m_TextValue->SetSelection( -1, -1 );
|
||||
|
@ -200,10 +183,10 @@ bool DIALOG_EDIT_ONE_FIELD::TransferDataToWindow()
|
|||
}
|
||||
|
||||
m_Orient->SetValue( m_orientation );
|
||||
m_TextSize->SetValue( StringFromValue( g_UserUnit, m_size ) );
|
||||
m_textSize.SetValue( m_size );
|
||||
m_TextHJustificationOpt->SetSelection( m_horizontalJustification );
|
||||
m_TextVJustificationOpt->SetSelection( m_verticalJustification );
|
||||
m_Invisible->SetValue( !m_isVisible );
|
||||
m_visible->SetValue( m_isVisible );
|
||||
m_TextShapeOpt->SetSelection( m_style );
|
||||
|
||||
return true;
|
||||
|
@ -226,10 +209,10 @@ bool DIALOG_EDIT_ONE_FIELD::TransferDataFromWindow()
|
|||
}
|
||||
|
||||
m_orientation = m_Orient->GetValue();
|
||||
m_size = ValueFromString( g_UserUnit, m_TextSize->GetValue() );
|
||||
m_size = m_textSize.GetValue();
|
||||
m_horizontalJustification = m_TextHJustificationOpt->GetSelection();
|
||||
m_verticalJustification = m_TextVJustificationOpt->GetSelection();
|
||||
m_isVisible = !m_Invisible->GetValue();
|
||||
m_isVisible = m_visible->GetValue();
|
||||
m_style = m_TextShapeOpt->GetSelection();
|
||||
|
||||
return true;
|
||||
|
@ -270,7 +253,7 @@ DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD( SCH_BASE_FRAME* aParent,
|
|||
|
||||
const SCH_COMPONENT* component = (SCH_COMPONENT*) aField->GetParent();
|
||||
|
||||
wxASSERT_MSG( component != NULL && component->Type() == SCH_COMPONENT_T,
|
||||
wxASSERT_MSG( component && component->Type() == SCH_COMPONENT_T,
|
||||
wxT( "Invalid schematic field parent item." ) );
|
||||
|
||||
// The library symbol may have been removed so using SCH_COMPONENT::GetPartRef() here
|
||||
|
@ -287,32 +270,28 @@ DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD( SCH_BASE_FRAME* aParent,
|
|||
|
||||
void DIALOG_SCH_EDIT_ONE_FIELD::UpdateField( SCH_FIELD* aField, SCH_SHEET_PATH* aSheetPath )
|
||||
{
|
||||
wxASSERT( aField != NULL || aField->Type() != SCH_FIELD_T );
|
||||
|
||||
if( aField->GetId() == REFERENCE )
|
||||
{
|
||||
wxASSERT( aSheetPath != NULL );
|
||||
wxASSERT( aSheetPath );
|
||||
|
||||
SCH_COMPONENT* component = dynamic_cast< SCH_COMPONENT* >( aField->GetParent() );
|
||||
|
||||
wxASSERT( component != NULL );
|
||||
wxASSERT( component );
|
||||
|
||||
if( component != NULL )
|
||||
if( component )
|
||||
component->SetRef( aSheetPath, m_text );
|
||||
}
|
||||
|
||||
bool modified = false;
|
||||
|
||||
modified = ( modified ||
|
||||
( ( aField->GetTextAngle() == TEXT_ANGLE_VERT ) != m_orientation ) );
|
||||
if( ( aField->GetTextAngle() == TEXT_ANGLE_VERT ) != m_orientation )
|
||||
modified = true;
|
||||
|
||||
modified = ( modified ||
|
||||
( ( aField->GetHorizJustify() !=
|
||||
IntToEdaTextHorizJustify( m_horizontalJustification - 1 ) ) ) );
|
||||
if( ( aField->GetHorizJustify() != IntToEdaTextHorizJustify( m_horizontalJustification - 1 ) ) )
|
||||
modified = true;
|
||||
|
||||
modified = ( modified ||
|
||||
( ( aField->GetVertJustify() !=
|
||||
IntToEdaTextVertJustify( m_verticalJustification - 1 ) ) ) );
|
||||
if( ( aField->GetVertJustify() != IntToEdaTextVertJustify( m_verticalJustification - 1 ) ) )
|
||||
modified = true;
|
||||
|
||||
aField->SetText( m_text );
|
||||
updateText( aField );
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
*/
|
||||
|
||||
#include <dialog_lib_edit_text_base.h>
|
||||
#include <widgets/unit_binder.h>
|
||||
|
||||
class SCH_BASE_FRAME;
|
||||
class LIB_FIELD;
|
||||
|
@ -50,11 +51,10 @@ public:
|
|||
DIALOG_EDIT_ONE_FIELD( SCH_BASE_FRAME* aParent, const wxString& aTitle,
|
||||
const EDA_TEXT* aTextItem );
|
||||
|
||||
~DIALOG_EDIT_ONE_FIELD() {}
|
||||
~DIALOG_EDIT_ONE_FIELD() override {}
|
||||
|
||||
virtual bool TransferDataToWindow() override;
|
||||
|
||||
virtual bool TransferDataFromWindow() override;
|
||||
bool TransferDataToWindow() override;
|
||||
bool TransferDataFromWindow() override;
|
||||
|
||||
SCH_BASE_FRAME* GetParent() { return dynamic_cast< SCH_BASE_FRAME* >( wxDialog::GetParent() ); }
|
||||
|
||||
|
@ -77,41 +77,16 @@ protected:
|
|||
*/
|
||||
void OnTextValueSelectButtonClick( wxCommandEvent& aEvent ) override;
|
||||
|
||||
/// @todo Update DIALOG_SHIM to handle this transparently so no matter what mode the
|
||||
/// dialogs is shown, everything is handled without this ugliness.
|
||||
void OnOkClick( wxCommandEvent& aEvent ) override
|
||||
{
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_OK );
|
||||
else
|
||||
EndDialog( wxID_OK );
|
||||
}
|
||||
|
||||
void OnCancelClick( wxCommandEvent& event ) override
|
||||
{
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_CANCEL );
|
||||
else
|
||||
EndDialog( wxID_CANCEL );
|
||||
}
|
||||
|
||||
void OnCloseDialog( wxCloseEvent& aEvent ) override
|
||||
{
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_CANCEL );
|
||||
else
|
||||
EndDialog( wxID_CANCEL );
|
||||
}
|
||||
|
||||
int m_fieldId;
|
||||
bool m_isPower;
|
||||
wxString m_text;
|
||||
int m_style;
|
||||
int m_size;
|
||||
bool m_orientation;
|
||||
int m_verticalJustification;
|
||||
int m_horizontalJustification;
|
||||
bool m_isVisible;
|
||||
UNIT_BINDER m_textSize;
|
||||
int m_fieldId;
|
||||
bool m_isPower;
|
||||
wxString m_text;
|
||||
int m_style;
|
||||
int m_size;
|
||||
bool m_orientation;
|
||||
int m_verticalJustification;
|
||||
int m_horizontalJustification;
|
||||
bool m_isVisible;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/**
|
||||
* @file dialog_lib_edit_text.cpp
|
||||
* @brief dialog to editing graphic texts (not fields) in body components.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
|
@ -28,12 +23,6 @@
|
|||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <gr_basic.h>
|
||||
#include <common.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <base_units.h>
|
||||
|
||||
#include <general.h>
|
||||
#include <lib_edit_frame.h>
|
||||
#include <class_libentry.h>
|
||||
#include <lib_text.h>
|
||||
|
@ -42,128 +31,84 @@
|
|||
|
||||
|
||||
DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT( LIB_EDIT_FRAME* aParent, LIB_TEXT* aText ) :
|
||||
DIALOG_LIB_EDIT_TEXT_BASE( aParent )
|
||||
DIALOG_LIB_EDIT_TEXT_BASE( aParent ),
|
||||
m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true, 0 )
|
||||
{
|
||||
m_parent = aParent;
|
||||
m_graphicText = aText;
|
||||
initDlg();
|
||||
|
||||
// Disable options for fieldedit, not existing in graphic text
|
||||
m_visible->Show( false );
|
||||
m_TextValueSelectButton->Hide();
|
||||
m_PowerComponentValues->Show( false );
|
||||
|
||||
SetInitialFocus( m_TextValue );
|
||||
|
||||
m_sdbSizerButtonsOK->SetDefault();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
FinishDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_EDIT_TEXT::initDlg( )
|
||||
bool DIALOG_LIB_EDIT_TEXT::TransferDataToWindow()
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
m_TextValue->SetFocus();
|
||||
|
||||
// Disable options for fieldedition, not existing in graphic text
|
||||
m_Invisible->Show(false);
|
||||
|
||||
if( m_graphicText )
|
||||
{
|
||||
msg = StringFromValue( g_UserUnit, m_graphicText->GetTextWidth() );
|
||||
m_TextSize->SetValue( msg );
|
||||
m_textSize.SetValue( m_graphicText->GetTextWidth() );
|
||||
m_TextValue->SetValue( m_graphicText->GetText() );
|
||||
|
||||
if( m_graphicText->GetUnit() == 0 )
|
||||
m_CommonUnit->SetValue( true );
|
||||
if( m_graphicText->GetConvert() == 0 )
|
||||
m_CommonConvert->SetValue( true );
|
||||
if( m_graphicText->GetTextAngle() == TEXT_ANGLE_VERT )
|
||||
m_Orient->SetValue( true );
|
||||
m_CommonUnit->SetValue( m_graphicText->GetUnit() == 0 );
|
||||
m_CommonConvert->SetValue( m_graphicText->GetConvert() == 0 );
|
||||
m_Orient->SetValue( m_graphicText->GetTextAngle() == TEXT_ANGLE_VERT );
|
||||
|
||||
int shape = 0;
|
||||
if( m_graphicText->IsItalic() )
|
||||
shape = 1;
|
||||
if( m_graphicText->IsBold() )
|
||||
shape |= 2;
|
||||
|
||||
m_TextShapeOpt->SetSelection( shape );
|
||||
|
||||
switch ( m_graphicText->GetHorizJustify() )
|
||||
{
|
||||
case GR_TEXT_HJUSTIFY_LEFT:
|
||||
m_TextHJustificationOpt->SetSelection( 0 );
|
||||
break;
|
||||
|
||||
case GR_TEXT_HJUSTIFY_CENTER:
|
||||
m_TextHJustificationOpt->SetSelection( 1 );
|
||||
break;
|
||||
|
||||
case GR_TEXT_HJUSTIFY_RIGHT:
|
||||
m_TextHJustificationOpt->SetSelection( 2 );
|
||||
break;
|
||||
case GR_TEXT_HJUSTIFY_LEFT: m_TextHJustificationOpt->SetSelection( 0 ); break;
|
||||
case GR_TEXT_HJUSTIFY_CENTER: m_TextHJustificationOpt->SetSelection( 1 ); break;
|
||||
case GR_TEXT_HJUSTIFY_RIGHT: m_TextHJustificationOpt->SetSelection( 2 ); break;
|
||||
}
|
||||
|
||||
switch ( m_graphicText->GetVertJustify() )
|
||||
{
|
||||
case GR_TEXT_VJUSTIFY_TOP:
|
||||
m_TextVJustificationOpt->SetSelection( 0 );
|
||||
break;
|
||||
|
||||
case GR_TEXT_VJUSTIFY_CENTER:
|
||||
m_TextVJustificationOpt->SetSelection( 1 );
|
||||
break;
|
||||
|
||||
case GR_TEXT_VJUSTIFY_BOTTOM:
|
||||
m_TextVJustificationOpt->SetSelection( 2 );
|
||||
break;
|
||||
case GR_TEXT_VJUSTIFY_TOP: m_TextVJustificationOpt->SetSelection( 0 ); break;
|
||||
case GR_TEXT_VJUSTIFY_CENTER: m_TextVJustificationOpt->SetSelection( 1 ); break;
|
||||
case GR_TEXT_VJUSTIFY_BOTTOM: m_TextVJustificationOpt->SetSelection( 2 ); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = StringFromValue( g_UserUnit, m_parent->m_textSize );
|
||||
m_TextSize->SetValue( msg );
|
||||
m_textSize.SetValue( m_parent->m_textSize );
|
||||
|
||||
if( ! m_parent->m_drawSpecificUnit )
|
||||
m_CommonUnit->SetValue( true );
|
||||
if( ! m_parent->m_drawSpecificConvert )
|
||||
m_CommonConvert->SetValue( true );
|
||||
if( m_parent->m_current_text_angle == TEXT_ANGLE_VERT )
|
||||
m_Orient->SetValue( true );
|
||||
m_CommonUnit->SetValue( !m_parent->m_drawSpecificUnit );
|
||||
m_CommonConvert->SetValue( !m_parent->m_drawSpecificConvert );
|
||||
m_Orient->SetValue( m_parent->m_current_text_angle == TEXT_ANGLE_VERT );
|
||||
}
|
||||
|
||||
msg = m_TextSizeText->GetLabel() + ReturnUnitSymbol();
|
||||
m_TextSizeText->SetLabel( msg );
|
||||
|
||||
m_sdbSizerButtonsOK->SetDefault();
|
||||
|
||||
// Hide the select button as the child dialog classes use this
|
||||
m_TextValueSelectButton->Hide();
|
||||
|
||||
// Hide the "Power component value text cannot be modified!" warning
|
||||
m_PowerComponentValues->Show( false );
|
||||
Fit();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_EDIT_TEXT::OnCancelClick( wxCommandEvent& event )
|
||||
bool DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow()
|
||||
{
|
||||
EndModal(wxID_CANCEL);
|
||||
}
|
||||
|
||||
|
||||
/* Updates the different parameters for the component being edited */
|
||||
void DIALOG_LIB_EDIT_TEXT::OnOkClick( wxCommandEvent& event )
|
||||
{
|
||||
wxString Line;
|
||||
|
||||
Line = m_TextValue->GetValue();
|
||||
m_parent->m_current_text_angle = m_Orient->GetValue() ? TEXT_ANGLE_VERT : TEXT_ANGLE_HORIZ;
|
||||
wxString msg = m_TextSize->GetValue();
|
||||
m_parent->m_textSize = ValueFromString( g_UserUnit, msg );
|
||||
m_parent->m_drawSpecificConvert = m_CommonConvert->GetValue() ? false : true;
|
||||
m_parent->m_drawSpecificUnit = m_CommonUnit->GetValue() ? false : true;
|
||||
m_parent->m_textSize = m_textSize.GetValue();
|
||||
m_parent->m_drawSpecificConvert = !m_CommonConvert->GetValue();
|
||||
m_parent->m_drawSpecificUnit = !m_CommonUnit->GetValue();
|
||||
|
||||
if( m_graphicText )
|
||||
{
|
||||
if( ! Line.IsEmpty() )
|
||||
m_graphicText->SetText( Line );
|
||||
else
|
||||
if( m_TextValue->GetValue().IsEmpty() )
|
||||
m_graphicText->SetText( wxT( "[null]" ) );
|
||||
else
|
||||
m_graphicText->SetText( m_TextValue->GetValue() );
|
||||
|
||||
m_graphicText->SetTextSize( wxSize( m_parent->m_textSize, m_parent->m_textSize ) );
|
||||
m_graphicText->SetTextAngle( m_parent->m_current_text_angle );
|
||||
|
@ -183,37 +128,21 @@ void DIALOG_LIB_EDIT_TEXT::OnOkClick( wxCommandEvent& event )
|
|||
|
||||
switch( m_TextHJustificationOpt->GetSelection() )
|
||||
{
|
||||
case 0:
|
||||
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
break;
|
||||
case 0: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT ); break;
|
||||
case 1: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER ); break;
|
||||
case 2: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); break;
|
||||
}
|
||||
|
||||
switch( m_TextVJustificationOpt->GetSelection() )
|
||||
{
|
||||
case 0:
|
||||
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
|
||||
break;
|
||||
case 0: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP ); break;
|
||||
case 1: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER ); break;
|
||||
case 2: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); break;
|
||||
}
|
||||
}
|
||||
|
||||
if( m_parent->GetDrawItem() )
|
||||
m_parent->SetMsgPanel( m_parent->GetDrawItem() );
|
||||
|
||||
EndModal(wxID_OK);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -26,9 +26,8 @@
|
|||
#ifndef _DIALOG_LIB_EDIT_TEXT_H_
|
||||
#define _DIALOG_LIB_EDIT_TEXT_H_
|
||||
|
||||
|
||||
#include <dialog_lib_edit_text_base.h>
|
||||
|
||||
#include <widgets/unit_binder.h>
|
||||
|
||||
class LIB_EDIT_FRAME;
|
||||
class LIB_TEXT;
|
||||
|
@ -38,16 +37,16 @@ class DIALOG_LIB_EDIT_TEXT : public DIALOG_LIB_EDIT_TEXT_BASE
|
|||
{
|
||||
private:
|
||||
LIB_EDIT_FRAME* m_parent;
|
||||
LIB_TEXT* m_graphicText;
|
||||
LIB_TEXT* m_graphicText;
|
||||
UNIT_BINDER m_textSize;
|
||||
|
||||
public:
|
||||
DIALOG_LIB_EDIT_TEXT( LIB_EDIT_FRAME* aParent, LIB_TEXT* aText );
|
||||
~DIALOG_LIB_EDIT_TEXT() {};
|
||||
~DIALOG_LIB_EDIT_TEXT() override {};
|
||||
|
||||
private:
|
||||
void initDlg( );
|
||||
void OnOkClick( wxCommandEvent& aEvent ) override;
|
||||
void OnCancelClick( wxCommandEvent& aEvent ) override;
|
||||
bool TransferDataToWindow() override;
|
||||
bool TransferDataFromWindow() override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -23,98 +23,108 @@ DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindow
|
|||
bUpperBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bTextValueBoxSizer;
|
||||
bTextValueBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||
bTextValueBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText1->Wrap( -1 );
|
||||
bTextValueBoxSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bTextValueOptsSizer;
|
||||
bTextValueOptsSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
bTextValueBoxSizer->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_TextValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextValue->SetMinSize( wxSize( 200,-1 ) );
|
||||
|
||||
bTextValueOptsSizer->Add( m_TextValue, 1, wxALL|wxEXPAND, 5 );
|
||||
bTextValueBoxSizer->Add( m_TextValue, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_TextValueSelectButton = new wxButton( this, wxID_ANY, _("Select"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bTextValueOptsSizer->Add( m_TextValueSelectButton, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
bTextValueBoxSizer->Add( bTextValueOptsSizer, 1, wxEXPAND, 5 );
|
||||
bTextValueBoxSizer->Add( m_TextValueSelectButton, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
bUpperBoxSizer->Add( bTextValueBoxSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bTextSizeSizer;
|
||||
bTextSizeSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_TextSizeText = new wxStaticText( this, wxID_ANY, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextSizeText->Wrap( -1 );
|
||||
bTextSizeSizer->Add( m_TextSizeText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
bPropertiesSizer->Add( bUpperBoxSizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_TextSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bTextSizeSizer->Add( m_TextSize, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
wxBoxSizer* bSizer9;
|
||||
bSizer9 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
bUpperBoxSizer->Add( bTextSizeSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bPropertiesSizer->Add( bUpperBoxSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
m_PowerComponentValues = new wxStaticText( this, wxID_ANY, _("Power symbol value text cannot be modified!"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_PowerComponentValues = new wxStaticText( this, wxID_ANY, _("Note: power symbol value text cannot be modified."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_PowerComponentValues->Wrap( -1 );
|
||||
m_PowerComponentValues->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
m_PowerComponentValues->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
|
||||
|
||||
bPropertiesSizer->Add( m_PowerComponentValues, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
bSizer9->Add( m_PowerComponentValues, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bPropertiesSizer->Add( bSizer9, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bBottomtBoxSizer;
|
||||
bBottomtBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxStaticBoxSizer* sOptionsSizer;
|
||||
sOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL );
|
||||
|
||||
m_Orient = new wxCheckBox( sOptionsSizer->GetStaticBox(), wxID_ANY, _("Vertical"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sOptionsSizer->Add( m_Orient, 0, wxALL, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( sOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
sOptionsSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_CommonUnit = new wxCheckBox( sOptionsSizer->GetStaticBox(), wxID_ANY, _("Common to all units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sOptionsSizer->Add( m_CommonUnit, 0, wxALL, 5 );
|
||||
|
||||
m_CommonConvert = new wxCheckBox( sOptionsSizer->GetStaticBox(), wxID_ANY, _("Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sOptionsSizer->Add( m_CommonConvert, 0, wxALIGN_RIGHT|wxBOTTOM|wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
m_Invisible = new wxCheckBox( sOptionsSizer->GetStaticBox(), wxID_ANY, _("Invisible"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sOptionsSizer->Add( m_Invisible, 0, wxALIGN_LEFT|wxBOTTOM|wxLEFT, 5 );
|
||||
wxBoxSizer* bSizer8;
|
||||
bSizer8 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
bBottomtBoxSizer->Add( sOptionsSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
bSizer8->Add( 0, 0, 1, wxEXPAND|wxTOP, 2 );
|
||||
|
||||
wxBoxSizer* bTextSizeSizer;
|
||||
bTextSizeSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textSizeLabel->Wrap( -1 );
|
||||
bTextSizeSizer->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_textSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bTextSizeSizer->Add( m_textSizeCtrl, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textSizeUnits->Wrap( -1 );
|
||||
bTextSizeSizer->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizer8->Add( bTextSizeSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
m_visible = new wxCheckBox( this, wxID_ANY, _("Visible"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer8->Add( m_visible, 0, wxALIGN_LEFT|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_Orient = new wxCheckBox( this, wxID_ANY, _("Vertical"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer8->Add( m_Orient, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to all units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer8->Add( m_CommonUnit, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer8->Add( m_CommonConvert, 0, wxALIGN_RIGHT|wxBOTTOM|wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
|
||||
bBottomtBoxSizer->Add( bSizer8, 4, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bBottomtBoxSizer->Add( 0, 0, 0, wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
wxString m_TextShapeOptChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold and italic") };
|
||||
int m_TextShapeOptNChoices = sizeof( m_TextShapeOptChoices ) / sizeof( wxString );
|
||||
m_TextShapeOpt = new wxRadioBox( this, wxID_ANY, _("Style:"), wxDefaultPosition, wxDefaultSize, m_TextShapeOptNChoices, m_TextShapeOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_TextShapeOpt = new wxRadioBox( this, wxID_ANY, _("Text Style"), wxDefaultPosition, wxDefaultSize, m_TextShapeOptNChoices, m_TextShapeOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_TextShapeOpt->SetSelection( 3 );
|
||||
bBottomtBoxSizer->Add( m_TextShapeOpt, 1, wxALL|wxEXPAND, 5 );
|
||||
bBottomtBoxSizer->Add( m_TextShapeOpt, 3, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxString m_TextHJustificationOptChoices[] = { _("Align left"), _("Align center"), _("Align right") };
|
||||
int m_TextHJustificationOptNChoices = sizeof( m_TextHJustificationOptChoices ) / sizeof( wxString );
|
||||
m_TextHJustificationOpt = new wxRadioBox( this, wxID_ANY, _("Horizontal Align:"), wxDefaultPosition, wxDefaultSize, m_TextHJustificationOptNChoices, m_TextHJustificationOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_TextHJustificationOpt = new wxRadioBox( this, wxID_ANY, _("Horizontal Align"), wxDefaultPosition, wxDefaultSize, m_TextHJustificationOptNChoices, m_TextHJustificationOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_TextHJustificationOpt->SetSelection( 0 );
|
||||
bBottomtBoxSizer->Add( m_TextHJustificationOpt, 1, wxALL|wxEXPAND, 5 );
|
||||
bBottomtBoxSizer->Add( m_TextHJustificationOpt, 3, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxString m_TextVJustificationOptChoices[] = { _("Align top"), _("Align center"), _("Align bottom") };
|
||||
int m_TextVJustificationOptNChoices = sizeof( m_TextVJustificationOptChoices ) / sizeof( wxString );
|
||||
m_TextVJustificationOpt = new wxRadioBox( this, wxID_ANY, _("Vertical Align:"), wxDefaultPosition, wxDefaultSize, m_TextVJustificationOptNChoices, m_TextVJustificationOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_TextVJustificationOpt = new wxRadioBox( this, wxID_ANY, _("Vertical Align"), wxDefaultPosition, wxDefaultSize, m_TextVJustificationOptNChoices, m_TextVJustificationOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_TextVJustificationOpt->SetSelection( 0 );
|
||||
bBottomtBoxSizer->Add( m_TextVJustificationOpt, 1, wxALL|wxEXPAND, 5 );
|
||||
bBottomtBoxSizer->Add( m_TextVJustificationOpt, 3, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bPropertiesSizer->Add( bBottomtBoxSizer, 1, wxEXPAND, 5 );
|
||||
bPropertiesSizer->Add( bBottomtBoxSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND, 6 );
|
||||
bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 6 );
|
||||
|
||||
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bMainSizer->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_sdbSizerButtons = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
|
||||
|
@ -133,8 +143,6 @@ DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindow
|
|||
// Connect Events
|
||||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCloseDialog ) );
|
||||
m_TextValueSelectButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnTextValueSelectButtonClick ), NULL, this );
|
||||
m_sdbSizerButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCancelClick ), NULL, this );
|
||||
m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnOkClick ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_LIB_EDIT_TEXT_BASE::~DIALOG_LIB_EDIT_TEXT_BASE()
|
||||
|
@ -142,7 +150,5 @@ DIALOG_LIB_EDIT_TEXT_BASE::~DIALOG_LIB_EDIT_TEXT_BASE()
|
|||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCloseDialog ) );
|
||||
m_TextValueSelectButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnTextValueSelectButtonClick ), NULL, this );
|
||||
m_sdbSizerButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnCancelClick ), NULL, this );
|
||||
m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_TEXT_BASE::OnOkClick ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -22,9 +22,8 @@
|
|||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -40,17 +39,18 @@ class DIALOG_LIB_EDIT_TEXT_BASE : public DIALOG_SHIM
|
|||
wxStaticText* m_staticText1;
|
||||
wxTextCtrl* m_TextValue;
|
||||
wxButton* m_TextValueSelectButton;
|
||||
wxStaticText* m_TextSizeText;
|
||||
wxTextCtrl* m_TextSize;
|
||||
wxStaticText* m_PowerComponentValues;
|
||||
wxStaticText* m_textSizeLabel;
|
||||
wxTextCtrl* m_textSizeCtrl;
|
||||
wxStaticText* m_textSizeUnits;
|
||||
wxCheckBox* m_visible;
|
||||
wxCheckBox* m_Orient;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxCheckBox* m_CommonUnit;
|
||||
wxCheckBox* m_CommonConvert;
|
||||
wxCheckBox* m_Invisible;
|
||||
wxRadioBox* m_TextShapeOpt;
|
||||
wxRadioBox* m_TextHJustificationOpt;
|
||||
wxRadioBox* m_TextVJustificationOpt;
|
||||
wxStaticLine* m_staticline2;
|
||||
wxStdDialogButtonSizer* m_sdbSizerButtons;
|
||||
wxButton* m_sdbSizerButtonsOK;
|
||||
wxButton* m_sdbSizerButtonsCancel;
|
||||
|
@ -58,8 +58,6 @@ class DIALOG_LIB_EDIT_TEXT_BASE : public DIALOG_SHIM
|
|||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnCloseDialog( wxCloseEvent& event ) { event.Skip(); }
|
||||
virtual void OnTextValueSelectButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
|
|
@ -125,10 +125,11 @@ void DIALOG_PLOT_SCHEMATIC::initDlg()
|
|||
|
||||
// Set the default line width (pen width which should be used for
|
||||
// items that do not have a pen size defined (like frame ref)
|
||||
PutValueInLocalUnits( *m_DefaultLineSizeCtrl, GetDefaultLineThickness() );
|
||||
int defaultLineSize = GetDefaultLineThickness();
|
||||
m_DefaultLineSizeCtrl->SetValue( StringFromValue( m_units, defaultLineSize, true, true ) );
|
||||
|
||||
// Initialize HPGL specific widgets
|
||||
PutValueInLocalUnits( *m_penHPGLWidthCtrl, m_HPGLPenSize );
|
||||
m_penHPGLWidthCtrl->SetValue( StringFromValue( m_units, m_HPGLPenSize, true, true ) );
|
||||
|
||||
// Plot directory
|
||||
wxString path = m_parent->GetPlotDirectoryName();
|
||||
|
@ -237,11 +238,13 @@ void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event )
|
|||
m_paperSizeOption->Set( paperSizes );
|
||||
m_paperSizeOption->SetSelection( selection );
|
||||
|
||||
m_DefaultLineSizeCtrl->Enable( fmt == PLOT_FORMAT_POST
|
||||
|| fmt == PLOT_FORMAT_PDF
|
||||
|| fmt == PLOT_FORMAT_SVG );
|
||||
bool enable = fmt == PLOT_FORMAT_POST || fmt == PLOT_FORMAT_PDF || fmt == PLOT_FORMAT_SVG;
|
||||
m_defaultLineWidthTitle->Enable( enable );
|
||||
m_DefaultLineSizeCtrl->Enable( enable );
|
||||
|
||||
m_plotOriginTitle->Enable( fmt == PLOT_FORMAT_HPGL );
|
||||
m_plotOriginOpt->Enable( fmt == PLOT_FORMAT_HPGL );
|
||||
m_penHPGLWidthTitle->Enable( fmt == PLOT_FORMAT_HPGL );
|
||||
m_penHPGLWidthCtrl->Enable( fmt == PLOT_FORMAT_HPGL );
|
||||
}
|
||||
|
||||
|
@ -257,7 +260,8 @@ void DIALOG_PLOT_SCHEMATIC::getPlotOptions()
|
|||
// HPGL Pen Size is stored in mm in config
|
||||
m_config->Write( PLOT_HPGL_PEN_SIZE_KEY, m_HPGLPenSize/IU_PER_MM );
|
||||
|
||||
SetDefaultLineThickness( ValueFromTextCtrl( *m_DefaultLineSizeCtrl ) );
|
||||
int thickness = ValueFromString( GetUserUnits(), m_DefaultLineSizeCtrl->GetValue(), true );
|
||||
SetDefaultLineThickness( thickness );
|
||||
|
||||
// Plot directory
|
||||
wxString path = m_outputDirectoryName->GetValue();
|
||||
|
|
|
@ -105,10 +105,9 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
|
|||
gbSizer2->SetFlexibleDirection( wxBOTH );
|
||||
gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
wxStaticText* sPositionLabel;
|
||||
sPositionLabel = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Position:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sPositionLabel->Wrap( -1 );
|
||||
gbSizer2->Add( sPositionLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
m_plotOriginTitle = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Position:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotOriginTitle->Wrap( -1 );
|
||||
gbSizer2->Add( m_plotOriginTitle, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
wxString m_plotOriginOptChoices[] = { _("Bottom left"), _("Center on page") };
|
||||
int m_plotOriginOptNChoices = sizeof( m_plotOriginOptChoices ) / sizeof( wxString );
|
||||
|
@ -116,9 +115,9 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
|
|||
m_plotOriginOpt->SetSelection( 0 );
|
||||
gbSizer2->Add( m_plotOriginOpt, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_penHPLGWidthTitle = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_penHPLGWidthTitle->Wrap( -1 );
|
||||
gbSizer2->Add( m_penHPLGWidthTitle, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
m_penHPGLWidthTitle = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_penHPGLWidthTitle->Wrap( -1 );
|
||||
gbSizer2->Add( m_penHPGLWidthTitle, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_penHPGLWidthCtrl = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer2->Add( m_penHPGLWidthCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
|
|
@ -1198,11 +1198,11 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">sPositionLabel</property>
|
||||
<property name="name">m_plotOriginTitle</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">none</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
|
@ -1375,7 +1375,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_penHPLGWidthTitle</property>
|
||||
<property name="name">m_penHPGLWidthTitle</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
|
|
@ -57,8 +57,9 @@ class DIALOG_PLOT_SCHEMATIC_BASE : public DIALOG_SHIM
|
|||
wxStaticText* m_defaultLineWidthTitle;
|
||||
wxTextCtrl* m_DefaultLineSizeCtrl;
|
||||
wxStaticBoxSizer* m_HPGLOptionsSizer;
|
||||
wxStaticText* m_plotOriginTitle;
|
||||
wxChoice* m_plotOriginOpt;
|
||||
wxStaticText* m_penHPLGWidthTitle;
|
||||
wxStaticText* m_penHPGLWidthTitle;
|
||||
wxTextCtrl* m_penHPGLWidthCtrl;
|
||||
WX_HTML_REPORT_PANEL* m_MessagesBox;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
|
|
|
@ -1125,9 +1125,11 @@ void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
|
|||
DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
|
||||
DefaultTransform );
|
||||
|
||||
DIALOG_LIB_EDIT_TEXT* frame = new DIALOG_LIB_EDIT_TEXT( this, (LIB_TEXT*) DrawItem );
|
||||
frame->ShowModal();
|
||||
frame->Destroy();
|
||||
DIALOG_LIB_EDIT_TEXT dlg( this, (LIB_TEXT*) DrawItem );
|
||||
|
||||
if( dlg.ShowModal() != wxID_OK )
|
||||
return;
|
||||
|
||||
OnModify();
|
||||
|
||||
// Display new text
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
#define VAR 1
|
||||
#define ASSIGN 2
|
||||
#define SEMCOL 3
|
||||
#define PLUS 4
|
||||
#define MINUS 5
|
||||
#define UNIT 6
|
||||
#define DIVIDE 7
|
||||
#define MULT 8
|
||||
#define ENDS 9
|
||||
#define VALUE 10
|
||||
#define PARENL 11
|
||||
#define PARENR 12
|
|
@ -68,7 +68,6 @@ Supported units are millimeters (mm), Mil (mil) and inch (")
|
|||
#ifndef NUMERIC_EVALUATOR_H_
|
||||
#define NUMERIC_EVALUATOR_H_
|
||||
|
||||
#include "grammar.h"
|
||||
#include <stddef.h>
|
||||
#include <string>
|
||||
#include <string>
|
||||
|
|
Loading…
Reference in New Issue