Inner size of a Gadget

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by alizta.

at least for things like panels... try to write dynamical resizeing without... impossible... you might try to calculate yourself, but that is *very* difficult. the user could have changed windows settings, so that Panel Headers are bigger or smaller, or he yould use WinXP/Luna Mode...



---when all you have is a hammer, everything starts to look like a nail... ---
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by alizta

at least for things like panels... try to write dynamical resizeing without... impossible... you might try to calculate yourself, but that is *very* difficult. the user could have changed windows settings, so that Panel Headers are bigger or smaller, or he yould use WinXP/Luna Mode...
Calculating sizes yourself is easy (well, sort of :) but you have to make some assumptions, especially under Windows. In my experience a lot of the sizes seem to be fixed, although I don't have XP or any other skinning tools.

There is no way to get Windows controls to tell you their sizes before you create them, but they are usually flexible enough to resize after you create them.

I don't know about Linux in this respect.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.50)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> try to write dynamical resizeing without... impossible...

Not impossible at all:

viewtopic.php?t=3700
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by alizta.

ratios will not work for me. still i got the resizing to work properly and to my surprise, it did not make any difference if it was run in luna. still i calculate positions now like ThisGadgetHeight - EstimatedStatusbarHeight and so on... if even one of this settings is changed, it will cease to work.
For work i used to code in PowerBuilder and it had the feature of retrieving the space you realy have to work with. A feature like that would make things easier, since now i have to find a way of getting *every* system setting which might have an effect on Panelheaders, Statusbars etc wich wil be a lot of work (if it is even possible to get these information).

---when all you have is a hammer, everything starts to look like a nail... ---
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> it did not make any difference if it was run in luna.

What is this "luna" mode?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by alizta.


the skinned gui of winXP is called luna.


---when all you have is a hammer, everything starts to look like a nail... ---
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by alizta

the skinned gui of winXP is called luna.
Would you be able to download and test a small program I wrote with Luna on WinXP? It uses my GUI layout code and I would like to hear how well/badly it performs under those conditions where you say inner gadget sizes are different from older versions of Windows.

At the moment it cannot handle status bars - I was looking at those the other day and from my API docs it seems there is no way to find out how big a status bar (or any other Windows gadget) will be drawn until you actually create it, and then you can measure it's size.

Anyway, if you would like to check it, the file is ->http://www.david-mcminn.co.uk/files/layout_demo.zip<-

--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by alizta.

i'm coding under xp as well. just switch to 'classic mode'. there are people out there who claim that xp's classic mode is just a skin for luna, but this is not true. it will behave in 'classic mode' like it will behave on NT/2k or 9x.
my problem is: you can change fontsizes which enlargens Panelheaders, you can change the size of scrollbars, etc all of which can affect the innersize of something as a panelgadget.

---when all you have is a hammer, everything starts to look like a nail... ---
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by alizta.

just tried your program anyway. resizes well on my system.
i tried my program and experimented a little.
if you have an exact layout of widgets boarding directly to each other there is following problem: if your program has a menu and the fontsize of the menu is changed, your resizing code will not work properly.

---when all you have is a hammer, everything starts to look like a nail... ---
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by alizta

other there is following problem: if your program has a menu and the fontsize of the menu is changed, your resizing code will not work properly.
The MenuHeight() command should tell you how big a menu bar will be (and you can call it before you open a window). I think there is also a Windows message that gets sent to applications when the font size changes, so you may be able to detect that and change the size and positions of your gadgets accordingly.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by alizta.


thanks a lot. i hadn't seen that there was something like menuheigh().
this will make things for me much easyer.

---when all you have is a hammer, everything starts to look like a nail... ---
Post Reply