You've already forked lazarus-ccr
richmemo: implementing Redo and CanRedo for Win32
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5844 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -203,6 +203,7 @@ type
|
||||
CurrentPage: Integer; var AbortPrint: Boolean);
|
||||
procedure DoLinkAction(ALinkAction: TLinkAction; const AMouseInfo: TLinkMouseInfo;
|
||||
LinkStart, LinkEnd: Integer);
|
||||
function GetCanRedo: Boolean; virtual;
|
||||
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
@ -257,11 +258,14 @@ type
|
||||
|
||||
function CharAtPos(x, y: Integer): Integer;
|
||||
|
||||
procedure Redo; virtual;
|
||||
|
||||
property HideSelection : Boolean read fHideSelection write SetHideSelection;
|
||||
property OnSelectionChange: TNotifyEvent read fOnSelectionChange write fOnSelectionChange;
|
||||
property ZoomFactor: Double read GetZoomFactor write SetZoomFactor;
|
||||
property OnPrintAction: TPrintActionEvent read fOnPrintAction write fOnPrintAction;
|
||||
property OnLinkAction: TLinkActionEvent read fOnLinkAction write fOnLinkAction;
|
||||
property CanRedo: Boolean read GetCanRedo;
|
||||
end;
|
||||
|
||||
{ TRichMemo }
|
||||
@ -1102,6 +1106,14 @@ begin
|
||||
Result:=-1;
|
||||
end;
|
||||
|
||||
function TCustomRichMemo.GetCanRedo: Boolean;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
Result:=TWSCustomRichMemoClass(WidgetSetClass).GetCanRedo(Self)
|
||||
else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
function TCustomRichMemo.PrintMeasure(const params: TPrintParams; var est: TPrintMeasure): Boolean;
|
||||
begin
|
||||
if not Assigned(Printer) then begin
|
||||
@ -1117,5 +1129,11 @@ begin
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
procedure TCustomRichMemo.Redo;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
TWSCustomRichMemoClass(WidgetSetClass).Redo(Self);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -136,6 +136,9 @@ type
|
||||
|
||||
class function Print(const AWinControl: TWinControl; APrinter: TPrinter;
|
||||
const AParams: TPrintParams; DoPrint: Boolean): Integer; override;
|
||||
|
||||
class procedure Redo(const AWinControl: TWinControl); override;
|
||||
class function GetCanRedo(const AWinControl: TWinControl): Boolean; override;
|
||||
end;
|
||||
|
||||
{ TWin32Inline }
|
||||
@ -531,7 +534,7 @@ begin
|
||||
end;
|
||||
|
||||
class function TWin32WSCustomRichMemo.CanPasteFromClipboard(
|
||||
const AWinControl: TWinControl): Boolean;
|
||||
const AWinControl: TWinControl): boolean;
|
||||
begin
|
||||
Result:=Assigned(AWinControl) and (SendMessage(AWinControl.Handle, EM_CANPASTE, 0, 0)<>0);
|
||||
end;
|
||||
@ -1437,6 +1440,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TWin32WSCustomRichMemo.Redo(const AWinControl: TWinControl);
|
||||
begin
|
||||
SendMessage( AWinControl.Handle, EM_REDO, 0, 0);
|
||||
end;
|
||||
|
||||
class function TWin32WSCustomRichMemo.GetCanRedo(const AWinControl: TWinControl
|
||||
): Boolean;
|
||||
begin
|
||||
Result:=SendMessage( AWinControl.Handle, EM_CANREDO, 0, 0)<>0;
|
||||
end;
|
||||
|
||||
|
||||
// The function doesn't use Windows 7 (Vista?) animations. And should.
|
||||
function ThemedNCPaint(AWindow: Windows.HANDLE; RichMemo: TCustomRichMemo; WParam: WParam; LParam: LParam; var Handled: Boolean): LResult;
|
||||
|
@ -115,6 +115,9 @@ type
|
||||
AHandler: TRichMemoInline; wsObj: TRichMemoInlineWSObject); virtual;
|
||||
|
||||
class function Print(const AWinControl: TWinControl; APrinter: TPrinter; const AParams: TPrintParams; DoPrint: Boolean): Integer; virtual;
|
||||
|
||||
class procedure Redo(const AWinControl: TWinControl); virtual;
|
||||
class function GetCanRedo(const AWinControl: TWinControl): Boolean; virtual;
|
||||
end;
|
||||
TWSCustomRichMemoClass = class of TWSCustomRichMemo;
|
||||
|
||||
@ -406,5 +409,16 @@ begin
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
class procedure TWSCustomRichMemo.Redo(const AWinControl: TWinControl);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
class function TWSCustomRichMemo.GetCanRedo(const AWinControl: TWinControl
|
||||
): Boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Reference in New Issue
Block a user