Sign in Join

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

Mailing lists / lazarus / 2015-03

Button Default not working in IDE dialog

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

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/

Reply by email