Subject | Re: SemiAuto inserting text into gridcell |
---|---|
Author | Aage Johansen |
Post date | 2001-07-04T20:04:51Z |
Hi Rita !
these is close to your suggestion. However, the method fails when it comes
to cells in a TIB_Grid - and there's my problem.
var
MACRO3 : array [Ord('A')..Ord('Z')] of String;
and selected by Ctrl+<letter>
The following works fine:
if (Sender is TIB_Edit) then
begin
if Shift = [ssCtrl] then
begin
if Key in [Ord('A')..Ord('Z')] then (Sender as
TIB_Edit).SelText:=MACRO3[Key];
Key:=000;
end;
end;
But ...
What's so special about the cell in the grid. Will I have to find the
fieldname and use:
ibqrKINO.FieldByName(FIELDNAME).AsString:=MACRO3[...];
Is there a straightforward way to get the fieldname for the current cell in
the grid?
Why did the previous test work when run in the IDE with a breakpoint, and
otherwise fail?
Regards,
Aage J.
>I better understand what you want to accommplish;Yes. Writing to an TIB_Edit (or a TIB_Memo) works fine. My approach with
>Use SendKeys(s:String) with F8 our F... to whrite a constant string to
>your edit box
these is close to your suggestion. However, the method fails when it comes
to cells in a TIB_Grid - and there's my problem.
>So your MACRO3 looks like this?Yes, in principle. The strings are read from an INI-file at startup.
>var MACRO3: array [65..90] of String = ('AA','BB','CC','DD',
> 'EE','FF','GG','HH',
var
MACRO3 : array [Ord('A')..Ord('Z')] of String;
and selected by Ctrl+<letter>
The following works fine:
if (Sender is TIB_Edit) then
begin
if Shift = [ssCtrl] then
begin
if Key in [Ord('A')..Ord('Z')] then (Sender as
TIB_Edit).SelText:=MACRO3[Key];
Key:=000;
end;
end;
But ...
What's so special about the cell in the grid. Will I have to find the
fieldname and use:
ibqrKINO.FieldByName(FIELDNAME).AsString:=MACRO3[...];
Is there a straightforward way to get the fieldname for the current cell in
the grid?
Why did the previous test work when run in the IDE with a breakpoint, and
otherwise fail?
Regards,
Aage J.