Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

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

  Switch to unified view

a/ooDialog/branches/4.2.3/trunk/examples/oobandit.rex b/ooDialog/branches/4.2.3/trunk/examples/oobandit.rex
...
...
50
 *  actual size.  The pixel size of the bitmaps is first converted to the
50
 *  actual size.  The pixel size of the bitmaps is first converted to the
51
 *  correct dialog unit size, correct for the actual dialog to be constructed.
51
 *  correct dialog unit size, correct for the actual dialog to be constructed.
52
 *
52
 *
53
 *  Then the size of the dialog and the size and placement of the dialog
53
 *  Then the size of the dialog and the size and placement of the dialog
54
 *  controls are calculated around the bitmap size.
54
 *  controls are calculated around the bitmap size.
55
 *
56
 * Note: this program uses the public routine, locate(), to get the full path
57
 * name to the directory this source code file is located. In places, the
58
 * variable holding this value has been callously abbreviated to 'sd' which
59
 * stands for source directory.
60
 *
55
 */
61
 */
56
62
57
   -- Use the global .constDir for symbolic IDs, and add IDs for this example.
63
   -- Use the global .constDir for symbolic IDs, and add IDs for this example.
58
   .application~useGlobalConstDir('O')
64
   .application~useGlobalConstDir('O')
59
   .constDir[IDC_PB_STOP]        = 1100
65
   .constDir[IDC_PB_STOP]        = 1100
...
...
62
   .constDir[IDC_PB_BMP_CENTER]  = 1202
68
   .constDir[IDC_PB_BMP_CENTER]  = 1202
63
   .constDir[IDC_PB_BMP_RIGHT]   = 1203
69
   .constDir[IDC_PB_BMP_RIGHT]   = 1203
64
   .constDir[IDC_EDIT]           = 120
70
   .constDir[IDC_EDIT]           = 120
65
   .constDir[IDC_UD]             = 1206
71
   .constDir[IDC_UD]             = 1206
66
72
67
   j = locate()
68
69
         /* 1ms fast, 500ms slow, 200ms start, equals random every 25th */
73
         /* 1ms fast, 500ms slow, 200ms start, equals random every 25th */
70
   d = .BanditDlg~new(1, 1000, 1000, 25)
74
   d = .BanditDlg~new(1, 1000, 1000, 25)
71
   d~execute("SHOWTOP")
75
   d~execute("SHOWTOP")
72
76
73
   return 0
77
   return 0
...
...
119
   self~initCode = self~createcenter(dlgSize~width, dlgSize~height, title)
123
   self~initCode = self~createcenter(dlgSize~width, dlgSize~height, title)
120
124
121
::method defineDialog
125
::method defineDialog
122
   expose bmp. initialSpeed dlgSize bitMapSize
126
   expose bmp. initialSpeed dlgSize bitMapSize
123
127
124
   sd = .application~srcDir
128
   sd = locate()
125
129
126
   -- Load the bitmaps into memory.
130
   -- Load the bitmaps into memory.
127
   bmp.1 = self~loadBitmap(sd"bmp\tiger.bmp")
131
   bmp.1 = self~loadBitmap(sd"bmp\tiger.bmp")
128
   bmp.2 = self~loadBitmap(sd"bmp\chihuahu.bmp")
132
   bmp.2 = self~loadBitmap(sd"bmp\chihuahu.bmp")
129
   bmp.3 = self~loadBitmap(sd"bmp\eleph2.bmp")
133
   bmp.3 = self~loadBitmap(sd"bmp\eleph2.bmp")