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.

git-svn-id: trunk@2114 -
This commit is contained in:
lazarus 2002-08-17 23:40:58 +00:00
parent e7d65f6940
commit c6b0c62f81
3 changed files with 57 additions and 32 deletions

View File

@ -1186,7 +1186,7 @@ end;
procedure TCustomSynEdit.CreateParams(var Params: TCreateParams); procedure TCustomSynEdit.CreateParams(var Params: TCreateParams);
const const
ScrollBar: array[TScrollStyle] of DWORD = (0, WS_HSCROLL, WS_VSCROLL, ScrollBar: array[TScrollStyle] of DWORD = (0, WS_HSCROLL, WS_VSCROLL,
WS_HSCROLL or WS_VSCROLL); WS_HSCROLL or WS_VSCROLL, WS_HSCROLL, WS_VSCROLL, WS_HSCROLL or WS_VSCROLL);
BorderStyles: array[TBorderStyle] of DWORD = (0, WS_BORDER); BorderStyles: array[TBorderStyle] of DWORD = (0, WS_BORDER);
ClassStylesOff = CS_VREDRAW or CS_HREDRAW; ClassStylesOff = CS_VREDRAW or CS_HREDRAW;
begin begin

View File

@ -185,12 +185,12 @@ end;
procedure TMemoTestForm.Button5Click(Sender: TObject); procedure TMemoTestForm.Button5Click(Sender: TObject);
begin begin
Memo1.Lines.Add(Edit1.Text); Memo1.Append(Edit1.Text);
end; end;
procedure TMemoTestForm.Button6Click(Sender: TObject); procedure TMemoTestForm.Button6Click(Sender: TObject);
begin begin
Memo2.Lines.Add(Edit1.Text); Memo2.Append(Edit1.Text);
end; end;
begin begin

View File

@ -17,32 +17,6 @@
* * * *
***************************************************************************** *****************************************************************************
} }
{------------------------------------------------------------------------------
Method: TCustomMemo.Append
Params:
Returns:
------------------------------------------------------------------------------}
procedure TCustomMemo.Append(Value : String);
begin
//TODO: Custommemo.append
end;
{------------------------------------------------------------------------------
Method: TCustomMemo.SetLines
Params:
Returns:
------------------------------------------------------------------------------}
procedure TCustomMEmo.SetLines(Value : TStrings);
begin
if Value <> nil then
begin
Assert(False, 'Trace:Assigning Lines');
FLines.Assign(Value);
Assert(False, 'Trace:Assigned Lines');
end;
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Method: TCustomMemo.Create Method: TCustomMemo.Create
@ -55,6 +29,8 @@ constructor TCustomMemo.Create(AOwner: TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
fCompStyle := csMemo; fCompStyle := csMemo;
Width:= 185;
Height:= 89;
FWordWrap := True; FWordWrap := True;
FFont := TFont.Create; FFont := TFont.Create;
FLines := TMemoStrings.Create(Self); FLines := TMemoStrings.Create(Self);
@ -74,16 +50,59 @@ begin
inherited destroy; inherited destroy;
end; end;
{------------------------------------------------------------------------------
Method: TCustomMemo.Append
Params:
Returns:
------------------------------------------------------------------------------}
procedure TCustomMemo.Append(const Value : String);
begin
Lines.Add(Value);
end;
{------------------------------------------------------------------------------
Method: TCustomMemo.SetLines
Params:
Returns:
------------------------------------------------------------------------------}
procedure TCustomMemo.SetLines(Value : TStrings);
begin
if Value <> nil then
begin
Assert(False, 'Trace:Assigning Lines');
FLines.Assign(Value);
Assert(False, 'Trace:Assigned Lines');
end;
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Method: TCustomMemo.SetWordWrap Method: TCustomMemo.SetWordWrap
Params: Params:
Returns: Returns:
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TCustomMemo.SetWordWrap(Value : Boolean); procedure TCustomMemo.SetScrollbars(const Value : TScrollStyle);
begin begin
FWordWrap := Value; if Value <> FScrollbars then begin
//TODO:Call sendmessage FScrollbars:= Value;
CNSendMessage(LM_SETPROPERTIES, Self, nil);
end;
end;
{------------------------------------------------------------------------------
Method: TCustomMemo.SetWordWrap
Params:
Returns:
------------------------------------------------------------------------------}
procedure TCustomMemo.SetWordWrap(const Value : boolean);
begin
if Value <> FWordWrap then begin
FWordWrap := Value;
CNSendMessage(LM_SETPROPERTIES, Self, nil);
end;
end; end;
// included by stdctrls.pp // included by stdctrls.pp
@ -91,6 +110,12 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
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 Revision 1.6 2002/05/10 06:05:52 lazarus
MG: changed license to LGPL MG: changed license to LGPL