Subject | IB_Currency bug (KeyDown event) |
---|---|
Author | Fabio Bot |
Post date | 2005-07-23T16:05:54Z |
Hi,
IB_Currency has a bug that doesn't allow to change the focus in the
event KEYDOWN.
Create a new form and put two components IB_Currency:
IB_Currency1 and IB_Currency2
Now put the following code in the event KeyDown of IB_Currency1:
if Key = VK_DOWN then
IB_Currency2.SetFocus;
Run the program and do type arrow down on first IB_Currency, verify
that the focus is not going to IB_Currency2.
Repeat this test with another component as IB_Date, you will see that
it work's right.
Well, debugging the code I reached the problem that's on the
CreateParams event from IB_Currency (at IB_Controls.pas).
procedure TIB_Currency.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams( Params );
// ES_MULTILINE necessary for right alignment
if not (csDesigning in ComponentState) then
Params.Style := Params.Style or ES_RIGHT or ES_MULTILINE;
end;
If I remove the "or ES_MULTILINE" then the bug disappears:
procedure TIB_Currency.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams( Params );
if not (csDesigning in ComponentState) then
Params.Style := Params.Style or ES_RIGHT;
end;
Please Marco Menardi / Jason Wharton,
Can you put this patch on next release please ?
Thanks in advance,
Fábio Bot.
Curitiba/PR - Brazil
IB_Currency has a bug that doesn't allow to change the focus in the
event KEYDOWN.
Create a new form and put two components IB_Currency:
IB_Currency1 and IB_Currency2
Now put the following code in the event KeyDown of IB_Currency1:
if Key = VK_DOWN then
IB_Currency2.SetFocus;
Run the program and do type arrow down on first IB_Currency, verify
that the focus is not going to IB_Currency2.
Repeat this test with another component as IB_Date, you will see that
it work's right.
Well, debugging the code I reached the problem that's on the
CreateParams event from IB_Currency (at IB_Controls.pas).
procedure TIB_Currency.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams( Params );
// ES_MULTILINE necessary for right alignment
if not (csDesigning in ComponentState) then
Params.Style := Params.Style or ES_RIGHT or ES_MULTILINE;
end;
If I remove the "or ES_MULTILINE" then the bug disappears:
procedure TIB_Currency.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams( Params );
if not (csDesigning in ComponentState) then
Params.Style := Params.Style or ES_RIGHT;
end;
Please Marco Menardi / Jason Wharton,
Can you put this patch on next release please ?
Thanks in advance,
Fábio Bot.
Curitiba/PR - Brazil