Forum > IDE/CodeTools

Declare Variable IDE tool default button

(1/2) > >>

DimTim:
...now it is the HELP button, which is inconvenient: you have to press TAB, and then ENTER.  It would be logical to make OK the default button.  For myself, I just removed the HELP button, but maybe others also feel that inconvenient.

JuhaManninen:
It is unit DeclareVarDlg in components/codetools/ide/.
There ButtonPanel1.DefaultButton = pbOK and in design time the OK button is shown as default.
DefaultButton is not changes in run time.
I don't understand why the Help button becomes default. Could you please debug the code.
ButtonPanel is used in many places. I don't believe it has such a bug.

DimTim:
Even on the help page, which is displayed when that button is pressed, HELP shown as default: https://wiki.lazarus.freepascal.org/Cody#Declare_Variable :)

For myself, I just edited declarevardlg.lfm, line 23:

--- Code: ---ShowButtons = [pbOK, pbCancel, pbHelp]
--- End code ---
to

--- Code: ---ShowButtons = [pbOK, pbCancel]
--- End code ---

JuhaManninen:

--- Quote from: DimTim on July 28, 2023, 04:55:28 pm ---Even on the help page, which is displayed when that button is pressed, HELP shown as default: https://wiki.lazarus.freepascal.org/Cody#Declare_Variable :)

--- End quote ---
Yes because that is a screenshot and a bug is included in the screenshot obviously. Why would a bug go away when somebody takes a screenshot of it?


--- Quote ---For myself, I just edited declarevardlg.lfm, line 23:

--- Code: ---ShowButtons = [pbOK, pbCancel, pbHelp]
--- End code ---
to

--- Code: ---ShowButtons = [pbOK, pbCancel]
--- End code ---

--- End quote ---
OK, you removed the Help button. It can be done easier than by editing declarevardlg.lfm. Does not solve the actual issue.

Can somebody please try to reproduce the bug with a simple example project with a form and a ButtonPanel.

dsiders:

--- Quote from: JuhaManninen on July 28, 2023, 10:21:37 pm ---
--- Quote from: DimTim on July 28, 2023, 04:55:28 pm ---Even on the help page, which is displayed when that button is pressed, HELP shown as default: https://wiki.lazarus.freepascal.org/Cody#Declare_Variable :)

--- End quote ---
Yes because that is a screenshot and a bug is included in the screenshot obviously. Why would a bug go away when somebody takes a screenshot of it?


--- Quote ---For myself, I just edited declarevardlg.lfm, line 23:

--- Code: ---ShowButtons = [pbOK, pbCancel, pbHelp]
--- End code ---
to

--- Code: ---ShowButtons = [pbOK, pbCancel]
--- End code ---

--- End quote ---
OK, you removed the Help button. It can be done easier than by editing declarevardlg.lfm. Does not solve the actual issue.

Can somebody please try to reproduce the bug with a simple example project with a form and a ButtonPanel.

--- End quote ---

His complaint is that the Help button is always the first one in the tab order for keyboard navigation. See the UpdateButtonOrder method for the panel.

Navigation

[0] Message Index

[#] Next page

Go to full version