Gui, Show first time bigger than screen size?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Scoox
Posts: 99
Joined: 11 May 2014, 09:12
Location: China

Gui, Show first time bigger than screen size?

15 Sep 2018, 04:06

Quick question:

My display is 2376 pixels wide. I'm able to display a GUI that's wider than 2376 pixels if I explicitly define its width thus:

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Margin, 15, 15
Gui, Add, Edit, w3000
Gui, Show, w3200 ;<<<


However, the following code shows a GUI that's 2376 pixels wide, which seems wrong because the help file says: "If there is no previous size, the window will be auto-sized according to the size and positions of the controls it contains."

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Margin, 15, 15
Gui, Add, Edit, w3000
Gui, Show


The following code also shows a GUI that's 2376 pixels wide, which seems even wronger because you I'm explicitly telling it to autosize:

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Margin, 15, 15
Gui, Add, Edit, w3000
Gui, Show, Autosize ;<<<


I'm currently using the following code as a workaround:

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Margin, 15, 15
Gui, Add, Edit, w3000
Gui, Show ;<<<
Gui, Show, Autosize ;<<<


Am I misinformed? Thanks
garry
Posts: 1419
Joined: 22 Dec 2013, 12:50

Re: Gui, Show first time bigger than screen size?

15 Sep 2018, 05:15

no answer , just idea , GUI example depending screensize % ( e.g. FHD-1920*1080 or 4K-3840*2160 )

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
Scoox
Posts: 99
Joined: 11 May 2014, 09:12
Location: China

Re: Gui, Show first time bigger than screen size?

15 Sep 2018, 05:21

@garry In my case the problem is that my GUI has to be physically big because it relies on small clickable areas on an image. If it's too small, it becomes too difficult to aim for these areas. I plan to run my script on a bigger screen but I'm currently on the road and only have my small laptop to work with.

Just wondering whether this is a bug or a feature, and if it's a feature then I'm obviously misreading it.
just me
Posts: 5459
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Gui, Show first time bigger than screen size?

15 Sep 2018, 10:47

Scoox wrote:... which seems wrong because the help file says: "If there is no previous size, the window will be auto-sized according to the size and positions of the controls it contains."

From my experience that's not true. If you don't specify the GUI's width or height, AHK apparently restricts it to the width or height of the primary monitor's working area.
lexikos
Posts: 6129
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Gui, Show first time bigger than screen size?

16 Sep 2018, 00:13

Yes, AutoHotkey limits the automatic size to the width and height determined via SystemParametersInfo(SPI_GETWORKAREA, 0, &work_rect, 0);, but...
Chris wrote:// Seems best to restrict window size to the size of the desktop whenever explicit sizes
// weren't given, since most users would probably want that. But only on first use of
// "Gui Show" (even "Gui, Show, Hide"):
So...

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Margin, 15, 15
Gui, Add, Edit, w3000
Gui, Show, Hide ; First use
Gui, Show, AutoSize ; Second use


Windows also prevents windows from becoming (much?) larger than the virtual screen, but not with complete consistency. For instance, if I make the window resizable, attempting to resize it limits it to 1942 pixels wide with my 1920x1080 screen.
Scoox wrote:In my case the problem is that my GUI has to be physically big because it relies on small clickable areas on an image. If it's too small, it becomes too difficult to aim for these areas. I plan to run my script on a bigger screen but I'm currently on the road and only have my small laptop to work with.
I don't think that explains why you need the GUI to be larger than your screen. You can't see what's not on the screen. I'd guess that you move the window around in order to view different parts of the image, but I think allowing the image to scroll or move within the GUI would make more sense and be easier to use (it just wouldn't be as easy to implement).

One way would be to allow dragging the picture with the mouse. You can detect left-click by monitoring WM_LBUTTONDOWN with OnMessage, or use a hotkey, and then monitor the mouse position with a timer or loop and move the control within the GUI correspondingly.
User avatar
Scoox
Posts: 99
Joined: 11 May 2014, 09:12
Location: China

Re: Gui, Show first time bigger than screen size?

16 Sep 2018, 13:19

Thank you Lexikos for the detailed reply and everyone else for chiming in. That answers my question. By 'bigger' I meant 'more pixels' (e.g. 4K) so as to accommodate the entire UI without it spilling past the screen edges and without re-scaling. As you guessed, I am moving the window around to be able to see the bits that fell outside the screen. A scrollable UI would be very good and I've needed it some times in the past but it seemed more hassle than it was worth, add to that he fact that I'm not a programmer, so I tend to choose the path of least resistance that gets the job done.
techmania
Posts: 1
Joined: 18 Sep 2018, 17:42

Re: Gui, Show first time bigger than screen size?

18 Sep 2018, 17:52

Scoox wrote:@garry In my case the problem is that my GUI has to be physically big because it relies on small clickable areas on an image. If it's too small, it becomes too difficult to aim for these areas. I plan to run my script on a bigger screen but I'm currently on the road and only have my small laptop to work with.

Just wondering whether this is a bug or a feature, and if it's a feature then I'm obviously misreading it.


It is problem due to significant accessibility and image create particular areas of an image into links. So you can check it and change its setting to solve your problem

Return to “Ask For Help”

Who is online

Users browsing this forum: Adrulesok99, Google [Bot], hanz79x, just me, newbieforever, scriptors and 83 guests