mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 13:09:35 +02:00
convert LM_APPENDTEXT to interface method
git-svn-id: trunk@5959 -
This commit is contained in:
parent
574cfd8529
commit
9bf5da6991
lcl
@ -128,7 +128,7 @@ begin
|
||||
LastLine:=S+LineEnding;
|
||||
if (CurText<>'') and (not (CurText[length(CurText)] in [#10,#13])) then
|
||||
LastLine:=LineEnding+LastLine;
|
||||
CNSendMessage(LM_APPENDTEXT, FMemo, PChar(LastLine))
|
||||
FMemoWidgetClass.AppendText(FMemo, LastLine);
|
||||
end else begin
|
||||
TempStrings.Insert(Index, S);
|
||||
FMemo.Text:=TempStrings.Text;
|
||||
@ -148,6 +148,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.11 2004/09/10 17:59:57 micha
|
||||
convert LM_APPENDTEXT to interface method
|
||||
|
||||
Revision 1.10 2004/04/10 17:58:57 mattias
|
||||
implemented mainunit hints for include files
|
||||
|
||||
|
@ -255,7 +255,6 @@ type
|
||||
|
||||
// misc
|
||||
Function GetCaption(Sender : TObject) : String; virtual;
|
||||
procedure AppendText(Sender: TObject; Str: PChar); virtual;
|
||||
Procedure SetPixel(Sender : TObject; Data : Pointer);virtual;
|
||||
Procedure GetPixel(Sender : TObject; Data : Pointer);virtual;
|
||||
function GetValue(Sender : TObject; Data : pointer) : integer;virtual;
|
||||
@ -460,6 +459,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.196 2004/09/10 17:59:57 micha
|
||||
convert LM_APPENDTEXT to interface method
|
||||
|
||||
Revision 1.195 2004/09/10 16:28:51 mattias
|
||||
implemented very rudimentary TTabControl
|
||||
|
||||
|
@ -3854,9 +3854,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
LM_APPENDTEXT:
|
||||
AppendText(Sender,PChar(Data));
|
||||
|
||||
else
|
||||
if Sender<>nil then
|
||||
Assert(True, Format('WARNING: Unhandled message %d in IntSendMessage3'
|
||||
@ -3917,33 +3914,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
procedure TGtkWidgetSet.AppendText(Sender: TObject; Str: PChar);
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TGtkWidgetSet.AppendText(Sender: TObject; Str: PChar);
|
||||
var
|
||||
Widget: PGtkWidget;
|
||||
CurMemoLen: cardinal;
|
||||
begin
|
||||
if Str=nil then exit;
|
||||
|
||||
if (Sender is TWinControl) then begin
|
||||
{$IfDef GTK1}
|
||||
case TWinControl(Sender).fCompStyle of
|
||||
csMemo:
|
||||
begin
|
||||
Widget:=GetWidgetInfo(Pointer(TWinControl(Sender).Handle),
|
||||
true)^.CoreWidget;
|
||||
gtk_text_freeze(PGtkText(Widget));
|
||||
CurMemoLen := gtk_text_get_length(PGtkText(Widget));
|
||||
gtk_editable_insert_text(PGtkOldEditable(Widget),Str,StrLen(Str),@CurMemoLen);
|
||||
gtk_text_thaw(PGtkText(Widget));
|
||||
end;
|
||||
end;
|
||||
{$EndIf}
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: TGtkWidgetSet.SetCallback
|
||||
Params: AMsg - message for which to set a callback
|
||||
@ -8853,6 +8823,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.547 2004/09/10 17:59:58 micha
|
||||
convert LM_APPENDTEXT to interface method
|
||||
|
||||
Revision 1.546 2004/09/10 16:28:51 mattias
|
||||
implemented very rudimentary TTabControl
|
||||
|
||||
|
@ -124,6 +124,7 @@ type
|
||||
private
|
||||
protected
|
||||
public
|
||||
class procedure AppendText(const ACustomMemo: TCustomMemo; AText: string); override;
|
||||
end;
|
||||
|
||||
{ TGtkWSEdit }
|
||||
@ -339,6 +340,25 @@ begin
|
||||
{$EndIf}
|
||||
end;
|
||||
|
||||
{ TGtkWSCustomMemo }
|
||||
|
||||
procedure TGtkWSCustomMemo.AppendText(const ACustomMemo: TCustomMemo; AText: string);
|
||||
var
|
||||
Widget: PGtkWidget;
|
||||
CurMemoLen: cardinal;
|
||||
begin
|
||||
if Length(AText) = 0 then
|
||||
exit;
|
||||
|
||||
{$IfDef GTK1}
|
||||
Widget:=GetWidgetInfo(Pointer(ACustomMemo.Handle), true)^.CoreWidget;
|
||||
gtk_text_freeze(PGtkText(Widget));
|
||||
CurMemoLen := gtk_text_get_length(PGtkText(Widget));
|
||||
gtk_editable_insert_text(PGtkOldEditable(Widget), PChar(AText), Length(AText), @CurMemoLen);
|
||||
gtk_text_thaw(PGtkText(Widget));
|
||||
{$EndIf}
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@ -355,7 +375,7 @@ initialization
|
||||
// RegisterWSComponent(TCustomListBox, TGtkWSCustomListBox);
|
||||
// RegisterWSComponent(TListBox, TGtkWSListBox);
|
||||
RegisterWSComponent(TCustomEdit, TGtkWSCustomEdit);
|
||||
// RegisterWSComponent(TCustomMemo, TGtkWSCustomMemo);
|
||||
RegisterWSComponent(TCustomMemo, TGtkWSCustomMemo);
|
||||
// RegisterWSComponent(TEdit, TGtkWSEdit);
|
||||
// RegisterWSComponent(TMemo, TGtkWSMemo);
|
||||
// RegisterWSComponent(TCustomLabel, TGtkWSCustomLabel);
|
||||
|
@ -244,7 +244,6 @@ Var
|
||||
Num: Integer;
|
||||
PStr, PStr2: PChar;
|
||||
SizeRect: TRECT; // used by LM_SETSIZE,LM_INVALIDATE,LM_CLB_SET_CHECKED and LM_REDRAW
|
||||
S: String;
|
||||
TBB: TBBUTTON;
|
||||
WindowStyle: Integer; //used by LM_SETTABPOSITION
|
||||
AMenu: TMenu;
|
||||
@ -299,16 +298,6 @@ Begin
|
||||
Exit;
|
||||
End;
|
||||
Case LM_Message of
|
||||
LM_APPENDTEXT:
|
||||
Begin
|
||||
if (Data <> nil) and (PChar(Data)^ <> #0) then
|
||||
begin
|
||||
{ TODO: needs to be moved/changed when TWSWinControl.SetText is broken up further }
|
||||
TWin32WSWinControl.GetText(Sender as TWinControl, S);
|
||||
S := S + PChar(Data);
|
||||
TWin32WSWinControl.SetText(Sender as TWinControl, S);
|
||||
end;
|
||||
End;
|
||||
LM_ADDCHILD:
|
||||
Begin
|
||||
Assert(False, 'Trace:Adding a child to Parent');
|
||||
@ -2771,6 +2760,9 @@ End;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.239 2004/09/10 17:59:58 micha
|
||||
convert LM_APPENDTEXT to interface method
|
||||
|
||||
Revision 1.238 2004/09/10 14:38:29 micha
|
||||
convert lm_gettext to new interface methods
|
||||
remove lm_settext replacement settext methods in twidgetsets
|
||||
|
@ -129,6 +129,7 @@ type
|
||||
private
|
||||
protected
|
||||
public
|
||||
class procedure AppendText(const ACustomMemo: TCustomMemo; AText: string); override;
|
||||
end;
|
||||
|
||||
{ TWin32WSEdit }
|
||||
@ -376,6 +377,21 @@ begin
|
||||
SetProp(winhandle, 'MAXLENGTH', NewLength);
|
||||
end;
|
||||
|
||||
{ TWin32WSCustomMemo }
|
||||
|
||||
procedure TWin32WSCustomMemo.AppendText(const ACustomMemo: TCustomMemo; AText: string);
|
||||
var
|
||||
S: string;
|
||||
begin
|
||||
if Length(AText) > 0 then
|
||||
begin
|
||||
GetText(ACustomMemo, S);
|
||||
S := S + AText;
|
||||
SetText(ACustomMemo, S);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@ -392,7 +408,7 @@ initialization
|
||||
RegisterWSComponent(TCustomListBox, TWin32WSCustomListBox);
|
||||
// RegisterWSComponent(TListBox, TWin32WSListBox);
|
||||
RegisterWSComponent(TCustomEdit, TWin32WSCustomEdit);
|
||||
// RegisterWSComponent(TCustomMemo, TWin32WSCustomMemo);
|
||||
RegisterWSComponent(TCustomMemo, TWin32WSCustomMemo);
|
||||
// RegisterWSComponent(TEdit, TWin32WSEdit);
|
||||
// RegisterWSComponent(TMemo, TWin32WSMemo);
|
||||
// RegisterWSComponent(TCustomLabel, TWin32WSCustomLabel);
|
||||
|
@ -214,7 +214,6 @@ const
|
||||
LM_SETCURSOR = LM_User+81;
|
||||
|
||||
LM_INTERNALPAINT = LM_User + 90;
|
||||
LM_APPENDTEXT = LM_User + 91;
|
||||
|
||||
// these IDs are reserved for internal messages in the interfaces
|
||||
LM_INTERFACEFIRST = LM_User+99;
|
||||
@ -1034,6 +1033,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.80 2004/09/10 17:59:57 micha
|
||||
convert LM_APPENDTEXT to interface method
|
||||
|
||||
Revision 1.79 2004/09/10 14:38:29 micha
|
||||
convert lm_gettext to new interface methods
|
||||
remove lm_settext replacement settext methods in twidgetsets
|
||||
|
@ -1123,6 +1123,7 @@ type
|
||||
TMemoStrings = class(TStrings)
|
||||
private
|
||||
FMemo: TCustomMemo;
|
||||
FMemoWidgetClass: TWSCustomMemoClass;
|
||||
protected
|
||||
function Get(Index : Integer): String; override;
|
||||
function GetCount: Integer; override;
|
||||
@ -1131,6 +1132,8 @@ type
|
||||
procedure Clear; override;
|
||||
procedure Delete(index : Integer); override;
|
||||
procedure Insert(index: Integer; const S: String); override;
|
||||
|
||||
property MemoWidgetClass: TWSCustomMemoClass read FMemoWidgetClass write FMemoWidgetClass;
|
||||
end;
|
||||
|
||||
procedure Register;
|
||||
@ -1171,6 +1174,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.166 2004/09/10 17:59:57 micha
|
||||
convert LM_APPENDTEXT to interface method
|
||||
|
||||
Revision 1.165 2004/09/10 09:43:12 micha
|
||||
convert LM_SETLABEL message to interface methods
|
||||
|
||||
|
@ -116,7 +116,10 @@ type
|
||||
{ TWSCustomMemo }
|
||||
|
||||
TWSCustomMemo = class(TWSCustomEdit)
|
||||
public
|
||||
class procedure AppendText(const ACustomMemo: TCustomMemo; AText: string); virtual;
|
||||
end;
|
||||
TWSCustomMemoClass = class of TWSCustomMemo;
|
||||
|
||||
{ TWSEdit }
|
||||
|
||||
@ -251,6 +254,12 @@ procedure TWSCustomEdit.SetSelLength(const ACustomEdit: TCustomEdit; NewLength:
|
||||
begin
|
||||
end;
|
||||
|
||||
{ TWSCustomMemo }
|
||||
|
||||
procedure TWSCustomMemo.AppendText(const ACustomMemo: TCustomMemo; AText: string);
|
||||
begin
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@ -265,7 +274,7 @@ initialization
|
||||
RegisterWSComponent(TCustomListBox, TWSCustomListBox);
|
||||
// RegisterWSComponent(TListBox, TWSListBox);
|
||||
RegisterWSComponent(TCustomEdit, TWSCustomEdit);
|
||||
// RegisterWSComponent(TCustomMemo, TWSCustomMemo);
|
||||
RegisterWSComponent(TCustomMemo, TWSCustomMemo);
|
||||
// RegisterWSComponent(TEdit, TWSEdit);
|
||||
// RegisterWSComponent(TMemo, TWSMemo);
|
||||
// RegisterWSComponent(TCustomLabel, TWSCustomLabel);
|
||||
|
Loading…
Reference in New Issue
Block a user