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 144 of file pl_editor.cpp.

148  {
149  if( !IsOK( NULL, _( "pl_editor is already running. Continue?" ) ) )
150  return false;
151  }
152 
154 
155  // read current setup and reopen last directory if no filename to open in
156  // command line
157  bool reopenLastUsedDirectory = argc == 1;
158  GetSettings( reopenLastUsedDirectory );
159 
160  // Must be called before creating the main frame in order to
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:129
kiface::IFACE ( const char *  aName,
KIWAY::FACE_T  aType 
)

Definition at line 136 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 173 of file pl_editor.cpp.

References PL_EDITOR_FRAME::LoadPageLayoutDescrFile(), and PL_EDITOR_FRAME::OnNewPageLayout().

177  {
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:107
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.

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().