It is currently Mon May 25, 2020 10:15 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject:
PostPosted: Thu Jan 10, 2002 8:51 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by tinman.

Hi,

I have a few questions relating to application programming and things
to do with windows (actual windows, not the OS).

1) How do you find out the size of the desktop?

2) What strategy is best used for creating re-sizable GUIs? On the
Amiga, if the gui was resized, you'd get a message, free all the
gadgets and the recreate them taking the new window sizes into
account. Is this the same steps you need to do under Windows, or is
there a better way?

3) How do you find out things like size of the default font, title
bars and so forth?

Thanks!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jan 10, 2002 10:07 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by tranquil.

Quote:
1) How do you find out the size of the desktop?



Use this:

height=getsystemmetrics_(#SM_CYSCREEN)
width=getsystemmetrics_(#SM_CXSCREEN)

But next, please use the "Search"-function above, there is a topic about it in the Tips & Tricks Thread. :)

Quote:

2) What strategy is best used for creating re-sizable GUIs? On the
Amiga, if the gui was resized, you'd get a message, free all the
gadgets and the recreate them taking the new window sizes into
account. Is this the same steps you need to do under Windows, or is
there a better way?



I do this all in one Procedure using the ResizeGadget command.
It looks something like:


Procedure SizeCallback(WindowID, Message, lParam, wParam)
Shared winw,winh
If Message = #WM_SIZE
;
winw = WindowWidth() : winh = WindowHeight()
If winw < 600 : winw = 602 : EndIf
If winh < 300 : winh = 303 : EndIf
;
ResizeGadget (0,0,0,winw-10,winh-70)
ResizeGadget ( 1, 4, 140, winw-20, winh-240)
ResizeGadget ( 2, 10, 10, winw-40, winh-310)
ResizeGadget ( 3, 10, winh-293, 100, 20)
UpdateStatusBar (0)
;
UpdateWindow_(WindowID())
EndIf
EndProcedure

SetWindowCallback(@SizeCallback())

Quote:
3) How do you find out things like size of the default font, title
bars and so forth?


No Idea yet, but should be possible to solve this with some API Commands. Please take a look into the Tips & Tricks Section, there you can find some Links to good API Reference Sources.

Hope that helps a bit.

bye

Mike

Tranquilizer/ Secretly!
Registred PureBasic User


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye