- I'm not particularly concerned re. what the final syntax should be, but I think that these proposals outline a coherent system that allows for more readable scripts and for sensibly-named functions to be added in future.
GENERAL POINTS
XXXChoose (index)
XXXChooseString
XXXGetChoice (to return index not string)
XXXGetChoiceString (new)
XXXFindItem
[EDIT: Or:]
XXXChooseIndex
XXXChoose (string)
XXXGetChoiceIndex
XXXGetChoice (to return string)
XXXFindItem
[note: potentially these could all be part of XXXGetItems/XXXSetItems instead, but they might be simpler as separate functions]
[note: potentially XXXChoose/XXXChooseString, XXXGetChoice/XXXGetChoiceString could be combined by having a parameter which specifies return string instead of index]
LEAVE AS THEY ARE [enabled/style/visible/hWnd]
ControlGet, Enabled -> ControlGetEnabled
Control, Disable -> ControlSetEnabled
Control, Enable -> ControlSetEnabled
ControlGet, Visible -> ControlGetVisible
Control, Hide -> ControlHide
Control, Show -> ControlShow
ControlGet, Style -> ControlGetStyle
ControlGet, ExStyle -> ControlGetExStyle
Control, Style -> ControlSetStyle
Control, ExStyle -> ControlSetExStyle
ControlGet, Hwnd -> ControlGetHwnd
LEAVE AS THEY ARE [further (were never subcommands)]
ControlClick
ControlFocus
ControlGetFocus
ControlGetPos
ControlGetText
ControlMove
ControlSend
ControlSendText
ControlSetText
CHANGE EDIT CONTROL FUNCTIONS
ControlGet, CurrentCol -> ControlGetCurrentCol [make it: EditGetCurrentCol]
ControlGet, CurrentLine -> ControlGetCurrentLine [make it: EditGetCurrentLine]
ControlGet, LineCount -> ControlGetLineCount [make it: EditGetLineCount]
ControlGet, Line -> ControlGetLine [make it: EditGetLine]
ControlGet, Selected -> ControlGetSelected [make it: EditGetSelected]
Control, EditPaste -> ControlEditPaste [make it: EditPaste]
BUTTON CONTROLS [rename to allow more Btn functions in future][either Btn or Button]
ControlGet, Checked -> ControlGetChecked [make it: BtnGetChecked]
Control, Check -> ControlSetChecked [make it: BtnSetChecked]
Control, Uncheck -> ControlSetChecked [make it: BtnSetChecked]
COMBOBOX/LISTBOX/LISTVIEW [rename to allow more CB/LB/LV functions in future]
ControlGet, Choice -> ControlGetChoice [make it: XXXGetChoice (index)/XXXGetChoiceString where XXX=CB/LB][note: XXXGetChoice split into 2 functions to return index/string]
Control, Choose -> ControlChoose [make it: XXXChoose where XXX=CB/LB]
Control, ChooseString -> ControlChooseString [make it: XXXChooseString where XXX=CB/LB]
Control, Add -> ControlAddItem [make it: XXXAddItem where XXX=CB/LB]
Control, Delete -> ControlDeleteItem [make it: XXXDeleteItem where XXX=CB/LB]
ControlGet, FindString -> ControlFindItem [make it: XXXFindItem where XXX=CB/LB]
ControlGet, List -> ControlGetList [make it: XXXGetItems where XXX=CB/LB/LV]
Control, HideDropDown -> ControlHideDropDown [make it: CBHideDropDown]
Control, ShowDropDown -> ControlShowDropDown [make it: CBShowDropDown]
TAB CONTROLS
Control, TabLeft -> ControlSetTab [make it: TabChoose]
Control, TabRight -> ControlSetTab [make it: TabChoose]
ControlGet, Tab -> ControlGetTab [make it: TabGetChoice (index)]
LOW PRIORITY: RESTORE THE FOLLOWING FOR INTERNAL/EXTERNAL CONTROLS
[either as LV_/SB_/TV_ or as LV/SB/TV]
[change the parameters so that any control can be specified, e.g. 'Control, WinTitle' etc]
[I'm not particularly concerned about changing the function names]
LV_Add
LV_Delete
LV_DeleteCol
LV_GetCount
LV_GetNext
LV_GetText
LV_Insert
LV_InsertCol
LV_Modify
LV_ModifyCol
LV_SetImageList
SB_SetIcon
SB_SetParts
SB_SetText
StatusBarGetText [make it able to handle any control, not just 'msctls_statusbar321']
StatusBarWait [make it able to handle any control, not just 'msctls_statusbar321']
TV_Add
TV_Delete
TV_Get
TV_GetChild
TV_GetCount
TV_GetNext
TV_GetParent
TV_GetPrev
TV_GetSelection
TV_GetText
TV_Modify
TV_SetImageList
Thanks for reading.
why was LoopParse (no space) removed? - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=41821&p=190742#p190742
Link:- For certain ControlXXX functions, specific to certain control types, the most sensible thing to do may be to create functions with the control type in the name.
- One reason is that when I look at, for example, ControlShowDropDown/ControlGetCurrentLine/ControlGetSelected/ControlAddItem, I instantly think, which control type is that for, will it work with the control I'm working with.
- Seeing multiple functions specific to a particular type of control, identified by their prefixes, makes it easier to follow the logic of the script.
- I would say as a rule of thumb, a ControlXXX function should only be called ControlXXX if it works with six control types or more.
- People will naturally be reluctant to add more ControlXXX functions to AHK, with the 'Control' prefix, that only work for one type of control.
- There were a lot of listview/treeview functions in AHK v1, and so having LV/TV prefixes would be consistent with this.
Control Functions
https://lexikos.github.io/v2/docs/commands/Control.htm