sw00n Posted December 2, 2010 Share Posted December 2, 2010 (edited) ok i have: Func shaders() GUICreate("Common Textures List", 500, 210, 269, 216) $Home1 = GUICtrlCreateMenu("Home") GUISetState(@SW_SHOW) endfunc And it works great, but it actually opens another GUI beside it... Is there another way to make it open within itself without making another new window in the start bar? full code: expandcollapse popup#include <GUIConstantsEx.au3> #include <INet.au3> #include <GuiButton.au3> #include <GuiToolBar.au3> #include <StaticConstants.au3> GUICreate("1up Shader Maker.v1", 500, 210, 269, 216) $input1 = GUICtrlCreateInput("", 7, 39, 150, 20) $label1 = GUICtrlCreateLabel("Enter Your Texture Path below", 6, 17, 250, 15) $menu1 = GUICtrlCreateMenu("File") $open = GUICtrlCreateMenuItem("Open", $menu1) $save = GUICtrlCreateMenuItem("Save As", $menu1) $exit = GUICtrlCreateMenuItem("Exit", $menu1) $help1 = GUICtrlCreateMenu("Help") $help = GUICtrlCreateMenuItem("Help", $help1) $edit = GUICtrlCreateEdit("", 200, 10, 270, 150) $common = GUICtrlCreateMenu("Common") $shaders = GUICtrlCreateMenuItem("Common Shaders", $common) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $exit exit1() Case $help help() Case $open open1() Case $save save() Case $shaders shaders() EndSwitch WEnd Func help() MsgBox(0, "", "Enter the path or your texture, default is: textures/Name Here/Name Here") EndFunc ;==>help Func exit1() MsgBox(0, "Exiting", "Now Exiting...") Exit EndFunc ;==>exit1 Func open1() $message = ("Only Open Shaders and Text Files") $var = FileOpenDialog($message, @ScriptDir & "\", "List (*.shader)") $file = FileRead($var) If @error Then MsgBox(0, "", "No File(s) were selected") Else GUICtrlSetData($edit, $file) EndIf EndFunc ;==>open1 Func save() $file = FileSaveDialog("Save Active Proxies", @ScriptDir, "Text Files (.shader)|All Files (*.*)", 18, "ShaderMv1.shader") $xFile = FileOpen($file, 8 + 2) FileWrite($xFile, GUICtrlRead($Input1)) EndFunc Func shaders() GUICreate("Common Textures List", 500, 210, 269, 216) $Home1 = GUICtrlCreateMenu("Home") GUISetState(@SW_SHOW) endfunc Edited December 2, 2010 by sw00n Link to comment Share on other sites More sharing options...
hannes08 Posted December 2, 2010 Share Posted December 2, 2010 Hi sw00n, please try this: expandcollapse popup#include <GUIConstantsEx.au3> #include <INet.au3> #include <GuiButton.au3> #include <GuiToolBar.au3> #include <StaticConstants.au3> $parent = GUICreate("1up Shader Maker.v1", 500, 210, 269, 216) $input1 = GUICtrlCreateInput("", 7, 39, 150, 20) $label1 = GUICtrlCreateLabel("Enter Your Texture Path below", 6, 17, 250, 15) $menu1 = GUICtrlCreateMenu("File") $open = GUICtrlCreateMenuItem("Open", $menu1) $save = GUICtrlCreateMenuItem("Save As", $menu1) $exit = GUICtrlCreateMenuItem("Exit", $menu1) $help1 = GUICtrlCreateMenu("Help") $help = GUICtrlCreateMenuItem("Help", $help1) $edit = GUICtrlCreateEdit("", 200, 10, 270, 150) $common = GUICtrlCreateMenu("Common") $shaders = GUICtrlCreateMenuItem("Common Shaders", $common) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $exit exit1() Case $help help() Case $open open1() Case $save save() Case $shaders shaders($parent) EndSwitch WEnd Func help() MsgBox(0, "", "Enter the path or your texture, default is: textures/Name Here/Name Here") EndFunc ;==>help Func exit1() MsgBox(0, "Exiting", "Now Exiting...") Exit EndFunc ;==>exit1 Func open1() $message = ("Only Open Shaders and Text Files") $var = FileOpenDialog($message, @ScriptDir & "\", "List (*.shader)") $file = FileRead($var) If @error Then MsgBox(0, "", "No File(s) were selected") Else GUICtrlSetData($edit, $file) EndIf EndFunc ;==>open1 Func save() $file = FileSaveDialog("Save Active Proxies", @ScriptDir, "Text Files (.shader)|All Files (*.*)", 18, "ShaderMv1.shader") $xFile = FileOpen($file, 8 + 2) FileWrite($xFile, GUICtrlRead($Input1)) EndFunc Func shaders($parent) GUICreate("Common Textures List", 500, 210, 269, 216,-1,-1,$parent) $Home1 = GUICtrlCreateMenu("Home") GUISetState(@SW_SHOW) endfunc Made liite changes to the line where you create your first GUI, to the function call of "shaders" and to the shaders function including the GUI Create there. You can assign a parent GUI to a new GUI. Regards, Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
sw00n Posted December 2, 2010 Author Share Posted December 2, 2010 Thank you so much for you help, i appreciate it Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 2, 2010 Moderators Share Posted December 2, 2010 sw00n,Now you are using multiple GUIs, could I recommend the Managing Multiple GUIs tutorial in the Wiki. It might save you a lot of frustration! 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...
sw00n Posted December 2, 2010 Author Share Posted December 2, 2010 Just got done reading the tutorial, thank you for recommending that.. Now i have a better understanding on how to manage multiple GUIs 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