From: <mie...@us...> - 2009-08-22 20:05:00
|
Revision: 5098 http://oorexx.svn.sourceforge.net/oorexx/?rev=5098&view=rev Author: miesfeld Date: 2009-08-22 20:04:51 +0000 (Sat, 22 Aug 2009) Log Message: ----------- 2842161 OOdialog pixel calculation wrong Fix the oograph.rex sample program. Modified Paths: -------------- main/trunk/samples/windows/oodialog/oograph.rex Modified: main/trunk/samples/windows/oodialog/oograph.rex =================================================================== --- main/trunk/samples/windows/oodialog/oograph.rex 2009-08-22 19:24:02 UTC (rev 5097) +++ main/trunk/samples/windows/oodialog/oograph.rex 2009-08-22 20:04:51 UTC (rev 5098) @@ -55,7 +55,7 @@ exit end - d~createCenter(570 / d~FactorX, 440 / d~FactorY, , + d~createCenter(770 / d~FactorX, 440 / d~FactorY, , "Graphical Demonstration of Open Object Rexx and OODialog Capabilities") d~execute("SHOWTOP") d~deinstall @@ -71,15 +71,29 @@ ::method DefineDialog expose but2size - but2pos = 140 / self~FactorY + but2pos = 160 / self~FactorY but2size = 300 / self~FactorY - self~AddBitmapButton(101,1,10,self~SizeX-1, 110 / self~FactorY,,,"bmp\install.bmp",,,,"USEPAL") - self~AddBitmapButton(102,10,but2pos,self~SizeX - 20,but2size,,,"bmp\install2.bmp") - self~AddWhiteFrame(10, self~SizeY - 52, self~SizeX-20, 24,"HIDDEN", 203) - self~AddButton(103,12, self~SizeY - 50, self~SizeX-24, 20,,,"OWNER NOTAB") + -- The two bitmap buttons are created larger than they need to be. In particular, + -- The 102 button height is much larger, it covers most of the lower part of the + -- dialog. + -- + -- Then, the bitmaps for the buttons are displaced (moved from the upper left corner + -- of the button) by a large amount. The 101 button is displaced far to the right, + -- and the 102 button is displaced far to the bottom and far to the left. In the run() + -- method, scrollBitmapFromTo() is used to scroll the bitmaps from their displaced positions + -- back to the upper left corner of the buttons. This gives the bitmaps the appearance of + -- scrolling from the right to the left, the 101 button, and from the bottom to the top, + -- the 102 button. + + self~AddBitmapButton(101,1,10,self~SizeX-1, 130 / self~FactorY,,,"bmp\install.bmp",,,,"USEPAL") + self~AddBitmapButton(102,20,but2pos,self~SizeX - 20,but2size,,,"bmp\install2.bmp") self~DisplaceBitmap(101,self~SizeX * self~FactorX+10, 0) self~DisplaceBitmap(102, -450, 100) + + -- Add the other controls. + self~AddWhiteFrame(10, self~SizeY - 52, self~SizeX-20, 28,"HIDDEN", 203) + self~AddButton(103,12, self~SizeY - 50, self~SizeX-24, 24,,,"OWNER NOTAB") self~AddButtonGroup(self~SizeX-220, self~SizeY - 18,60,12, , "&Bitmap-Viewer 111 BmpView &Draw-Color-Demo 112 OODraw &Cancel 2 CANCEL", 1, "DEFAULT") @@ -92,7 +106,7 @@ self~setItemSysColor(101, COLOR_BTNFACE) self~setItemSysColor(102, COLOR_BTNFACE) -::method Run unguarded +::method run unguarded expose m but2size bmppos = but2size - 125 / self~FactorY self~DisableItem(111) /* disable push buttons */ @@ -100,10 +114,18 @@ self~DisableItem(2) ret = play("inst.wav", yes) - self~ScrollBitmapFromTo(101, self~SizeX * self~FactorX, 5, 5, 5, -12, 0, 1) + + -- Scroll the bitmaps from their displaced positions back to the upper left corners + -- of the buttons. + self~ScrollBitmapFromTo(101, self~SizeX * self~FactorX, 5, 12, 5, -12, 0, 1) self~ScrollBitmapFromTo(102, 30, bmppos, 30, 0, 0, -3, 2, 1) - self~ResizeItem(102, self~SizeX-40, self~SizeY-120, "NOREDRAW") + -- The size of the 102 button actually covers the controls under the button. If the + -- user clicks on any portion of the button, the button is repainted in the 'depressed' + -- state. Since the other controls are not repainted, this cause them (or parts of + -- them) to disappear. To prevent that, we resize the button to only take up the height + -- needed for the bitamp. + self~ResizeItem(102, self~sizeX-40, (120 / self~factorY) + 2, "NOREDRAW") self~ShowItem(103) /* show scroll button */ self~ShowItem(203) @@ -112,7 +134,7 @@ self~EnableItem(112) /* asynchronuous scroll */ m = self~start("ScrollInButton",103,"This OODialog sample demonstrates dynamic dialog creation", , - "Arial", 36, "BOLD", 2,2,2,6) + "Arial", 36, "BOLD", 0,2,2,6) do while self~finished = 0 & m~completed = 0 self~HandleMessages end @@ -121,7 +143,7 @@ do while self~finished = 0 /* scroll asynchronously so scrolling can be interrupted when button is pressed */ m = self~start("ScrollInButton", 103, "... please press Bitmap-Viewer or Draw-Color-Demo buttons to run graphical applications ...", , - "Arial", 32, "SEMIBOLD", 7, 2,4) + "Arial", 32, "SEMIBOLD", 0, 2,4) do while self~finished = 0 & m~completed = 0 self~HandleMessages This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mie...@us...> - 2009-11-21 15:41:26
|
Revision: 5330 http://oorexx.svn.sourceforge.net/oorexx/?rev=5330&view=rev Author: miesfeld Date: 2009-11-21 15:41:14 +0000 (Sat, 21 Nov 2009) Log Message: ----------- Trivial formatting and copyright changes to the oograph.rex sample Modified Paths: -------------- main/trunk/samples/windows/oodialog/oograph.rex Modified: main/trunk/samples/windows/oodialog/oograph.rex =================================================================== --- main/trunk/samples/windows/oodialog/oograph.rex 2009-11-18 20:26:13 UTC (rev 5329) +++ main/trunk/samples/windows/oodialog/oograph.rex 2009-11-21 15:41:14 UTC (rev 5330) @@ -1,12 +1,12 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2006 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ /* distribution. A copy is also available at the following address: */ -/* http://www.oorexx.org/license.html */ +/* http://www.oorexx.org/license.html */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ @@ -36,7 +36,7 @@ /* */ /*----------------------------------------------------------------------------*/ /****************************************************************************/ -/* Name: OOGRAPH.REX */ +/* Name: OOGRAPH.REX */ /* Type: Object REXX Script */ /* */ /* Description: Graphical demonstration */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mie...@us...> - 2009-11-30 05:45:28
|
Revision: 5365 http://oorexx.svn.sourceforge.net/oorexx/?rev=5365&view=rev Author: miesfeld Date: 2009-11-30 05:45:20 +0000 (Mon, 30 Nov 2009) Log Message: ----------- More clean up of the oograph.rex example Modified Paths: -------------- main/trunk/samples/windows/oodialog/oograph.rex Modified: main/trunk/samples/windows/oodialog/oograph.rex =================================================================== --- main/trunk/samples/windows/oodialog/oograph.rex 2009-11-30 03:19:24 UTC (rev 5364) +++ main/trunk/samples/windows/oodialog/oograph.rex 2009-11-30 05:45:20 UTC (rev 5365) @@ -55,8 +55,8 @@ exit end - d~createCenter(770 / d~FactorX, 440 / d~FactorY, , - "Graphical Demonstration of Open Object Rexx and OODialog Capabilities") + title = "Graphical Demonstration of Open Object Rexx and OODialog Capabilities" + d~createCenter(trunc(770 / d~FactorX), trunc(470 / d~FactorY), title) d~execute("SHOWTOP") d~deinstall return @@ -71,8 +71,8 @@ ::method defineDialog expose but2size - but2pos = 160 / self~factorY - but2size = 300 / self~factorY + but2pos = trunc(170 / self~factorY) + but2size = trunc(300 / self~factorY) -- The two bitmap buttons are created larger than they need to be. In particular, -- The 102 button height is much larger, it covers most of the lower part of the @@ -86,89 +86,90 @@ -- appearance of scrolling from the right to the left, and the 102 button the appearance -- of scrolling from the bottom to the top. - self~createBitmapButton(101, 1, 10, self~sizeX-1, 130 / self~factorY, "USEPAL", , , "bmp\install.bmp") + self~createBitmapButton(101, 1, 10, self~sizeX-1, trunc(130 / self~factorY), "USEPAL", , , "bmp\install.bmp") self~createBitmapButton(102, 20, but2pos, self~sizeX - 20, but2size, , , , "bmp\install2.bmp") - pos = .Point~new(self~sizeX * self~factorX + 10, 0) + pos = .Point~new(trunc(self~sizeX * self~factorX) + 10, 0) self~setBitmapPosition(101, pos) - pos~x = -450 - pos~y = 100 + pos~x = 0 + pos~y = trunc(self~sizeY * self~factorY) + 10 self~setBitmapPosition(102, pos) -- Add the other controls. - self~createWhiteFrame(203, 10, self~SizeY - 52, self~sizeX-20, 28, "HIDDEN") - self~createPushButton(103, 12, self~SizeY - 50, self~sizeX-24, 24, "OWNER NOTAB") - self~createPushButtonGroup(self~sizeX-220, self~sizeY - 18,60,12, , - "&Bitmap-Viewer 111 BmpView &Draw-Color-Demo 112 OODraw &Cancel 2 CANCEL", 1, "DEFAULT") + self~createWhiteFrame(203, 10, self~SizeY - 62, self~sizeX - 20, 38, "HIDDEN") + self~createPushButton(103, 12, self~SizeY - 60, self~sizeX - 24, 34, "OWNER NOTAB") + groupArgs = "&Bitmap-Viewer 111 BmpView &Draw-Color-Demo 112 OODraw &Cancel 2 CANCEL" + self~createPushButtonGroup(self~sizeX - 220, self~sizeY - 18, 60, 12, groupArgs, 1, "DEFAULT") + ::method initDialog -- We set the background color of these buttons to the same backgroud color -- as the dialog, so that the buttons blend into the dialog. COLOR_BTNFACE = 15 - self~setItemSysColor(103, COLOR_BTNFACE) - self~setItemSysColor(101, COLOR_BTNFACE) - self~setItemSysColor(102, COLOR_BTNFACE) + self~setControlSysColor(103, COLOR_BTNFACE) + self~setControlSysColor(101, COLOR_BTNFACE) + self~setControlSysColor(102, COLOR_BTNFACE) ::method run unguarded expose m but2size - bmppos = but2size - 125 / self~FactorY - self~DisableItem(111) /* disable push buttons */ - self~DisableItem(112) - self~DisableItem(2) + bmppos = trunc(but2size - 125 / self~FactorY) + self~disableControl(111) /* disable push buttons */ + self~disableControl(112) + self~disableControl(2) ret = play("inst.wav", yes) -- Scroll the bitmaps from their displaced positions back to the upper left corners -- of the buttons. - self~ScrollBitmapFromTo(101, self~SizeX * self~FactorX, 5, 12, 5, -12, 0, 1) - self~ScrollBitmapFromTo(102, 30, bmppos, 30, 0, 0, -3, 2, 1) + self~scrollBitmapFromTo(101, trunc(self~SizeX * self~FactorX), 5, 12, 5, -12, 0, 1) + self~scrollBitmapFromTo(102, 30, bmppos, 30, 0, 0, -3, 2, 1) -- The size of the 102 button actually covers the controls under the button. If the -- user clicks on any portion of the button, the button is repainted in the 'depressed' -- state. Since the other controls are not repainted, this cause them (or parts of -- them) to disappear. To prevent that, we resize the button to only take up the height -- needed for the bitamp. - self~ResizeItem(102, self~sizeX-40, (120 / self~factorY) + 2, "NOREDRAW") + self~resizeControl(102, 450 + 32, 120 + 2, "NOREDRAW") - self~ShowItem(103) /* show scroll button */ - self~ShowItem(203) - self~EnableItem(2) /* Enable push buttons */ - self~EnableItem(111) - self~EnableItem(112) + self~showControl(103) /* show scroll button */ + self~showControl(203) + self~enableControl(2) /* Enable push buttons */ + self~enableControl(111) + self~enableControl(112) /* asynchronuous scroll */ m = self~start("ScrollInButton",103,"This OODialog sample demonstrates dynamic dialog creation", , "Arial", 36, "BOLD", 0,2,2,6) do while self~finished = 0 & m~completed = 0 - self~HandleMessages + self~handleMessages end - if m~completed = 0 then self~ScrollInButton(103) /* end scroll */ + if m~completed = 0 then self~scrollInButton(103) /* end scroll */ do while self~finished = 0 /* scroll asynchronously so scrolling can be interrupted when button is pressed */ - m = self~start("ScrollInButton", 103, "... please press Bitmap-Viewer or Draw-Color-Demo buttons to run graphical applications ...", , - "Arial", 32, "SEMIBOLD", 0, 2,4) + m = self~start("scrollInButton", 103, "... please press Bitmap-Viewer or Draw-Color-Demo buttons to run graphical applications ...", , + "Arial", 32, "SEMIBOLD", 0, 2, 4) do while self~finished = 0 & m~completed = 0 - self~HandleMessages + self~handleMessages end /* if still scrolling, end the scroll */ - if m~completed = 0 then self~ScrollInButton(103) + if m~completed = 0 then self~scrollInButton(103) end ::method BmpView /* invoke Bitmap Viewer OOBMPVU.REX */ expose m - if m~completed = 0 then self~ScrollInButton(103) - self~hideWindow(self~get) + if m~completed = 0 then self~scrollInButton(103) + self~hideWindow(self~hwnd) call "oobmpvu.rex" - self~~showWindow(self~get)~toTheTop - self~ScrollInButton(103) /* restart scrolling */ + self~~showWindow(self~hwnd)~toTheTop + self~scrollInButton(103) /* restart scrolling */ ::method OODraw /* Invoke Color Draw Demo OODRAW.REX */ expose m - if m~completed = 0 then self~ScrollInButton(103) - self~hideWindow(self~get) + if m~completed = 0 then self~scrollInButton(103) + self~hideWindow(self~hwnd) call "oodraw.rex" - self~~showWindow(self~get)~toTheTop - self~ScrollInButton(103) /* restart scrolling */ + self~~showWindow(self~hwnd)~toTheTop + self~scrollInButton(103) /* restart scrolling */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mie...@us...> - 2009-11-30 15:15:21
|
Revision: 5367 http://oorexx.svn.sourceforge.net/oorexx/?rev=5367&view=rev Author: miesfeld Date: 2009-11-30 15:15:08 +0000 (Mon, 30 Nov 2009) Log Message: ----------- More tweaks to the oograph.rex example Modified Paths: -------------- main/trunk/samples/windows/oodialog/oograph.rex Modified: main/trunk/samples/windows/oodialog/oograph.rex =================================================================== --- main/trunk/samples/windows/oodialog/oograph.rex 2009-11-30 15:01:05 UTC (rev 5366) +++ main/trunk/samples/windows/oodialog/oograph.rex 2009-11-30 15:15:08 UTC (rev 5367) @@ -138,38 +138,49 @@ self~enableControl(2) /* Enable push buttons */ self~enableControl(111) self~enableControl(112) - /* asynchronuous scroll */ - m = self~start("ScrollInButton",103,"This OODialog sample demonstrates dynamic dialog creation", , - "Arial", 36, "BOLD", 0,2,2,6) + + -- Asynchronuous scrolling text. + text = "This OODialog sample demonstrates dynamic dialog creation" + m = self~start("ScrollInButton", 103, text, "Arial", 36, "BOLD", 0, 2, 2, 6) do while self~finished = 0 & m~completed = 0 self~handleMessages end if m~completed = 0 then self~scrollInButton(103) /* end scroll */ do while self~finished = 0 - /* scroll asynchronously so scrolling can be interrupted when button is pressed */ - m = self~start("scrollInButton", 103, "... please press Bitmap-Viewer or Draw-Color-Demo buttons to run graphical applications ...", , - "Arial", 32, "SEMIBOLD", 0, 2, 4) + -- Scroll asynchronously so scrolling can be interrupted when button is pressed. + text = "... please press Bitmap-Viewer or Draw-Color-Demo buttons to run graphical applications ..." + m = self~start("scrollInButton", 103, text, "Arial", 32, "SEMIBOLD", 0, 2, 4) do while self~finished = 0 & m~completed = 0 self~handleMessages end - /* if still scrolling, end the scroll */ + -- If still scrolling, end the scroll. if m~completed = 0 then self~scrollInButton(103) end -::method BmpView /* invoke Bitmap Viewer OOBMPVU.REX */ +-- Invoke the Bitmap Viewer program (oobmpvu.rex.) +::method BmpView expose m + -- Pause the scrolling and hide ourself. if m~completed = 0 then self~scrollInButton(103) - self~hideWindow(self~hwnd) + self~hide + call "oobmpvu.rex" - self~~showWindow(self~hwnd)~toTheTop - self~scrollInButton(103) /* restart scrolling */ -::method OODraw /* Invoke Color Draw Demo OODRAW.REX */ + -- Show ourself and restart the scrolling. + self~~show~toTheTop + self~scrollInButton(103) + +-- Invoke the Color Draw Demo program (oodraw.rex.) +::method OODraw expose m + -- Pause the scrolling and hide ourself. if m~completed = 0 then self~scrollInButton(103) - self~hideWindow(self~hwnd) + self~hide + call "oodraw.rex" - self~~showWindow(self~hwnd)~toTheTop - self~scrollInButton(103) /* restart scrolling */ + + -- Show ourself and restart the scrolling. + self~~show~toTheTop + self~scrollInButton(103) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mie...@us...> - 2010-06-26 18:56:48
|
Revision: 6046 http://oorexx.svn.sourceforge.net/oorexx/?rev=6046&view=rev Author: miesfeld Date: 2010-06-26 18:56:42 +0000 (Sat, 26 Jun 2010) Log Message: ----------- ooDialog - Improve the oograph.rex example. Add better comments, don't over- ride the run() method, don't busy-wait, remove misleading method calls. Modified Paths: -------------- main/trunk/samples/windows/oodialog/oograph.rex Modified: main/trunk/samples/windows/oodialog/oograph.rex =================================================================== --- main/trunk/samples/windows/oodialog/oograph.rex 2010-06-26 02:22:16 UTC (rev 6045) +++ main/trunk/samples/windows/oodialog/oograph.rex 2010-06-26 18:56:42 UTC (rev 6046) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2010 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -35,32 +35,37 @@ /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*----------------------------------------------------------------------------*/ -/****************************************************************************/ -/* Name: OOGRAPH.REX */ -/* Type: Object REXX Script */ -/* */ -/* Description: Graphical demonstration */ -/* */ -/****************************************************************************/ - parse source . . me - mydir = me~left(me~lastpos('\')-1) /* where is code */ - env = 'ENVIRONMENT' - sp = value('SOUNDPATH',,env) - sp = value('SOUNDPATH',mydir'\WAV;'sp,env) +/** + * Name: oograph.rex + * Type: Open Object REXX Script + * + * Description: A dialog that allows the user to execute two graphical ooRexx + * examples. One example displays bitmaps and the other example + * shows how to use the drawing methods provided by ooDialog. + * + * The main program, this program, shows how to use the + * scrollBitmapFromTo() and scrollInButton() methods. + */ - d = .GraphDialog~new() - if d~InitCode \= 0 then do - say "Dialog init did not work" - exit - end + parse source . . me + mydir = me~left(me~lastpos('\')-1) /* where is code */ + env = 'ENVIRONMENT' + sp = value('SOUNDPATH', , env) + sp = value('SOUNDPATH', mydir'\WAV;'sp, env) - title = "Graphical Demonstration of Open Object Rexx and ooDialog Capabilities" - d~createCenter(trunc(770 / d~FactorX), trunc(470 / d~FactorY), title) - d~execute("SHOWTOP") - d~deinstall - return + d = .GraphDialog~new() + if d~initCode \= 0 then do + say "Dialog init did not work" + return d~initCode + end + title = "Graphical Demonstration of Open Object Rexx and ooDialog Capabilities" + d~createCenter(trunc(770 / d~FactorX), trunc(470 / d~FactorY), title) + d~execute("SHOWTOP") + + return 0 + /*-------------------------------- requires --------------------------*/ ::requires "ooDialog.cls" @@ -80,11 +85,11 @@ -- -- Then, the bitmaps for the buttons are positioned (moved from the upper left corner -- of the button) by a large amount. The 101 button is positioned far to the right, - -- and the 102 button is positioned far to the bottom and far to the left. In the run() - -- method, scrollBitmapFromTo() is used to scroll the bitmaps from their positions back - -- to the upper left corner of the buttons. This gives the bitmaps the 101 button the - -- appearance of scrolling from the right to the left, and the 102 button the appearance - -- of scrolling from the bottom to the top. + -- and the 102 button is positioned far to the bottom and far to the left. In the + -- showInterface() method, scrollBitmapFromTo() is used to scroll the bitmaps from + -- their positions back to the upper left corner of the buttons. This gives the 101 + -- button the appearance of scrolling from the right to the left, and the 102 button + -- the appearance of scrolling from the bottom to the top. self~createBitmapButton(101, 1, 10, self~sizeX-1, trunc(130 / self~factorY), "USEPAL", , , "bmp\install.bmp") self~createBitmapButton(102, 20, but2pos, self~sizeX - 20, but2size, , , , "bmp\install2.bmp") @@ -100,7 +105,7 @@ self~createWhiteFrame(203, 10, self~SizeY - 62, self~sizeX - 20, 38, "HIDDEN") self~createPushButton(103, 12, self~SizeY - 60, self~sizeX - 24, 34, "OWNER NOTAB") - groupArgs = "&Bitmap-Viewer 111 BmpView &Draw-Color-Demo 112 OODraw &Cancel 2 CANCEL" + groupArgs = "&Bitmap-Viewer 111 bitmapViewer &Draw-Color-Demo 112 ooDraw &Cancel 2 CANCEL" self~createPushButtonGroup(self~sizeX - 220, self~sizeY - 18, 60, 12, groupArgs, 1, "DEFAULT") ::method initDialog @@ -112,9 +117,13 @@ self~setControlSysColor(101, COLOR_BTNFACE) self~setControlSysColor(102, COLOR_BTNFACE) -::method run unguarded + self~start("showInterface") + +::method showInterface unguarded expose m but2size + bmppos = trunc(but2size - 125 / self~FactorY) + self~disableControl(111) /* disable push buttons */ self~disableControl(112) self~disableControl(2) @@ -139,48 +148,72 @@ self~enableControl(111) self~enableControl(112) - -- Asynchronuous scrolling text. + -- Start the Asynchronuous scrolling of the introductory text. text = "This ooDialog sample demonstrates dynamic dialog creation" m = self~start("ScrollInButton", 103, text, "Arial", 36, "BOLD", 0, 2, 2, 6) - do while self~finished = 0 & m~completed = 0 - self~handleMessages - end - if m~completed = 0 then self~scrollInButton(103) /* end scroll */ + m~notify(.message~new(self, "scrollingFinished")) - do while self~finished = 0 - -- Scroll asynchronously so scrolling can be interrupted when button is pressed. + -- Now, wait until the scrolling finishes, or the user closes the main dialog. + self~waitForEvent + + -- While the user has not closed the dialog, scroll the instruction text. + do while \ self~finished text = "... please press Bitmap-Viewer or Draw-Color-Demo buttons to run graphical applications ..." m = self~start("scrollInButton", 103, text, "Arial", 32, "SEMIBOLD", 0, 2, 4) + m~notify(.message~new(self, "scrollingFinished")) - do while self~finished = 0 & m~completed = 0 - self~handleMessages - end - -- If still scrolling, end the scroll. - if m~completed = 0 then self~scrollInButton(103) + self~waitForEvent end +-- Wait until the haveEvent object variable turns .true. In this program we just +-- watch for two events, the scrolling text has finished, or the user has closed +-- the dialog. +::method waitForEvent unguarded + expose haveEvent + + haveEvent = .false + guard on when haveEvent + +-- This is the notification method for the scrolling text. It is invoked when +-- the scrollInButton() method has finished. The haveEvent object variable is +-- set to true which causes ourself to stop waiting. +::method scrollingFinished unguarded + expose haveEvent + haveEvent = .true + +-- leaving() is invoked by the ooDialog framework when the underlying dialog is +-- closed. It serves as a notification that the dialog is finished. The default +-- implementation does nothing. It can be, and if meant to be, over-ridden by +-- the programmer when desired. We use it to signal ourself to stop waiting by +-- setting haveEvent to true. +::method leaving unguarded + expose haveEvent + haveEvent = .true + + -- Invoke the Bitmap Viewer program (oobmpvu.rex.) -::method BmpView +::method bitmapViewer expose m - -- Pause the scrolling and hide ourself. - if m~completed = 0 then self~scrollInButton(103) + + -- Stop the scrolling and hide ourself. + if \ m~completed then self~scrollInButton(103) self~hide call "oobmpvu.rex" - -- Show ourself and restart the scrolling. + -- Show ourself and become the topmost. self~~show~toTheTop - self~scrollInButton(103) -- Invoke the Color Draw Demo program (oodraw.rex.) -::method OODraw +::method ooDraw expose m - -- Pause the scrolling and hide ourself. + + -- Stop the scrolling and hide ourself. if m~completed = 0 then self~scrollInButton(103) self~hide call "oodraw.rex" - -- Show ourself and restart the scrolling. + -- Show ourself and become the topmost. self~~show~toTheTop - self~scrollInButton(103) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |