Jump to content

change gui size without controls changing size


jennico
 Share

Recommended Posts

hi there,

scripting a game for my son i want to create the following:

a resizable window with a certain amount of picture controls. the picture controls shall keep their size while the window size is being changed. if the controls don't fit the windows, i want scroll bars to take effect.

using the forum help i found out how to make a resizable window with scroll bars :BitOr($WS_POPUP, $WS_HSCROLL, $WS_VSCROLL, $WS_MAXIMIZEBOX, $WS_CAPTION, $WS_SYSMENU, $WS_MINIMIZEBOX, $WS_THICKFRAME).

but:

- the scroll bars don't do anything and

- on changing the window size the controls are resized, too. i want to keep them stable.

how can i realize this ?

thanx for your constant help here !

j.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

I've had the same problem with the resizing controls before... but i just used GUICtrlSetPos() to fix that, since i only had 2 controls in that particular case. For the scrollbars, look here.

If you're creating a game, you should also check out prospeed, It has MANY image effects and other stuff, but you'd probably be interested in its scrolling background feature.

Also, you may want to look at this.

Link to comment
Share on other sites

well, i have to follow the links and read a lot.

then, for the GUICtrlSetPos(): do i have to put it into the msg loop, because the ctrl position has to be checked all the time ? this seems a little bit inefficient to me and will cause flickering, or not ?

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

Well, to tell the truth, I didn't have my window resizable like yours is...I had 3 menu options that change the size of the GUI, and at the same time, change the size/position of the controls. It was actually for a pong game i tried to make a while ago, but i never finished so there are a lot of blank functions and stuff :shocked: I never even got the balls/paddles...

Because the code is sorta long (not even 200 lines, but still ) I decided to put in in an attachment.

pong.au3

Link to comment
Share on other sites

isn't there a better way to keep the controls stable ? i don't think it makes sense to reset the size and position of 600 controls in an infinite loop. the effort is too big.

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

isn't there a better way to keep the controls stable ? i don't think it makes sense to reset the size and position of 600 controls in an infinite loop. the effort is too big.

j.

Look into AutoIt helpfile at GUICtrlSetResizing()

It's exactly what you need.

EDIT: especially $GUI_DOCKSIZE

Edited by Zedna
Link to comment
Share on other sites

yes !

this seems to be right !

thanx j.

Edit: GUICtrlSetResizing(-1,$GUI_DOCKALL) does it !

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

hi again,

having read and tested the scrollable gui scripts by gafrost and holger i have to admit that i am shocked.

none of those scripts work properly.

isn't there a better way to add scrollbars to a gui meanwhile ?

j.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...