Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
by 

...

Unknown user

Read Part 1

I like to start just about any development project with unit tests, but part of this project involves UI code and that isn't something that's usually easy to plug into a unit test. 

...

Line 4 is an include file pointing to a class I've created using John Hickey's wonderful ClarionLive! Class Creator, or Clive as I like to call him. I use Clive constantly. 

Image RemovedImage Added

For now the CML_UI_ListCheckbox class is just a shell with a stub Initialize method. I also have a queue to hold some data and code to populate that queue with random values. 

The first field in the queue will be used to display the check box, which means displaying an icon. And any field that displays an icon needs to have a Long variable immediately following it. 

A word on CML classes

I'm going to be releasing the classes from this article series as part of the The ClarionMag Library, so they all follow the CML compiling convention which by default expects to find the classes in CMagLib.DLL.

When I'm doing development, however, I typically don't want to have to recompile that DLL each time I make a class change. Instead I set whatever app I'm using (hand code app or unit test DLL) to compile the ClarionMag Library classes along with the app:

Image RemovedImage Added

My app compiles and looks like this:

...

Code Block
                                            Member
                                            Map
                                            End
    Include('CML_UI_ListCheckbox.inc'),Once
    !include('CML_System_Diagnostics_Logger.inc'),once
!dbg                                     CML_System_Diagnostics_Logger
CML_UI_ListCheckbox.Initialize                  procedure(long listFEQ)
    code
    self.ListFEQ = ListFeq
    self.ListFEQ{PROPLIST:Icon,1} = 1
    self.ListFEQ{PROP:IconList,1} = '~CML_UnChecked.ico'
    self.ListFEQ{PROP:IconList,2} = '~CML_Checked.ico'  
    self.ListFEQ{PROPLIST:Picture,1} = '@p p'
    pragma('link (CML_Checked.ico)')
    pragma('link (CML_UnChecked.ico)')

Next time: Making the Initialize call more flexible, and turning checkboxes on and off.