Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#3906 closed Feature Request (Completed)

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

Reported by: KaFu Owned by: J-Paul Mesnage
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, 4 years ago

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 J-Paul Mesnage, 4 years ago

Type: BugFeature Request

comment:3 by J-Paul Mesnage, 4 years ago

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

I change it to a "feature" request

comment:4 by TicketCleanup, 4 years ago

Version: 3.3.16.0

Automatic ticket cleanup.

comment:5 by J-Paul Mesnage, 4 years ago

Owner: set to J-Paul Mesnage
Status: newassigned

comment:6 by J-Paul Mesnage, 4 years ago

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 J-Paul Mesnage, 4 years ago

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

comment:8 by J-Paul Mesnage, 4 years ago

Milestone: 3.3.15.6
Resolution: Completed
Status: assignedclosed

Added by revision [12849] in version: 3.3.15.6

comment:9 by J-Paul Mesnage, 4 years ago

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 J-Paul Mesnage.

Add Comment


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