Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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

Change History (9)

comment:1 Changed 3 years ago by pixelsearch

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 Changed 3 years ago by Jpm

  • Type changed from Bug to Feature Request

comment:3 Changed 3 years ago by Jpm

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

I change it to a "feature" request

comment:4 Changed 3 years ago by TicketCleanup

  • Version 3.3.16.0 deleted

Automatic ticket cleanup.

comment:5 Changed 3 years ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

comment:6 Changed 3 years ago by Jpm

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 Changed 3 years ago by Jpm

  • Summary changed from GUICreate example #1 - use of $idOK to GUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type

comment:8 Changed 3 years ago by Jpm

  • Milestone set to 3.3.15.6
  • Resolution set to Completed
  • Status changed from assigned to closed

Added by revision [12849] in version: 3.3.15.6

comment:9 Changed 3 years ago by Jpm

  • Milestone changed from 3.3.15.6 to 3.3.16.1

Added by revision [12851] in version: 3.3.16.1

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.