XGP::XApplication Class Reference

Baseclass for X-applications; it creates an application-window with a client. More...

Inherited by XGP::XInfoApplication.

List of all members.

Public Member Functions

 XApplication (const char *pTitle)
 ~XApplication ()

Static Public Member Functions

static void initI18n ()
static void initI18n (const char *package, const char *dir)

Protected Types

typedef boost::scoped_ptr
< Gtk::VBox > 
PVBox

Protected Member Functions

virtual void setIconProgram (const guint8 *iconData, int lenData)
Gtk::VBox * getClient () const
void addHelpMenu (Glib::ustring &uiString, bool withDynTrace=false)
Help menu handling
virtual const char * getHelpfile ()
virtual void showAboutbox ()
void showHelp ()
void selectHelpBrowser ()
void showTraceObjects ()

Protected Attributes

PVBox vboxClient
Glib::RefPtr< Gtk::ActionGroup > grpAction
Glib::RefPtr< Gtk::UIManager > mgrUI
Glib::ustring helpBrowser


Detailed Description

Baseclass for X-applications; it creates an application-window with a client.

Furthermore there exists the posibility to add a help-menu consisting of:

To get the last two entries, the getHelpfile() method must not return NULL.

The following algorithm is used to determine the help file to display:

  1. If the file does not start with a single slash (/) and does not specify the file-protocoll (starting with file://), just pass the filename to the browser.
  2. Else assume a local file to display and check the language settings: If the environment variable LANGUAGE is not empty, take that value, else the locale settings (LC_MESSAGES).
  3. Take every (colon-separated) entry from the value of step 2 and append it to the name of the help-file.
  4. If step 3 does not specify a valid file name, cut the language specifier at the last underscore (_). (E.g. change de_AT to de).
  5. Repeat step 4 until either a file is found or the languge specifier is empty. If this still does not succeed, procceed with step 3.
  6. Nothing worked; search for the file "as is".
  7. As last ressort append a ".en" to the filename.

Member Typedef Documentation

typedef boost::scoped_ptr<Gtk::VBox> XGP::XApplication::PVBox [protected]

Smart pointer for a vbox.


Constructor & Destructor Documentation

XGP::XApplication::XApplication ( const char *  pTitle  ) 

Constructor; creates a program-window showing only an empty menu and an area (a GTK::VBox) for the client.

Furthermore SIGSEGV and SIGBUS signals are trapped to produce a stackdump in the log file.

Parameters:
pTitle Pointer to title of the application

XGP::XApplication::~XApplication (  ) 

Destructor.


Member Function Documentation

void XGP::XApplication::addHelpMenu ( Glib::ustring &  uiString,
bool  withDynTrace = false 
) [protected]

Adds a help-menu at the end of the menu.

This menu consists of an "About"-entry and - if the method getHelpfile() does return a value - entries to display a help-file and to configure the help browser.

Additionally an entry to show a dialog enabling to change the trace-level dynamically is added, if withDynTrace is set to true.

Parameters:
uiString String, to which the menu-structure is appended
withDynTrace Flag, if an entry to show the trace-window should be added

Gtk::VBox* XGP::XApplication::getClient (  )  const [inline, protected]

Returns the client window.

const char * XGP::XApplication::getHelpfile (  )  [protected, virtual]

Returns the name of the help file to display.

Returns:
const char* Name of help-file (NULL: none)

void XGP::XApplication::initI18n ( const char *  package,
const char *  dir 
) [static]

Initializes the program for internationalization by setting the locale and loading the messagefile.

Parameters:
package Name of the message-catalog
dir Root-directory for message-catalogs

void XGP::XApplication::initI18n (  )  [static]

Initializes the program for localization by setting the locale and loading the messagefile.

void XGP::XApplication::selectHelpBrowser (  )  [protected]

Shows the dialog to select the browser to display the help.

void XGP::XApplication::setIconProgram ( const guint8 *  pIconData,
int  lenData 
) [protected, virtual]

Sets the program icon which is used by some window managers when minimising the program.

Parameters:
pIconData Array of characters describing the icon (inline format)
lenData,: Length of inline data
Precondition:
pIconData must be a valid pointer to inline data
Remarks:
Some window managers might also display the icon on other ocassions.

Reimplemented in XGP::XInfoApplication.

void XGP::XApplication::showAboutbox (  )  [protected, virtual]

Displays the about box. See also XAbout for a dialog implementing one.

void XGP::XApplication::showHelp (  )  [protected]

Shows the help to the program.

void XGP::XApplication::showTraceObjects (  )  [protected]

Shows the dialog to set the levels of the dynamic trace.


Member Data Documentation

Glib::RefPtr<Gtk::ActionGroup> XGP::XApplication::grpAction [protected]

Actions of the application.

Glib::ustring XGP::XApplication::helpBrowser [protected]

Name of the browser to show the help.

Glib::RefPtr<Gtk::UIManager> XGP::XApplication::mgrUI [protected]

UI-manager.

Client window of the application.


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

XGP Version 0.9.31 - Generated on Wed Nov 18 11:25:29 2009 by doxygen 1.5.8