76#include <wx/filedlg.h>
80#include <wx/fdrepdlg.h>
83#define FR_HISTORY_LIST_CNT 10
98 const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
99 long aStyle, const wxString& aFrameName, const
EDA_IU_SCALE& aIuScale ) :
100 KIWAY_PLAYER( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName, aIuScale ),
130 m_auimgr.SetFlags( wxAUI_MGR_DEFAULT );
132 if( ( aStyle & wxFRAME_NO_TASKBAR ) == 0 )
134 CreateStatusBar( 8 )->SetDoubleBuffered(
true );
153 Bind( wxEVT_DPI_CHANGED,
154 [&]( wxDPIChangedEvent& aEvent )
156 if( ( GetWindowStyle() & wxFRAME_NO_TASKBAR ) == 0 )
207 auto gridSelectorFactory =
221 auto zoomSelectorFactory =
233 auto overrideLocksFactory =
242 [
this]( wxCommandEvent& aEvent )
325 wxCommandEvent e( EDA_EVT_UNITS_CHANGED );
326 ProcessEventLocally( e );
398 wxArrayString gridsList;
404 for(
const wxString&
grid : gridsList )
448 int preset = wxNOT_FOUND;
450 for(
size_t jj = 0; jj < zoomList.size(); ++jj )
452 if( zoomList[jj] ==
zoom )
454 preset = (int) jj + 1;
459 if( preset != wxNOT_FOUND )
474 wxString
text = wxString::Format(
_(
"Zoom %.2f" ),
zoom );
489 wxCHECK_RET(
m_gridSelectBox, wxS(
"m_gridSelectBox uninitialized" ) );
497 wxUpdateUIEvent
dummy;
504 wxUpdateUIEvent
dummy;
614 if(
zoom == current )
622 wxCHECK_RET(
m_zoomSelectBox, wxS(
"m_zoomSelectBox uninitialized" ) );
660 canvas->CallAfter( [canvas]() { canvas->
ResizeGal(
true ); } );
674 std::shared_ptr<ZOOM_MENU> zoomMenu = std::make_shared<ZOOM_MENU>(
this );
675 zoomMenu->SetTool( commonTools );
678 std::shared_ptr<GRID_MENU> gridMenu = std::make_shared<GRID_MENU>(
this );
679 gridMenu->SetTool( commonTools );
692 SetStatusText( msg, 6 );
701 SetStatusText( msg, 7 );
715 msg.Printf(
_(
"grid %s" ), gridSettings.
grids[currentIdx].UserUnitsMessageText(
this,
false ) );
717 SetStatusText( msg, 4 );
733 default: msg =
_(
"Units" );
break;
736 SetStatusText( msg, 5 );
752 constexpr int numLocalFields = 8;
754 wxStatusBar* stsbar = GetStatusBar();
758 int totalFields = stsbar->GetFieldsCount();
760 std::vector<int> dims = {
774 KIUI::GetTextSize( wxT(
"dx 00000.0000 dy 00000.0000 dist 00000.0000" ), stsbar ).x + spacer,
789 for(
int idx = numLocalFields; idx < totalFields; ++idx )
790 dims.emplace_back( stsbar->GetStatusWidth( idx ) );
792 SetStatusWidths( dims.size(), dims.data() );
826 return wxString::Format( wxT(
"Z %.2f" ),
zoom );
900 m_messagePanel->AppendMessage( aTextUpper, aTextLower, aPadding );
928 m_messagePanel->AppendMessage( aTextUpper, aTextLower, aPadding );
935 wxCHECK_RET( aItem, wxT(
"Invalid EDA_ITEM pointer. Bad programmer." ) );
937 std::vector<MSG_PANEL_ITEM> items;
950 GetCanvas()->SetEvtHandlerEnabled(
true );
971 wxString envCanvasType;
973 if( wxGetEnv(
"KICAD_SOFTWARE_RENDERING", &envCanvasType ) )
975 if( envCanvasType.CmpNoCase(
"1" ) == 0
976 || envCanvasType.CmpNoCase(
"true" ) == 0
977 || envCanvasType.CmpNoCase(
"yes" ) == 0 )
999 static std::vector<FRAME_T> s_allowedFrames = {
FRAME_SCH,
1009 if( wxGetEnv(
"KICAD_SOFTWARE_RENDERING",
nullptr ) )
1023 cfg->m_Graphics.canvas_type =
static_cast<int>( aCanvasType );
1036 double xOffset = fmod( gridOrigin.
x, gridSize.
x );
1037 int x =
KiROUND( (aPosition.
x - xOffset) / gridSize.
x );
1038 double yOffset = fmod( gridOrigin.
y, gridSize.
y );
1039 int y =
KiROUND( (aPosition.
y - yOffset) / gridSize.
y );
1041 return KiROUND( x * gridSize.
x + xOffset, y * gridSize.
y + yOffset );
1050 double xOffset = fmod( gridOrigin.
x, gridSize.
x );
1051 int x =
KiROUND( (aPosition.
x - xOffset) / gridSize.
x );
1052 double yOffset = fmod( gridOrigin.
y, gridSize.
y );
1053 int y =
KiROUND( (aPosition.
y - yOffset) / gridSize.
y );
1055 return KiROUND( x * gridSize.
x + xOffset, y * gridSize.
y + yOffset );
1079 std::vector<wxWindow*> dialogs;
1081 for( wxWindow* window : GetChildren() )
1084 dialogs.push_back( window );
1093 bool centerView =
false;
1094 std::vector<BOX2D> dialogScreenRects;
1108 dialogScreenRects.emplace_back(
ToVECTOR2D(
GetCanvas()->ScreenToClient( dialog->GetScreenPosition() ) ),
1113 for(
BOX2D rect : dialogScreenRects )
1115 rect.Inflate( rect.GetWidth() / 10 );
1117 if( rect.Contains(
GetCanvas()->GetView()->ToScreen( aPos ) ) )
1128 catch(
const Clipper2Lib::Clipper2Exception& e )
1130 wxFAIL_MSG( wxString::Format( wxT(
"Clipper2 exception occurred centering object: %s" ), e.what() ) );
1139 const wxString& aSheetName,
const wxString& aSheetPath,
1140 const wxString& aFileName,
const TITLE_BLOCK& aTitleBlock,
1141 const std::map<wxString, wxString>* aProperties,
int aSheetCount,
1142 const wxString& aPageNumber,
double aMils2Iu,
const PROJECT* aProject,
1143 const wxString& aSheetLayer,
bool aIsFirstPage )
1162 drawList.
Print( aSettings );
1167 const std::map<wxString, wxString>* aProperties,
1168 double aMils2Iu,
const wxString &aFilename,
1169 const wxString &aSheetLayer )
1175 wxPoint origin = DC->GetDeviceOrigin();
1179 DC->SetDeviceOrigin( 0, 0 );
1180 DC->SetAxisOrientation(
true,
false );
1190 DC->SetDeviceOrigin( origin.x, origin.y );
1191 DC->SetAxisOrientation(
true,
true );
1199 return wxEmptyString;
1206 return wxEmptyString;
1211 const wxString& wildcard,
const wxString& ext,
1214 aFilename.SetExt( ext );
1216 wxString defaultDir = aFilename.GetPath();
1218 if( defaultDir.IsEmpty() )
1221 if( isDirectory && doOpen )
1223 wxDirDialog dlg(
this, aTitle, defaultDir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
1225 if( dlg.ShowModal() == wxID_CANCEL )
1228 aFilename = dlg.GetPath();
1229 aFilename.SetExt( ext );
1234 if( aFilename.GetName().empty() )
1235 aFilename.SetName( wxS(
"Library" ) );
1237 wxFileDialog dlg(
this, aTitle, defaultDir, aFilename.GetFullName(), wildcard,
1238 doOpen ? wxFD_OPEN | wxFD_FILE_MUST_EXIST
1239 : wxFD_SAVE | wxFD_CHANGE_DIR | wxFD_OVERWRITE_PROMPT );
1242 dlg.SetCustomizeHook( *aFileDlgHook );
1246 if( dlg.ShowModal() == wxID_CANCEL )
1249 aFilename = dlg.GetPath();
1250 aFilename.SetExt( ext );
1266 search_pane_info.Caption(
_(
"Search" ) );
1272 properties_pane_info.Caption(
_(
"Properties" ) );
1278 net_inspector_panel_info.Caption(
_(
"Net Inspector" ) );
1304 bool show = !pane.IsShown();
1321 if(
Pgm().GetCommonSettings()->m_Git.enableGit )
1363 const std::function<
bool(
const SELECTION& )>& aEnable )
1366 const std::string arcToolPrefix = aDrawArc.
GetName();
1370 [
this, arcToolPrefix](
const SELECTION& )
1467 if(
GetCanvas()->GetBackend() != requested )
1500 wxSize image_size =
GetCanvas()->GetClientSize();
1502 wxBitmap bitmap( image_size.x, image_size.y );
1505 memdc.SelectObject( bitmap );
1506 memdc.Blit( 0, 0, image_size.x, image_size.y, &dc, 0, 0 );
1507 memdc.SelectObject( wxNullBitmap );
1509 image = bitmap.ConvertToImage();
1512 wxBitmapType type = wxBITMAP_TYPE_PNG;
1513 switch( aBitmapType )
1520 bool retv =
image.SaveFile( aFileName, type );
1544 std::vector<const PLUGIN_ACTION*> actions;
1545 wxCHECK( aCfg, actions );
1549 std::map<wxString, const PLUGIN_ACTION*> actionMap;
1550 std::set<const PLUGIN_ACTION*> handled;
1553 actionMap[action->identifier] = action;
1557 if( actionMap.contains( identifier ) )
1560 actions.emplace_back( action );
1561 handled.insert( action );
1565 for(
const auto& action : actionMap | std::views::values )
1567 if( !handled.contains( action ) )
1568 actions.emplace_back( action );
1577 wxCHECK( aMenu, 0 );
1589 const std::vector<wxImage>& images =
1593 wxBitmapBundle icon;
1595 if( images.empty() )
1601 wxVector<wxBitmap> bitmaps;
1603 for(
const wxImage& img : images )
1604 bitmaps.push_back( wxBitmap( img ) );
1612 wxMenuItem* item =
KIUI::AddMenuItem( aMenu, wxID_ANY, action->name, action->description, icon );
1614 Connect( item->GetId(), wxEVT_COMMAND_MENU_SELECTED,
1643 : action->icon_light;
1645 if( images.empty() )
1648 wxVector<wxBitmap> bitmaps;
1650 for(
const wxImage& img : images )
1651 bitmaps.push_back( wxBitmap( img ) );
1658 wxAuiToolBarItem* button = aToolbar->AddTool( wxID_ANY, wxEmptyString, icon, action->name );
1660 Connect( button->GetId(), wxEVT_COMMAND_MENU_SELECTED,
1672 std::optional<wxString> identifier;
1682 std::shared_ptr<REPORTER>
reporter;
1685 reporter = std::make_shared<STATUSBAR_WARNING_REPORTER>( statusBar, wxS(
"plugin" ) );
ARC_DRAW_MODE
Construction sequence used when interactively drawing a circular arc.
@ CENTER_START_END
Center, then start (sets radius), then sweep to the end.
ARC_DRAW_MODE IncrementArcDrawMode(ARC_DRAW_MODE aMode)
Return the next mode in the cycle order used by the cycle-mode action.
BASE_SCREEN class implementation.
constexpr EDA_IU_SCALE unityScale
wxBitmapBundle KiBitmapBundleDef(BITMAPS aBitmap, int aDefHeight)
Construct and return a bitmap bundle for the given icon ID, with the default bitmap size being aDefHe...
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION gridProperties
static TOOL_ACTION millimetersUnits
static TOOL_ACTION updatePreferences
static TOOL_ACTION gridPreset
static TOOL_ACTION updateUnits
static TOOL_ACTION milsUnits
static TOOL_ACTION inchesUnits
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION zoomPreset
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
Responsible for loading plugin definitions for API-based plugins (ones that do not run inside KiCad i...
void InvokeAction(const wxString &aIdentifier, std::shared_ptr< REPORTER > aReporter=nullptr)
std::vector< const PLUGIN_ACTION * > GetActionsForScope(PLUGIN_ACTION_SCOPE aScope)
std::map< int, wxString > & ButtonBindings(FRAME_T aFrame)
std::map< int, wxString > & MenuBindings(FRAME_T aFrame)
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
ARC_DRAW_MODE m_ArcDrawMode
Construction sequence last used by the arc drawing tool in this application.
FIND_REPLACE m_FindReplace
Handles how to draw a screen (a board, a schematic ...)
int GetVirtualPageNumber() const
const wxString & GetPageNumber() const
static wxBitmapBundle MakeBitmapBundleDef(const wxVector< wxBitmap > &aBitmaps, int aDefHeight)
Constructs a bitmap bundle from the given bitmaps.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr size_type GetWidth() const
constexpr bool Contains(const Vec &aPoint) const
Color settings are a bit different than most of the settings objects in that there can be more than o...
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
void SetPlotterMilsToIUfactor(double aMils2Iu)
Set the scalar to convert pages units (mils) to plot units.
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
void SetSheetPath(const wxString &aSheetPath)
Set the sheet path to draw/plot.
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
void SetDefaultPenSize(int aPenSize)
void Print(const RENDER_SETTINGS *aSettings)
Draws the item list created by BuildDrawItemsList.
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
void SetIsFirstPage(bool aIsFirstPage)
Set if the page is the first page.
void SetProperties(const std::map< wxString, wxString > *aProps)
Set properties used for text variable resolution.
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
void SetProject(const PROJECT *aProject)
void SelectToolbarAction(const TOOL_ACTION &aAction) override
Select the given action in the toolbar group which contains it, if any.
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
virtual WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg)
Return a pointer to the window settings for this frame.
void OnToolbarSizeChanged()
Update toolbars if desired toolbar icon changed.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
static const wxString GitCommitPaneName()
Named here rather than beside the editors' other panes, because the project manager docks this one to...
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
void RegisterCustomToolbarControlFactory(const ACTION_TOOLBAR_CONTROL &aControlDesc, const ACTION_TOOLBAR_CONTROL_FACTORY &aControlFactory)
Register a creation factory for toolbar controls that are present in this frame.
virtual void configureToolbars()
wxTimer * m_autoSaveTimer
int GetMaxUndoItems() const
virtual void LoadSettings(APP_SETTINGS_BASE *aCfg)
Load common frame parameters from a configuration file.
wxString GetMruPath() const
virtual void OnSize(wxSizeEvent &aEvent)
int GetAutoSaveInterval() const
virtual void SaveSettings(APP_SETTINGS_BASE *aCfg)
Save common frame parameters to a configuration data file.
void SetMruPath(const wxString &aPath)
bool m_isClosing
Set by the close window event handler after frames are asked if they can close.
The base class for create windows for drawing purpose.
virtual const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const
Return bounding box of document with option to not include some items.
wxCheckBox * m_overrideLocksCb
wxArrayString m_replaceStringHistoryList
virtual void ClearMsgPanel()
Clear all messages from the message panel.
static std::vector< const PLUGIN_ACTION * > GetOrderedPluginActions(PLUGIN_ACTION_SCOPE aScope, APP_SETTINGS_BASE *aCfg)
Return ordered list of plugin actions for display in the toolbar.
void configureToolbars() override
EDA_DRAW_PANEL_GAL * m_canvas
virtual void ActivateGalCanvas()
Use to start up the GAL drawing canvas.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
static bool CanvasFailed(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas)
GIT_COMMIT_PANE * m_gitCommitPane
GAL_DISPLAY_OPTIONS_IMPL m_galDisplayOptions
This the frame's interface to setting GAL display options.
virtual const TITLE_BLOCK & GetTitleBlock() const =0
void onActivate(wxActivateEvent &aEvent)
COLOR_SETTINGS * m_colorSettings
wxChoice * m_gridSelectBox
void AddStandardSubMenus(TOOL_MENU &aMenu)
Construct a "basic" menu for a tool, containing only items that apply to all tools (e....
void ReleaseFile()
Release the current file marked in use.
int m_lastToolbarIconSize
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
The current canvas type.
virtual wxString GetFullScreenDesc() const
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
void DisplayToolMsg(const wxString &msg) override
std::unique_ptr< LOCKFILE > m_file_checker
Prevents opening same file multiple times.
void OnUpdateSelectZoom(wxUpdateUIEvent &aEvent)
Update the checked item in the zoom wxchoice.
virtual const PAGE_INFO & GetPageSettings() const =0
void DisplayUnitsMsg()
Display current unit pane in the status bar.
void setupUnits(APP_SETTINGS_BASE *aCfg)
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void setArcModeConditions(const TOOL_ACTION &aDrawArc, const std::function< bool(const SELECTION &)> &aEnable)
Check each arc mode's tool action while the arc tool runs in that mode.
void UpdateGridSelectBox()
Rebuild the grid combobox to respond to any changes in the GUI (units, user grid changes,...
bool LockFile(const wxString &aFileName)
Mark a schematic file as being in use.
virtual void HardRedraw()
Rebuild the GAL and redraws the screen.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
bool SaveCanvasImageToFile(const wxString &aFileName, BITMAP_TYPE aBitmapType)
Save the current view as an image file.
void UpdateZoomSelectBox()
Rebuild the grid combobox to respond to any changes in the GUI (units, user grid changes,...
virtual void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Change the current rendering backend.
virtual void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
const wxString GetZoomLevelIndicator() const
Return a human readable value for display in dialogs.
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
virtual void resolveCanvasType()
Determine the canvas type to load (with prompt if required) and initializes m_canvasType.
BASE_SCREEN * m_currentScreen
current used SCREEN
virtual wxString GetScreenDesc() const
VECTOR2I GetNearestGridPosition(const VECTOR2I &aPosition) const
Return the nearest aGridSize location to aPosition.
void SyncZoomSelectBox()
Show the current zoom in the zoom wxchoice, as a preset or as its own entry.
EDA_MSG_PANEL * m_messagePanel
virtual const VECTOR2I & GetGridOrigin() const =0
Return the absolute coordinates of the origin of the snap grid.
void RefreshGitCommitPane()
Attach the git session if needed and refresh the version-control pane, when it is shown.
bool saveCanvasTypeSetting(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Store the canvas type in the application settings.
virtual const TOOL_ACTION * drawArcAction(ARC_DRAW_MODE aMode) const
The action that starts the arc tool in aMode, or nullptr in a frame without an arc tool.
EDA_DRAW_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName, const EDA_IU_SCALE &aIuScale)
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
NET_INSPECTOR_PANEL * m_netInspectorPanel
void ToggleGitCommitPane()
bool LibraryFileBrowser(const wxString &aTitle, bool doOpen, wxFileName &aFilename, const wxString &wildcard, const wxString &ext, bool isDirectory, FILEDLG_HOOK_NEW_LIBRARY *aFileDlgHook=nullptr)
virtual void SetGridVisibility(bool aVisible)
virtual void handleActivateEvent(wxActivateEvent &aEvent)
Handle a window activation event.
virtual void AddApiPluginTools(ACTION_TOOLBAR *aToolbar)
Append actions from API plugins to the given toolbar.
virtual void OnApiPluginInvoke(wxCommandEvent &aEvent)
Handler for activating an API plugin (via toolbar or menu).
virtual void UpdateMsgPanel()
Redraw the message panel.
wxStatusBar * OnCreateStatusBar(int number, long style, wxWindowID id, const wxString &name) override
Create the status line (like a wxStatusBar).
virtual COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const
Returns a pointer to the active color theme settings.
void ToggleUserUnits() override
void FocusOnLocation(const VECTOR2I &aPos, bool aAllowScroll=true)
Useful to focus on a particular location, in find functions.
virtual void CreateHotkeyPopup()
void UpdateStatusBar() override
Update the status bar information.
void syncToolbarSelections() override
Called after the toolbars are rebuilt so a frame can select the group entries that reflect its saved ...
void GetUnitPair(EDA_UNITS &aPrimaryUnit, EDA_UNITS &aSecondaryUnits) override
Get the pair or units in current use.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
void updateStatusBarWidths()
void PrintDrawingSheet(const RENDER_SETTINGS *aSettings, BASE_SCREEN *aScreen, const std::map< wxString, wxString > *aProperties, double aMils2Iu, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Print the drawing-sheet (frame and title block).
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
wxSocketServer * m_socketServer
SEARCH_PANE * m_searchPane
EDA_SEARCH_DATA & GetFindReplaceData()
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void OnMove(wxMoveEvent &aEvent) override
std::vector< wxWindow * > findDialogs()
virtual void DisplayGridMsg()
Display current grid size in the status bar.
EDA_DRAW_PANEL_GAL::GAL_TYPE loadCanvasTypeSetting()
Return the canvas type stored in the application settings.
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
wxArrayString m_findStringHistoryList
static std::set< EDA_DRAW_PANEL_GAL::GAL_TYPE > m_failedCanvases
The canvases that have failed in any EDA_DRAW_FRAME this session.
wxChoice * m_zoomSelectBox
size_t AddApiPluginMenuItems(ACTION_MENU *aMenu)
Append actions from API plugins to the given menu.
virtual std::unique_ptr< GRID_HELPER > MakeGridHelper()
virtual PLUGIN_ACTION_SCOPE PluginActionScope() const
std::unique_ptr< EDA_SEARCH_DATA > m_findReplaceData
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
void DisplayConstraintsMsg(const wxString &msg)
void AppendMsgPanel(const wxString &aTextUpper, const wxString &aTextLower, int aPadding=6)
Append a message to the message panel.
virtual void SetGridOverrides(bool aOverride)
PROPERTIES_PANEL * m_propertiesPanel
bool m_showBorderAndTitleBlock
VECTOR2I GetNearestHalfGridPosition(const VECTOR2I &aPosition) const
Return the nearest aGridSize / 2 location to aPosition.
bool IsGitCommitPaneShown()
void ClearToolbarControl(int aId) override
bool GetOverrideLocks() const
HOTKEY_CYCLE_POPUP * m_hotkeyPopup
virtual void UpdateProperties()
void OnUpdateSelectGrid(wxUpdateUIEvent &aEvent)
Update the checked item in the grid wxchoice.
static bool IsPluginActionButtonVisible(const PLUGIN_ACTION &aAction, APP_SETTINGS_BASE *aCfg)
static constexpr GAL_TYPE GAL_FALLBACK
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the KIGFX::VIEW_CONTROLS instance used in the panel.
virtual KIGFX::VIEW * GetView() const
Return a pointer to the KIGFX::VIEW instance used in the panel.
void ResizeGal(bool aForce=false)
Resize the GAL to the current client size of this panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
@ GAL_TYPE_LAST
Sentinel, do not use as a parameter.
@ GAL_TYPE_OPENGL
OpenGL implementation.
@ GAL_TYPE_CAIRO
Cairo implementation.
@ GAL_TYPE_NONE
GAL not used (the legacy wxDC engine is used)
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
void UpdateTouchpadGestureHandler()
Apply the current native touchpad gesture preference to the active backend window.
virtual bool SwitchBackend(GAL_TYPE aGalType)
Switch method of rendering graphics.
void StartDrawing()
Begin drawing if it was stopped previously.
static GAL_TYPE ResolveStoredCanvasType(int aStoredCanvasType)
Convert a stored canvas type setting into a backend that can actually be used.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
A panel to display various information messages.
Class that groups generic conditions for editor states.
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
static const TOOL_EVENT SelectedEvent
A color representation with 4 components: red, green, blue, alpha.
double GetZoomFactor() const
const VECTOR2D & GetGridSize() const
Return the grid size.
void SetGridVisibility(bool aVisibility)
Set the visibility setting of the grid.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
wxDC * GetPrintDC() const
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void LoadSettings()
Load new settings from program common settings.
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
KISTATUSBAR is a wxStatusBar suitable for Kicad manager.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
KIWAY_PLAYER(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName, const EDA_IU_SCALE &aIuScale)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
EDA_MSG_PANEL items for displaying messages.
Describe the page size and margins of a paper page on which to eventually print or plot.
virtual COMMON_SETTINGS * GetCommonSettings() const
virtual API_PLUGIN_MANAGER & GetPluginManager() const
Container for project specific data.
virtual bool AttachGitRepository()
Find the Git repository containing the project directory and bind it to the session.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
Hold the information shown in the lower right corner of a plot, printout, or editing view.
EDA_UNITS GetUserUnits() const
void SetUserUnits(EDA_UNITS aUnits)
This file is part of the common library.
#define DEFAULT_MAX_UNDO_ITEMS
#define FR_HISTORY_LIST_CNT
Maximum size of the find/replace history stacks.
void PrintDrawingSheet(const RENDER_SETTINGS *aSettings, const PAGE_INFO &aPageInfo, const wxString &aSheetName, const wxString &aSheetPath, const wxString &aFileName, const TITLE_BLOCK &aTitleBlock, const std::map< wxString, wxString > *aProperties, int aSheetCount, const wxString &aPageNumber, double aMils2Iu, const PROJECT *aProject, const wxString &aSheetLayer, bool aIsFirstPage)
Print the border and title block.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
@ FRAME_SCH_SYMBOL_EDITOR
This file contains miscellaneous commonly used macros and functions.
Message panel definition file.
KICOMMON_API bool IsImperialUnit(EDA_UNITS aUnit)
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
KICOMMON_API wxFont GetStatusFont(wxWindow *aWindow)
KICOMMON_API wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmapBundle &aImage, wxItemKind aType=wxITEM_NORMAL)
Create and insert a menu item with an icon into aMenu.
KICOMMON_API wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
PGM_BASE & Pgm()
The global program "get" accessor.
std::function< bool(const SELECTION &)> SELECTION_CONDITION
Functor type that checks a specific condition for selected items.
std::vector< FAB_LAYER_COLOR > dummy
Functors that can be used to figure out how the action controls should be displayed in the UI and if ...
std::vector< wxString > replace_history
std::vector< wxString > find_history
std::vector< std::pair< wxString, bool > > actions
Ordered list of plugin actions mapped to whether or not they are shown in the toolbar.
std::vector< GRID > grids
An action performed by a plugin via the IPC API.
Store the common settings that are saved and loaded for each window / frame.
std::vector< double > zoom_factors
IbisParser parser & reporter
wxLogTrace helper definitions.
Functions to provide common constants and other functions to assist in making a consistent UI.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
VECTOR2D ToVECTOR2D(const wxPoint &aPoint)