KiCad PCB EDA Suite
pl_editor.cpp File Reference

page layout editor main file. More...

#include <fctsys.h>
#include <kiface_i.h>
#include <confirm.h>
#include <gestfich.h>
#include <worksheet_shape_builder.h>
#include <pl_editor_frame.h>
#include <hotkeys.h>
#include <build_version.h>
#include <wx/file.h>
#include <wx/snglinst.h>

Go to the source code of this file.

Classes

struct  PGE::IFACE
 

Namespaces

 PGE
 

Functions

PGE::IFACE KIFACE_I PGE::kiface ("pl_editor", KIWAY::FACE_PL_EDITOR)
 
 IFACE (const char *aName, KIWAY::FACE_T aType)
 
bool OnKifaceStart (PGM_BASE *aProgram, int aCtlBits) override
 
void OnKifaceEnd () override
 
wxWindow * CreateWindow (wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
 
void * IfaceOrAddress (int aDataId) override
 Function IfaceOrAddress return a pointer to the requested object. More...
 
KIFACE_IKiface ()
 Global KIFACE_I "get" accessor. More...
 
 MY_API (KIFACE *) KIFACE_GETTER(int *aKIFACEversion
 
PGM_BASEPgm ()
 The global Program "get" accessor. More...
 

Variables

static PGM_BASEprocess
 
int aKiwayVersion
 
int PGM_BASEaProgram
 
return & kiface
 

Detailed Description

page layout editor main file.

Definition in file pl_editor.cpp.

Function Documentation

wxWindow* kiface::CreateWindow ( wxWindow *  aParent,
int  aClassId,
KIWAY aKiway,
int  aCtlBits = 0 
)
override

Definition at line 142 of file pl_editor.cpp.

146  {
147  if( !IsOK( NULL, _( "pl_editor is already running. Continue?" ) ) )
148  return false;
149  }
150 
151  // read current setup and reopen last directory if no filename to open in
152  // command line
153  bool reopenLastUsedDirectory = argc == 1;
154  GetSettings( reopenLastUsedDirectory );
155 
156  // Must be called before creating the main frame in order to
157  // display the real hotkeys in menus or tool tips
158  ReadHotkeyConfig( PL_EDITOR_FRAME_NAME, s_PlEditor_Hokeys_Descr );
#define PL_EDITOR_FRAME_NAME
Definition: draw_frame.h:51
int ReadHotkeyConfig(const wxString &aAppname, struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys...
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:295
kiface::IFACE ( const char *  aName,
KIWAY::FACE_T  aType 
)

Definition at line 134 of file pl_editor.cpp.

void* kiface::IfaceOrAddress ( int  aDataId)
override

Function IfaceOrAddress return a pointer to the requested object.

The safest way to use this is to retrieve a pointer to a static instance of an interface, similar to how the KIFACE interface is exported. But if you know what you are doing use it to retrieve anything you want.

Parameters
aDataIdidentifies which object you want the address of.
Returns
void* - and must be cast into the know type.

Definition at line 171 of file pl_editor.cpp.

References WORKSHEET_LAYOUT::GetTheInstance(), PL_EDITOR_FRAME::LoadPageLayoutDescrFile(), PL_EDITOR_FRAME::OnNewPageLayout(), and WORKSHEET_LAYOUT::SetPageLayout().

173  {
174  fn = argv[1];
KIFACE_I& Kiface ( )

Global KIFACE_I "get" accessor.

Definition at line 100 of file pl_editor.cpp.

References PGE::kiface().

100 { return kiface; }
return & kiface
Definition: pl_editor.cpp:108
MY_API ( KIFACE )
void kiface::OnKifaceEnd ( )
override
bool kiface::OnKifaceStart ( PGM_BASE aProgram,
int  aCtlBits 
)
override
PGM_BASE& Pgm ( )

The global Program "get" accessor.

Implemented in: 1) common/single_top.cpp, 2) kicad/kicad.cpp, and 3) scripting/kiway.i

Definition at line 112 of file pl_editor.cpp.

References process, and program.

113 {
114  wxASSERT( process ); // KIFACE_GETTER has already been called.
115  return *process;
116 }
static PGM_BASE * process
Definition: pl_editor.cpp:98

Variable Documentation

int aKiwayVersion

Definition at line 105 of file pl_editor.cpp.

int PGM_BASE* aProgram
Initial value:
{
Class PGM_BASE keeps program (whole process) data for KiCad programs.
Definition: pgm_base.h:149
int PGM_BASE * aProgram
Definition: pl_editor.cpp:106
static PGM_BASE * process
Definition: pl_editor.cpp:98

Definition at line 106 of file pl_editor.cpp.

Referenced by PGE::IFACE::IFACE().

return& kiface

Definition at line 108 of file pl_editor.cpp.

PGM_BASE* process
static

Definition at line 98 of file pl_editor.cpp.

Referenced by Pgm().