` Using Notify to help open multiple docked toolboxes (Jim Gambon) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Clarion in general: Using Notify to help open multiple docked toolboxes
2004-04-17 -- Jim Gambon
 
Newsgroups: comp.lang.clarion,softvelocity.clarion.language > Maybe I'm a bit slow here on a Friday PM, but I'm not seeing how to > change the code to accomplish what was easily done in C55: Here are some step. You are right, it was much easier in C55, and if they add some MDI Open syncronization code to the RTL you won't have to do this. This, however, is what Windows "Event Driven Programming" is all about, and I guess we have been spoiled . Still, that's why we use a higher level "business" language like Clarion, instead of "C". The trick is to have each toolbox tell the frame it is open, and it's OK to start another toolbox. 1) In the apps Global data set up a LONG to hold the AppFrame Thread, and an equate to be the Notify code. Like this: glo:AppFrameThread LONG Notify:ToolBoxStart EQUATE(1) ! It doesn't have to be "1" 2) In the frame procedure set up a local variable to be ToolBox start switch, and initialize it to zero. Also, set up a variable to hold the received Notify Code: ToolboxSwitch LONG(0) ReceivedNotify LONG 3) In the Event:OpenWindow handler of the Frame set the AppFrameThread value, and send a notify to the frame to start a toolbox. Like this: glo:AppFrameThread = THREAD() NOTIFY(Notify:ToolBoxStart) 4) In the Event handler for the window set up a handler for the EVENT:Notify that increments the ToolBoxSwtich, tests the value of the ToolBoxSwitch, and starts a toolbox. Like this: IF EVENT() = EVENT:Notify NOTIFICATION(ReceivedNotify) IF ReceivedNotify = Notify:ToolBoxStart ToolboxSwitch +=1 CASE ToolboxSwitch OF 1 IF L:ReportToolbar POST(EVENT:Accepted,?L:ReportToolbar) END OF 2 IF L:StoreroomToolbar POST(EVENT:Accepted,?L:StoreroomToolbar) END OF 3 IF L:ApplicantToolbar POST(EVENT:Accepted,?L:ApplicantToolbar) END OF 4 IF L:FinanceToolbar POST(EVENT:Accepted,?L:FinanceToolbar) END OF 5 IF L:ReceptionToolbar POST(EVENT:Accepted,?L:ReceptionToolbar) END OF 6 IF L:RoomToolbar POST(EVENT:Accepted,?L:RoomToolbar) END ELSE ! NOP - We are done END !CASE END !IF END !IF 5) In the Event:OpenWindow handler of each toolbox tell the Frame it has started. When the AppFrame receives this message it will increment the ToolBoxSwitch, and start another toolbox. Like this: NOTIFY(Notify:ToolBoxStart,glo:AppFrameThread) You can extend this idea by saving the toolbox thread numbers and letting the AppFrame tell the toolbox to do certain thing (like refresh, or close, or whatever.) Good luck with it. Let me know if this was clear, and actually helps out. Regards, Jim


Today is April 16, 2024, 4:25 am
This article has been viewed 35112 times.
Google search has resulted in 9 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: