Recent

Author Topic: SetFocus at Onexit  (Read 5771 times)

soho

  • Newbie
  • Posts: 3
SetFocus at Onexit
« on: November 01, 2010, 12:12:46 pm »
I have a problem with the SetFocus - command in an Onexit-routine. I have written a little Testprogramm to demonstrate the error.

3 TEdit-fields in a form.

In the Onexit-routine of the first field the following commands are integrated:
If Edit1.Text = '' then begin
  Error := 'No input';
  Edit1.SetFocus;
  exit;
end;
If Edit1.Text = 'OK' then
  Edit3.SetFocus
ELSE
  Edit2.SetFocus;

In Windows this routine works correctly.

In the MAX OS X Version LCL Widget Type = carbon this routine doesn't work.
Is Edit1.Text = '' then Edit1 and Edit2 are marked, two cursor are blinking, one in Edit1 and one in Edit2; the keyboard input is inserted in Edit2.
But when I set a breakpoint in the first line of the Onexit-routine, this routine works also correctly.

I can't find the mistake! Can you help me?

My lazarus Version: FPC 2.4.0, Lazarus SVN Revision 28017.

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: SetFocus at Onexit
« Reply #1 on: November 04, 2010, 01:44:18 am »
If it works in Windows but not in another environment then it is a widgetset bug. You will need to report it at the bugtracker.

soho

  • Newbie
  • Posts: 3
Re: SetFocus at Onexit
« Reply #2 on: November 04, 2010, 07:26:07 am »
Thanks for your message. I have it under 0017825 in the bugtracker inserted.

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: SetFocus at Onexit
« Reply #3 on: November 04, 2010, 09:55:23 am »
@soho, please attach compilable project (example) to that issue.
We don't have enough spare time to create example projects for each reported issue.

soho

  • Newbie
  • Posts: 3
Re: SetFocus at Onexit
« Reply #4 on: November 05, 2010, 08:43:03 am »
Excuse! Now TestSetFocus.zip attached. In the zip-file I have 2 files included - unit1.pas and unit1.lfm.
« Last Edit: November 05, 2010, 09:45:12 am by soho »

 

TinyPortal © 2005-2018