AutoHotkey Community

It is currently May 26th, 2012, 6:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: March 7th, 2008, 3:49 pm 
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? :D Thank you very much if you can.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2008, 3:56 pm 
Am I correct that you want to keep a fixed aspect ratio scaling of the window within a min/max boundery?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2008, 3:59 pm 
Offline

Joined: February 9th, 2006, 8:36 pm
Posts: 338
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2008, 6:08 pm 
Cool, yes Bobo, this is correct! :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 7:49 am 
Can anyone perform this stunt?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 9:58 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Plastic wrote:
Can anyone perform this stunt?


Maybe you were referring to a non-ahk GUI ? :roll:

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


:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 11:11 am 
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? :shock:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 11:21 am 
Offline

Joined: February 9th, 2006, 8:36 pm
Posts: 338
I think you can do it, just google for some examples in VB or C


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 11:23 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Plastic wrote:
See what I mean?


Code:
; Further handling goes here


See what I mean? ;)

Related:



:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 1:10 pm 
It must be too hard for AHK? What are these examples in foreign languages? :D I can't see why nobody can do this.... it is just a fixed element right? :) ;)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 1:16 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Plastic wrote:
I can't see why nobody can do this.... ;)


:roll:

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.

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 1:42 pm 
Offline

Joined: February 9th, 2006, 8:36 pm
Posts: 338
be the first to implement this in AHK :-D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2008, 2:24 pm 
Plastic wrote:
It must be too hard for AHK?

No, just not interesting enough. Hook/OnMessage on WM_WINDOWPOSCHANGING.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2008, 3:35 am 
Anonymous wrote:
Hook/OnMessage on WM_WINDOWPOSCHANGING.

The rigorous way may be using WM_NCCALCSIZE, but it can be a lot more tedious.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2008, 2:50 pm 
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? :D Sorry if I seem confused, trying to get some learning experience here and make this work. :D


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: bobbysoon, kkkddd1, Tipsy3000, Yahoo [Bot] and 78 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group