I'm wanting to create a "join lines" hotkey that works in a TWebMemo: position the cursor on a line, hit <ctrl>-J
or <alt>-J
or something like that and the current line has the next line appended to it with a space in between. I can't get anything to happen, but worse, none of the ways to get the line# where the cursor is at that work with a TMemo work with a TWebMemo, even thouth TWebMemo seems to be derived from TCustomMemo. Suggestions are welcome.
In the mean time, this is an issue:
Trying to access memo.CaretPos gives a compiler error:
[Error] myForm1(1953): identifier not found "CaretPos"
I even tried this:
type
TmyMemo = class (TCustomMemo)
public
function GetCaretPos: TPoint; override;
end;
function TmyMemo.GetCaretPos: TPoint;
begin
Result := inherited GetCaretPos;
end;
The compiler says this:
[Error] myForm1(1944): There is no method in an ancestor class to be overridden "function GetCaretPos of Object"
However, vcl.std.ctrls
shows this:
TCustomMemo = class(TCustomEdit)
private
FLines: TStrings;
FScrollBars: System.UITypes.TScrollStyle;
FWordWrap: Boolean;
FWantReturns: Boolean;
FWantTabs: Boolean;
class constructor Create;
class destructor Destroy;
procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE;
procedure WMNCDestroy(var Message: TWMNCDestroy); message WM_NCDESTROY;
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWindowHandle(const Params: TCreateParams); override;
function GetCaretPos: TPoint; virtual; <------
procedure DoGetGestureOptions(var Gestures: TInteractiveGestures;
var Options: TInteractiveGestureOptions); override;
. . .