Modify

#3906 closed Feature Request (Completed)

GUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type

Reported by: KaFu Owned by: Jpm
Milestone: 3.3.16.1 Component: Documentation
Version: Severity: None
Keywords: Cc:

Description

Hiho,

again and again I stumble over this variable :). I often use the example 1 as a simple copy&paste starting point for testing.

Now the button control is labeled $idOK, which is also used in <MsgBoxConstants.au3> as a return value.

It's not a problem in local scope, but I often remove the function definition and then $idOK is suddenly in Global scope and collides with the messagebox const.

I would like to propose to rename the variable in the GUICreate() example into something like $c_Button_OK.

Best Regards

Attachments (0)

Change History (9)

comment:1 by pixelsearch, on Aug 8, 2022 at 3:46:50 PM

Hi all,
Kafu's idea is interesting (renaming this specific variable) but it should start with $id... to be consistent with most examples found in the help file. If you look at the example GUICtrlCreateButton, you'll find variable names like $idButton_Notepad or $idButton_Close

Maybe we could adapt this naming convention to the 1st example found in GUICreate, renaming this annoying $idOK to $idButton_OK ?

comment:2 by Jpm, on Aug 8, 2022 at 7:01:47 PM

Type: BugFeature Request

comment:3 by Jpm, on Aug 8, 2022 at 7:03:44 PM

For me is not a bug,
The example is working without any Error

I change it to a "feature" request

comment:4 by TicketCleanup, on Aug 8, 2022 at 8:00:02 PM

Version: 3.3.16.0

Automatic ticket cleanup.

comment:5 by Jpm, on Aug 12, 2022 at 2:24:16 PM

Owner: set to Jpm
Status: newassigned

comment:6 by Jpm, on Aug 17, 2022 at 12:05:07 PM

In fact I will adapt all examples to have $idOK = $idBtn_OK as the created ctrl is a Button

For example $g_idX = GUICtrlCreateLabel("0", 10, 10, 50)
will be $g_idLbl_X = GUICtrlCreateLabel("0", 10, 10, 50)

to reflect the type of the ctrl created

comment:7 by Jpm, on Aug 17, 2022 at 12:11:32 PM

Summary: GUICreate example #1 - use of $idOKGUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type

comment:8 by Jpm, on Aug 17, 2022 at 12:14:00 PM

Milestone: 3.3.15.6
Resolution: Completed
Status: assignedclosed

Added by revision [12849] in version: 3.3.15.6

comment:9 by Jpm, on Aug 17, 2022 at 12:32:43 PM

Milestone: 3.3.15.63.3.16.1

Added by revision [12851] in version: 3.3.16.1

Modify Ticket

Action
as closed The owner will remain Jpm.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.