Jump to content

Recommended Posts

Posted (edited)

Hello everyone,

I hope that you have all had an enjoyable festive season.

I am working on a program, for which I wish to create menus with a single menuitem, in them, but I dont want the submenu to have an arrow, as shown here:

Posted Image

Please note that this is not the actual menu I wish to do this to, as mentioned earlier, it will contain 1 submenu item only, not numerous.

Does anybody know how to do that?

Thanks!

Edited by Mikeman27294
  • Moderators
Posted

Mikeman27294,

I do not think you can. And I also fail to see the requirement - if the top-level menu holds only a single submenu item, then why not put the submenu items into the top-level menu and save a step? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

Thanks for the reply.

Well so you understand my reasoning for this, I am having a go at making a GUI designer in autoit for autoit (just to learn more about autoit's capabilities and if I can pull it off, it will hopefully be something the community enjoys). The reason I want to do it like this, is because I want people to be able to make menu items into menus just be hovering over the menu item, having it display a submenu saying "Add Submenu item" and when they click, it creates the submenu item.

An image speaks louder than words, so here is an image showing what I hope for it to look like:

Posted Image

As I said, an image speaks louder than words. There is actually an arrow in that, but I removed it in paint (I'm too poor for photoshop atm haha). Would it even be possible to add a right click menu to a menu item or something like that?

Thanks.

Posted

Just out of curiosity what do you have against the small arrow?

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Posted

Hahaha it's just that I want the user to be able to create a menu item or a menu as they wish. If it has the arrow, it shows that the control is a menu, and cannot be a menu item.

Posted

Change your thinking, instead of making a menu with sub-menus, consider making the menu a child GUI to the main GUI, then turn the menu items into either labels or buttons, that way you can do whatever you want with them. You should make it so that the "menu" GUI acts like a menu normally does so that, to the user, it's not apparent that it's not a real menu.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted (edited)

Hmmmm... I wouldnt have a clue how to do that...

But I will give it a shot anyway, thanks.

So what I should do is check to see if the cursor is hovered over a menu item, and if so I create the child GUI? And would I be able to align the GUI with the menu item using the menu item's ID or would I have to move the GUI each time or create a new GUI for each one?

Edited by Mikeman27294
Posted

I have a script I was working on, it's a media player with control buttons that only show when the mouse is over the GUI for the player, and the player GUI is the active window. It also has a pop up volume control that only shows when the mouse is over the GUI and over the control buttons GUI. I did it this way so that the main GUI would take up less space on the desktop screen and only showed the buttons when they'd need to be shown.

Func _ButtonGUIActivate() ; This function is used to display the player buttons and the volume control only when mouse is over the main GUI and that GUI is active
    Local $MousePos = MouseGetPos()
    $MGPosition = WinGetPos("Media Player") ; get the position of the Main GUI
        ; Below code is, if the player is the active window or the Button gui is, or the Volume Control gui is the active window, and the mouse is over one of those windows
        ; then show the button GUI and if the mouse is also over the button or vol control guishow the vol control gui.
    If (WinActive("Media Player") Or WinActive("Buttons") Or WinActive("Volume")) And ($MousePos[0] >= $MGPosition[0] And $MousePos[0] <= $MGPosition[0] + 430) And ($MousePos[1] >= $MGPosition[1] And $MousePos[1] <= $MGPosition[1] + 515) Then 
        GUISetState(@SW_SHOW, $ButtonGUI)
        If ($MousePos[0] >= $MGPosition[0] + 70 And $MousePos[0] <= $MGPosition[0] + 380) And ($MousePos[1] >= $MGPosition[1] + 429 And $MousePos[1] <= $MGPosition[1] + 515) Then
            GUISetState(@SW_SHOW, $VolumeCtrlGUI)
        Else
            GUISetState(@SW_HIDE, $VolumeCtrlGUI)
        EndIf
    Else
        GUISetState(@SW_HIDE, $ButtonGUI)
        GUISetState(@SW_HIDE, $VolumeCtrlGUI)
    EndIf
EndFunc   ;==>_ButtonGUIActivate

I also use code to move those 2 pop up windows whenever the main window is moved so that they appear to be stuck together. I know the code looks complicated, but it's actually pretty straight forward, it's just looking to see where the mouse is and if it's over the main GUI it pops up the ButtonGUI, and if over the ButtonGUI it pops open the VolumeCtrlGUI. I have this activated by an AdLibRegister call so it's always being checked. I'm sure there's a more elegant way of doing something like this, but it worked this way, so that's how I went on this project.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

So are you trying to make a Koda in Autoit? If so let me know, and I know a few other people who might be able to help. (An Autoit coded Koda has been attempted multiple times)

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...