| View previous topic :: View next topic |
| Author |
Message |
Plastic Guest
|
Posted: Fri Mar 07, 2008 3:49 pm Post subject: a simple but hard GUI ? for gifted binary minds... |
|
|
Hello, I have been stumped trying to get this working at all. Can you figure this out? Please generate a simple GUI, that when pumped with specs like:
INPUT_W_START=300
INPUT_H_START=350
INPUT_W_END=425
INPUT_H_END=496
Will enable enlargement and shrinkage of the GUI (please note: proportionally), but will not let it grow or shrink past the START & END points specified. This logic assumes the dimensions inputed are congruent/proportional to each other (which #'s those are proportional) Can someone or anyone make this one work? Thank you very much if you can. |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Fri Mar 07, 2008 3:56 pm Post subject: |
|
|
| Am I correct that you want to keep a fixed aspect ratio scaling of the window within a min/max boundery? |
|
| Back to top |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 319
|
Posted: Fri Mar 07, 2008 3:59 pm Post subject: |
|
|
| IMHO anyway this would require interception of WinAPI internal WM_SIZE message and subclassing of the GUI window, there should be some examples in other languages for sure |
|
| Back to top |
|
 |
Plastic Guest
|
Posted: Fri Mar 07, 2008 6:08 pm Post subject: |
|
|
Cool, yes Bobo, this is correct!  |
|
| Back to top |
|
 |
Plastic Guest
|
Posted: Sat Mar 08, 2008 7:49 am Post subject: |
|
|
| Can anyone perform this stunt? |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5887
|
Posted: Sat Mar 08, 2008 9:58 am Post subject: |
|
|
| Plastic wrote: | | Can anyone perform this stunt? |
Maybe you were referring to a non-ahk GUI ?
| Code: | Gui +Resize +MinSize300x350 +MaxSize425x496
Gui, Show, w300 h350
Return
GuiSize:
Gui, Show,, % " GuiSize : " A_GuiWidth "x" A_GuiHeight
; Further handling goes here
Return
GuiClose:
ExitApp |
 |
|
| Back to top |
|
 |
Plastic Guest
|
Posted: Sat Mar 08, 2008 11:11 am Post subject: |
|
|
Ah, very excellent, but this only addresses 1 of the factors. The GUI does indeed stay put within the MIN and MAX... however, the ultimate goal is to see if anyone can make it do that + keep the proportions aligned, so, I.E., if the box WIDTH only was stretched, the height would magically follow in sync-step See what I mean?  |
|
| Back to top |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 319
|
Posted: Sat Mar 08, 2008 11:21 am Post subject: |
|
|
| I think you can do it, just google for some examples in VB or C |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5887
|
Posted: Sat Mar 08, 2008 11:23 am Post subject: |
|
|
| Plastic wrote: | | See what I mean? |
| Code: | | ; Further handling goes here |
See what I mean?
Related:
 |
|
| Back to top |
|
 |
Plastic Guest
|
Posted: Sat Mar 08, 2008 1:10 pm Post subject: |
|
|
It must be too hard for AHK? What are these examples in foreign languages? I can't see why nobody can do this.... it is just a fixed element right?  |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5887
|
Posted: Sat Mar 08, 2008 1:16 pm Post subject: |
|
|
| Plastic wrote: | I can't see why nobody can do this....  |
I have given you a starting point - so, why do not you put some efforts and see how hard it is .. and maybe you can post your non-working code .. so others can continue from there.
 |
|
| Back to top |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 319
|
Posted: Sat Mar 08, 2008 1:42 pm Post subject: |
|
|
be the first to implement this in AHK  |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Mar 08, 2008 2:24 pm Post subject: |
|
|
| Plastic wrote: | | It must be too hard for AHK? |
No, just not interesting enough. Hook/OnMessage on WM_WINDOWPOSCHANGING. |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Mar 09, 2008 3:35 am Post subject: |
|
|
| Anonymous wrote: | | Hook/OnMessage on WM_WINDOWPOSCHANGING. |
The rigorous way may be using WM_NCCALCSIZE, but it can be a lot more tedious. |
|
| Back to top |
|
 |
Plastic Guest
|
Posted: Sun Mar 09, 2008 2:50 pm Post subject: |
|
|
There doesn't seem to be much info. out there on those commands. I am fairly new at Win API accessing... but those appear like a solution. So what is going on with those commands -- are we hooking into a general GUI, and forcing it to calculate to a proportional resize? Sorry if I seem confused, trying to get some learning experience here and make this work.  |
|
| Back to top |
|
 |
|