43#include <wx/wupdlock.h>
50#define DLG_MIN_TEXTSIZE 0.01
51#define DLG_MAX_TEXTSIZE 100.0
56 m_scintillaTricks( nullptr ),
57 m_textSizeX( aParent, m_staticTextTsizeX, m_textCtrlTextSizeX, m_textSizeXUnits ),
58 m_textSizeY( aParent, m_staticTextTsizeY, m_textCtrlTextSizeY, m_textSizeYUnits ),
59 m_constraintX( aParent, m_constraintXLabel, m_constraintXCtrl, m_constraintXUnits ),
60 m_constraintY( aParent, m_constraintYLabel, m_constraintYCtrl, m_constraintYUnits ),
61 m_textPosX( aParent, m_staticTextPosX, m_textCtrlPosX, m_TextPosXUnits ),
62 m_textPosY( aParent, m_staticTextPosY, m_textCtrlPosY, m_TextPosYUnits ),
63 m_textEndX( aParent, m_staticTextEndX, m_textCtrlEndX, m_TextEndXUnits ),
64 m_textEndY( aParent, m_staticTextEndY, m_textCtrlEndY, m_TextEndYUnits ),
65 m_textStepX( aParent, m_staticTextStepX, m_textCtrlStepX, m_TextStepXUnits ),
66 m_textStepY( aParent, m_staticTextStepY, m_textCtrlStepY, m_TextStepYUnits ),
67 m_defaultTextSizeX( aParent, m_staticTextDefTsX, m_textCtrlDefaultTextSizeX,
68 m_defaultTextSizeXUnits ),
69 m_defaultTextSizeY( aParent, m_staticTextDefTsY, m_textCtrlDefaultTextSizeY,
70 m_defaultTextSizeYUnits ),
71 m_defaultLineWidth( aParent, m_defaultLineWidthLabel, m_defaultLineWidthCtrl,
72 m_defaultLineWidthUnits ),
73 m_defaultTextThickness( aParent, m_defaultTextThicknessLabel, m_defaultTextThicknessCtrl,
74 m_defaultTextThicknessUnits ),
75 m_textLeftMargin( aParent, m_leftMarginLabel, m_leftMarginCtrl, m_leftMarginUnits ),
76 m_textRightMargin( aParent, m_rightMarginLabel, m_rightMarginCtrl, m_rightMarginUnits ),
77 m_textTopMargin( aParent, m_topMarginLabel, m_topMarginCtrl, m_topMarginUnits ),
78 m_textBottomMargin( aParent, m_bottomMarginLabel, m_bottomMarginCtrl, m_bottomMarginUnits ),
79 m_lineWidth( aParent, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ),
80 m_propertiesDirty( false )
84 m_stcText->SetUseVerticalScrollBar(
false );
85 m_stcText->SetUseHorizontalScrollBar(
false );
92 m_stcText->SetTechnology(wxSTC_TECHNOLOGY_DIRECTWRITE);
128 [
this]( wxCommandEvent& event )
158 return FromDIP( wxSize( 150, -1 ) );
234 wxWindowUpdateLocker noUpdates(
this );
293 msg.Printf( wxT(
"%.3f" ), item->
m_Orient );
349 msg.Printf( wxT(
"%d" ), item->
GetPPI() );
408 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
420 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
507 if( aItem ==
nullptr )
561 msg.Printf( wxT(
"%ld" ), itmp );
603 EDA_UNITS::UNSCALED, msg );
632 if( msg.ToLong( &value ) )
633 item->
SetPPI( (
int)value );
642 wxArrayString autocompleteTokens;
644 int start =
m_stcText->WordStartPosition( pos,
true );
648 &&
m_stcText->GetCharAt( start-2 ) ==
'$'
649 &&
m_stcText->GetCharAt( start-1 ) ==
'{' )
653 partial =
m_stcText->GetTextRange( start, pos );
656 autocompleteTokens.push_back( entry.first );
678 message <<
_(
"Texts can include keywords." ) <<
"<br>";
679 message <<
_(
"Keyword notation is ${keyword}" ) <<
"<br>";
680 message <<
_(
"Each keyword is replaced by its value" ) <<
"<br><br>";
681 message <<
_(
"These build-in keywords are always available:" ) <<
"<br><br>";
684 message =
"KICAD_VERSION\n";
685 message <<
"# " <<
_(
"(sheet number)" ) <<
"\n";
686 message <<
"## " <<
_(
"(sheet count)" ) <<
"\n";
687 message <<
"COMMENT1 thru COMMENT9\n";
688 message <<
"COMPANY\n";
689 message <<
"FILENAME\n";
690 message <<
"ISSUE_DATE\n";
691 message <<
"LAYER\n";
692 message <<
"PAPER " <<
_(
"(paper size)" ) <<
"\n";
693 message <<
"REVISION\n";
694 message <<
"SHEETNAME\n";
695 message <<
"SHEETPATH\n";
696 message <<
"TITLE\n";
constexpr EDA_IU_SCALE drawSheetIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
KIGFX::COLOR4D GetSwatchColor() const
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
void SetSwatchBackground(const KIGFX::COLOR4D &aBackground)
Set the swatch background color.
void SetPPI(int aBitmapPPI)
bool ReplaceAntiSlashSequence()
Replace the '\''n' sequence by EOL and the sequence '\''\' by only one '\' inside m_FullText.
GR_TEXT_H_ALIGN_T m_Hjustify
KIGFX::COLOR4D m_TextColor
VECTOR2D m_BoundingBoxSize
GR_TEXT_V_ALIGN_T m_Vjustify
Drawing sheet structure type definitions.
PAGE_OPTION GetPage1Option() const
void SetPage1Option(PAGE_OPTION aChoice)
DS_ITEM_TYPE GetType() const
const wxString GetClassName() const
VECTOR2D m_IncrementVector
Handle the graphic items list to draw/plot the frame and title block.
void SetBottomMargin(double aMargin)
VECTOR2D m_DefaultTextSize
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
void SetRightMargin(double aMargin)
double m_DefaultLineWidth
void SetLeftMargin(double aMargin)
double m_DefaultTextThickness
void SetTopMargin(double aMargin)
Base class to handle basic graphic items.
DS_DATA_ITEM * GetPeer() const
static void GetTextVars(wxArrayString *aVars)
virtual COLOR4D GetDrawBgColor() const
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic, bool aForDrawingSheet=false) const
bool HaveFontSelection() const
void SetFontSelection(KIFONT::FONT *aFont)
void AddHTML_Text(const wxString &message)
Add HTML text (without any change) to message list.
void ListSet(const wxString &aList)
Add a list of items.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Class PANEL_PROPERTIES_BASE.
wxTextCtrl * m_textCtrlRepeatCount
BITMAP_BUTTON * m_separator2
wxScrolledWindow * m_swItemProperties
wxStaticBoxSizer * m_sbSizerEndPosition
wxStaticText * m_staticTextType
wxTextCtrl * m_textCtrlComment
wxBoxSizer * m_SizerTextOptions
wxComboBox * m_comboBoxCornerPos
wxStyledTextCtrl * m_stcText
wxScrolledWindow * m_swGeneralOpts
BITMAP_BUTTON * m_alignCenter
wxStaticText * m_staticTextInclabel
BITMAP_BUTTON * m_separator3
wxTextCtrl * m_textCtrlRotation
BITMAP_BUTTON * m_separator4
wxTextCtrl * m_textCtrlBitmapDPI
wxComboBox * m_comboBoxCornerEnd
wxStaticText * m_staticTextBitmapDPI
wxBoxSizer * m_SizerItemProperties
COLOR_SWATCH * m_textColorSwatch
BITMAP_BUTTON * m_alignRight
BITMAP_BUTTON * m_vAlignMiddle
wxStaticText * m_staticTextSizeInfo
wxTextCtrl * m_textCtrlTextIncrement
wxStaticText * m_staticTextRot
BITMAP_BUTTON * m_vAlignTop
BITMAP_BUTTON * m_vAlignBottom
BITMAP_BUTTON * m_alignLeft
wxChoice * m_choicePageOpt
void DisplayDrawingSheet()
Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout.
The main window used in the drawing sheet editor.
void OnModify() override
Must be called after a change in order to set the "modify" flag.
void SaveCopyInUndoList()
Save a copy of the description (in a S expr string) for Undo/redo commands.
PL_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual std::map< wxString, wxString > & GetTextVars() const
void onModify(wxCommandEvent &aEvent) override
UNIT_BINDER m_defaultTextSizeX
void onScintillaFocusLost(wxFocusEvent &aEvent) override
PROPERTIES_FRAME(PL_EDITOR_FRAME *aParent)
UNIT_BINDER m_constraintX
UNIT_BINDER m_defaultLineWidth
UNIT_BINDER m_textBottomMargin
PL_EDITOR_FRAME * m_parent
UNIT_BINDER m_textLeftMargin
UNIT_BINDER m_defaultTextThickness
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
void onHelp(wxCommandEvent &aEvent) override
void OnSetDefaultValues(wxCommandEvent &event) override
void onTextFocusLost(wxFocusEvent &aEvent) override
void CopyPrmsFromItemToPanel(DS_DATA_ITEM *aItem)
void OnUpdateUI(wxUpdateUIEvent &aEvent) override
void onHAlignButton(wxCommandEvent &aEvent)
void CopyPrmsFromGeneralToPanel()
bool CopyPrmsFromPanelToItem(DS_DATA_ITEM *aItem)
wxSize GetMinSize() const override
void onVAlignButton(wxCommandEvent &aEvent)
UNIT_BINDER m_constraintY
UNIT_BINDER m_defaultTextSizeY
UNIT_BINDER m_textTopMargin
UNIT_BINDER m_textRightMargin
SCINTILLA_TRICKS * m_scintillaTricks
bool CopyPrmsFromPanelToGeneral()
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
EDA_ANGLE AngleValueFromString(const wxString &aTextValue) const
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
#define TB_DEFAULT_TEXTSIZE
KICOMMON_API double FromUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Return in internal units the value aValue given in a real unit such as "in", "mm",...
KICOMMON_API double DoubleValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Function DoubleValueFromString converts aTextValue to a double.
KICOMMON_API double ToUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
double fromMM(double aMMValue)
double toMM(double aIUValue)
#define DLG_MIN_TEXTSIZE
Minimum drawing sheet text default size in millmeters from PROPERTIES_FRAME.
bool validateMM(UNIT_BINDER &aUnitBinder, double aMin, double aMax)
#define DLG_MAX_TEXTSIZE
Maximum drawing sheet text size in mm from PROPERTIES_FRAME.
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
VECTOR2< double > VECTOR2D