KiCad PCB EDA Suite
Loading...
Searching...
No Matches
properties_frame.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2013 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#include <project.h>
23#include <scintilla_tricks.h>
25#include <widgets/font_choice.h>
27#include <tool/tool_manager.h>
31#include <view/view.h>
32#include <bitmaps.h>
33
34#include "properties_frame.h"
35#include "pl_editor_frame.h"
37
39#include <wx/wupdlock.h>
40
46#define DLG_MIN_TEXTSIZE 0.01
47#define DLG_MAX_TEXTSIZE 100.0
48
49
51 PANEL_PROPERTIES_BASE( aParent ),
52 m_scintillaTricks( nullptr ),
76 m_propertiesDirty( false )
77{
78 m_parent = aParent;
79
80 m_stcText->SetUseVerticalScrollBar( false );
81 m_stcText->SetUseHorizontalScrollBar( false );
82 m_stcText->SetEOLMode( wxSTC_EOL_LF ); // Always use LF as eol char, regardless the platform
83
84#ifdef _WIN32
85 // Without this setting, on Windows, some esoteric unicode chars create display issue
86 // in a wxStyledTextCtrl.
87 // for SetTechnology() info, see https://www.scintilla.org/ScintillaDoc.html#SCI_SETTECHNOLOGY
88 m_stcText->SetTechnology(wxSTC_TECHNOLOGY_DIRECTWRITE);
89#endif
90
91 m_scintillaTricks = new SCINTILLA_TRICKS( m_stcText, wxT( "{}" ), false );
92
93 m_staticTextSizeInfo->SetFont( KIUI::GetInfoFont( this ).Italic() );
94
95 m_bold->SetIsCheckButton();
97 m_italic->SetIsCheckButton();
99
100 m_separator2->SetIsSeparator();
101
102 m_alignLeft->SetIsRadioButton();
104 m_alignCenter->SetIsRadioButton();
106 m_alignRight->SetIsRadioButton();
108
109 m_separator3->SetIsSeparator();
110
111 m_vAlignTop->SetIsRadioButton();
113 m_vAlignMiddle->SetIsRadioButton();
115 m_vAlignBottom->SetIsRadioButton();
117
118 m_separator4->SetIsSeparator();
119
120 m_textColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
121 m_textColorSwatch->SetSwatchBackground( aParent->GetDrawBgColor() );
122
123 m_textColorSwatch->Bind( COLOR_SWATCH_CHANGED,
124 [this]( wxCommandEvent& event )
125 {
126 m_propertiesDirty = true;
127 } );
128
129 // ensure sizers are up to date
130 // (fix an issue on GTK but should not create issues on other platforms):
131 m_swItemProperties->Fit();
132 m_swGeneralOpts->Fit();
133
134 m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this );
135 m_stcText->Bind( wxEVT_STC_AUTOCOMP_CHAR_DELETED, &PROPERTIES_FRAME::onScintillaCharAdded,
136 this );
137 m_alignLeft->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
138 m_alignCenter->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
139 m_alignRight->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
140 m_vAlignTop->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
141 m_vAlignMiddle->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
142 m_vAlignBottom->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
143}
144
145
151
152
154{
155 return FromDIP( wxSize( 150, -1 ) );
156}
157
158
159double fromMM( double aMMValue )
160{
162}
163
164
165double toMM( double aIUValue )
166{
168}
169
170
171bool validateMM( UNIT_BINDER& aUnitBinder, double aMin, double aMax )
172{
173 return aUnitBinder.Validate( aMin, aMax, EDA_UNITS::MM );
174}
175
176
178{
180
181 // Set default parameters
182 m_defaultLineWidth.SetDoubleValue( fromMM( model.m_DefaultLineWidth ) );
183
184 m_defaultTextSizeX.SetDoubleValue( fromMM( model.m_DefaultTextSize.x ) );
185 m_defaultTextSizeY.SetDoubleValue( fromMM( model.m_DefaultTextSize.y ) );
186 m_defaultTextThickness.SetDoubleValue( fromMM( model.m_DefaultTextThickness ) );
187
188 m_textLeftMargin.SetDoubleValue( fromMM( model.GetLeftMargin() ) );
189 m_textRightMargin.SetDoubleValue( fromMM( model.GetRightMargin() ) );
190 m_textTopMargin.SetDoubleValue( fromMM( model.GetTopMargin() ) );
191 m_textBottomMargin.SetDoubleValue( fromMM( model.GetBottomMargin() ) );
192}
193
194
196{
198
199 // Import default parameters from widgets
200 if( validateMM( m_defaultLineWidth, 0.0, 10.0 ) )
201 model.m_DefaultLineWidth = toMM( m_defaultLineWidth.GetIntValue() );
202
204 model.m_DefaultTextSize.x = toMM( m_defaultTextSizeX.GetIntValue() );
205
207 model.m_DefaultTextSize.y = toMM( m_defaultTextSizeY.GetIntValue() );
208
209 if( validateMM( m_defaultTextThickness, 0.0, 5.0 ) )
210 model.m_DefaultTextThickness = toMM( m_defaultTextThickness.GetIntValue() );
211
212 // Get page margins values
213 model.SetRightMargin( toMM( m_textRightMargin.GetIntValue() ) );
214 model.SetBottomMargin( toMM( m_textBottomMargin.GetIntValue() ) );
215 model.SetLeftMargin( toMM( m_textLeftMargin.GetIntValue() ) );
216 model.SetTopMargin( toMM( m_textTopMargin.GetIntValue() ) );
217
218 return true;
219}
220
221
223{
224 if( !aItem )
225 {
226 m_SizerItemProperties->Show( false );
227 m_propertiesDirty = false;
228 return;
229 }
230
231 // No not update display during rebuild:
232 wxWindowUpdateLocker noUpdates( this );
233
234 wxString msg;
235
236 // Set parameters common to all DS_DATA_ITEM types
237 m_staticTextType->SetLabel( aItem->GetClassName() );
238 m_textCtrlComment->SetValue( aItem->m_Info );
239
240 switch( aItem->GetPage1Option() )
241 {
242 default:
243 case ALL_PAGES: m_choicePageOpt->SetSelection( 0 ); break;
244 case FIRST_PAGE_ONLY: m_choicePageOpt->SetSelection( 1 ); break;
245 case SUBSEQUENT_PAGES: m_choicePageOpt->SetSelection( 2 ); break;
246 }
247
248 // Position/ start point
249 m_textPosX.SetDoubleValue( fromMM( aItem->m_Pos.m_Pos.x ) );
250 m_textPosY.SetDoubleValue( fromMM( aItem->m_Pos.m_Pos.y ) );
251
252 switch( aItem->m_Pos.m_Anchor )
253 {
254 case RB_CORNER: m_comboBoxCornerPos->SetSelection( 2 ); break;
255 case RT_CORNER: m_comboBoxCornerPos->SetSelection( 0 ); break;
256 case LB_CORNER: m_comboBoxCornerPos->SetSelection( 3 ); break;
257 case LT_CORNER: m_comboBoxCornerPos->SetSelection( 1 ); break;
258 }
259
260 // End point
261 m_textEndX.SetDoubleValue( fromMM( aItem->m_End.m_Pos.x ) );
262 m_textEndY.SetDoubleValue( fromMM( aItem->m_End.m_Pos.y ) );
263
264 switch( aItem->m_End.m_Anchor )
265 {
266 case RB_CORNER: m_comboBoxCornerEnd->SetSelection( 2 ); break;
267 case RT_CORNER: m_comboBoxCornerEnd->SetSelection( 0 ); break;
268 case LB_CORNER: m_comboBoxCornerEnd->SetSelection( 3 ); break;
269 case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break;
270 }
271
272 m_lineWidth.SetDoubleValue( fromMM( aItem->m_LineWidth ) );
273
274 // Now, set prms more specific to DS_DATA_ITEM types
275 // For a given type, disable widgets which are not relevant,
276 // and be sure widgets which are relevant are enabled
277 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
278 {
279 DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
280 item->m_FullText = item->m_TextBase;
281
282 // Replace our '\' 'n' sequence by the EOL char
284 m_stcText->SetValue( item->m_FullText );
285 m_stcText->EmptyUndoBuffer();
286
287 msg.Printf( wxT( "%d" ), item->m_IncrementLabel );
288 m_textCtrlTextIncrement->SetValue( msg );
289
290 // Rotation (poly and text)
291 msg.Printf( wxT( "%.3f" ), item->m_Orient );
292 m_textCtrlRotation->SetValue( msg );
293
294 // Constraints:
295 m_constraintX.SetDoubleValue( fromMM( item->m_BoundingBoxSize.x ) );
296 m_constraintY.SetDoubleValue( fromMM( item->m_BoundingBoxSize.y ) );
297
298 // Font Options
299 m_fontCtrl->SetFontSelection( item->m_Font, true /*silent mode */ );
300
301 m_bold->Check( item->m_Bold );
302 m_italic->Check( item->m_Italic );
303
304 m_textColorSwatch->SetSwatchColor( item->m_TextColor, false );
305
307 btn->Check( false );
308
309 switch( item->m_Hjustify )
310 {
311 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check(); break;
312 case GR_TEXT_H_ALIGN_CENTER: m_alignCenter->Check(); break;
313 case GR_TEXT_H_ALIGN_RIGHT: m_alignRight->Check(); break;
315 }
316
318 btn->Check( false );
319
320 switch( item->m_Vjustify )
321 {
322 case GR_TEXT_V_ALIGN_TOP: m_vAlignTop->Check(); break;
323 case GR_TEXT_V_ALIGN_CENTER: m_vAlignMiddle->Check(); break;
324 case GR_TEXT_V_ALIGN_BOTTOM: m_vAlignBottom->Check(); break;
326 }
327
328 // Text size
329 m_textSizeX.SetDoubleValue( fromMM( item->m_TextSize.x ) );
330 m_textSizeY.SetDoubleValue( fromMM( item->m_TextSize.y ) );
331 }
332
333 if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
334 {
335 DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
336
337 // Rotation (poly and text)
338 msg.Printf( wxT( "%.3f" ), item->m_Orient.AsDegrees() );
339 m_textCtrlRotation->SetValue( msg );
340 }
341
342 if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
343 {
344 DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
345
346 // select definition in PPI
347 msg.Printf( wxT( "%d" ), item->GetPPI() );
348 m_textCtrlBitmapDPI->SetValue( msg );
349 }
350
351 m_SizerItemProperties->Show( true );
352
355
357 || aItem->GetType() == DS_DATA_ITEM::DS_RECT );
358
359 m_lineWidth.Show( aItem->GetType() != DS_DATA_ITEM::DS_BITMAP );
360
361 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT
363 {
364 m_staticTextRot->Show( true );
365 m_textCtrlRotation->Show( true );
366 }
367 else
368 {
369 m_staticTextRot->Show( false );
370 m_textCtrlRotation->Show( false );
371 }
372
375
378
379 // Repeat parameters
380 msg.Printf( wxT( "%d" ), aItem->m_RepeatCount );
381 m_textCtrlRepeatCount->SetValue( msg );
382
383 m_textStepX.SetDoubleValue( fromMM( aItem->m_IncrementVector.x ) );
384 m_textStepY.SetDoubleValue( fromMM( aItem->m_IncrementVector.y ) );
385
386 // The number of widgets was modified, so recalculate sizers
387 m_swItemProperties->Layout();
388
389#ifdef __WXGTK__
390 // This call is mandatory on wxGTK to initialize the right virtual size and therefore
391 // scrollbars, but for some reason, create issues on Windows (incorrect display
392 // until the frame is resized). Joys of multiplatform dev.
393 m_swItemProperties->Fit();
394#endif
395
396 // send a size event to be sure scrollbars will be added/removed as needed
397 m_swItemProperties->PostSizeEvent();
398 m_swItemProperties->Refresh();
399}
400
401
402void PROPERTIES_FRAME::onHAlignButton( wxCommandEvent& aEvent )
403{
405 {
406 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
407 btn->Check( false );
408 }
409
410 m_propertiesDirty = true;
411}
412
413
414void PROPERTIES_FRAME::onVAlignButton( wxCommandEvent& aEvent )
415{
417 {
418 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
419 btn->Check( false );
420 }
421
422 m_propertiesDirty = true;
423}
424
425
427{
428 PL_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool<PL_SELECTION_TOOL>();
429 PL_SELECTION& selection = selTool->GetSelection();
430
431 m_parent->SaveCopyInUndoList();
432
433 DS_DRAW_ITEM_BASE* drawItem = (DS_DRAW_ITEM_BASE*) selection.Front();
434
435 if( drawItem )
436 {
437 DS_DATA_ITEM* dataItem = drawItem->GetPeer();
438 CopyPrmsFromPanelToItem( dataItem );
439
440 // Be sure what is displayed is what is set for item
441 // (mainly, texts can be modified if they contain "\n")
442 CopyPrmsFromItemToPanel( dataItem );
443 m_parent->GetCanvas()->GetView()->Update( drawItem );
444 }
445
447
448 // Refresh values, exactly as they are converted, to avoid any mistake
450
451 m_propertiesDirty = false;
452
453 m_parent->OnModify();
454
455 // Rebuild the draw list with the new parameters
456 m_parent->GetCanvas()->DisplayDrawingSheet();
457 m_parent->GetCanvas()->Refresh();
458}
459
460
461void PROPERTIES_FRAME::onModify( wxCommandEvent& aEvent )
462{
463 m_propertiesDirty = true;
464}
465
466
467void PROPERTIES_FRAME::onTextFocusLost( wxFocusEvent& aEvent )
468{
469 m_propertiesDirty = true;
470 aEvent.Skip(); // Mandatory in wxFocusEvent
471}
472
473
474void PROPERTIES_FRAME::OnUpdateUI( wxUpdateUIEvent& aEvent )
475{
477 {
478 // Clear m_propertiesDirty now. Otherwise OnAcceptPrms() is called multiple
479 // times (probably by each updated widget)
480 m_propertiesDirty = false;
481 CallAfter(
482 [this]()
483 {
484 OnAcceptPrms();
485 } );
486 }
487}
488
489
490void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
491{
493
495 model.m_DefaultLineWidth = 0.15;
496 model.m_DefaultTextThickness = 0.15;
497
499
500 // Rebuild the draw list with the new parameters
501 m_parent->GetCanvas()->DisplayDrawingSheet();
502 m_parent->GetCanvas()->Refresh();
503}
504
505
507{
508 if( aItem == nullptr )
509 return false;
510
511 wxString msg;
512
513 // Import common parameters:
514 aItem->m_Info = m_textCtrlComment->GetValue();
515
516 switch( m_choicePageOpt->GetSelection() )
517 {
518 default:
519 case 0: aItem->SetPage1Option( ALL_PAGES ); break;
520 case 1: aItem->SetPage1Option( FIRST_PAGE_ONLY ); break;
521 case 2: aItem->SetPage1Option( SUBSEQUENT_PAGES ); break;
522 }
523
524 // Import thickness
525 if( validateMM( m_lineWidth, 0.0, 10.0 ) )
526 aItem->m_LineWidth = toMM( m_lineWidth.GetIntValue() );
527
528 // Import Start point
529 aItem->m_Pos.m_Pos.x = toMM( m_textPosX.GetIntValue() );
530 aItem->m_Pos.m_Pos.y = toMM( m_textPosY.GetIntValue() );
531
532 switch( m_comboBoxCornerPos->GetSelection() )
533 {
534 case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
535 case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
536 case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
537 case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
538 }
539
540 // Import End point
541 aItem->m_End.m_Pos.x = toMM( m_textEndX.GetIntValue() );
542 aItem->m_End.m_Pos.y = toMM( m_textEndY.GetIntValue() );
543
544 switch( m_comboBoxCornerEnd->GetSelection() )
545 {
546 case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
547 case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
548 case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
549 case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
550 }
551
552 // Import Repeat prms
553 long itmp;
554 msg = m_textCtrlRepeatCount->GetValue();
555 msg.ToLong( &itmp );
556
557 // Ensure m_RepeatCount is > 0. Otherwise it create issues because a repeat
558 // count < 1 make no sense
559 if( itmp < 1l )
560 {
561 itmp = 1;
562 msg.Printf( wxT( "%ld" ), itmp );
563 m_textCtrlRepeatCount->SetValue( msg );
564 }
565
566 aItem->m_RepeatCount = itmp;
567
568 aItem->m_IncrementVector.x = toMM( m_textStepX.GetIntValue() );
569 aItem->m_IncrementVector.y = toMM( m_textStepY.GetIntValue() );
570
571 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
572 {
573 DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
574
575 item->m_TextBase = m_stcText->GetValue();
576
577 msg = m_textCtrlTextIncrement->GetValue();
578 msg.ToLong( &itmp );
579 item->m_IncrementLabel = itmp;
580
581 item->m_Bold = m_bold->IsChecked();
582 item->m_Italic = m_italic->IsChecked();
583 item->m_TextColor = m_textColorSwatch->GetSwatchColor();
584
585 if( m_alignLeft->IsChecked() )
587 else if( m_alignCenter->IsChecked() )
589 else if( m_alignRight->IsChecked() )
591
592 if( m_vAlignTop->IsChecked() )
594 else if( m_vAlignMiddle->IsChecked() )
596 else if( m_vAlignBottom->IsChecked() )
598
599 if( m_fontCtrl->HaveFontSelection() )
600 item->m_Font = m_fontCtrl->GetFontSelection( item->m_Bold, item->m_Italic, true );
601
602 msg = m_textCtrlRotation->GetValue();
604 EDA_UNITS::UNSCALED, msg );
605
606 // Import text size
608 item->m_TextSize.x = toMM( m_textSizeX.GetIntValue() );
609
611 item->m_TextSize.y = toMM( m_textSizeY.GetIntValue() );
612
613 // Import constraints:
614 item->m_BoundingBoxSize.x = toMM( m_constraintX.GetIntValue() );
615 item->m_BoundingBoxSize.y = toMM( m_constraintY.GetIntValue() );
616 }
617
618 if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
619 {
620 DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
621
622 msg = m_textCtrlRotation->GetValue();
623 item->m_Orient = m_parent->AngleValueFromString( msg );
624 }
625
626 if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
627 {
628 DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
629 long value;
630
631 msg = m_textCtrlBitmapDPI->GetValue();
632
633 if( msg.ToLong( &value ) )
634 item->SetPPI( (int)value );
635 }
636
637 return true;
638}
639
640
641void PROPERTIES_FRAME::onScintillaCharAdded( wxStyledTextEvent &aEvent )
642{
643 wxArrayString autocompleteTokens;
644 int pos = m_stcText->GetCurrentPos();
645 int start = m_stcText->WordStartPosition( pos, true );
646 wxString partial;
647
648 if( start >= 2
649 && m_stcText->GetCharAt( start-2 ) == '$'
650 && m_stcText->GetCharAt( start-1 ) == '{' )
651 {
652 DS_DRAW_ITEM_LIST::GetTextVars( &autocompleteTokens );
653
654 partial = m_stcText->GetTextRange( start, pos );
655
656 for( std::pair<wxString, wxString> entry : m_parent->Prj().GetTextVars() )
657 autocompleteTokens.push_back( entry.first );
658 }
659
660 m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
661 m_stcText->SetFocus();
662}
663
664
665void PROPERTIES_FRAME::onScintillaFocusLost( wxFocusEvent& aEvent )
666{
667 m_stcText->AutoCompCancel();
668 m_propertiesDirty = true;
669 aEvent.Skip();
670}
671
672
673void PROPERTIES_FRAME::onHelp( wxHyperlinkEvent& aEvent )
674{
675 // Show the system variables for worksheet text:
676 HTML_MESSAGE_BOX dlg( wxGetTopLevelParent( this ), _( "Predefined Keywords" ) );
677 wxString message;
678
679 message << _( "Texts can include keywords." ) << "<br>";
680 message << _( "Keyword notation is ${keyword}" ) << "<br>";
681 message << _( "Each keyword is replaced by its value" ) << "<br><br>";
682 message << _( "These build-in keywords are always available:" ) << "<br><br>";
683 dlg.AddHTML_Text( message );
684
685 message = "KICAD_VERSION\n";
686 message << "# " << _( "(sheet number)" ) << "\n";
687 message << "## " << _( "(sheet count)" ) << "\n";
688 message << "COMMENT1 thru COMMENT9\n";
689 message << "COMPANY\n";
690 message << "FILENAME\n";
691 message << "ISSUE_DATE\n";
692 message << "LAYER\n";
693 message << "PAPER " << _( "(paper size)" ) << "\n";
694 message << "REVISION\n";
695 message << "SHEETNAME\n";
696 message << "SHEETPATH\n";
697 message << "TITLE\n";
698
699 dlg.ListSet( message );
700 dlg.ShowModal();
701}
constexpr EDA_IU_SCALE drawSheetIUScale
Definition base_units.h:122
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:106
@ text_align_right
@ text_valign_top
@ text_align_left
@ text_valign_center
@ text_align_center
@ text_valign_bottom
A bitmap button widget that behaves like an AUI toolbar item's button when it is drawn.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:398
int ShowModal() override
void SetPPI(int aBitmapPPI)
bool ReplaceAntiSlashSequence()
Replace the '\''n' sequence by EOL and the sequence '\''\' by only one '\' inside m_FullText.
KIFONT::FONT * m_Font
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
POINT_COORD m_Pos
wxString m_Info
double m_LineWidth
POINT_COORD m_End
Handle the graphic items list to draw/plot the frame and title block.
static DS_DATA_MODEL & GetTheInstance()
Return the instance of DS_DATA_MODEL used in the application.
Base class to handle basic graphic items.
DS_DATA_ITEM * GetPeer() const
static void GetTextVars(wxArrayString *aVars)
double AsDegrees() const
Definition eda_angle.h:116
virtual COLOR4D GetDrawBgColor() const
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.
wxScrolledWindow * m_swItemProperties
wxStaticBoxSizer * m_sbSizerEndPosition
wxStyledTextCtrl * m_stcText
wxScrolledWindow * m_swGeneralOpts
wxStaticText * m_defaultLineWidthUnits
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)
wxStaticText * m_defaultTextSizeXUnits
wxStaticText * m_staticTextSizeInfo
wxStaticText * m_defaultLineWidthLabel
wxStaticText * m_defaultTextThicknessLabel
wxHyperlinkCtrl * m_syntaxHelpLink
wxStaticText * m_defaultTextThicknessUnits
wxStaticText * m_defaultTextSizeYUnits
The main window used in the drawing sheet editor.
PL_SELECTION & GetSelection()
Return the set of currently selected items.
VECTOR2D m_Pos
void onModify(wxCommandEvent &aEvent) override
UNIT_BINDER m_defaultTextSizeX
void onScintillaFocusLost(wxFocusEvent &aEvent) override
UNIT_BINDER m_lineWidth
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_textSizeY
UNIT_BINDER m_textLeftMargin
UNIT_BINDER m_defaultTextThickness
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
UNIT_BINDER m_textEndX
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 onHelp(wxHyperlinkEvent &aEvent) override
bool CopyPrmsFromPanelToItem(DS_DATA_ITEM *aItem)
UNIT_BINDER m_textEndY
wxSize GetMinSize() const override
UNIT_BINDER m_textSizeX
void onVAlignButton(wxCommandEvent &aEvent)
UNIT_BINDER m_constraintY
UNIT_BINDER m_defaultTextSizeY
UNIT_BINDER m_textPosX
UNIT_BINDER m_textStepY
UNIT_BINDER m_textTopMargin
UNIT_BINDER m_textRightMargin
UNIT_BINDER m_textPosY
UNIT_BINDER m_textStepX
SCINTILLA_TRICKS * m_scintillaTricks
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
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.
#define TB_DEFAULT_TEXTSIZE
@ FIRST_PAGE_ONLY
@ SUBSEQUENT_PAGES
@ ALL_PAGES
@ RB_CORNER
@ RT_CORNER
@ LT_CORNER
@ LB_CORNER
#define _(s)
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)
Convert aTextValue to a double.
KICOMMON_API double ToUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
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.
KIBIS_MODEL * model
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_CENTER
@ GR_TEXT_V_ALIGN_TOP
VECTOR2< double > VECTOR2D
Definition vector2d.h:682