Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

MyApp Class Reference

Application class. More...

#include <main.h>

List of all members.

Public Member Functions

virtual bool OnInit ()
 Initializes the application.
virtual int OnExit ()
 Exits the application.
virtual void init_txt (wxString lang, wxString csv, wxHashString *target=NULL, int ln=1)
 Initializes a hash table from a CSV file.
virtual void do_my_ass (bool b, wxString msg=_T(""))
 "My assertion" - little inside joke...
virtual void do_my_log (wxString function, wxString msg=_T(""))
 Logs events to a file.
virtual wxString getHTMLCommand (wxString command)
 Returns the command line for running a browser.
virtual wxString getFileFormatApplication (wxString type)
 Returns application associated with a file type.
virtual wxString getFileFormatCommand (wxString type, wxString file)
 Returns the command line for running this file.
virtual wxString get_GENtle_version ()
 Returns the GENtle version string.
virtual wxString getLocalDBname ()
 Returns the filename of the default local database.

Public Attributes

MyFrameframe
 The application frame.
wxMimeTypesManager mtm
 The MIME types manager.
wxString homedir
 Directory of the application.
wxString bmpdir
 Directory of the bitmaps.
wxString slash
 The platform-dependent directory separator slash.
int programVersion
 The database access program version.
int dbWarningIssued
 Was a database warning issued?
wxHashString _text
 Contains the current GUI translation.
wxHashString clp
 Command line parameters.
wxCSConv * isoconv
 UTF-8 conversion helper.

Private Member Functions

virtual void registerFileExtension (wxString extension)
 Registers a file extension to GENtle (windows only).
virtual void registerProtocol (wxString extension)
 Registers a protocol to GENtle (windows only).

Private Attributes

wxFile * errout
 The ERROR.txt file handler for do_my_ass.
wxFile * logout
 The LOG.txt file handler for do_my_log.
int total_log_time
 The log timer for do_my_log.
int total_log_counter
 The log counter for do_my_log.
wxSingleInstanceChecker * m_checker
 Checks if another instance is running.
wxString theRealLocalDb


Detailed Description

Application class.


Member Function Documentation

void MyApp::do_my_ass bool  b,
wxString  msg = _T("")
[virtual]
 

"My assertion" - little inside joke...

Parameters:
b The condition given in the call. No assertion when b is FALSE.
msg The message string to write into errout.
The function writes the text of "msg" to the ERROR.txt file in case "b" is true. This is done to catch possible out-of-range errors. The function should not be used in releases, as the mere out-of-range check might significantly impact on performance. Called as "myass" (see main.h defs).

void MyApp::do_my_log wxString  function,
wxString  msg = _T("")
[virtual]
 

Logs events to a file.

Parameters:
function The originating function name of the log event.
msg The message string to write into logout.
The function writes the text of "msg" to the LOG.txt file together with the "function" name. This is done to log events and variable values at certain points in the code. This should not be used in releases, as it will severely impact on performance. Called as "mylog" (see main.h defs).

wxString MyApp::get_GENtle_version  )  [virtual]
 

Returns the GENtle version string.

wxString MyApp::getFileFormatApplication wxString  type  )  [virtual]
 

Returns application associated with a file type.

Parameters:
type The file ending to find the application for.

wxString MyApp::getFileFormatCommand wxString  type,
wxString  file
[virtual]
 

Returns the command line for running this file.

wxString MyApp::getHTMLCommand wxString  command  )  [virtual]
 

Returns the command line for running a browser.

Parameters:
command The URL/file.

wxString MyApp::getLocalDBname  )  [virtual]
 

Returns the filename of the default local database.

void MyApp::init_txt wxString  lang,
wxString  csv,
wxHashString *  target = NULL,
int  ln = 1
[virtual]
 

Initializes a hash table from a CSV file.

Parameters:
lang the column identifier (first row of the CSV file)
csv the CSV file
target the hash table; if NULL (default), the language table is created
ln the default language number

int MyApp::OnExit  )  [virtual]
 

Exits the application.

  • Finished a log, if one is written
  • deletes the wxSingleInstanceChecker

bool MyApp::OnInit  )  [virtual]
 

Initializes the application.

  • Initializes variables
  • Initializes handlers
  • Checks if another program instance is already running
  • Creates a new local database, if necessary
  • Creates the frame
  • Shows the splash screen
  • Shows Tip of the Day (currently deactivated)
  • Registers file extensions

void MyApp::registerFileExtension wxString  extension  )  [private, virtual]
 

Registers a file extension to GENtle (windows only).

void MyApp::registerProtocol wxString  extension  )  [private, virtual]
 

Registers a protocol to GENtle (windows only).


Member Data Documentation

wxHashString MyApp::_text
 

Contains the current GUI translation.

wxString MyApp::bmpdir
 

Directory of the bitmaps.

wxHashString MyApp::clp
 

Command line parameters.

int MyApp::dbWarningIssued
 

Was a database warning issued?

wxFile* MyApp::errout [private]
 

The ERROR.txt file handler for do_my_ass.

MyFrame* MyApp::frame
 

The application frame.

wxString MyApp::homedir
 

Directory of the application.

wxCSConv* MyApp::isoconv
 

UTF-8 conversion helper.

wxFile* MyApp::logout [private]
 

The LOG.txt file handler for do_my_log.

wxSingleInstanceChecker* MyApp::m_checker [private]
 

Checks if another instance is running.

wxMimeTypesManager MyApp::mtm
 

The MIME types manager.

int MyApp::programVersion
 

The database access program version.

wxString MyApp::slash
 

The platform-dependent directory separator slash.

wxString MyApp::theRealLocalDb [private]
 

int MyApp::total_log_counter [private]
 

The log counter for do_my_log.

int MyApp::total_log_time [private]
 

The log timer for do_my_log.


The documentation for this class was generated from the following files:
Generated on Fri Aug 11 16:19:44 2006 for GENtle by  doxygen 1.4.1