Gui::PythonCommand Class Reference

The Python command class This is a special type of command class. More...

#include <Command.h>

Inheritance diagram for Gui::PythonCommand:
Gui::Command Gui::CommandBase

List of all members.

Public Member Functions

 PythonCommand (const char *name, PyObject *pcPyCommand, const char *pActivationString)
virtual ~PythonCommand ()
Methods to get the properties of the command



const char * className () const
 The C++ class name is needed as context for the translation framework.
const char * getAccel () const
const char * getMenuText () const
const char * getPixmap () const
const char * getStatusTip () const
const char * getToolTipText () const
const char * getWhatsThis () const
void languageChange ()
 Reassigns QAction stuff after the language has changed.

Protected Member Functions

const char * getResource (const char *sName) const
 Returns the resource values.
Methods reimplemented for Command Framework



virtual void activated (int iMsg)
 Method which gets called when activated.
virtual ActioncreateAction (void)
 Creates the used Action.
const char * getHelpUrl (void)
 Get the help URL.
virtual bool isActive (void)
 if the command is not always active

Protected Attributes

PyObject_pcPyCommand
 a pointer to the Python command object
PyObject_pcPyResourceDict
 the command object resource dictionary
std::string Activation
 the activation sequence

Detailed Description

The Python command class This is a special type of command class.

It's used to bind a Python command class into the FreeCAD command framework. An object of this class gets a reference to the Python command object and manages all the passing between the C++ and the Python world. This includes everything like setting resources such as bitmaps, activation or bindings to the user interface.

See also:
CommandManager
Author:
Jürgen Riegel

Definition at line 307 of file Command.h.


Constructor & Destructor Documentation

PythonCommand::PythonCommand ( const char *  name,
PyObject pcPyCommand,
const char *  pActivationString 
)
virtual Gui::PythonCommand::~PythonCommand (  )  [inline, virtual]

Definition at line 311 of file Command.h.


Member Function Documentation

void PythonCommand::activated ( int  iMsg  )  [protected, virtual]
const char* Gui::PythonCommand::className (  )  const [inline, virtual]

The C++ class name is needed as context for the translation framework.

Implements Gui::CommandBase.

Definition at line 331 of file Command.h.

Action * PythonCommand::createAction ( void   )  [protected, virtual]
const char * PythonCommand::getAccel (  )  const [virtual]

Reimplemented from Gui::CommandBase.

Definition at line 835 of file Gui/Command.cpp.

References getResource().

Referenced by createAction().

const char * PythonCommand::getHelpUrl ( void   )  [protected]

Get the help URL.

Definition at line 777 of file Gui/Command.cpp.

References _pcPyCommand, and Base::Interpreter().

const char * PythonCommand::getMenuText (  )  const [virtual]

Reimplemented from Gui::CommandBase.

Definition at line 815 of file Gui/Command.cpp.

References getResource().

Referenced by createAction(), and languageChange().

const char * PythonCommand::getPixmap (  )  const [virtual]

Reimplemented from Gui::CommandBase.

Definition at line 830 of file Gui/Command.cpp.

References getResource().

const char * PythonCommand::getResource ( const char *  sName  )  const [protected]

Returns the resource values.

Definition at line 709 of file Gui/Command.cpp.

References _pcPyResourceDict.

Referenced by createAction(), getAccel(), getMenuText(), getPixmap(), getStatusTip(), getToolTipText(), and getWhatsThis().

const char * PythonCommand::getStatusTip (  )  const [virtual]

Reimplemented from Gui::CommandBase.

Definition at line 825 of file Gui/Command.cpp.

References getResource().

Referenced by createAction(), and languageChange().

const char * PythonCommand::getToolTipText (  )  const [virtual]

Reimplemented from Gui::CommandBase.

Definition at line 820 of file Gui/Command.cpp.

References getResource().

Referenced by createAction(), and languageChange().

const char * PythonCommand::getWhatsThis (  )  const [virtual]

Reimplemented from Gui::CommandBase.

Definition at line 807 of file Gui/Command.cpp.

References Gui::Command::getName(), and getResource().

Referenced by createAction(), and languageChange().

bool PythonCommand::isActive ( void   )  [protected, virtual]

if the command is not always active

Reimplemented from Gui::Command.

Definition at line 742 of file Gui/Command.cpp.

References _pcPyCommand, Py::Exception::clear(), macros::cmd, Py::Object::getAttr(), Py::Object::hasAttr(), and Py::Object::ptr().

void PythonCommand::languageChange (  )  [virtual]

Member Data Documentation

a pointer to the Python command object

Definition at line 345 of file Command.h.

Referenced by activated(), getHelpUrl(), isActive(), and PythonCommand().

the command object resource dictionary

Definition at line 347 of file Command.h.

Referenced by getResource(), and PythonCommand().

std::string Gui::PythonCommand::Activation [protected]

the activation sequence

Definition at line 349 of file Command.h.

Referenced by activated(), and PythonCommand().


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:01 2011 for FreeCAD by  doxygen 1.6.1