Main Page | Alphabetical List | Class List | File List | Class Members | File Members

GeneratorToolFrame Class Reference

#include <generatortool.h>

List of all members.

Public Member Functions

 GeneratorToolFrame (const wxString &title, const wxPoint &pos, const wxSize &pos, long style, const wxString &name)
 ~GeneratorToolFrame ()
void OnQuit (wxCommandEvent &event)
void OnAbout (wxCommandEvent &event)
void OnButtonLogin (wxCommandEvent &event)
void OnButtonLogout (wxCommandEvent &event)
void OnButtonLaunch (wxCommandEvent &event)
void set_properties ()
void do_layout ()
void DbEstb ()
wxString IntToWxstring (int id)
void InstantiateForm (int id, int x, int y, int w, int h, int type, int style, wxString title, int isindex)
void InstantiateObject (int type, int formid, int oid, wxString olabel, wxString odefault, int ox, int oy, int ow, int oh, int ostyle, int oAttrtype)
void RefreshGrid (int formid, int objectid)
void FormGenericEventFunc (wxCommandEvent &event)
void MenuGenericEventFunc (wxCommandEvent &event)
void ButtonGenericEventFunc (wxCommandEvent &event)
void StaticTextGenericEventFunc (wxCommandEvent &event)
void TextCtrlGenericEventFunc (wxCommandEvent &event)


Constructor & Destructor Documentation

GeneratorToolFrame::GeneratorToolFrame const wxString &  title,
const wxPoint &  pos,
const wxSize &  size,
long  style,
const wxString &  name
 

Constructor.

Initialises the Window of the FastApp Binary Client with a login screen.

  • title = label/ title of window
  • pos = pixel position of the window referenced from top left of screen (0,0). e.g. wxPoint(200,300)
  • size = size of the window to be displayed
  • style = style of the window. See the wxWidgets documentation. e.g. wxMAXIMISE
  • name = identifying name of the frame for wxWidgets

Also see GeneratorToolFrame::~GeneratorToolFrame()

Definition at line 55 of file generatortool.cpp.

GeneratorToolFrame::~GeneratorToolFrame  ) 
 

Destructor of GeneratorToolFrame.

Definition at line 87 of file generatortool.cpp.


Member Function Documentation

void GeneratorToolFrame::ButtonGenericEventFunc wxCommandEvent &  event  ) 
 

This event handling method is used to cater to the possible actions required of a button (e.g.

INSERT some new records, Invoke a POPUP, Delete a record, etc.)

Hence, the 3 designers (Feifei, Hweeli and myself) of the components of FastApp has agreed on an Event Handling Protocol which will serve as the common method of executing the dynamic events according to the different situations.

Briefly, this is how this method works:

  1. From the event object passed into the method, we can obtain the object ID where the event occurred.
  2. Then, knowing the ID, we will enter the SysDB to check out its corresponding Event ID.
  3. With the Event ID, we will be able to check the Fa_Process Relation(This is where all the relevant event handling steps are stored for their relevant objects) in the SysDB. We will extract the Steps (aka. Process IDs and Process Descriptions related to this Event ID)
  4. We will execute the event according to its previously agreed protocol.

Definition at line 775 of file generatortool.cpp.

Referenced by ButtonGenericEventFunc(), and InstantiateObject().

void GeneratorToolFrame::DbEstb  ) 
 

This is the core of the ODBC Connections with the SysDB in the process of collecting data.

//Check currency of the ODBC.INI file with the server. The program RSYNC will be run in the shell script that is executed by the system() function. The simple BASH Script checkodbc.sh will do the following:

  • Do a password-less connection through SSH
  • Do a check if the file has been updated. If it has, download the updated version, if not, do nothing.

Prior to this execution of scripts, a system administrator will have to configure the password-less SSH Connection with the server so that the synching with the server's ODBC.ini file is done seamlessly.

As a TODO For the future, we may again write a BASH Script to automate this pre-configuration process.

Definition at line 1586 of file generatortool.cpp.

Referenced by OnButtonLogin().

void GeneratorToolFrame::do_layout  ) 
 

Sets the layout of the frame.

It is a corner for the programmer to do easy adjustments of the Sizers and the layout of the frame.

Definition at line 125 of file generatortool.cpp.

Referenced by GeneratorToolFrame().

void GeneratorToolFrame::FormGenericEventFunc wxCommandEvent &  event  ) 
 

Generic Event Handling Function for Forms.

Definition at line 640 of file generatortool.cpp.

void GeneratorToolFrame::InstantiateForm int  id,
int  x,
int  y,
int  w,
int  h,
int  type,
int  style,
wxString  title,
int  isindex
 

Before looking at the InstantiateForm Functionality, we need to look at the RTTI mechanism:.

  • - It consists of 3 major parts:
    1. wxDynamicCast() method: For obtaining a pointer to an object of a derived class given the pointer to a base class of that object. This method delivers the pointer only if the object pointed to is REALLY of the specified derived class; otherwise it will return a 0.
    2. the Type ID: In FastApp, each Form(window) and Control has a classifying typeid which differentiates it type from the other controls. (e.g. Buttons are of the typeid = 101 while StaticTexts are of the typeid = 100) Hence, this type id is used for identifying the exact type of an object given a pointer to a base class.
    3. wxClassInfo : This acts as a hook for further Runtime information associated with a type.

  • Next the utilisation of wxHashTables, the main reasons for their usage are:
    1. Each Form or Control in the SysDB are Uniquely identified by their FIDs or ObjIDs. Hence, with a potentially large pool of these objects as the programme's utilisation increases, the best data structure has to be one that can grow with no major concerns of indexing and also one which allows any arbitrary key(id) to be used to index a new object.
    2. We will pass in the form information into a hashtable entry with its id as the key to the hash table

  • How this method works:
    1. The parameters of the forms are passed into the function.
    2. By recognising the type of the form, (e.g. Frame), it will move into the appropriate instantiation branch of a switch condition.
    3. Within each case of the switch(which corresponds to the typeid of the form), we will do the following:
      • "new" the Form object and then store into the formtable has table by its formid, this is to allow easy control and manipulation in further steps in the program
      • Extract the newly-inserted item as its base object and Dynamic Cast it into its appropriate derived Object.
      • Connect this Form Object with its appropriate Dynamic Event Handling Methods.

Definition at line 493 of file generatortool.cpp.

Referenced by OnButtonLaunch().

void GeneratorToolFrame::InstantiateObject int  type,
int  formid,
int  oid,
wxString  olabel,
wxString  odefault,
int  ox,
int  oy,
int  ow,
int  oh,
int  ostyle,
int  oAttrtype
 

  • How this method works: -# The parameters of the Controls are passed into the function.

  1. By recognising the type of the Control, (e.g. wxButton), it will move into the appropriate instantiation branch of a switch condition.
  2. Within each case of the switch(which corresponds to the typeid of the Control), we will do the following:
    • "new" the required Control object without a hard coded name and then store into the objecttable has table by its formid, this is to allow easy control and manipulation in further steps in the program
    • Extract the newly-inserted item as its base object and Dynamic Cast it into its appropriate derived Control Object.
    • Connect this Control Object with its appropriate Dynamic Event Handling Methods.

Definition at line 538 of file generatortool.cpp.

Referenced by OnButtonLaunch().

wxString GeneratorToolFrame::IntToWxstring int  id  ) 
 

Handy tool for the Conversion of integer type into the wxWidget Compliant string type, wxString.

This method is the opposite of atoi()

Definition at line 460 of file generatortool.cpp.

Referenced by ButtonGenericEventFunc(), OnButtonLaunch(), and RefreshGrid().

void GeneratorToolFrame::MenuGenericEventFunc wxCommandEvent &  event  ) 
 

Generic Event Handling Function for Menus.

Definition at line 1557 of file generatortool.cpp.

void GeneratorToolFrame::OnAbout wxCommandEvent &  event  ) 
 

A Message Box will pop up with a brief description of the program and its version.

Definition at line 160 of file generatortool.cpp.

void GeneratorToolFrame::OnButtonLaunch wxCommandEvent &  event  ) 
 

This method is the most crucial component of the entire programme.

It comprises of the following key steps:

This method does the following:

  • Get the Selected Application's name and id
  • Establish an ODBC Connection with the System Database, the SysDB.
  • Collect all the necessary information/ attributes/ parameters for the construction of the forms and objects from the SysDB.
  • Using the Run Time Type Identification (RTTI) Methods of (e.g. wxDynamicCast) provided by wxWidgets
    1. Render out the Forms by storing them into the form wxHashTable formtable and instantiate it with InstantiateForm()
    2. For each Form, Render out their Objects(Controls) by first storing them into objecttable and then instantiate it with InstantiateObject()
    3. For each Object rendered, connect them to the Dynamic Event Handling Functions through the wxWidgets Dynamic Event Handling features.

Definition at line 329 of file generatortool.cpp.

void GeneratorToolFrame::OnButtonLogin wxCommandEvent &  event  ) 
 

Event Handling Method for the Login Button.

This method handles the event that is triggered by the clicking of the login button of the first screen.

This method does the following:

  1. Checking of whether both fields are filled up.
  2. Authentication of Login Name and Password
  3. After a match of the login information, a Connection with the PostgreSQL database will be established with DbEstb()
  4. After the DB connection is established, the List of Designed Applications will be displayed in the Listbox on the following screen.

Definition at line 181 of file generatortool.cpp.

void GeneratorToolFrame::OnButtonLogout wxCommandEvent &  event  ) 
 

Event Handling Method for Logout.

Reverts User back to login screen.

Definition at line 282 of file generatortool.cpp.

void GeneratorToolFrame::OnQuit wxCommandEvent &  event  ) 
 

Event Handling Method of GeneratorToolFrame.

Closes the window when a user clicks on the Quit Menu Item or Quit Button.

Definition at line 149 of file generatortool.cpp.

void GeneratorToolFrame::RefreshGrid int  formid,
int  objectid
 

Note that this generic code is used for the dynamically rendered program, and will be able to take in any grid.

Definition at line 650 of file generatortool.cpp.

Referenced by ButtonGenericEventFunc(), and InstantiateObject().

void GeneratorToolFrame::set_properties  ) 
 

Sets the propeties of the frame.

It is a corner for programmer to do simple configuration of the controls within the frame. In this function, many miscellaneous configurations of the frame's controls are coded here.

Definition at line 101 of file generatortool.cpp.

Referenced by GeneratorToolFrame().

void GeneratorToolFrame::StaticTextGenericEventFunc wxCommandEvent &  event  ) 
 

Generic Event Handling Function for StaticText.

Definition at line 1548 of file generatortool.cpp.

void GeneratorToolFrame::TextCtrlGenericEventFunc wxCommandEvent &  event  ) 
 

Generic Event Handling Function for TextCtrls.

Definition at line 1566 of file generatortool.cpp.

Referenced by InstantiateObject().


The documentation for this class was generated from the following files:
Generated on Thu Mar 3 01:54:38 2005 for FastApp Binary Client by doxygen 1.3.6
Hosted by www.Geocities.ws

1