Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-08

Default buttons in IDE dialog don't seem to work

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I use the "Run Parameters" dialog a lot. I change the "Command Line Parameters" value frequently, and when I hit ENTER I expect the dialog to close, but it doesn't.

I looked at the code (runparamsopts.pas) and it uses a ButtonPanel and the DefaultButton = pkOK, so why doesn't hitting ENTER do the same as when I click the OK button?

I'm using Lazarus 1.5 r48959 FPC 2.6.4 x86_64-linux-gtk 2

The Run Parameters dialog is not the only place in the IDE where this happens.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 9 lines
Hi, I use the "Run Parameters" dialog a lot. I change the "Command Line Parameters" value frequently, and when I hit ENTER I expect the dialog to close, but it doesn't. I looked at the code (runparamsopts.pas) and it uses a ButtonPanel and the DefaultButton = pkOK, so why doesn't hitting ENTER do the same as when I click the OK button?

The OK button is not necessarily activated by default. You need to activate that behaviour: it should be set as 'Default'.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
You need to activate that behaviour: it should be set as 'Default'.

The buttons are not individual buttons it is the TButtonPanel component. That component doesn't have a Default property and you can select the individual buttons (in the form designer). I thought the TButtonPanel.DefaultButton = pbOK does the same as TButton.Default, or am I understanding that wrong.

http://lazarus-ccr.sourceforge.net/docs/lcl/buttonpanel/tbuttonpanel.html

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys: I use the "Run Parameters" dialog a lot. I change the "Command Line Parameters" value…
Graeme Geldenhuys wrote
I looked at the code (runparamsopts.pas) and it uses a ButtonPanel and the DefaultButton = pkOK, so why doesn't hitting ENTER do the same as when I click the OK button?

Ha, I just thought of something. The Run Parameters dialog has TEdit and TComboBox (the edit kind) components. The value I'm editing is in the edit combobox, and that seems to prevent the "default button" behaviour from working.

If I place the edit cursor inside a TEdit and hit ENTER, then the dialog closes as expected.

Is this a known issue? Is there a work-around? This issue is driving me crazy.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email