JellyFish666 Posted April 30, 2008 Share Posted April 30, 2008 I am not sure how to do this my GUI is my desktop width and height and I want to have 4 objects take up all the room in the GUI equally. I am not sure what I should divide by to make all 4 parts equal and I want it to work on all monitors widths and heights. #include <GUIConstants.au3> GUICreate("test", @DesktopWidth, @DesktopHeight) GUICtrlCreateGraphic(0 , 0 , @DesktopWidth /? , @DesktopHeight /?) GUICtrlCreateGraphic(? , ? , @DesktopWidth /? , @DesktopHeight /?) GUICtrlCreateGraphic(? , ? , @DesktopWidth /? , @DesktopHeight /?) GUICtrlCreateGraphic(? , ? , @DesktopWidth /? , @DesktopHeight /?) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
DaRam Posted April 30, 2008 Share Posted April 30, 2008 You need to decide if you want them stacked side by side or tiled on your GUI. Also are there margins between them? For no gaps, side by side the height is the height of your GUI and the widths are your GUI's width / 4 For tile, each one will he height/4 and width / 4, position them thus: 0,0 | 0, width/4 | 0, height / 4 | width/4, height/4 Link to comment Share on other sites More sharing options...
BrettF Posted April 30, 2008 Share Posted April 30, 2008 So like divide the screen into 4 parts? I guess divide by 2... So the following. #include <GUIConstants.au3> GUICreate("test", @DesktopWidth, @DesktopHeight) GUICtrlCreateGraphic(0 , 0 , @DesktopWidth /2, @DesktopHeight /2) GUICtrlSetBkColor (-1, 0xF2289F) GUICtrlCreateGraphic(0 , @DesktopHeight /2, @DesktopWidth /2, @DesktopHeight /2) GUICtrlCreateGraphic(@DesktopWidth /2, 0, @DesktopWidth /2, @DesktopHeight /2) GUICtrlCreateGraphic(@DesktopWidth /2, @DesktopHeight /2, @DesktopWidth /2, @DesktopHeight /2) GUICtrlSetBkColor (-1, 0xF2289F) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
flip209 Posted April 30, 2008 Share Posted April 30, 2008 Nicely done... " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
JellyFish666 Posted May 1, 2008 Author Share Posted May 1, 2008 Perfect, exactly what I was trying to do and now I can start coding This project will be very interesting Link to comment Share on other sites More sharing options...
Skrip Posted May 1, 2008 Share Posted May 1, 2008 You may need to minus like 110 from the height, because of the title bar. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
DaRam Posted May 1, 2008 Share Posted May 1, 2008 You may need to minus like 110 from the height, because of the title bar.In VBA you had a properties of a window called InsideWidth and InsideHeight. I wonder if AutoIT GUI has some constants defined for use similar to these. Link to comment Share on other sites More sharing options...
therks Posted May 1, 2008 Share Posted May 1, 2008 You can use WinGetClientSize on the window before creating the controls. Of course, if your window is fullscreen this isn't a problem, but don't know if that's what the OP wants. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now