Jump to content

GUI Function Names


Jon
 Share

Recommended Posts

  • Administrators

Ok, pretty happy with the GUI now, I just want to make sure we are all happy about the function names as once I do a "public" release I'll be reluctant to change them.

The list of GUI functions is:

GUICreate

GUICtrlCreateAvi

GUICtrlCreateButton

GUICtrlCreateCheckbox

GUICtrlCreateCombo

GUICtrlCreateContextMenu

GUICtrlCreateDate

GUICtrlCreateDummy

GUICtrlCreateEdit

GUICtrlCreateGroup

GUICtrlCreateIcon

GUICtrlCreateInput

GUICtrlCreateLabel

GUICtrlCreateList

GUICtrlCreateMenu

GUICtrlCreateMenuitem

GUICtrlCreatePic

GUICtrlCreateProgress

GUICtrlCreateRadio

GUICtrlCreateSlider

GUICtrlCreateTab

GUICtrlCreateTabItem

GUICtrlCreateTreeView

GUICtrlCreateTreeViewitem

GUICtrlCreateUpdown

GUICtrlDelete

GUICtrlGetState

GUICtrlSetBkColor

GUICtrlSetColor

GUICtrlSetCursor

GUICtrlSetData

GUICtrlSetFont

GUICtrlSetImage

GUICtrlSetLimit

GUICtrlSetOnEvent

GUICtrlSetPos

GUICtrlSetResizing

GUICtrlSetState

GUICtrlSetStyle

GUICtrlSetTip

GUIDelete

GUIGetCursorInfo

GUIGetMsg

GUIRead

GUIRecvMsg

GUISendMsg

GUISendToDummy

GUISetBkColor

GUISetCoord

GUISetCursor

GUISetFont

GUISetHelp

GUISetIcon

GUISetOnEvent

GUISetState

GUIStartGroup

GUISwitch

That's fine, but I think some are wrong, these:

GUIRead

GUIRecvMsg

GUISendMsg

They refer to controls so maybe they should have GuiCtrl... prefixed.

Also, I mostly like the naming conventions (fits in with the descriptive, if long, style of AutoIt functions), but a couple of the GUI functions end up being massive, like:

GUICtrlCreateContextMenu

Should we try and shorten them (all of them, not just the contextmenu one)? Or is the long but descriptive version better? What about Add instead of Create to at least save 3 letters :)

GUICtrlAdd...?

GCtrlAdd...?

GCAdd...?

etc...

Or CMenu for ContextMenu? TV or TView for TreeView?

Link to comment
Share on other sites

  • Administrators

Ok, that's a pretty good indication.

What about the other point:

GUIRead

GUIRecvMsg

GUISendMsg

Should I rename them to:

GuiCtrlRead

GuiCtrlRecvMsg

GuiCtrlSendMsg

?

Link to comment
Share on other sites

  • Developers

Ok, that's a pretty good indication.

What about the other point:

GUIRead

GUIRecvMsg

GUISendMsg

Should I rename them to:

GuiCtrlRead

GuiCtrlRecvMsg

GuiCtrlSendMsg

?

<{POST_SNAPBACK}>

The proposed names are better for consistency ..

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

GUICtrlCreateProgress
I think Create could be shortened to
GuiCtrlCrProgress
that would save 4 letters.

I consider all the common wording in the functions could be shortened.

Or CMenu for ContextMenu? TV or TView for TreeView?
I do not like TV. Not descriptive. TView sounds good. Plus CMenu also. Maybe Checkbox could be Chkbox?

GuiCtrlRead
GuiCtrlRecvMsg
GuiCtrlSendMsg
May as well change these 3. Have not worked out how to use the last 2 yet. But use GuiRead alot for reading checkboxes and inputboxes.
Link to comment
Share on other sites

This is a perhaps a radical change? But currently you have to enter lots of common characters before you reach the actual control names.

GUICtrlSet     10 Letters
GUICtrlCreate  13 Letters

A reduction could be done by having Ctrl on the tail end instead.

GUICreate
GUICrAviCtrl
GUICrButtonCtrl
GUICrChkboxCtrl
GUICrComboCtrl
GUICrCMenuCtrl
GUICrDateCtrl
GUICrDummyCtrl
GUICrEditCtrl
GUICrGroupCtrl
GUICrIconCtrl
GUICrInputCtrl
GUICrLabelCtrl
GUICrListCtrl
GUICrMenuCtrl
GUICrMenuitemCtrl
GUICrPicCtrl
GUICrProgressCtrl
GUICrRadioCtrl
GUICrSliderCtrl
GUICrTabCtrl
GUICrTabItemCtrl
GUICrTrViewCtrl
GUICrTrViewitemCtrl
GUICrUpdownCtrl
GUIDeleteCtrl
GUIGetStateCtrl
GUISetBkColorCtrl
GUISetColorCtrl
GUISetCursorCtrl
GUISetDataCtrl
GUISetFontCtrl
GUISetImageCtrl
GUISetLimitCtrl
GUISetOnEventCtrl
GUISetPosCtrl
GUISetResizingCtrl
GUISetStateCtrl
GUISetStyleCtrl
GUISetTipCtrl
GUIDelete
GUIGetCursorInfo
GUIGetMsg
GUIReadCtrl
GUIRecvMsgCtrl
GUISendMsgCtrl
GUISendToDummy
GUISetBkColor
GUISetCoord
GUISetCursor
GUISetFont
GUISetHelp
GUISetIcon
GUISetOnEvent
GUISetState
GUIStartGroup
GUISwitch
Link to comment
Share on other sites

Personally, I use scite for autocomplete of all function names, and it is kinda hard typing GuiCtrlCreate before even typing the first letter of the item I want to create. What about just CtrlAdd? Something like CtrlAddButton? I would personally prefer Some stat letters at the beginning of all control functions, but a small amount of them. Readability is one of the most important points, so MHZ's idea will definately not work.

What about the following:

CtrlAddAvi
CtrlAddButton
CtrlAddCheckbox
CtrlAddCombo
CtrlAddContextMenu
CtrlAddDate
CtrlAddDummy
CtrlAddEdit
CtrlAddGroup
CtrlAddIcon
CtrlAddInput
CtrlAddLabel
CtrlAddList
CtrlAddMenu
CtrlAddMenuitem
CtrlAddPic
CtrlAddProgress
CtrlAddRadio
CtrlAddSlider
CtrlAddTab
CtrlAddTabItem
CtrlAddTreeView
CtrlAddTreeViewitem
CtrlAddUpdown

of corse, the functions no longer have the GUI in front of them, but is that needed?

Who else would I be?
Link to comment
Share on other sites

Why not replace "Ctrl" with "Gui" in this-is-me's idea?:

GuiAddAvi

GuiAddButton

GuiAddCheckbox

GuiAddCombo

GuiAddContextMenu

.....

GuiAddTab

GuiAddTabItem

GuiAddTreeView

GuiAddTreeViewitem

GuiAddUpdown

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

I kicked off an new radical idea? I thought I would get super strong opposition from this.

Anyway, I like the look of CS function names. Any function names whether 10 characters long or 26 characters long, takes time to get used to recognizing them and understanding what they are. But the big benefit is writing the code with efficient naming syntax. Recognition of interpreting the code, comes with time and experience. Recognition is easier with smaller words with less letters.

My variables are $chk for checkbox, $lbl for label and so on. Learned from doing Visual basic. I have no problem at all, reading these variable methods. Same can be for functions. CS method is not as extreme. Still looks basic. Saves typing 10 or so letters before you reach, the range of controls that you are interested in.

@w_sp8er

Do you live just around the corner from me? I'm at Strathpine. :)

Link to comment
Share on other sites

If we changed the naming, what should we do to the following function names?

GuiCtrlSetState --> GuiSetCtrlState? or unchanged?

GuiCtrlDelete --> GuiRemoveCtrl??

GuiDelete --> GuiDestroy? or unchanged?

GuiSetState

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

You want long names? Use any .NET language. These names aren't long, these are fine, leave most of them alone and make the few minor changes with things like GuiRead() and GuiSend/RecvMsg(). Those have been discussed before. Nobody had been complaining about "long" function names until now. In fact, the only complaint was that a few of us did mention that some of the names didn't fit in so well (Which I mentioned a couple sentences back). The current names are not ambiguous in the least. Its better to be explicit than ambiguous, that leads to far less confusion.

Link to comment
Share on other sites

GUICtrlAdd...?

GCtrlAdd...?

GCAdd...?

etc...

Sorry, but it was asked in the first post. This is a recent event of changing names. I know of no previous discussion on this. No-one even knew what the final functions would be. Dot notation used in .Net is different to function names in Autoit3. Like comparing oranges to apples. Shortened names would still be explicit?

This will set the standard for Autoit 1.0.103 Final and set the base for Autoit 1.0.104. So the decision should be made suitable. No matter what the outcome would be.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...