![]() ![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 61
1998-2004 Gravitybox Software LLC
I think that this demonstrates quite well how to build a simple database program
with the schedule. It does however only show the loading and saving of appointments.
Perhaps you wish to configure rooms, categories, providers, etc. We have seen how to
load room and categories, but how do we configure and add them? We will start by
creating a simple Room configuration screen.
Figure 5.1
We start by creating the screen. I have chosen to use standard controls like list
boxes and buttons because this is the lowest common denominator for learning and
also ensures that everyone can create the screen, without any other third-party
components. The setup screen will have a listbox and five configuration buttons, in
addition to the Ok and Cancel buttons. The configuration buttons will consist of an add,
rename, and remove button, as well as the up and down buttons. The first three do
exactly what they are named. The up and down buttons allow the user to specify the
order in which the rooms are displayed on the schedule, by reordering previously added
rooms.
We will store the database information in a temporary collection while the
configuration screen is visible. This is done so that we may make changes and they will
not be saved until we wish for them to be saved. The program contains the CItemCol
and CItemEl class definitions. The first one will be used to create a collection of
objects that will store the necessary information for each room.
Option Explicit
Dim Rooms As New CItemCol
Dim Changed As Boolean
Dim arrDeleted() As Long
Also notice in the forms declaration section there is a Changed variable. This stores
the dirty state of the screen. It is used to determine if the screen needs to be saved
|