You've already forked lina-components
mirror of
https://bitbucket.org/Dennis07/lina-components.git
synced 2025-08-24 21:49:04 +02:00
Version 1.0 DEV 1.18
Signed-off-by: dennis07 <den.goehlert@t-online.de>
This commit is contained in:
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
These statistics cover the official repository of Lina Components.
|
These statistics cover the official repository of Lina Components.
|
||||||
|
|
||||||
Total lines of code (LoC): 18400+
|
Total lines of code (LoC): 19400+
|
||||||
Total visual components (VC): 22
|
Total visual components (VC): 23
|
||||||
|
|
||||||
Sample projects and other 3rd-party code are not included.
|
Sample projects and other 3rd-party code are not included.
|
Binary file not shown.
BIN
Resource/Bitmap/Large/TCaptionedEdit.bmp
Normal file
BIN
Resource/Bitmap/Large/TCaptionedEdit.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
Resource/Bitmap/Small/TCaptionedEdit.bmp
Normal file
BIN
Resource/Bitmap/Small/TCaptionedEdit.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
Resource/Bitmap/TCaptionedEdit.bmp
Normal file
BIN
Resource/Bitmap/TCaptionedEdit.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
@@ -5,6 +5,9 @@ TBATTERY32 BITMAP "Bitmap\Large\TBattery.bmp"
|
|||||||
TCALCULATOR BITMAP "Bitmap\TCalculator.bmp"
|
TCALCULATOR BITMAP "Bitmap\TCalculator.bmp"
|
||||||
TCALCULATOR16 BITMAP "Bitmap\Small\TCalculator.bmp"
|
TCALCULATOR16 BITMAP "Bitmap\Small\TCalculator.bmp"
|
||||||
TCALCULATOR32 BITMAP "Bitmap\Large\TCalculator.bmp"
|
TCALCULATOR32 BITMAP "Bitmap\Large\TCalculator.bmp"
|
||||||
|
TCAPTIONEDEDIT BITMAP "Bitmap\TCaptionedEdit.bmp"
|
||||||
|
TCAPTIONEDEDIT16 BITMAP "Bitmap\Small\TCaptionedEdit.bmp"
|
||||||
|
TCAPTIONEDEDIT32 BITMAP "Bitmap\Large\TCaptionedEdit.bmp"
|
||||||
TCOMMANDBUTTON BITMAP "Bitmap\TCommandButton.bmp"
|
TCOMMANDBUTTON BITMAP "Bitmap\TCommandButton.bmp"
|
||||||
TCOMMANDBUTTON16 BITMAP "Bitmap\Small\TCommandButton.bmp"
|
TCOMMANDBUTTON16 BITMAP "Bitmap\Small\TCommandButton.bmp"
|
||||||
TCOMMANDBUTTON32 BITMAP "Bitmap\Large\TCommandButton.bmp"
|
TCOMMANDBUTTON32 BITMAP "Bitmap\Large\TCommandButton.bmp"
|
||||||
|
@@ -144,6 +144,40 @@ type
|
|||||||
property CaptionPosition: TPoint read FCaptionPosition write FCaptionPosition;
|
property CaptionPosition: TPoint read FCaptionPosition write FCaptionPosition;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFNDEF NO_MULTIPLATFORM}
|
||||||
|
[ComponentPlatformsAttribute(pidWin32 or pidWin64)]
|
||||||
|
{$ENDIF}
|
||||||
|
TCaptionedEdit = class(TEdit)
|
||||||
|
private
|
||||||
|
{ Private-Deklarationen }
|
||||||
|
FAbout: TComponentAbout;
|
||||||
|
FShowCaption: Boolean;
|
||||||
|
FCaption: TCaption;
|
||||||
|
FCaptionFont: TFont;
|
||||||
|
FCaptionMode: TMemoCaptionMode;
|
||||||
|
FCaptionVisible: Boolean;
|
||||||
|
FCaptionPosition: TPoint;
|
||||||
|
{ Methoden }
|
||||||
|
procedure SetShowCaption(Value: Boolean);
|
||||||
|
procedure SetCaptionFont(Value: TFont);
|
||||||
|
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
|
||||||
|
protected
|
||||||
|
procedure WndProc(var Message: TMessage); override;
|
||||||
|
public
|
||||||
|
{ Public-Deklarationen }
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
destructor Destroy; override;
|
||||||
|
property CaptionVisible: Boolean read FCaptionVisible default False;
|
||||||
|
published
|
||||||
|
{ Published-Deklarationen }
|
||||||
|
property About: TComponentAbout read FAbout;
|
||||||
|
property ShowCaption: Boolean read FShowCaption write SetShowCaption default True;
|
||||||
|
property Caption: TCaption read FCaption write FCaption;
|
||||||
|
property CaptionFont: TFont read FCaptionFont write SetCaptionFont;
|
||||||
|
property CaptionMode: TMemoCaptionMode read FCaptionMode write FCaptionMode default mcmUnfocusedOnly;
|
||||||
|
property CaptionPosition: TPoint read FCaptionPosition write FCaptionPosition;
|
||||||
|
end;
|
||||||
|
|
||||||
TShortcutLabel = class;
|
TShortcutLabel = class;
|
||||||
|
|
||||||
TShortcutLabelFont = class(TPersistent)
|
TShortcutLabelFont = class(TPersistent)
|
||||||
@@ -332,7 +366,7 @@ implementation
|
|||||||
{$IFDEF ADD_COMPONENTREG}
|
{$IFDEF ADD_COMPONENTREG}
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
RegisterComponents({$IFDEF ADD_SINGLECATEGORY}ComponentsPage{$ELSE}ComponentsPage_Advanced{$ENDIF},[TCommandButton,TScrollListBox,TPaintMemo,TShortcutLabel,TSizePanel,TPathEdit,TValueEdit]);
|
RegisterComponents({$IFDEF ADD_SINGLECATEGORY}ComponentsPage{$ELSE}ComponentsPage_Advanced{$ENDIF},[TCommandButton,TScrollListBox,TPaintMemo,TCaptionedEdit,TShortcutLabel,TSizePanel,TPathEdit,TValueEdit]);
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
@@ -705,6 +739,88 @@ begin
|
|||||||
OnPaint(Self);
|
OnPaint(Self);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ ----------------------------------------------------------------------------
|
||||||
|
TCaptionedEdit
|
||||||
|
---------------------------------------------------------------------------- }
|
||||||
|
|
||||||
|
constructor TCaptionedEdit.Create(AOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
FAbout := TComponentAbout.Create(TCaptionedEdit);
|
||||||
|
FShowCaption := True;
|
||||||
|
FCaptionFont := TFont.Create;
|
||||||
|
FCaptionFont.Assign(Font);
|
||||||
|
FCaptionFont.Color := clGray;
|
||||||
|
FCaptionFont.Style := [fsItalic];
|
||||||
|
FCaptionMode := mcmUnfocusedOnly;
|
||||||
|
FCaptionVisible := False;
|
||||||
|
FCaptionPosition.X := 2;
|
||||||
|
FCaptionPosition.Y := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
destructor TCaptionedEdit.Destroy;
|
||||||
|
begin
|
||||||
|
FAbout.Free;
|
||||||
|
FCaptionFont.Free;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCaptionedEdit.SetShowCaption(Value: Boolean);
|
||||||
|
begin
|
||||||
|
FShowCaption := Value;
|
||||||
|
Repaint;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCaptionedEdit.SetCaptionFont(Value: TFont);
|
||||||
|
begin
|
||||||
|
FCaptionFont.Assign(Value);
|
||||||
|
Repaint;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCaptionedEdit.WMPaint(var Message: TWMPaint);
|
||||||
|
var
|
||||||
|
CCanvas: TControlCanvas;
|
||||||
|
CRect: TRect;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
FCaptionVisible := False;
|
||||||
|
if FShowCaption and (not (csDestroying in ComponentState)) then
|
||||||
|
begin
|
||||||
|
if ((not Focused) or (CaptionMode = mcmAnyState)) and (Length(Text) < 1) then
|
||||||
|
begin
|
||||||
|
CCanvas := TControlCanvas.Create;
|
||||||
|
try
|
||||||
|
CCanvas.Control := Self;
|
||||||
|
CCanvas.Brush.Color := Color;
|
||||||
|
CRect := ClientRect;
|
||||||
|
InflateRect(CRect,3,3);
|
||||||
|
CCanvas.FillRect(CRect);
|
||||||
|
CCanvas.Font.Assign(FCaptionFont);
|
||||||
|
CCanvas.TextOut(FCaptionPosition.X,FCaptionPosition.Y,FCaption);
|
||||||
|
finally
|
||||||
|
CCanvas.Free;
|
||||||
|
end;
|
||||||
|
FCaptionVisible := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCaptionedEdit.WndProc(var Message: TMessage);
|
||||||
|
begin
|
||||||
|
inherited WndProc(Message);
|
||||||
|
case Message.Msg of
|
||||||
|
WM_LBUTTONUP, WM_LBUTTONDOWN, WM_LBUTTONDBLCLK,
|
||||||
|
WM_RBUTTONDOWN, WM_RBUTTONUP, WM_RBUTTONDBLCLK,
|
||||||
|
WM_MOUSEMOVE,
|
||||||
|
WM_SETFOCUS, WM_KILLFOCUS,
|
||||||
|
WM_KEYDOWN, WM_KEYUP: begin
|
||||||
|
Repaint;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ ----------------------------------------------------------------------------
|
{ ----------------------------------------------------------------------------
|
||||||
TShortcutLabelFont
|
TShortcutLabelFont
|
||||||
---------------------------------------------------------------------------- }
|
---------------------------------------------------------------------------- }
|
||||||
|
Reference in New Issue
Block a user