mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 19:58:25 +02:00
247 lines
8.0 KiB
PHP
247 lines
8.0 KiB
PHP
// included by stdctrls.pp
|
|
|
|
{******************************************************************************
|
|
TCustomMemo
|
|
******************************************************************************
|
|
|
|
*****************************************************************************
|
|
* *
|
|
* This file is part of the Lazarus Component Library (LCL) *
|
|
* *
|
|
* See the file COPYING.LCL, included in this distribution, *
|
|
* for details about the copyright. *
|
|
* *
|
|
* This program is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
|
* *
|
|
*****************************************************************************
|
|
}
|
|
|
|
{------------------------------------------------------------------------------
|
|
Method: TCustomMemo.Create
|
|
Params:
|
|
Returns:
|
|
|
|
Constructor for the class
|
|
------------------------------------------------------------------------------}
|
|
constructor TCustomMemo.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
fCompStyle := csMemo;
|
|
FWordWrap := True;
|
|
FFont := TFont.Create;
|
|
FLines := TMemoStrings.Create(Self);
|
|
FVertScrollbar := TMemoScrollBar.Create(Self, sbVertical);
|
|
FHorzScrollbar := TMemoScrollBar.Create(Self, sbHorizontal);
|
|
SetInitialBounds(0,0,185,90);
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
Method: TCustomMemo.Destroy
|
|
Params: None
|
|
Returns: Nothing
|
|
|
|
Destructor for the class.
|
|
------------------------------------------------------------------------------}
|
|
destructor TCustomMemo.Destroy;
|
|
begin
|
|
FreeThenNil(FLines);
|
|
FreeThenNil(FFont);
|
|
FreeThenNil(FVertScrollbar);
|
|
FreeThenNil(FHorzScrollbar);
|
|
inherited destroy;
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
Method: TCustomMemo.Append
|
|
Params:
|
|
Returns:
|
|
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.Append(const Value : String);
|
|
begin
|
|
Lines.Add(Value);
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
procedure TCustomMemo.Clear;
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.Clear;
|
|
begin
|
|
Lines.Clear;
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
procedure TCustomMemo.Clear;
|
|
------------------------------------------------------------------------------}
|
|
function TCustomMemo.GetTextLen: Integer;
|
|
begin
|
|
Result := Length(Text);
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
procedure TCustomMemo.SetHorzScrollBar(const AValue: TMemoScrollBar);
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.SetHorzScrollBar(const AValue: TMemoScrollBar);
|
|
begin
|
|
if FHorzScrollBar=AValue then exit;
|
|
FHorzScrollBar:=AValue;
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
procedure TCustomMemo.SetVertScrollBar(const AValue: TMemoScrollBar);
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.SetVertScrollBar(const AValue: TMemoScrollBar);
|
|
begin
|
|
if FVertScrollBar=AValue then exit;
|
|
FVertScrollBar:=AValue;
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
function TCustomMemo.StoreScrollBars: boolean;
|
|
------------------------------------------------------------------------------}
|
|
function TCustomMemo.StoreScrollBars: boolean;
|
|
begin
|
|
Result:=true;
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
Method: TCustomMemo.SetLines
|
|
Params:
|
|
Returns:
|
|
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.SetLines(const Value : TStrings);
|
|
begin
|
|
if (Value <> nil) then
|
|
FLines.Assign(Value);
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
procedure TCustomMemo.SetScrollbars(const Value : TScrollStyle);
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.SetScrollbars(const Value : TScrollStyle);
|
|
begin
|
|
if Value <> FScrollbars then begin
|
|
FScrollbars:= Value;
|
|
if HandleAllocated then
|
|
CNSendMessage(LM_SETPROPERTIES, Self, nil);
|
|
end;
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
procedure TCustomMemo.InitializeWnd;
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.InitializeWnd;
|
|
begin
|
|
inherited InitializeWnd;
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
procedure TCustomMemo.Loaded;
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.Loaded;
|
|
begin
|
|
inherited Loaded;
|
|
CNSendMessage(LM_SETPROPERTIES, Self, nil);
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
Method: TCustomMemo.SetWordWrap
|
|
Params:
|
|
Returns:
|
|
|
|
------------------------------------------------------------------------------}
|
|
procedure TCustomMemo.SetWordWrap(const Value : boolean);
|
|
begin
|
|
if Value <> FWordWrap then begin
|
|
FWordWrap := Value;
|
|
if HandleAllocated and (not (csLoading in ComponentState)) then
|
|
CNSendMessage(LM_SETPROPERTIES, Self, nil);
|
|
end;
|
|
end;
|
|
|
|
// included by stdctrls.pp
|
|
|
|
{ =============================================================================
|
|
|
|
$Log$
|
|
Revision 1.17 2003/11/01 18:58:15 mattias
|
|
added clipboard support for TCustomEdit from Colin
|
|
|
|
Revision 1.16 2003/06/13 11:58:46 mattias
|
|
fixed readonly of properties
|
|
|
|
Revision 1.15 2003/04/15 08:54:27 mattias
|
|
fixed TMemo.WordWrap
|
|
|
|
Revision 1.14 2003/03/31 10:57:40 mattias
|
|
fixes for current fpc 1.1
|
|
|
|
Revision 1.13 2003/03/31 10:49:50 mattias
|
|
fixed parsing records
|
|
|
|
Revision 1.12 2003/03/29 17:20:05 mattias
|
|
added TMemoScrollBar
|
|
|
|
Revision 1.11 2003/03/28 23:03:38 mattias
|
|
started TMemoScrollbar
|
|
|
|
Revision 1.10 2003/03/17 08:51:09 mattias
|
|
added IsWindowVisible
|
|
|
|
Revision 1.9 2003/03/11 07:46:43 mattias
|
|
more localization for gtk- and win32-interface and lcl
|
|
|
|
Revision 1.8 2002/10/30 13:50:26 lazarus
|
|
MG: fixed message without handle
|
|
|
|
Revision 1.7 2002/09/05 10:12:07 lazarus
|
|
|
|
New dialog for multiline caption of TCustomLabel.
|
|
Prettified TStrings property editor.
|
|
Memo now has automatic scrollbars (not fully working), WordWrap and Scrollbars property
|
|
Removed saving of old combo text (it broke things and is not needed). Cleanups.
|
|
|
|
Revision 1.6 2002/05/10 06:05:52 lazarus
|
|
MG: changed license to LGPL
|
|
|
|
Revision 1.5 2002/04/18 08:09:03 lazarus
|
|
MG: added include comments
|
|
|
|
Revision 1.4 2002/03/25 17:59:20 lazarus
|
|
GTK Cleanup
|
|
Shane
|
|
|
|
Revision 1.3 2001/11/12 07:56:56 lazarus
|
|
MG: free FFont on destroy
|
|
|
|
Revision 1.2 2001/01/10 20:12:29 lazarus
|
|
Added the Nudge feature to the IDE.
|
|
Shane
|
|
|
|
Revision 1.1 2000/07/13 10:28:25 michael
|
|
+ Initial import
|
|
|
|
Revision 1.4 2000/06/16 13:33:21 lazarus
|
|
Created a new method for adding controls to the toolbar to be dropped onto the form!
|
|
Shane
|
|
|
|
Revision 1.3 2000/05/09 02:07:40 lazarus
|
|
Replaced writelns with Asserts. CAW
|
|
|
|
Revision 1.2 2000/04/13 21:25:16 lazarus
|
|
MWE:
|
|
~ Added some docu and did some cleanup.
|
|
Hans-Joachim Ott <hjott@compuserve.com>:
|
|
* TMemo.Lines works now.
|
|
+ TMemo has now a property Scrollbar.
|
|
= TControl.GetTextBuf revised :-)
|
|
+ Implementation for CListBox columns added
|
|
* Bug in TGtkCListStringList.Assign corrected.
|
|
|
|
|
|
}
|
|
|