Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /ooDialog/branches/4.2.3/trunk/examples/propertySheet.tabControls/oodListViews.rex [r9605] .. [r9606] Maximize Restore

  Switch to side-by-side view

--- a/ooDialog/branches/4.2.3/trunk/examples/propertySheet.tabControls/oodListViews.rex
+++ b/ooDialog/branches/4.2.3/trunk/examples/propertySheet.tabControls/oodListViews.rex
@@ -48,6 +48,12 @@
  *    control.  Demonstrates some other list-view features, such as info tips,
  *    user item data, in place label editing, drag and drop in icon view, etc..
  *
+ *
+ * Note: this program uses the public routine, locate(), to get the full path
+ * name to the directory this source code file is located. In places, the
+ * variable holding this value has been callously abbreviated to 'sd' which
+ * stands for source directory.
+ *
  */
 
   srcDir = locate()
@@ -73,9 +79,13 @@
 ::class 'ListsDialog' subclass RcDialog
 
 ::method init
+  expose sd
+
   forward class (super) continue
 
   if self~initCode <> 0 then return self~initCode
+
+  sd = locate()
 
   self~createImageLists
   self~initRecords
@@ -91,7 +101,7 @@
 
 
 ::method initDialog
-  expose tabControl pageDialog smallIcons normalIcons records pbBackward pbForward ckInfoTips
+  expose tabControl pageDialog smallIcons normalIcons records pbBackward pbForward ckInfoTips sd
 
   -- Set the Use Info Tips check box.
   ckInfoTips = self~newCheckBox(IDC_CK_INFOTIPS)
@@ -120,7 +130,7 @@
   w = (displayRect~right * (7 / 12)) % 4
   tabControl~setMinTabWidth(w)
 
-  pageDialog = .PageDialog~new(.application~srcDir"rc\oodListViews.rc", IDD_PAGE, , , , , self)
+  pageDialog = .PageDialog~new(sd"rc\oodListViews.rc", IDD_PAGE, , , , , self)
   pageDialog~useInfoTips = .true
   pageDialog~initialize(smallIcons, normalIcons, records)
 
@@ -274,9 +284,9 @@
  * show up as a new item in the list-view.
  */
 ::method onAdd unguarded
-  expose pageDialog
-
-  dlg = .AddressDialog~new(.application~srcDir'rc\oodListViews.rc', IDD_ADDRESS)
+  expose pageDialog sd
+
+  dlg = .AddressDialog~new(sd'rc\oodListViews.rc', IDD_ADDRESS)
 
   if dlg~initCode = 0 then do
     if dlg~execute("SHOWTOP") == self~IDOK then do
@@ -311,11 +321,11 @@
  * values the user entered and have the page dialog update the list-view item.
  */
 ::method onEdit unguarded
-  expose pageDialog
+  expose pageDialog sd
 
   rec = pageDialog~getSelectedRecord
 
-  dlg = .AddressDialog~new(.application~srcDir'rc\oodListViews.rc', IDD_ADDRESS, rec)
+  dlg = .AddressDialog~new(sd'rc\oodListViews.rc', IDD_ADDRESS, rec)
 
   if dlg~initCode = 0 then do
     if dlg~execute("SHOWTOP") == self~IDOK then do
@@ -412,9 +422,9 @@
  * very flexible.
  */
 ::method createImageLists private
-  expose smallIcons normalIcons
-
-  small = .Image~getImage(.application~srcDir"rc\oodListViews1.bmp")
+  expose smallIcons normalIcons sd
+
+  small = .Image~getImage(sd"rc\oodListViews1.bmp")
   tmpIL = .ImageList~create(.Size~new(16, 12), .Image~toID(ILC_COLOR4), 4, 0)
   if \small~isNull,  \tmpIL~isNull then do
       tmpIL~add(small)
@@ -425,7 +435,7 @@
     smallIcons = .nil
   end
 
-  normal = .Image~getImage(.application~srcDir"rc\oodListViews2.bmp")
+  normal = .Image~getImage(sd"rc\oodListViews2.bmp")
   tmpIL = .ImageList~create(.Size~new(32, 32), .Image~toID(ILC_COLOR4), 4, 0)
   if \normal~isNull,  \tmpIL~isNull then do
       tmpIL~add(normal)