forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hello ClearWin+
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
jjgermis



Joined: 21 Jun 2006
Posts: 404
Location: Nürnberg, Germany

PostPosted: Thu Jan 20, 2011 11:11 am    Post subject: Reply with quote

Eddie, thanks for the tipp on the handle thread.

I am making good progress in using the FTN95.CHM. However, if I look at the following example
Code:
winapp
  integer :: i,winio@
  external cb_help
  i=winio@('%ww&')
  i=winio@('%mn[Help]',cb_help)
end

integer function cb_help()
  integer i,winio@
  i=winio@('%ca[About Number Factoriser]&')
  i=winio@('%fn[Times New Roman]%ts%bf%cnTutorial&',2.0D0)
  i=winio@('%2nl%cn%9`bt[OK]')
  cb_help=1
  return
end

I must have two handles when the help window appears. In this case (I assume) that ClearWin+ automatically takes care that only the help is active. If I would like to override this situation I need the do something with the window handles. A simple example would do the thing - if someone can point me to that in the documentation. As soon as I press OK the main window is active again.



Uploaded with ImageShack.us
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1670
Location: Yateley, Hants, UK

PostPosted: Thu Jan 20, 2011 5:10 pm    Post subject: Reply with quote

The About box as programmed is modal - nothing else in the program is clickable, including the other windows, while this is on the screen. Other programs are accessible. Sure, the About box does have a handle, but it is hidden from you, because you have not provided a variable for it to be given to you. Actually, other things have handles (Windows handles that is) including the OK button. Again, you don't need to know those handles, and you haven't any way of accessing them.

Now with the way that the About box is shown, the only way to shut it is with the Close box (red cross, top right on the caption bar) OR the OK button. If you press the red cross, WINIO@ returns 0, if you press the button, WINIO@ returns 1. In neither case do you care about these values: the About box (window) will just disappear, and you will return control to the window it was called from. Sometimes you are concerned how the user exited the Window, and you can test the value returned (it is in the variable IA (say) as in

Code:
IA = WINIO@ ('   format codes  ')


for the last WINIO@ call in the sequence.

If you want to have the (windows) handle to a window, then use %hw to give it to you, and provide an integer to hold it - the handle is an integer. If you want the (windows) handle for the OK button, then use %lc to send it to you, and again provide an integer to hold it.

If you used 16-bit Windows, you will remember the "shortage of resources" messages. This was because the total number of unique 16-bit numbers available for handles was small. In 32-bit windows the total number is large.

If you repeatedly open and close the About box, Windows will generate and discard handles for it (and for the OK button). Each time, it is possible the numbers (handle values) are different.

These handles are Windows handles. For this use, you do not need to know what any of the handles are.

If you want to give the About box a life of its own, then use %lw (leave window) and provide an integer variable to control the window. THis is NOT a handle. However, if you change the value of the variable, then you can force the Window to close. This does mean that the particular variable needs to be in COMMON (etc) so that you can change its value when you want to shut the Window.

Note that although the buttons can have callbacks, the Close box cannot have a callback defined through WINIO@. A callback allows you to keep the window open after a button has been pressed, or close it after the callback code has been executed. The only way to do something similar for the Close box is to have a %cc code (which ALWAYS has its own callback) - or use %`cc which is similar but subtly different.

Eddie
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1670
Location: Yateley, Hants, UK

PostPosted: Thu Jan 20, 2011 5:19 pm    Post subject: Reply with quote

I forgot. A very useful thing in an About box is an image. One of the images you can use is a "standard icon", which you get by using the %si format code. If you have moved on from Windows XP, then stylistically this goes on the left of the About box, with text to the right. Maybe it is worth using %ob ... %cb to get these lined up, and because you don't want to see the boxes, make them %ob[invisible]. In XP and before, the standard icon goes on the top usually. I suppose this reflects the general move from 4:3 aspect ratio screens to 16:10 or 16:9 wide screens.

Of course, you can draw your own bitmap, reflecting your firm's logo, or the program branding. Perhaps this is a little advanced!

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group