diff --git a/common/drawing_sheet/drawing_sheet.keywords b/common/drawing_sheet/drawing_sheet.keywords index aa5b38be74..1c7ac7c3be 100644 --- a/common/drawing_sheet/drawing_sheet.keywords +++ b/common/drawing_sheet/drawing_sheet.keywords @@ -35,6 +35,7 @@ xy maxlen maxheight font +face bold italic size diff --git a/common/drawing_sheet/drawing_sheet_parser.cpp b/common/drawing_sheet/drawing_sheet_parser.cpp index 3c1f7e736c..cb5eaefa40 100644 --- a/common/drawing_sheet/drawing_sheet_parser.cpp +++ b/common/drawing_sheet/drawing_sheet_parser.cpp @@ -33,6 +33,7 @@ #include #include #include +#include using namespace DRAWINGSHEET_T; @@ -696,6 +697,9 @@ void DRAWING_SHEET_PARSER::parseText( DS_DATA_ITEM_TEXT* aItem ) break; case T_font: + { + wxString faceName; + for( token = NextTok(); token != T_RIGHT && token != EOF; token = NextTok() ) { switch( token ) @@ -703,6 +707,12 @@ void DRAWING_SHEET_PARSER::parseText( DS_DATA_ITEM_TEXT* aItem ) case T_LEFT: break; + case T_face: + NeedSYMBOL(); + faceName = FromUTF8(); + NeedRIGHT(); + break; + case T_bold: aItem->m_Bold = true; break; @@ -727,7 +737,12 @@ void DRAWING_SHEET_PARSER::parseText( DS_DATA_ITEM_TEXT* aItem ) break; } } + + if( !faceName.IsEmpty() ) + aItem->m_Font = KIFONT::FONT::GetFont( faceName, aItem->m_Bold, aItem->m_Italic ); + break; + } case T_justify: for( token = NextTok(); token != T_RIGHT && token != EOF; token = NextTok() ) diff --git a/common/drawing_sheet/ds_data_item.cpp b/common/drawing_sheet/ds_data_item.cpp index 38b9adb2c7..124e4c61cf 100644 --- a/common/drawing_sheet/ds_data_item.cpp +++ b/common/drawing_sheet/ds_data_item.cpp @@ -526,6 +526,7 @@ DS_DATA_ITEM_TEXT::DS_DATA_ITEM_TEXT( const wxString& aTextBase ) : m_Vjustify = GR_TEXT_V_ALIGN_CENTER; m_Italic = false; m_Bold = false; + m_Font = nullptr; m_Orient = 0.0; m_LineWidth = 0.0; // 0 means use default value } @@ -559,7 +560,7 @@ void DS_DATA_ITEM_TEXT::SyncDrawItems( DS_DRAW_ITEM_LIST* aCollector, KIGFX::VIE pensize = GetPenSizeForBold( std::min( textsize.x, textsize.y ) ); std::map itemFlags; - DS_DRAW_ITEM_TEXT* text = nullptr; + DS_DRAW_ITEM_TEXT* text = nullptr; for( size_t i = 0; i < m_drawItems.size(); ++i ) { @@ -583,7 +584,7 @@ void DS_DATA_ITEM_TEXT::SyncDrawItems( DS_DRAW_ITEM_LIST* aCollector, KIGFX::VIE continue; text = new DS_DRAW_ITEM_TEXT( this, j, m_FullText, GetStartPosUi( j ), textsize, pensize, - m_Italic, m_Bold ); + m_Font, m_Italic, m_Bold ); text->SetFlags( itemFlags[ j ] ); m_drawItems.push_back( text ); @@ -691,8 +692,8 @@ void DS_DATA_ITEM_TEXT::SetConstrainedTextSize() int linewidth = 0; size_micron.x = KiROUND( m_ConstrainedTextSize.x * FSCALE ); size_micron.y = KiROUND( m_ConstrainedTextSize.y * FSCALE ); - DS_DRAW_ITEM_TEXT dummy( DS_DRAW_ITEM_TEXT( this, 0, m_FullText, VECTOR2I( 0, 0 ), - size_micron, linewidth, m_Italic, m_Bold ) ); + DS_DRAW_ITEM_TEXT dummy( this, 0, m_FullText, VECTOR2I( 0, 0 ), size_micron, linewidth, + m_Font, m_Italic, m_Bold ); dummy.SetMultilineAllowed( true ); dummy.SetHorizJustify( m_Hjustify ) ; dummy.SetVertJustify( m_Vjustify ); diff --git a/common/drawing_sheet/ds_data_model_io.cpp b/common/drawing_sheet/ds_data_model_io.cpp index 22271d2dda..c1d51b2542 100644 --- a/common/drawing_sheet/ds_data_model_io.cpp +++ b/common/drawing_sheet/ds_data_model_io.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2013-2016 CERN - * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors. * * @author Jean-Pierre Charras, jp.charras at wanadoo.fr * @@ -33,6 +33,7 @@ #include #include #include +#include #include @@ -252,6 +253,9 @@ void DS_DATA_MODEL_IO::format( DS_DATA_ITEM_TEXT* aItem, int aNestLevel ) const { m_out->Print( 0, " (font" ); + if( aItem->m_Font && !aItem->m_Font->Name().IsEmpty() ) + m_out->Print( 0, " (face \"%s\")", aItem->m_Font->NameAsToken() ); + if( write_thickness ) m_out->Print( 0, " (linewidth %s)", double2Str( aItem->m_LineWidth ).c_str() ); diff --git a/common/drawing_sheet/ds_draw_item.cpp b/common/drawing_sheet/ds_draw_item.cpp index 9b966c0626..04fe329ffc 100644 --- a/common/drawing_sheet/ds_draw_item.cpp +++ b/common/drawing_sheet/ds_draw_item.cpp @@ -184,8 +184,7 @@ bool DS_DRAW_ITEM_TEXT::HitTest( const EDA_RECT& aRect, bool aContains, int aAcc wxString DS_DRAW_ITEM_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Text '%s'" ), - GetShownText() ); + return wxString::Format( _( "Text '%s'" ), GetShownText() ); } diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index 1ffbfefa37..887a024faf 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -277,11 +277,10 @@ void ERC_TESTER::TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet ) { if( text->GetShownText().Matches( wxT( "*${*}*" ) ) ) { - std::shared_ptr ercItem = - ERC_ITEM::Create( ERCE_UNRESOLVED_VARIABLE ); - ercItem->SetErrorMessage( _( "Unresolved text variable in drawing sheet." ) ); + std::shared_ptr erc = ERC_ITEM::Create( ERCE_UNRESOLVED_VARIABLE ); + erc->SetErrorMessage( _( "Unresolved text variable in drawing sheet." ) ); - SCH_MARKER* marker = new SCH_MARKER( ercItem, text->GetPosition() ); + SCH_MARKER* marker = new SCH_MARKER( erc, text->GetPosition() ); screen->Append( marker ); } } diff --git a/include/drawing_sheet/ds_data_item.h b/include/drawing_sheet/ds_data_item.h index 34327413a4..e1a1718e00 100644 --- a/include/drawing_sheet/ds_data_item.h +++ b/include/drawing_sheet/ds_data_item.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2013-2019 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -339,6 +339,7 @@ public: GR_TEXT_V_ALIGN_T m_Vjustify; bool m_Italic; bool m_Bold; + KIFONT::FONT* m_Font; VECTOR2D m_TextSize; VECTOR2D m_BoundingBoxSize; // When not null, this is the max size of the // full text. The text size will be modified diff --git a/include/drawing_sheet/ds_draw_item.h b/include/drawing_sheet/ds_draw_item.h index f8e138f651..d6696a1785 100644 --- a/include/drawing_sheet/ds_draw_item.h +++ b/include/drawing_sheet/ds_draw_item.h @@ -302,14 +302,15 @@ class DS_DRAW_ITEM_TEXT : public DS_DRAW_ITEM_BASE, public EDA_TEXT { public: DS_DRAW_ITEM_TEXT( DS_DATA_ITEM* aPeer, int aIndex, const wxString& aText, const VECTOR2I& aPos, - const VECTOR2I& aSize, int aPenWidth, bool aItalic = false, - bool aBold = false ) : + const VECTOR2I& aSize, int aPenWidth, KIFONT::FONT* aFont, + bool aItalic = false, bool aBold = false ) : DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T), EDA_TEXT( aText ) { SetTextPos( aPos ); SetTextSize( (wxSize) aSize ); SetTextThickness( aPenWidth ); + SetFont( aFont ); SetItalic( aItalic ); SetBold( aBold ); } diff --git a/include/drawing_sheet/ds_file_versions.h b/include/drawing_sheet/ds_file_versions.h index e9a963e722..1495393e11 100644 --- a/include/drawing_sheet/ds_file_versions.h +++ b/include/drawing_sheet/ds_file_versions.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2021 MikoĊ‚aj Wielgus - * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,4 +30,5 @@ * format. Comment the changes to the file format for historical purposes. */ -#define SEXPR_WORKSHEET_FILE_VERSION 20210606 // Initial version. +//#define SEXPR_WORKSHEET_FILE_VERSION 20210606 // Initial version. +#define SEXPR_WORKSHEET_FILE_VERSION 20220228 // Font support. diff --git a/pagelayout_editor/dialogs/properties_frame.cpp b/pagelayout_editor/dialogs/properties_frame.cpp index 17298264bc..74d6ff48e5 100644 --- a/pagelayout_editor/dialogs/properties_frame.cpp +++ b/pagelayout_editor/dialogs/properties_frame.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2013 CERN - * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr * * This program is free software; you can redistribute it and/or @@ -25,11 +25,14 @@ #include #include +#include +#include #include #include #include #include #include +#include #include "properties_frame.h" #include "pl_editor_frame.h" @@ -41,39 +44,25 @@ PROPERTIES_FRAME::PROPERTIES_FRAME( PL_EDITOR_FRAME* aParent ) : PANEL_PROPERTIES_BASE( aParent ), m_scintillaTricks( nullptr ), - m_textCtrlTextSizeXBinder( aParent, m_staticTextTsizeX, m_textCtrlTextSizeX, - m_TextTextSizeXUnits ), - m_textCtrlTextSizeYBinder( aParent, m_staticTextTsizeY, m_textCtrlTextSizeY, - m_TextTextSizeYUnits ), - m_textCtrlConstraintXBinder( aParent, m_staticTextConstraintX, m_textCtrlConstraintX, - m_TextConstraintXUnits ), - m_textCtrlConstraintYBinder( aParent, m_staticTextConstraintY, m_textCtrlConstraintY, - m_TextConstraintYUnits ), - m_textCtrlPosXBinder( aParent, m_staticTextPosX, m_textCtrlPosX, m_TextPosXUnits ), - m_textCtrlPosYBinder( aParent, m_staticTextPosY, m_textCtrlPosY, m_TextPosYUnits ), - m_textCtrlEndXBinder( aParent, m_staticTextEndX, m_textCtrlEndX, m_TextEndXUnits ), - m_textCtrlEndYBinder( aParent, m_staticTextEndY, m_textCtrlEndY, m_TextEndYUnits ), - m_textCtrlStepXBinder( aParent, m_staticTextStepX, m_textCtrlStepX, m_TextStepXUnits ), - m_textCtrlStepYBinder( aParent, m_staticTextStepY, m_textCtrlStepY, m_TextStepYUnits ), - m_textCtrlDefaultTextSizeXBinder( aParent, m_staticTextDefTsX, m_textCtrlDefaultTextSizeX, - m_TextDefaultTextSizeXUnits ), - m_textCtrlDefaultTextSizeYBinder( aParent, m_staticTextDefTsY, m_textCtrlDefaultTextSizeY, - m_TextDefaultTextSizeYUnits ), - m_textCtrlDefaultLineWidthBinder( aParent, m_staticTextDefLineW, - m_textCtrlDefaultLineWidth, m_TextDefaultLineWidthUnits ), - m_textCtrlDefaultTextThicknessBinder( aParent, m_staticTextDefTextThickness, - m_textCtrlDefaultTextThickness, - m_TextDefaultTextThicknessUnits ), - m_textCtrlLeftMarginBinder( aParent, m_staticTextLeftMargin, m_textCtrlLeftMargin, - m_TextLeftMarginUnits ), - m_textCtrlRightMarginBinder( aParent, m_staticTextDefRightMargin, m_textCtrlRightMargin, - m_TextRightMarginUnits ), - m_textCtrlTopMarginBinder( aParent, m_staticTextTopMargin, m_textCtrlTopMargin, - m_TextTopMarginUnits ), - m_textCtrlBottomMarginBinder( aParent, m_staticTextBottomMargin, m_textCtrlBottomMargin, - m_TextBottomMarginUnits ), - m_textCtrlThicknessBinder( aParent, m_staticTextThickness, m_textCtrlThickness, - m_TextLineThicknessUnits ) + m_textSizeX( aParent, m_staticTextTsizeX, m_textCtrlTextSizeX, m_textSizeXUnits ), + m_textSizeY( aParent, m_staticTextTsizeY, m_textCtrlTextSizeY, m_textSizeYUnits ), + m_constraintX( aParent, m_constraintXLabel, m_constraintXCtrl, m_constraintXUnits ), + m_constraintY( aParent, m_constraintYLabel, m_constraintYCtrl, m_constraintYUnits ), + m_textPosX( aParent, m_staticTextPosX, m_textCtrlPosX, m_TextPosXUnits ), + m_textPosY( aParent, m_staticTextPosY, m_textCtrlPosY, m_TextPosYUnits ), + m_textEndX( aParent, m_staticTextEndX, m_textCtrlEndX, m_TextEndXUnits ), + m_textEndY( aParent, m_staticTextEndY, m_textCtrlEndY, m_TextEndYUnits ), + m_textStepX( aParent, m_staticTextStepX, m_textCtrlStepX, m_TextStepXUnits ), + m_textStepY( aParent, m_staticTextStepY, m_textCtrlStepY, m_TextStepYUnits ), + m_defaultTextSizeX( aParent, m_staticTextDefTsX, m_textCtrlDefaultTextSizeX, m_defaultTextSizeXUnits ), + m_defaultTextSizeY( aParent, m_staticTextDefTsY, m_textCtrlDefaultTextSizeY, m_defaultTextSizeYUnits ), + m_defaultLineWidth( aParent, m_defaultLineWidthLabel, m_defaultLineWidthCtrl, m_defaultLineWidthUnits ), + m_defaultTextThickness( aParent, m_defaultTextThicknessLabel, m_defaultTextThicknessCtrl, m_defaultTextThicknessUnits ), + m_textLeftMargin( aParent, m_leftMarginLabel, m_leftMarginCtrl, m_leftMarginUnits ), + m_textRightMargin( aParent, m_rightMarginLabel, m_rightMarginCtrl, m_rightMarginUnits ), + m_textTopMargin( aParent, m_topMarginLabel, m_topMarginCtrl, m_topMarginUnits ), + m_textBottomMargin( aParent, m_bottomMarginLabel, m_bottomMarginCtrl, m_bottomMarginUnits ), + m_lineWidth( aParent, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ) { m_parent = aParent; @@ -84,6 +73,32 @@ PROPERTIES_FRAME::PROPERTIES_FRAME( PL_EDITOR_FRAME* aParent ) : m_staticTextSizeInfo->SetFont( KIUI::GetInfoFont( this ).Italic() ); + m_separator1->SetIsSeparator(); + + m_bold->SetIsCheckButton(); + m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) ); + m_italic->SetIsCheckButton(); + m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) ); + + m_separator2->SetIsSeparator(); + + m_alignLeft->SetIsCheckButton(); + m_alignLeft->SetBitmap( KiBitmap( BITMAPS::text_align_left ) ); + m_alignCenter->SetIsCheckButton(); + m_alignCenter->SetBitmap( KiBitmap( BITMAPS::text_align_center ) ); + m_alignRight->SetIsCheckButton(); + m_alignRight->SetBitmap( KiBitmap( BITMAPS::text_align_right ) ); + + m_separator3->SetIsSeparator(); + + m_vAlignTop->SetIsCheckButton(); + m_vAlignTop->SetBitmap( KiBitmap( BITMAPS::text_valign_top ) ); + m_vAlignMiddle->SetIsCheckButton(); + m_vAlignMiddle->SetBitmap( KiBitmap( BITMAPS::text_valign_center ) ); + m_vAlignBottom->SetIsCheckButton(); + m_vAlignBottom->SetBitmap( KiBitmap( BITMAPS::text_valign_bottom ) ); + + m_separator4->SetIsSeparator(); m_buttonOK->SetDefault(); // ensure sizers are up to date @@ -92,6 +107,12 @@ PROPERTIES_FRAME::PROPERTIES_FRAME( PL_EDITOR_FRAME* aParent ) : m_swGeneralOpts->Fit(); m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this ); + m_alignLeft->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this ); + m_alignCenter->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this ); + m_alignRight->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this ); + m_vAlignTop->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this ); + m_vAlignMiddle->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this ); + m_vAlignBottom->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this ); } @@ -120,59 +141,40 @@ wxSize PROPERTIES_FRAME::GetMinSize() const void PROPERTIES_FRAME::CopyPrmsFromGeneralToPanel() { - DS_DATA_MODEL& model = DS_DATA_MODEL::GetTheInstance(); + static EDA_UNITS units = EDA_UNITS::MILLIMETRES; + DS_DATA_MODEL& model = DS_DATA_MODEL::GetTheInstance(); // Set default parameters - m_textCtrlDefaultLineWidthBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, model.m_DefaultLineWidth ) ); + m_defaultLineWidth.SetDoubleValue( From_User_Unit( units, model.m_DefaultLineWidth ) ); - m_textCtrlDefaultTextSizeXBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, model.m_DefaultTextSize.x ) ); + m_defaultTextSizeX.SetDoubleValue( From_User_Unit( units, model.m_DefaultTextSize.x ) ); + m_defaultTextSizeY.SetDoubleValue( From_User_Unit( units, model.m_DefaultTextSize.y ) ); + m_defaultTextThickness.SetDoubleValue( From_User_Unit( units, model.m_DefaultTextThickness ) ); - m_textCtrlDefaultTextSizeYBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, model.m_DefaultTextSize.y ) ); - - m_textCtrlDefaultTextThicknessBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, model.m_DefaultTextThickness ) ); - - m_textCtrlLeftMarginBinder.SetDoubleValue( From_User_Unit( EDA_UNITS::MILLIMETRES, - model.GetLeftMargin() ) ); - m_textCtrlRightMarginBinder.SetDoubleValue( From_User_Unit( EDA_UNITS::MILLIMETRES, - model.GetRightMargin() ) ); - m_textCtrlTopMarginBinder.SetDoubleValue( From_User_Unit( EDA_UNITS::MILLIMETRES, - model.GetTopMargin() ) ); - m_textCtrlBottomMarginBinder.SetDoubleValue( From_User_Unit( EDA_UNITS::MILLIMETRES, - model.GetBottomMargin() ) ); + m_textLeftMargin.SetDoubleValue( From_User_Unit( units, model.GetLeftMargin() ) ); + m_textRightMargin.SetDoubleValue( From_User_Unit( units, model.GetRightMargin() ) ); + m_textTopMargin.SetDoubleValue( From_User_Unit( units, model.GetTopMargin() ) ); + m_textBottomMargin.SetDoubleValue( From_User_Unit( units, model.GetBottomMargin() ) ); } bool PROPERTIES_FRAME::CopyPrmsFromPanelToGeneral() { - DS_DATA_MODEL& model = DS_DATA_MODEL::GetTheInstance(); + static EDA_UNITS units = EDA_UNITS::MILLIMETRES; + DS_DATA_MODEL& model = DS_DATA_MODEL::GetTheInstance(); // Import default parameters from widgets - model.m_DefaultLineWidth = - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlDefaultLineWidthBinder.GetValue() ); + model.m_DefaultLineWidth = To_User_Unit( units, m_defaultLineWidth.GetValue() ); - model.m_DefaultTextSize.x = - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlDefaultTextSizeXBinder.GetValue() ); - model.m_DefaultTextSize.y = - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlDefaultTextSizeYBinder.GetValue() ); - - model.m_DefaultTextThickness = - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlDefaultTextThicknessBinder.GetValue() ); + model.m_DefaultTextSize.x = To_User_Unit( units, m_defaultTextSizeX.GetValue() ); + model.m_DefaultTextSize.y = To_User_Unit( units, m_defaultTextSizeY.GetValue() ); + model.m_DefaultTextThickness = To_User_Unit( units, m_defaultTextThickness.GetValue() ); // Get page margins values - model.SetRightMargin( - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlRightMarginBinder.GetValue() ) ); - model.SetBottomMargin( - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlBottomMarginBinder.GetValue() ) ); - - // coordinates of the left top corner are the left and top margins - model.SetLeftMargin( - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlLeftMarginBinder.GetValue() ) ); - model.SetTopMargin( - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlTopMarginBinder.GetValue() ) ); + model.SetRightMargin( To_User_Unit( units, m_textRightMargin.GetValue() ) ); + model.SetBottomMargin( To_User_Unit( units, m_textBottomMargin.GetValue() ) ); + model.SetLeftMargin( To_User_Unit( units, m_textLeftMargin.GetValue() ) ); + model.SetTopMargin( To_User_Unit( units, m_textTopMargin.GetValue() ) ); return true; } @@ -186,7 +188,8 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) return; } - wxString msg; + static EDA_UNITS units = EDA_UNITS::MILLIMETRES; + wxString msg; // Set parameters common to all DS_DATA_ITEM types m_staticTextType->SetLabel( aItem->GetClassName() ); @@ -201,11 +204,8 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) } // Position/ start point - m_textCtrlPosXBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, aItem->m_Pos.m_Pos.x ) ); - - m_textCtrlPosYBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, aItem->m_Pos.m_Pos.y ) ); + m_textPosX.SetDoubleValue( From_User_Unit( units, aItem->m_Pos.m_Pos.x ) ); + m_textPosY.SetDoubleValue( From_User_Unit( units, aItem->m_Pos.m_Pos.y ) ); switch( aItem->m_Pos.m_Anchor ) { @@ -216,10 +216,8 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) } // End point - m_textCtrlEndXBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, aItem->m_End.m_Pos.x ) ); - m_textCtrlEndYBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, aItem->m_End.m_Pos.y ) ); + m_textEndX.SetDoubleValue( From_User_Unit( units, aItem->m_End.m_Pos.x ) ); + m_textEndY.SetDoubleValue( From_User_Unit( units, aItem->m_End.m_Pos.y ) ); switch( aItem->m_End.m_Anchor ) { @@ -229,8 +227,7 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break; } - m_textCtrlThicknessBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, aItem->m_LineWidth ) ); + m_lineWidth.SetDoubleValue( From_User_Unit( units, aItem->m_LineWidth ) ); // Now, set prms more specific to DS_DATA_ITEM types // For a given type, disable widgets which are not relevant, @@ -244,42 +241,46 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) item->ReplaceAntiSlashSequence(); m_stcText->SetValue( item->m_FullText ); - msg.Printf( wxT("%d"), item->m_IncrementLabel ); + msg.Printf( wxT( "%d" ), item->m_IncrementLabel ); m_textCtrlTextIncrement->SetValue( msg ); // Rotation (poly and text) - msg.Printf( wxT("%.3f"), item->m_Orient ); + msg.Printf( wxT( "%.3f" ), item->m_Orient ); m_textCtrlRotation->SetValue( msg ); // Constraints: - m_textCtrlConstraintXBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, item->m_BoundingBoxSize.x ) ); - m_textCtrlConstraintYBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, item->m_BoundingBoxSize.y ) ); + m_constraintX.SetDoubleValue( From_User_Unit( units, item->m_BoundingBoxSize.x ) ); + m_constraintY.SetDoubleValue( From_User_Unit( units, item->m_BoundingBoxSize.y ) ); // Font Options - m_checkBoxBold->SetValue( item->m_Bold ); - m_checkBoxItalic->SetValue( item->m_Italic ); + m_fontCtrl->SetFontSelection( item->m_Font ); + + m_bold->Check( item->m_Bold ); + m_italic->Check( item->m_Italic ); + + for( BITMAP_BUTTON* btn : { m_alignLeft, m_alignCenter, m_alignRight } ) + btn->Check( false ); switch( item->m_Hjustify ) { - case GR_TEXT_H_ALIGN_LEFT: m_choiceHjustify->SetSelection( 0 ); break; - case GR_TEXT_H_ALIGN_CENTER: m_choiceHjustify->SetSelection( 1 ); break; - case GR_TEXT_H_ALIGN_RIGHT: m_choiceHjustify->SetSelection( 2 ); break; + case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check(); break; + case GR_TEXT_H_ALIGN_CENTER: m_alignCenter->Check(); break; + case GR_TEXT_H_ALIGN_RIGHT: m_alignRight->Check(); break; } + for( BITMAP_BUTTON* btn : { m_vAlignTop, m_vAlignMiddle, m_vAlignBottom } ) + btn->Check( false ); + switch( item->m_Vjustify ) { - case GR_TEXT_V_ALIGN_TOP: m_choiceVjustify->SetSelection( 0 ); break; - case GR_TEXT_V_ALIGN_CENTER: m_choiceVjustify->SetSelection( 1 ); break; - case GR_TEXT_V_ALIGN_BOTTOM: m_choiceVjustify->SetSelection( 2 ); break; + case GR_TEXT_V_ALIGN_TOP: m_vAlignTop->Check(); break; + case GR_TEXT_V_ALIGN_CENTER: m_vAlignMiddle->Check(); break; + case GR_TEXT_V_ALIGN_BOTTOM: m_vAlignBottom->Check(); break; } // Text size - m_textCtrlTextSizeXBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, item->m_TextSize.x ) ); - m_textCtrlTextSizeYBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, item->m_TextSize.y ) ); + m_textSizeX.SetDoubleValue( From_User_Unit( units, item->m_TextSize.x ) ); + m_textSizeY.SetDoubleValue( From_User_Unit( units, item->m_TextSize.y ) ); } if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON ) @@ -287,7 +288,7 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) DS_DATA_ITEM_POLYGONS* item = static_cast( aItem ); // Rotation (poly and text) - msg.Printf( wxT("%.3f"), item->m_Orient.AsDegrees() ); + msg.Printf( wxT( "%.3f" ), item->m_Orient.AsDegrees() ); m_textCtrlRotation->SetValue( msg ); } @@ -296,7 +297,7 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) DS_DATA_ITEM_BITMAP* item = static_cast( aItem ); // select definition in PPI - msg.Printf( wxT("%d"), item->GetPPI() ); + msg.Printf( wxT( "%d" ), item->GetPPI() ); m_textCtrlBitmapDPI->SetValue( msg ); } @@ -308,7 +309,7 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) m_sbSizerEndPosition->Show( aItem->GetType() == DS_DATA_ITEM::DS_SEGMENT || aItem->GetType() == DS_DATA_ITEM::DS_RECT ); - m_textCtrlThicknessBinder.Show( aItem->GetType() != DS_DATA_ITEM::DS_BITMAP ); + m_lineWidth.Show( aItem->GetType() != DS_DATA_ITEM::DS_BITMAP ); if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT || aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON ) @@ -329,14 +330,11 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) m_textCtrlTextIncrement->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT ); // Repeat parameters - msg.Printf( wxT("%d"), aItem->m_RepeatCount ); + msg.Printf( wxT( "%d" ), aItem->m_RepeatCount ); m_textCtrlRepeatCount->SetValue( msg ); - m_textCtrlStepXBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, aItem->m_IncrementVector.x ) ); - - m_textCtrlStepYBinder.SetDoubleValue( - From_User_Unit( EDA_UNITS::MILLIMETRES, aItem->m_IncrementVector.y ) ); + m_textStepX.SetDoubleValue( From_User_Unit( units, aItem->m_IncrementVector.x ) ); + m_textStepY.SetDoubleValue( From_User_Unit( units, aItem->m_IncrementVector.y ) ); // The number of widgets was modified, so recalculate sizers m_swItemProperties->Layout(); @@ -353,6 +351,26 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem ) } +void PROPERTIES_FRAME::onHAlignButton( wxCommandEvent& aEvent ) +{ + for( BITMAP_BUTTON* btn : { m_alignLeft, m_alignCenter, m_alignRight } ) + { + if( btn->IsChecked() && btn != aEvent.GetEventObject() ) + btn->Check( false ); + } +} + + +void PROPERTIES_FRAME::onVAlignButton( wxCommandEvent& aEvent ) +{ + for( BITMAP_BUTTON* btn : { m_vAlignTop, m_vAlignMiddle, m_vAlignBottom } ) + { + if( btn->IsChecked() && btn != aEvent.GetEventObject() ) + btn->Check( false ); + } +} + + void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event ) { PL_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool(); @@ -407,7 +425,8 @@ bool PROPERTIES_FRAME::CopyPrmsFromPanelToItem( DS_DATA_ITEM* aItem ) if( aItem == nullptr ) return false; - wxString msg; + const EDA_UNITS units = EDA_UNITS::MILLIMETRES; + wxString msg; // Import common parameters: aItem->m_Info = m_textCtrlComment->GetValue(); @@ -421,12 +440,11 @@ bool PROPERTIES_FRAME::CopyPrmsFromPanelToItem( DS_DATA_ITEM* aItem ) } // Import thickness - aItem->m_LineWidth = To_User_Unit( EDA_UNITS::MILLIMETRES, - m_textCtrlThicknessBinder.GetValue() ); + aItem->m_LineWidth = To_User_Unit( units, m_lineWidth.GetValue() ); // Import Start point - aItem->m_Pos.m_Pos.x = To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlPosXBinder.GetValue() ); - aItem->m_Pos.m_Pos.y = To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlPosYBinder.GetValue() ); + aItem->m_Pos.m_Pos.x = To_User_Unit( units, m_textPosX.GetValue() ); + aItem->m_Pos.m_Pos.y = To_User_Unit( units, m_textPosY.GetValue() ); switch( m_comboBoxCornerPos->GetSelection() ) { @@ -437,8 +455,8 @@ bool PROPERTIES_FRAME::CopyPrmsFromPanelToItem( DS_DATA_ITEM* aItem ) } // Import End point - aItem->m_End.m_Pos.x = To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlEndXBinder.GetValue() ); - aItem->m_End.m_Pos.y = To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlEndYBinder.GetValue() ); + aItem->m_End.m_Pos.x = To_User_Unit( units, m_textEndX.GetValue() ); + aItem->m_End.m_Pos.y = To_User_Unit( units, m_textEndY.GetValue() ); switch( m_comboBoxCornerEnd->GetSelection() ) { @@ -454,10 +472,8 @@ bool PROPERTIES_FRAME::CopyPrmsFromPanelToItem( DS_DATA_ITEM* aItem ) msg.ToLong( &itmp ); aItem->m_RepeatCount = itmp; - aItem->m_IncrementVector.x = To_User_Unit( EDA_UNITS::MILLIMETRES, - m_textCtrlStepXBinder.GetValue() ); - aItem->m_IncrementVector.y = To_User_Unit( EDA_UNITS::MILLIMETRES, - m_textCtrlStepYBinder.GetValue() ); + aItem->m_IncrementVector.x = To_User_Unit( units, m_textStepX.GetValue() ); + aItem->m_IncrementVector.y = To_User_Unit( units, m_textStepY.GetValue() ); if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT ) { @@ -469,37 +485,36 @@ bool PROPERTIES_FRAME::CopyPrmsFromPanelToItem( DS_DATA_ITEM* aItem ) msg.ToLong( &itmp ); item->m_IncrementLabel = itmp; - item->m_Bold = m_checkBoxBold->IsChecked(); - item->m_Italic = m_checkBoxItalic->IsChecked(); + item->m_Bold = m_bold->IsChecked(); + item->m_Italic = m_italic->IsChecked(); - switch( m_choiceHjustify->GetSelection() ) - { - case 0: item->m_Hjustify = GR_TEXT_H_ALIGN_LEFT; break; - case 1: item->m_Hjustify = GR_TEXT_H_ALIGN_CENTER; break; - case 2: item->m_Hjustify = GR_TEXT_H_ALIGN_RIGHT; break; - } + if( m_alignLeft->IsChecked() ) + item->m_Hjustify = GR_TEXT_H_ALIGN_LEFT; + else if( m_alignCenter->IsChecked() ) + item->m_Hjustify = GR_TEXT_H_ALIGN_CENTER; + else if( m_alignRight->IsChecked() ) + item->m_Hjustify = GR_TEXT_H_ALIGN_RIGHT; - switch( m_choiceVjustify->GetSelection() ) - { - case 0: item->m_Vjustify = GR_TEXT_V_ALIGN_TOP; break; - case 1: item->m_Vjustify = GR_TEXT_V_ALIGN_CENTER; break; - case 2: item->m_Vjustify = GR_TEXT_V_ALIGN_BOTTOM; break; - } + if( m_vAlignTop->IsChecked() ) + item->m_Vjustify = GR_TEXT_V_ALIGN_TOP; + else if( m_vAlignMiddle->IsChecked() ) + item->m_Vjustify = GR_TEXT_V_ALIGN_CENTER; + else if( m_vAlignBottom->IsChecked() ) + item->m_Vjustify = GR_TEXT_V_ALIGN_BOTTOM; + + if( m_fontCtrl->HaveFontSelection() ) + item->m_Font = m_fontCtrl->GetFontSelection( item->m_Bold, item->m_Italic ); msg = m_textCtrlRotation->GetValue(); item->m_Orient = DoubleValueFromString( EDA_UNITS::UNSCALED, msg ); // Import text size - item->m_TextSize.x = - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlTextSizeXBinder.GetValue() ); - item->m_TextSize.y = - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlTextSizeYBinder.GetValue() ); + item->m_TextSize.x = To_User_Unit( units, m_textSizeX.GetValue() ); + item->m_TextSize.y = To_User_Unit( units, m_textSizeY.GetValue() ); // Import constraints: - item->m_BoundingBoxSize.x = - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlConstraintXBinder.GetValue() ); - item->m_BoundingBoxSize.y = - To_User_Unit( EDA_UNITS::MILLIMETRES, m_textCtrlConstraintYBinder.GetValue() ); + item->m_BoundingBoxSize.x = To_User_Unit( units, m_constraintX.GetValue() ); + item->m_BoundingBoxSize.y = To_User_Unit( units, m_constraintY.GetValue() ); } if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON ) diff --git a/pagelayout_editor/dialogs/properties_frame.h b/pagelayout_editor/dialogs/properties_frame.h index 9f3ebff54c..8cd19a3307 100644 --- a/pagelayout_editor/dialogs/properties_frame.h +++ b/pagelayout_editor/dialogs/properties_frame.h @@ -6,6 +6,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2013 CERN + * Copyright (C) 2013-2022 KiCad Developers, see AUTHORS.txt for contributors. * @author Jean-Pierre Charras, jp.charras at wanadoo.fr * * This program is free software; you can redistribute it and/or @@ -45,34 +46,34 @@ class PROPERTIES_FRAME : public PANEL_PROPERTIES_BASE PL_EDITOR_FRAME* m_parent; SCINTILLA_TRICKS* m_scintillaTricks; - UNIT_BINDER m_textCtrlTextSizeXBinder; - UNIT_BINDER m_textCtrlTextSizeYBinder; + UNIT_BINDER m_textSizeX; + UNIT_BINDER m_textSizeY; - UNIT_BINDER m_textCtrlConstraintXBinder; - UNIT_BINDER m_textCtrlConstraintYBinder; + UNIT_BINDER m_constraintX; + UNIT_BINDER m_constraintY; - UNIT_BINDER m_textCtrlPosXBinder; - UNIT_BINDER m_textCtrlPosYBinder; + UNIT_BINDER m_textPosX; + UNIT_BINDER m_textPosY; - UNIT_BINDER m_textCtrlEndXBinder; - UNIT_BINDER m_textCtrlEndYBinder; + UNIT_BINDER m_textEndX; + UNIT_BINDER m_textEndY; - UNIT_BINDER m_textCtrlStepXBinder; - UNIT_BINDER m_textCtrlStepYBinder; + UNIT_BINDER m_textStepX; + UNIT_BINDER m_textStepY; - UNIT_BINDER m_textCtrlDefaultTextSizeXBinder; - UNIT_BINDER m_textCtrlDefaultTextSizeYBinder; + UNIT_BINDER m_defaultTextSizeX; + UNIT_BINDER m_defaultTextSizeY; - UNIT_BINDER m_textCtrlDefaultLineWidthBinder; - UNIT_BINDER m_textCtrlDefaultTextThicknessBinder; + UNIT_BINDER m_defaultLineWidth; + UNIT_BINDER m_defaultTextThickness; - UNIT_BINDER m_textCtrlLeftMarginBinder; - UNIT_BINDER m_textCtrlRightMarginBinder; + UNIT_BINDER m_textLeftMargin; + UNIT_BINDER m_textRightMargin; - UNIT_BINDER m_textCtrlTopMarginBinder; - UNIT_BINDER m_textCtrlBottomMarginBinder; + UNIT_BINDER m_textTopMargin; + UNIT_BINDER m_textBottomMargin; - UNIT_BINDER m_textCtrlThicknessBinder; + UNIT_BINDER m_lineWidth; public: PROPERTIES_FRAME( PL_EDITOR_FRAME* aParent ); @@ -84,6 +85,8 @@ public: void OnSetDefaultValues( wxCommandEvent& event ) override; void onScintillaCharAdded( wxStyledTextEvent &aEvent ); void onHelp( wxCommandEvent& aEvent ) override; + void onHAlignButton( wxCommandEvent &aEvent ); + void onVAlignButton( wxCommandEvent &aEvent ); // Data transfer from general properties to widgets void CopyPrmsFromGeneralToPanel(); diff --git a/pagelayout_editor/dialogs/properties_frame_base.cpp b/pagelayout_editor/dialogs/properties_frame_base.cpp index 386d581c61..4614488868 100644 --- a/pagelayout_editor/dialogs/properties_frame_base.cpp +++ b/pagelayout_editor/dialogs/properties_frame_base.cpp @@ -1,10 +1,13 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// +#include "widgets/bitmap_button.h" +#include "widgets/font_choice.h" + #include "properties_frame_base.h" /////////////////////////////////////////////////////////////////////////// @@ -24,7 +27,7 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c m_staticTextType = new wxStaticText( m_swItemProperties, wxID_ANY, _("Type"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextType->Wrap( -1 ); - m_staticTextType->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_SLANT, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); + m_staticTextType->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_SLANT, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); bSizerButt->Add( m_staticTextType, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 4 ); @@ -52,7 +55,6 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c m_stcText->SetViewWhiteSpace( false ); m_stcText->SetMarginWidth( 2, 0 ); m_stcText->SetIndentationGuides( false ); - m_stcText->SetReadOnly( false ); m_stcText->SetMarginWidth( 1, 0 ); m_stcText->SetMarginWidth( 0, 0 ); m_stcText->MarkerDefine( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS ); @@ -77,45 +79,127 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c wxBoxSizer* bSizerFontOpt; bSizerFontOpt = new wxBoxSizer( wxVERTICAL ); - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 4, 0, 0 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + wxGridBagSizer* gbSizer11; + gbSizer11 = new wxGridBagSizer( 3, 5 ); + gbSizer11->SetFlexibleDirection( wxBOTH ); + gbSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextHjust = new wxStaticText( m_swItemProperties, wxID_ANY, _("H align:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextHjust->Wrap( -1 ); - fgSizer1->Add( m_staticTextHjust, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + wxBoxSizer* formattingSizer; + formattingSizer = new wxBoxSizer( wxHORIZONTAL ); - wxString m_choiceHjustifyChoices[] = { _("Left"), _("Center"), _("Right") }; - int m_choiceHjustifyNChoices = sizeof( m_choiceHjustifyChoices ) / sizeof( wxString ); - m_choiceHjustify = new wxChoice( m_swItemProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHjustifyNChoices, m_choiceHjustifyChoices, 0 ); - m_choiceHjustify->SetSelection( 0 ); - fgSizer1->Add( m_choiceHjustify, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_separator1 = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + m_separator1->Enable( false ); + + formattingSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bold = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + m_bold->SetToolTip( _("Bold") ); + + formattingSizer->Add( m_bold, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_italic = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + m_italic->SetToolTip( _("Italic") ); + + formattingSizer->Add( m_italic, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_separator2 = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + m_separator2->Enable( false ); + + formattingSizer->Add( m_separator2, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_alignLeft = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + formattingSizer->Add( m_alignLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_alignCenter = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + formattingSizer->Add( m_alignCenter, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_alignRight = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + formattingSizer->Add( m_alignRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_separator3 = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + m_separator3->Enable( false ); + + formattingSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_vAlignTop = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + formattingSizer->Add( m_vAlignTop, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_vAlignMiddle = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + formattingSizer->Add( m_vAlignMiddle, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_vAlignBottom = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + formattingSizer->Add( m_vAlignBottom, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_separator4 = new BITMAP_BUTTON( m_swItemProperties, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); + m_separator4->Enable( false ); + + formattingSizer->Add( m_separator4, 0, wxALIGN_CENTER_VERTICAL, 5 ); - fgSizer1->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + gbSizer11->Add( formattingSizer, wxGBPosition( 0, 0 ), wxGBSpan( 1, 3 ), wxEXPAND|wxTOP|wxBOTTOM, 5 ); - m_checkBoxBold = new wxCheckBox( m_swItemProperties, wxID_ANY, _("Bold"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_checkBoxBold, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_fontLabel = new wxStaticText( m_swItemProperties, wxID_ANY, _("Font:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_fontLabel->Wrap( -1 ); + gbSizer11->Add( m_fontLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); - m_staticTextVjust = new wxStaticText( m_swItemProperties, wxID_ANY, _("V align:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextVjust->Wrap( -1 ); - fgSizer1->Add( m_staticTextVjust, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + wxString m_fontCtrlChoices[] = { _("Default Font"), _("KiCad Font") }; + int m_fontCtrlNChoices = sizeof( m_fontCtrlChoices ) / sizeof( wxString ); + m_fontCtrl = new FONT_CHOICE( m_swItemProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fontCtrlNChoices, m_fontCtrlChoices, 0 ); + m_fontCtrl->SetSelection( 0 ); + gbSizer11->Add( m_fontCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - wxString m_choiceVjustifyChoices[] = { _("Top"), _("Center"), _("Bottom") }; - int m_choiceVjustifyNChoices = sizeof( m_choiceVjustifyChoices ) / sizeof( wxString ); - m_choiceVjustify = new wxChoice( m_swItemProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVjustifyNChoices, m_choiceVjustifyChoices, 0 ); - m_choiceVjustify->SetSelection( 1 ); - fgSizer1->Add( m_choiceVjustify, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticTextTsizeX = new wxStaticText( m_swItemProperties, wxID_ANY, _("Text width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTsizeX->Wrap( -1 ); + gbSizer11->Add( m_staticTextTsizeX, wxGBPosition( 2, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlTextSizeX = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer11->Add( m_textCtrlTextSizeX, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_textSizeXUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textSizeXUnits->Wrap( -1 ); + gbSizer11->Add( m_textSizeXUnits, wxGBPosition( 2, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextTsizeY = new wxStaticText( m_swItemProperties, wxID_ANY, _("Text height:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTsizeY->Wrap( -1 ); + gbSizer11->Add( m_staticTextTsizeY, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlTextSizeY = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer11->Add( m_textCtrlTextSizeY, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_textSizeYUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textSizeYUnits->Wrap( -1 ); + gbSizer11->Add( m_textSizeYUnits, wxGBPosition( 3, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_constraintXLabel = new wxStaticText( m_swItemProperties, wxID_ANY, _("Max width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_constraintXLabel->Wrap( -1 ); + m_constraintXLabel->SetToolTip( _("Set to 0 to disable this constraint") ); + + gbSizer11->Add( m_constraintXLabel, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_constraintXCtrl = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer11->Add( m_constraintXCtrl, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_constraintXUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_constraintXUnits->Wrap( -1 ); + gbSizer11->Add( m_constraintXUnits, wxGBPosition( 4, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_constraintYLabel = new wxStaticText( m_swItemProperties, wxID_ANY, _("Max height:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_constraintYLabel->Wrap( -1 ); + m_constraintYLabel->SetToolTip( _("Set to 0 to disable this constraint") ); + + gbSizer11->Add( m_constraintYLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_constraintYCtrl = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer11->Add( m_constraintYCtrl, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_constraintYUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_constraintYUnits->Wrap( -1 ); + gbSizer11->Add( m_constraintYUnits, wxGBPosition( 5, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); - fgSizer1->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + gbSizer11->AddGrowableCol( 2 ); - m_checkBoxItalic = new wxCheckBox( m_swItemProperties, wxID_ANY, _("Italic"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_checkBoxItalic, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizerFontOpt->Add( fgSizer1, 0, wxEXPAND, 5 ); + bSizerFontOpt->Add( gbSizer11, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_SizerTextOptions->Add( bSizerFontOpt, 0, wxEXPAND|wxBOTTOM, 2 ); @@ -126,54 +210,6 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c fgSizer2->SetFlexibleDirection( wxBOTH ); fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextTsizeX = new wxStaticText( m_swItemProperties, wxID_ANY, _("Text width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTsizeX->Wrap( -1 ); - fgSizer2->Add( m_staticTextTsizeX, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlTextSizeX = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_textCtrlTextSizeX, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_TextTextSizeXUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextTextSizeXUnits->Wrap( -1 ); - fgSizer2->Add( m_TextTextSizeXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT, 5 ); - - m_staticTextTsizeY = new wxStaticText( m_swItemProperties, wxID_ANY, _("Text height:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTsizeY->Wrap( -1 ); - fgSizer2->Add( m_staticTextTsizeY, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlTextSizeY = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_textCtrlTextSizeY, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_TextTextSizeYUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextTextSizeYUnits->Wrap( -1 ); - fgSizer2->Add( m_TextTextSizeYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT|wxLEFT, 5 ); - - m_staticTextConstraintX = new wxStaticText( m_swItemProperties, wxID_ANY, _("Max width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextConstraintX->Wrap( -1 ); - m_staticTextConstraintX->SetToolTip( _("Set to 0 to disable this constraint") ); - - fgSizer2->Add( m_staticTextConstraintX, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlConstraintX = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_textCtrlConstraintX, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_TextConstraintXUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextConstraintXUnits->Wrap( -1 ); - fgSizer2->Add( m_TextConstraintXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT, 5 ); - - m_staticTextConstraintY = new wxStaticText( m_swItemProperties, wxID_ANY, _("Max height:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextConstraintY->Wrap( -1 ); - m_staticTextConstraintY->SetToolTip( _("Set to 0 to disable this constraint") ); - - fgSizer2->Add( m_staticTextConstraintY, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlConstraintY = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer2->Add( m_textCtrlConstraintY, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_TextConstraintYUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextConstraintYUnits->Wrap( -1 ); - fgSizer2->Add( m_TextConstraintYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT|wxLEFT, 5 ); - m_SizerTextOptions->Add( fgSizer2, 0, wxEXPAND|wxBOTTOM, 3 ); @@ -305,16 +341,16 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c gbSizer1->SetFlexibleDirection( wxBOTH ); gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextThickness = new wxStaticText( m_swItemProperties, wxID_ANY, _("Line width:"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticTextThickness->Wrap( -1 ); - gbSizer1->Add( m_staticTextThickness, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); + m_lineWidthLabel = new wxStaticText( m_swItemProperties, wxID_ANY, _("Line width:"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_lineWidthLabel->Wrap( -1 ); + gbSizer1->Add( m_lineWidthLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); - m_textCtrlThickness = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_textCtrlThickness, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + m_lineWidthCtrl = new wxTextCtrl( m_swItemProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_lineWidthCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - m_TextLineThicknessUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextLineThicknessUnits->Wrap( -1 ); - gbSizer1->Add( m_TextLineThicknessUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); + m_lineWidthUnits = new wxStaticText( m_swItemProperties, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lineWidthUnits->Wrap( -1 ); + gbSizer1->Add( m_lineWidthUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); m_staticTextRot = new wxStaticText( m_swItemProperties, wxID_ANY, _("Rotation:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRot->Wrap( -1 ); @@ -435,9 +471,9 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c m_textCtrlDefaultTextSizeX = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizer5->Add( m_textCtrlDefaultTextSizeX, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - m_TextDefaultTextSizeXUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextDefaultTextSizeXUnits->Wrap( -1 ); - fgSizer5->Add( m_TextDefaultTextSizeXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + m_defaultTextSizeXUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_defaultTextSizeXUnits->Wrap( -1 ); + fgSizer5->Add( m_defaultTextSizeXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); m_staticTextDefTsY = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Text height:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDefTsY->Wrap( -1 ); @@ -449,37 +485,37 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c m_textCtrlDefaultTextSizeY = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizer5->Add( m_textCtrlDefaultTextSizeY, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - m_TextDefaultTextSizeYUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextDefaultTextSizeYUnits->Wrap( -1 ); - fgSizer5->Add( m_TextDefaultTextSizeYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + m_defaultTextSizeYUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_defaultTextSizeYUnits->Wrap( -1 ); + fgSizer5->Add( m_defaultTextSizeYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - m_staticTextDefLineW = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDefLineW->Wrap( -1 ); - fgSizer5->Add( m_staticTextDefLineW, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + m_defaultLineWidthLabel = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_defaultLineWidthLabel->Wrap( -1 ); + fgSizer5->Add( m_defaultLineWidthLabel, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizer5->Add( 0, 0, 1, wxEXPAND, 5 ); - m_textCtrlDefaultLineWidth = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer5->Add( m_textCtrlDefaultLineWidth, 0, wxEXPAND|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + m_defaultLineWidthCtrl = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer5->Add( m_defaultLineWidthCtrl, 0, wxEXPAND|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - m_TextDefaultLineWidthUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextDefaultLineWidthUnits->Wrap( -1 ); - fgSizer5->Add( m_TextDefaultLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + m_defaultLineWidthUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_defaultLineWidthUnits->Wrap( -1 ); + fgSizer5->Add( m_defaultLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - m_staticTextDefTextThickness = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Text thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDefTextThickness->Wrap( -1 ); - fgSizer5->Add( m_staticTextDefTextThickness, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + m_defaultTextThicknessLabel = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Text thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_defaultTextThicknessLabel->Wrap( -1 ); + fgSizer5->Add( m_defaultTextThicknessLabel, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); fgSizer5->Add( 0, 0, 1, wxEXPAND|wxRIGHT, 5 ); - m_textCtrlDefaultTextThickness = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer5->Add( m_textCtrlDefaultTextThickness, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + m_defaultTextThicknessCtrl = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer5->Add( m_defaultTextThicknessCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - m_TextDefaultTextThicknessUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextDefaultTextThicknessUnits->Wrap( -1 ); - fgSizer5->Add( m_TextDefaultTextThicknessUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + m_defaultTextThicknessUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_defaultTextThicknessUnits->Wrap( -1 ); + fgSizer5->Add( m_defaultTextThicknessUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); fgSizer5->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -502,61 +538,61 @@ PANEL_PROPERTIES_BASE::PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, c fgSizer6->SetFlexibleDirection( wxBOTH ); fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextLeftMargin = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("Left:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextLeftMargin->Wrap( -1 ); - fgSizer6->Add( m_staticTextLeftMargin, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + m_leftMarginLabel = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("Left:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_leftMarginLabel->Wrap( -1 ); + fgSizer6->Add( m_leftMarginLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizer6->Add( 0, 0, 1, wxEXPAND, 5 ); - m_textCtrlLeftMargin = new wxTextCtrl( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer6->Add( m_textCtrlLeftMargin, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_leftMarginCtrl = new wxTextCtrl( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer6->Add( m_leftMarginCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_TextLeftMarginUnits = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextLeftMarginUnits->Wrap( -1 ); - fgSizer6->Add( m_TextLeftMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT, 5 ); + m_leftMarginUnits = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_leftMarginUnits->Wrap( -1 ); + fgSizer6->Add( m_leftMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT, 5 ); - m_staticTextDefRightMargin = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("Right:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDefRightMargin->Wrap( -1 ); - fgSizer6->Add( m_staticTextDefRightMargin, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + m_rightMarginLabel = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("Right:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rightMarginLabel->Wrap( -1 ); + fgSizer6->Add( m_rightMarginLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizer6->Add( 0, 0, 1, wxEXPAND, 5 ); - m_textCtrlRightMargin = new wxTextCtrl( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer6->Add( m_textCtrlRightMargin, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_rightMarginCtrl = new wxTextCtrl( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer6->Add( m_rightMarginCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_TextRightMarginUnits = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextRightMarginUnits->Wrap( -1 ); - fgSizer6->Add( m_TextRightMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT, 5 ); + m_rightMarginUnits = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rightMarginUnits->Wrap( -1 ); + fgSizer6->Add( m_rightMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT, 5 ); - m_staticTextTopMargin = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("Top:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTopMargin->Wrap( -1 ); - fgSizer6->Add( m_staticTextTopMargin, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + m_topMarginLabel = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("Top:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_topMarginLabel->Wrap( -1 ); + fgSizer6->Add( m_topMarginLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizer6->Add( 0, 0, 1, wxEXPAND|wxRIGHT, 5 ); - m_textCtrlTopMargin = new wxTextCtrl( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer6->Add( m_textCtrlTopMargin, 0, wxEXPAND|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + m_topMarginCtrl = new wxTextCtrl( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer6->Add( m_topMarginCtrl, 0, wxEXPAND|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - m_TextTopMarginUnits = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextTopMarginUnits->Wrap( -1 ); - fgSizer6->Add( m_TextTopMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + m_topMarginUnits = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_topMarginUnits->Wrap( -1 ); + fgSizer6->Add( m_topMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - m_staticTextBottomMargin = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("Bottom:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextBottomMargin->Wrap( -1 ); - fgSizer6->Add( m_staticTextBottomMargin, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + m_bottomMarginLabel = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("Bottom:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_bottomMarginLabel->Wrap( -1 ); + fgSizer6->Add( m_bottomMarginLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizer6->Add( 0, 0, 1, wxEXPAND, 5 ); - m_textCtrlBottomMargin = new wxTextCtrl( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer6->Add( m_textCtrlBottomMargin, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + m_bottomMarginCtrl = new wxTextCtrl( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer6->Add( m_bottomMarginCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - m_TextBottomMarginUnits = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextBottomMarginUnits->Wrap( -1 ); - fgSizer6->Add( m_TextBottomMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + m_bottomMarginUnits = new wxStaticText( bSizerGeneraMargins->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_bottomMarginUnits->Wrap( -1 ); + fgSizer6->Add( m_bottomMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); bSizerGeneraMargins->Add( fgSizer6, 1, wxEXPAND, 5 ); diff --git a/pagelayout_editor/dialogs/properties_frame_base.fbp b/pagelayout_editor/dialogs/properties_frame_base.fbp index 21faa7b007..07ead3a88f 100644 --- a/pagelayout_editor/dialogs/properties_frame_base.fbp +++ b/pagelayout_editor/dialogs/properties_frame_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,6 @@ properties_frame_base 1000 none - 1 properties_frame_base @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -48,7 +46,6 @@ -1,-1 - 0 wxTAB_TRAVERSAL @@ -260,7 +257,6 @@ - 0 @@ -446,7 +442,6 @@ protected 1 - 0 Resizable 1 @@ -474,25 +469,905 @@ none 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 0 - - 4 + + wxBOTH - + 2 - 0 + 5 - fgSizer1 + gbSizer11 wxFLEX_GROWMODE_SPECIFIED none - 0 - 0 - + 3 + 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT - 0 - + 3 + 0 + wxEXPAND|wxTOP|wxBOTTOM + 0 + 1 + + + formattingSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_separator1 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Bold + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_bold + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Bold + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Italic + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_italic + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Italic + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_separator2 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_alignLeft + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_alignCenter + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_alignRight + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_separator3 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_vAlignTop + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_vAlignMiddle + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_vAlignBottom + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + -1,-1 + + 0 + + 1 + m_separator4 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL + 1 + 1 + 1 1 1 @@ -520,7 +1395,7 @@ 0 0 wxID_ANY - H align: + Font: 0 0 @@ -529,7 +1404,7 @@ 0 1 - m_staticTextHjust + m_fontLabel 1 @@ -540,7 +1415,7 @@ 1 - + ; ; forward_declare 0 @@ -549,11 +1424,14 @@ -1 - + 5 - wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL - 0 - + 3 + 1 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 1 + 1 + 1 1 1 @@ -567,7 +1445,7 @@ 1 0 - "Left" "Center" "Right" + "Default Font" "KiCad Font" 1 1 @@ -589,7 +1467,7 @@ 0 1 - m_choiceHjustify + m_fontCtrl 1 @@ -601,7 +1479,7 @@ 1 - + FONT_CHOICE; widgets/font_choice.h; forward_declare 0 @@ -613,84 +1491,13 @@ - - 10 - wxEXPAND|wxRIGHT|wxLEFT - 1 - - 0 - protected - 0 - - - + 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Bold - - 0 - - - 0 - - 1 - m_checkBoxBold - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT - 0 + 2 + 0 + wxALIGN_CENTER_VERTICAL + 2 + 1 1 1 @@ -719,7 +1526,7 @@ 0 0 wxID_ANY - V align: + Text width: 0 0 @@ -728,7 +1535,7 @@ 0 1 - m_staticTextVjust + m_staticTextTsizeX 1 @@ -748,11 +1555,14 @@ -1 - + 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 2 + 1 + 1 1 1 @@ -766,7 +1576,6 @@ 1 0 - "Top" "Center" "Bottom" 1 1 @@ -784,11 +1593,12 @@ 0 + 0 0 - + -1,-1 1 - m_choiceVjustify + m_textCtrlTextSizeX 1 @@ -796,7 +1606,6 @@ 1 Resizable - 1 1 @@ -807,26 +1616,20 @@ wxFILTER_NONE wxDefaultValidator + - + 5 - wxEXPAND|wxRIGHT|wxLEFT - 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT - 0 - + 1 + 3 + wxALIGN_CENTER_VERTICAL + 2 + 1 + 1 1 1 @@ -840,7 +1643,6 @@ 1 0 - 0 1 1 @@ -855,7 +1657,8 @@ 0 0 wxID_ANY - Italic + mm + 0 0 @@ -863,7 +1666,134 @@ 0 1 - m_checkBoxItalic + m_textSizeXUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 2 + 0 + wxALIGN_CENTER_VERTICAL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Text height: + 0 + + 0 + + + 0 + + 1 + m_staticTextTsizeY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_textCtrlTextSizeY 1 @@ -881,11 +1811,466 @@ wxFILTER_NONE wxDefaultValidator + + + 5 + 1 + 3 + wxALIGN_CENTER_VERTICAL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_textSizeYUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 2 + 0 + wxALIGN_CENTER_VERTICAL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Max width: + 0 + + 0 + + + 0 + + 1 + m_constraintXLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Set to 0 to disable this constraint + + + + -1 + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_constraintXCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + 1 + 3 + wxALIGN_CENTER_VERTICAL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_constraintXUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 2 + 0 + wxALIGN_CENTER_VERTICAL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Max height: + 0 + + 0 + + + 0 + + 1 + m_constraintYLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Set to 0 to disable this constraint + + + + -1 + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_constraintYCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + 1 + 3 + wxALIGN_CENTER_VERTICAL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_constraintYUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + @@ -906,750 +2291,6 @@ none 0 3 - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text width: - 0 - - 0 - - - 0 - - 1 - m_staticTextTsizeX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_textCtrlTextSizeX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_TextTextSizeXUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text height: - 0 - - 0 - - - 0 - - 1 - m_staticTextTsizeY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_textCtrlTextSizeY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_TextTextSizeYUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Max width: - 0 - - 0 - - - 0 - - 1 - m_staticTextConstraintX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Set to 0 to disable this constraint - - - - -1 - - - - 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_textCtrlConstraintX - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_TextConstraintXUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Max height: - 0 - - 0 - - - 0 - - 1 - m_staticTextConstraintY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Set to 0 to disable this constraint - - - - -1 - - - - 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_textCtrlConstraintY - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_TextConstraintYUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - @@ -2988,7 +3629,7 @@ 0 -1,-1 1 - m_staticTextThickness + m_lineWidthLabel 1 @@ -3051,7 +3692,7 @@ 0 1 - m_textCtrlThickness + m_lineWidthCtrl 1 @@ -3119,7 +3760,7 @@ 0 1 - m_TextLineThicknessUnits + m_lineWidthUnits 1 @@ -4092,7 +4733,6 @@ - 0 @@ -4422,7 +5062,7 @@ 0 1 - m_TextDefaultTextSizeXUnits + m_defaultTextSizeXUnits 1 @@ -4618,7 +5258,7 @@ 0 1 - m_TextDefaultTextSizeYUnits + m_defaultTextSizeYUnits 1 @@ -4679,7 +5319,7 @@ 0 1 - m_staticTextDefLineW + m_defaultLineWidthLabel 1 @@ -4749,7 +5389,7 @@ 0 1 - m_textCtrlDefaultLineWidth + m_defaultLineWidthCtrl 1 @@ -4814,7 +5454,7 @@ 0 1 - m_TextDefaultLineWidthUnits + m_defaultLineWidthUnits 1 @@ -4875,7 +5515,7 @@ 0 1 - m_staticTextDefTextThickness + m_defaultTextThicknessLabel 1 @@ -4945,7 +5585,7 @@ 0 1 - m_textCtrlDefaultTextThickness + m_defaultTextThicknessCtrl 1 @@ -5010,7 +5650,7 @@ 0 1 - m_TextDefaultTextThicknessUnits + m_defaultTextThicknessUnits 1 @@ -5055,7 +5695,6 @@ - 0 @@ -5187,7 +5826,7 @@ 0 1 - m_staticTextLeftMargin + m_leftMarginLabel 1 @@ -5257,7 +5896,7 @@ 0 1 - m_textCtrlLeftMargin + m_leftMarginCtrl 1 @@ -5322,7 +5961,7 @@ 0 1 - m_TextLeftMarginUnits + m_leftMarginUnits 1 @@ -5383,7 +6022,7 @@ 0 1 - m_staticTextDefRightMargin + m_rightMarginLabel 1 @@ -5453,7 +6092,7 @@ 0 1 - m_textCtrlRightMargin + m_rightMarginCtrl 1 @@ -5518,7 +6157,7 @@ 0 1 - m_TextRightMarginUnits + m_rightMarginUnits 1 @@ -5579,7 +6218,7 @@ 0 1 - m_staticTextTopMargin + m_topMarginLabel 1 @@ -5649,7 +6288,7 @@ 0 1 - m_textCtrlTopMargin + m_topMarginCtrl 1 @@ -5714,7 +6353,7 @@ 0 1 - m_TextTopMarginUnits + m_topMarginUnits 1 @@ -5775,7 +6414,7 @@ 0 1 - m_staticTextBottomMargin + m_bottomMarginLabel 1 @@ -5845,7 +6484,7 @@ 0 1 - m_textCtrlBottomMargin + m_bottomMarginCtrl 1 @@ -5910,7 +6549,7 @@ 0 1 - m_TextBottomMarginUnits + m_bottomMarginUnits 1 @@ -5945,7 +6584,6 @@ - 0 diff --git a/pagelayout_editor/dialogs/properties_frame_base.h b/pagelayout_editor/dialogs/properties_frame_base.h index 55f4b5bb80..4d35e3bf3b 100644 --- a/pagelayout_editor/dialogs/properties_frame_base.h +++ b/pagelayout_editor/dialogs/properties_frame_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -10,24 +10,27 @@ #include #include #include +class BITMAP_BUTTON; +class FONT_CHOICE; + #include #include #include #include #include #include -#include #include #include #include +#include #include #include #include -#include +#include #include +#include #include #include -#include #include #include #include @@ -50,24 +53,32 @@ class PANEL_PROPERTIES_BASE : public wxPanel wxChoice* m_choicePageOpt; wxBoxSizer* m_SizerTextOptions; wxStyledTextCtrl* m_stcText; - wxStaticText* m_staticTextHjust; - wxChoice* m_choiceHjustify; - wxCheckBox* m_checkBoxBold; - wxStaticText* m_staticTextVjust; - wxChoice* m_choiceVjustify; - wxCheckBox* m_checkBoxItalic; + BITMAP_BUTTON* m_separator1; + BITMAP_BUTTON* m_bold; + BITMAP_BUTTON* m_italic; + BITMAP_BUTTON* m_separator2; + BITMAP_BUTTON* m_alignLeft; + BITMAP_BUTTON* m_alignCenter; + BITMAP_BUTTON* m_alignRight; + BITMAP_BUTTON* m_separator3; + BITMAP_BUTTON* m_vAlignTop; + BITMAP_BUTTON* m_vAlignMiddle; + BITMAP_BUTTON* m_vAlignBottom; + BITMAP_BUTTON* m_separator4; + wxStaticText* m_fontLabel; + FONT_CHOICE* m_fontCtrl; wxStaticText* m_staticTextTsizeX; wxTextCtrl* m_textCtrlTextSizeX; - wxStaticText* m_TextTextSizeXUnits; + wxStaticText* m_textSizeXUnits; wxStaticText* m_staticTextTsizeY; wxTextCtrl* m_textCtrlTextSizeY; - wxStaticText* m_TextTextSizeYUnits; - wxStaticText* m_staticTextConstraintX; - wxTextCtrl* m_textCtrlConstraintX; - wxStaticText* m_TextConstraintXUnits; - wxStaticText* m_staticTextConstraintY; - wxTextCtrl* m_textCtrlConstraintY; - wxStaticText* m_TextConstraintYUnits; + wxStaticText* m_textSizeYUnits; + wxStaticText* m_constraintXLabel; + wxTextCtrl* m_constraintXCtrl; + wxStaticText* m_constraintXUnits; + wxStaticText* m_constraintYLabel; + wxTextCtrl* m_constraintYCtrl; + wxStaticText* m_constraintYUnits; wxStaticText* m_staticTextSizeInfo; wxStaticText* m_staticTextComment; wxTextCtrl* m_textCtrlComment; @@ -89,9 +100,9 @@ class PANEL_PROPERTIES_BASE : public wxPanel wxStaticText* m_TextEndYUnits; wxStaticText* m_staticTextOrgEnd; wxComboBox* m_comboBoxCornerEnd; - wxStaticText* m_staticTextThickness; - wxTextCtrl* m_textCtrlThickness; - wxStaticText* m_TextLineThicknessUnits; + wxStaticText* m_lineWidthLabel; + wxTextCtrl* m_lineWidthCtrl; + wxStaticText* m_lineWidthUnits; wxStaticText* m_staticTextRot; wxTextCtrl* m_textCtrlRotation; wxStaticText* m_staticTextBitmapDPI; @@ -110,32 +121,32 @@ class PANEL_PROPERTIES_BASE : public wxPanel wxScrolledWindow* m_swGeneralOpts; wxStaticText* m_staticTextDefTsX; wxTextCtrl* m_textCtrlDefaultTextSizeX; - wxStaticText* m_TextDefaultTextSizeXUnits; + wxStaticText* m_defaultTextSizeXUnits; wxStaticText* m_staticTextDefTsY; wxTextCtrl* m_textCtrlDefaultTextSizeY; - wxStaticText* m_TextDefaultTextSizeYUnits; - wxStaticText* m_staticTextDefLineW; - wxTextCtrl* m_textCtrlDefaultLineWidth; - wxStaticText* m_TextDefaultLineWidthUnits; - wxStaticText* m_staticTextDefTextThickness; - wxTextCtrl* m_textCtrlDefaultTextThickness; - wxStaticText* m_TextDefaultTextThicknessUnits; + wxStaticText* m_defaultTextSizeYUnits; + wxStaticText* m_defaultLineWidthLabel; + wxTextCtrl* m_defaultLineWidthCtrl; + wxStaticText* m_defaultLineWidthUnits; + wxStaticText* m_defaultTextThicknessLabel; + wxTextCtrl* m_defaultTextThicknessCtrl; + wxStaticText* m_defaultTextThicknessUnits; wxButton* m_buttonDefault; - wxStaticText* m_staticTextLeftMargin; - wxTextCtrl* m_textCtrlLeftMargin; - wxStaticText* m_TextLeftMarginUnits; - wxStaticText* m_staticTextDefRightMargin; - wxTextCtrl* m_textCtrlRightMargin; - wxStaticText* m_TextRightMarginUnits; - wxStaticText* m_staticTextTopMargin; - wxTextCtrl* m_textCtrlTopMargin; - wxStaticText* m_TextTopMarginUnits; - wxStaticText* m_staticTextBottomMargin; - wxTextCtrl* m_textCtrlBottomMargin; - wxStaticText* m_TextBottomMarginUnits; + wxStaticText* m_leftMarginLabel; + wxTextCtrl* m_leftMarginCtrl; + wxStaticText* m_leftMarginUnits; + wxStaticText* m_rightMarginLabel; + wxTextCtrl* m_rightMarginCtrl; + wxStaticText* m_rightMarginUnits; + wxStaticText* m_topMarginLabel; + wxTextCtrl* m_topMarginCtrl; + wxStaticText* m_topMarginUnits; + wxStaticText* m_bottomMarginLabel; + wxTextCtrl* m_bottomMarginCtrl; + wxStaticText* m_bottomMarginUnits; wxButton* m_buttonGeneralOptsOK; - // Virtual event handlers, override them in your derived class + // Virtual event handlers, overide them in your derived class virtual void OnPageChanged( wxNotebookEvent& event ) { event.Skip(); } virtual void onHelp( wxCommandEvent& event ) { event.Skip(); } virtual void OnAcceptPrms( wxCommandEvent& event ) { event.Skip(); } @@ -145,7 +156,6 @@ class PANEL_PROPERTIES_BASE : public wxPanel public: PANEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); - ~PANEL_PROPERTIES_BASE(); };