AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

a simple but hard GUI ? for gifted binary minds...
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Plastic
Guest





PostPosted: Fri Mar 07, 2008 3:49 pm    Post subject: a simple but hard GUI ? for gifted binary minds... Reply with quote

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) Smile Can someone or anyone make this one work? Very Happy Thank you very much if you can.
Back to top
BoBoĻ
Guest





PostPosted: Fri Mar 07, 2008 3:56 pm    Post subject: Reply with quote

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

PostPosted: Fri Mar 07, 2008 3:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Plastic
Guest





PostPosted: Fri Mar 07, 2008 6:08 pm    Post subject: Reply with quote

Cool, yes Bobo, this is correct! Smile
Back to top
Plastic
Guest





PostPosted: Sat Mar 08, 2008 7:49 am    Post subject: Reply with quote

Can anyone perform this stunt?
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 5887

PostPosted: Sat Mar 08, 2008 9:58 am    Post subject: Reply with quote

Plastic wrote:
Can anyone perform this stunt?


Maybe you were referring to a non-ahk GUI ? Rolling Eyes

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


Smile
Back to top
View user's profile Send private message
Plastic
Guest





PostPosted: Sat Mar 08, 2008 11:11 am    Post subject: Reply with quote

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 Smile See what I mean? Shocked
Back to top
wOxxOm



Joined: 09 Feb 2006
Posts: 319

PostPosted: Sat Mar 08, 2008 11:21 am    Post subject: Reply with quote

I think you can do it, just google for some examples in VB or C
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 5887

PostPosted: Sat Mar 08, 2008 11:23 am    Post subject: Reply with quote

Plastic wrote:
See what I mean?


Code:
; Further handling goes here


See what I mean? Wink

Related:



Smile
Back to top
View user's profile Send private message
Plastic
Guest





PostPosted: Sat Mar 08, 2008 1:10 pm    Post subject: Reply with quote

It must be too hard for AHK? What are these examples in foreign languages? Very Happy I can't see why nobody can do this.... it is just a fixed element right? Smile Wink
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 5887

PostPosted: Sat Mar 08, 2008 1:16 pm    Post subject: Reply with quote

Plastic wrote:
I can't see why nobody can do this.... Wink


Rolling Eyes

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.

Smile
Back to top
View user's profile Send private message
wOxxOm



Joined: 09 Feb 2006
Posts: 319

PostPosted: Sat Mar 08, 2008 1:42 pm    Post subject: Reply with quote

be the first to implement this in AHK Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest






PostPosted: Sat Mar 08, 2008 2:24 pm    Post subject: Reply with quote

Plastic wrote:
It must be too hard for AHK?

No, just not interesting enough. Hook/OnMessage on WM_WINDOWPOSCHANGING.
Back to top
Guest






PostPosted: Sun Mar 09, 2008 3:35 am    Post subject: Reply with quote

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





PostPosted: Sun Mar 09, 2008 2:50 pm    Post subject: Reply with quote

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? Very Happy Sorry if I seem confused, trying to get some learning experience here and make this work. Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group