[Lazarus] Button Default not working in IDE dialog

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri Mar 20 08:33:59 CET 2015


Hi,

In the Condition Defines dialog (ide/condef.pas) the btnOK has the
Default = True property set, yet when I trigger the dialog in the IDE
via Ctrl+Shift+D (while programming) and simply hit ENTER (because the
default selection is correct) the dialog closes but the btnOK onclick
was never trigger - thus no conditional define was added to my source
code. It's as if the cancel button was clicked.

Why doesn't the Default = True work?

I had to mod the condef.pas unit by doing the following to get the
"simply press ENTER" to function.

procedure TCondForm.FormShow(Sender: TObject);
begin
  if SecondTest.Items.Count < 10 then
    SecondTest.Items.AddStrings(FirstTest.Items);
  ListBoxClick(Nil);
  btnOK.SetFocus;  // <<<<--- New line added
end;

Regards,
  - Graeme -

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




More information about the Lazarus mailing list