bouncingmolar Posted November 3, 2008 Share Posted November 3, 2008 I am trying to make a dropdown menu using GUICtrlCreateMenu But there is no option to position the menu on the window. by default it makes a menubar above all your other controls. Is there an alternative type of dropdown menu which i can position next to my buttons and labels? Thanks. Link to comment Share on other sites More sharing options...
Josbe Posted November 3, 2008 Share Posted November 3, 2008 I am trying to make a dropdown menu using GUICtrlCreateMenuBut there is no option to position the menu on the window. by default it makes a menubar above all your other controls. Is there an alternative type of dropdown menu which i can position next to my buttons and labels?Thanks.With menu control, it's not possible.TIP: Perhaps like as trick, you could recreate something similar to this, with GUICtrlCreateContextMenu() and some button or graphic. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
BrettF Posted November 3, 2008 Share Posted November 3, 2008 Always possible to use child windows... expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> Dim $defaultstatus = "Ready" $gui = GUICreate("Main GUI", 300, 180) GUICtrlSetState(-1, $GUI_CHECKED) $okbutton = GUICtrlCreateButton("OK", 50, 50, 100, 20) GUICtrlSetState(-1, $GUI_FOCUS) $cancelbutton = GUICtrlCreateButton("Cancel", 180, 130, 70, 20) $statuslabel = GUICtrlCreateLabel($defaultstatus, 0, 165, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN)) GUISetState(@SW_SHOW) $pic = GUICreate("", 169, 68, 50, 50, $WS_POPUP, $WS_EX_MDICHILD, $gui) $filemenu = GUICtrlCreateMenu("&File") $fileitem = GUICtrlCreateMenuItem("Open", $filemenu) GUICtrlSetState(-1, $GUI_DEFBUTTON) $helpmenu = GUICtrlCreateMenu("?") $saveitem = GUICtrlCreateMenuItem("Save", $filemenu) GUICtrlSetState(-1, $GUI_DISABLE) $infoitem = GUICtrlCreateMenuItem("Info", $helpmenu) $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu, 1) $separator1 = GUICtrlCreateMenuItem("", $filemenu, 2) ; create a separator line $viewmenu = GUICtrlCreateMenu("View", -1, 1) ; is created before "?" menu $viewstatusitem = GUICtrlCreateMenuItem("Statusbar", $viewmenu) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $exititem Exit Case $fileitem $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)") If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu) Case $viewstatusitem If BitAND(GUICtrlRead($viewstatusitem), $GUI_CHECKED) = $GUI_CHECKED Then GUICtrlSetState($viewstatusitem, $GUI_UNCHECKED) GUICtrlSetState($statuslabel, $GUI_HIDE) Else GUICtrlSetState($viewstatusitem, $GUI_CHECKED) GUICtrlSetState($statuslabel, $GUI_SHOW) EndIf Case $infoitem MsgBox(0, "Info", "Only a test...") EndSwitch WEnd Cheers, Brett 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...
Josbe Posted November 3, 2008 Share Posted November 3, 2008 Always possible to use child windows... ...Oh...you're right. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
BrettF Posted November 3, 2008 Share Posted November 3, 2008 These days I seem to find an answer to everything using child windows... 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...
bouncingmolar Posted November 3, 2008 Author Share Posted November 3, 2008 Always possible to use child windows... Hi brett thats cool! I actually saw your post after i added a child window! I got rid of the black line down the bottom by making the child windows height slightly smaller. Is there anyway of making the childwindows menu stay black when you activate the parent window?.... its pretty minor and my program will work greyed out but u know.... it looks kinda nice. Cheers guys. Link to comment Share on other sites More sharing options...
Kip Posted November 3, 2008 Share Posted November 3, 2008 (edited) Are you sure Menu control actually work in child windows? Because it doesnt redraw the menu. Edited November 3, 2008 by Kip MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
bouncingmolar Posted November 3, 2008 Author Share Posted November 3, 2008 Are you sure Menu control actually work in child windows? Because it doesnt redraw the menu.what do you mean it doesn't redraw? It seems to be working ok in my applicationdo you mean when you drag the window it disappears? If you do that is easily fixed by making it always on top (with conditions). Link to comment Share on other sites More sharing options...
BrettF Posted November 3, 2008 Share Posted November 3, 2008 Are you sure Menu control actually work in child windows? Because it doesnt redraw the menu.It doesn't redraw? Hmmm.... I'm not sure. It worked and I posted it as a concept for the OP to smooth out, everything made in 2minutes has bugs 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...
Kip Posted November 3, 2008 Share Posted November 3, 2008 I thought I read somewhere, you couldn't use menu controls in child windows. I could be wrong, but... MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. 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