` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

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

Par2: Snappier window repaints
1999-06-12 -- Jerry Norman
 
1. My overall approach is to hide a window during the time that Clarion is painting it, then unhide it so that it appears to "snap" onto the window. I learned it is necessary to hide (or close) the last child window after opening a new child window. Otherwise, the underlying window can be seen during resize activity and when you close your application, and it needs to be closed anyway before it can be reselected. This is because when Clarion opens a new window it doesn't go straight to the maximized state - it first paints in a normal size and then expands to the maximized state. BTW, for this application I am limiting my child windows to a single thread each. 2. To accomplish the hiding on initial load I put Self{PROP:Hide} = True in the ThisWindow.Init embed directly after Open the window. Note this does not work for an existing window that you are reselecting. I take care of that in 4 below. 3. Then, in ThisWindow.TakeSelected embed I put POST(Event:GainFocus,,,) after the parent call. 4. In the WindowEvents GainFocus embed (priority 5000) I put the following: Self{PROP:Maximize} = True IF glo:Thread:BrwNte SETTARGET(,glo:Thread:BrwNte) TARGET{PROP:Hide} = True END IF glo:Thread:BrwBus SETTARGET(,glo:Thread:BrwBus) TARGET{PROP:Hide} = True END SETTARGET(,glo:Thread:BrwPrj) Elsewhere, when I open a child window I assign the thread() to the appropriate glo:Thread variable, or if it is already open I post a GainFocus event to the thread. The above code hides whichever window is being overlaid by this newly selected window. I orginally thought I could just hide a window when it lost focus but this creates interesting results when the user selects another window outside your application . Note that there is no Self{PROP:Hide} = False. This is because PROP:Maximize does an implicit unhide (not sure why). I had to use PROP:Maximize because even though the child windows had the MAX attribute set, Clarion doesn't always maintain that state when you are resizing the window. I also found that some of the events I tried seemed inconsistent in there implementation. For example, I expected Maximized to fire anytime the window changed to the Maximized state but sometimes it doesn't.


Today is November 21, 2024, 6:54 am
This article has been viewed 35206 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: