![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 152
1998-2004 Gravitybox Software LLC
Select Case oItem.Name
Case "Today": 'Today
frmToday.Show
Case "Calendar": 'Calendar
frmCalendar.Show
Case "Contacts": 'Contacts
frmContact.Show
Case "Tasks": 'Tasks
Load frmTask
Set frmTask.TaskColumns = TaskColumns
Call frmTask.RefreshForm
frmTask.Show
Case "Notes": 'Notes
frmNote.Show
End Select
End Sub
The code for this method merely loads the appropriate form, when the user presses an
item on the Listbar.
The entire application rides on top of the OrganizeAPI DLL file. In the code displayed in
this section, you will see references to objects that you have never seen before and no
database access. Though this application uses a database to save and load data, only
the API actually touches the database. The GUI that we are building simply calls the
API. By constructing an object-oriented API, other application may be built that use the
API to manipulate the objects. For example, another application could be made that
does some type of data backup once a week. Another may be built that cleans up old
appointments or creates an archive of old appointments or task items.
Throughout this demonstration, the loading and saving of objects will be done using a
global object named ThisUser. This object is defined from the CUserPreference
class in the API DLL. It has properties and methods that control user maintenance,
saving, loading, etc. All load/save methods take this object as a parameter to properly
perform their operations. The format was chosen to ensure that the same user load and
saves the objects. This solves certain consistency problems. This user object also
contains the needed database connection information.
|