jim1 Posted March 18, 2009 Share Posted March 18, 2009 i have seen in some autoit programs u can extend for more option by pressing a button that reveals more option in an extended window from the same window. how i do that? Link to comment Share on other sites More sharing options...
Bert Posted March 18, 2009 Share Posted March 18, 2009 What you do is use winmove to resize your gui. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
foster74 Posted March 18, 2009 Share Posted March 18, 2009 (edited) Here's an example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIoneventmode", 1) Opt('GUIResizeMode', 802) $expanded = False GUICreate("GUI",300,300,-1,-1) guisetstate() $expand = GUICtrlCreateButton("Expand", 240,10,50,25) $lol = GUICtrlCreateButton("lol", 400,50,50,25) GUICtrlSetOnEvent($expand,"expand") guictrlcreatelabel("SURPRISE!",375,100,100,50) While 1 sleep(100) Wend Func Expand() If $expanded = False Then $expanded = True WinMove( "GUI", "", default, default,500,332) Else $expanded = False WinMove( "GUI", "", default, default,332,332) EndIf EndFunc ... GUIoneventmode is the only way I know of =( Why won't the program let it work correctly? Edited March 18, 2009 by foster74 Link to comment Share on other sites More sharing options...
jim1 Posted March 18, 2009 Author Share Posted March 18, 2009 thank u is it possible to do that without those opt? because when i try just the command it just makes the window larger doesnt reveal a new area. In a program i try to do i cant use opt because it doesnt let it work correct. any idea how can i make it without opts and func? Link to comment Share on other sites More sharing options...
martin Posted March 18, 2009 Share Posted March 18, 2009 thank uis it possible to do that without those opt? because when i try just the command it just makes the window larger doesnt reveal a new area. In a program i try to do i cant use opt because it doesnt let it work correct. any idea how can i make it without opts and func?The resizing options determine what happens to the controls when the window resizes. The value 802 will keep the controls fixed in the positions and sizes as they were designed relative to the top left of the window. If that isn't what you want then look in the help for GuiCtrlSetResizing. ORyou need to tell us what opt stops you doing what because because your post didn't really make sense to me Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
jim1 Posted March 18, 2009 Author Share Posted March 18, 2009 i cant use opt on event mode. so i dont know exactly how i can make button work correct it can extend but not de-extend after u press it one time. i use if/endif for buttons and cant use func because of problem with gui on event mode.also for some reason if u write same number as gui window will not be sized correct and it need to add +32 why is that?GUICreate("GUI",300,300,-1,-1)WinMove( "GUI", "", default, default,500,332) Link to comment Share on other sites More sharing options...
martin Posted March 18, 2009 Share Posted March 18, 2009 i cant use opt on event mode. so i dont know exactly how i can make button work correct it can extend but not de-extend after u press it one time. i use if/endif for buttons and cant use func because of problem with gui on event mode.also for some reason if u write same number as gui window will not be sized correct and it need to add +32 why is that?GUICreate("GUI",300,300,-1,-1)WinMove( "GUI", "", default, default,500,332)The resizing of controls is not connected to whether or not you use OnEvnt mode. Unfortunately the AutoIt functions are not consistent IMO when dealing with window sizes. When you crerate a window the dimensions are for the client area, so the window will actually be larger because of the borders and the title bar.When you use WinMove the size you give is for the window size not the client area, which is why you found that you have to add the height of the title bar plus the width of the border.I am not sure I understand your extend/de-extend (expand/shrink) problem. If you want one button to toggle the size then you just need to set a variable so that you know which way to adjust the size next time. If you have a problem then you could show your code and I expect someone would soon tell you how to fix if it's not too long. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Bert Posted March 18, 2009 Share Posted March 18, 2009 Show your code and we can tell you what you need to do to fix it. (or even better, fix it for you) The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Azazash Posted April 16, 2009 Share Posted April 16, 2009 if it was me, i'd do something like ... Global $clicked = 0 Global $Form1 = GUICreate("Form1", 0, 0, 300, 300) Global $Button1 = GUICtrlCreateButton("...", 10, 10, 75, 25) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 if $clicked = 0 then winmove... ;Place the expanded window here $clicked = 1 else winmove ... ; Place the normal window here. $clicked = 0 endif EndSwitch WEnd But then im pretty noobie at this and im sure there are better ways of doing it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 16, 2009 Moderators Share Posted April 16, 2009 jim1, The last time you asked this question I replied here suggesting that opening child windows might be the way to go. 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 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