meisandy Posted September 15, 2010 Posted September 15, 2010 Hi, This isn't really an autoit related question, more a logical question... I am making a GUI that will be fullscreen using @DestopHeight & @Desktop width, with various inputs. But I need to work out how to ensure that the different elements aren't over/under sized on different size screens. Any pratical ideas? I've thought of dividing into to collunms but it's quite long and drawn out, but I thought there may be an easier way. Thanks in advanced!
Moderators Melba23 Posted September 15, 2010 Moderators Posted September 15, 2010 DjATUit,Welcome to the wonderful world of GUICtrlSetResizing! Look what happens when you try resizing this GUI: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 500, 200, Default, Default, BitOr($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) $hButton = GUICtrlCreateButton("Test", 10, 10, 80, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $hLabel = GUICtrlCreateLabel("Test", 100, 10, 380, 60) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlSetBkColor(-1, 0xFF0000) $hList = GUICtrlCreateList("", 10, 80, 400, 100) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndYou can also set the resizing mode as a default for all controls using Opt("GUIResizeMode", ##). Have fun! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
meisandy Posted September 15, 2010 Author Posted September 15, 2010 Yet again Melba, you've done it! You never fail to impress me - it's not just your knowledge it's the way you express it and your attitude towards all kinds of questions. Thank you very much DjATUit
Moderators Melba23 Posted September 15, 2010 Moderators Posted September 15, 2010 DjATUit, Thank you for that - nice to get some feedback. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
meisandy Posted September 17, 2010 Author Posted September 17, 2010 Hi, again, not sure if anyone will still pay attention to this post but... I've just Review what Melba said and it's all good but I need an example closer to what I'm looking for which is: I'm creating a GUI which is full screen so you wont be able to see the taskbar, etc - using @DesktopHeight and @DesktopWidth but ofcorse there's more than one screen size, so I need to make sure what ever the screen size is, all the preporstions are the same. Anyone done that before or knows how to do it? Please Help!
Moderators Melba23 Posted September 17, 2010 Moderators Posted September 17, 2010 DjATUit,My solution still works. Create your window to suitable initial size and then use WinMove to size it to the actual screen dimensions. Here is an example to show what I mean: expandcollapse popup#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 1280, 960, 0, 0) $hButton_1 = GUICtrlCreateButton("800x600", 10, 10, 80, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $hButton_2 = GUICtrlCreateButton("1280x960", 110, 10, 80, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $hButton_3 = GUICtrlCreateButton("Full Screen", 210, 10, 80, 30) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlCreateLabel("", 300, 10, 480, 60) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlCreateLabel("", 1160, 850, 100, 100) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlSetBkColor(-1, 0x0000FF) $hList = GUICtrlCreateList("", 10, 80, 400, 400) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton_1 WinMove($hGUI, "", 0, 0, 800, 600) Case $hButton_2 WinMove($hGUI, "", 0, 0, 1280, 960) Case $hButton_3 WinMove($hGUI, "", 0, 0, @DesktopWidth, @DesktopHeight) EndSwitch WEndI would suggest that you make the initial GUI to standard screen dimensions as above and adjust the initial control sizes so that they do not look too small or too large when you change the GUI dimensions to fit.Now all you need is the WinMove($hGUI, "", 0, 0, @DesktopWidth, @DesktopHeight) line in your script after the GUI is created and it should work as you want. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
meisandy Posted September 17, 2010 Author Posted September 17, 2010 M23, I had no doubt your solution still worked - infact I was about to ask you about it (PM) when I saw you was posting on my topic! Thanks for the example and that was what I had in mind but I was just wondering if there was anything else, etc. But Thank you loads Melba, DjATUit
Moderators Melba23 Posted September 17, 2010 Moderators Posted September 17, 2010 DjATUitin fact I was about to ask you about it (PM)I am very glad you did not do that as it is considered extremely rude here. Just stick with posting in the forum (start a new topic if necessary) - that way everyone gets to see and learn, whcih is why we are all here in the first place. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
GEOSoft Posted September 17, 2010 Posted September 17, 2010 DjATUitI am very glad you did not do that as it is considered extremely rude here. M23And in my case it probably would not elicit the desired type of reply.You only use PM's to get support when requested to do so. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
meisandy Posted September 17, 2010 Author Posted September 17, 2010 Oh okay, extremely sorry everyone Thanks for that and everything else you help with
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