| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Tel.: +0351-8012255 =}
- {= Loewenstr.7a = info@swiftsoft.de =}
- {========================================================================}
- {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
- {========================================================================}
- {= This code is for reference purposes only and may not be copied or =}
- {= distributed in any format electronic or otherwise except one copy =}
- {= for backup purposes. =}
- {= =}
- {= No Delphi Component Kit or Component individually or in a collection=}
- {= subclassed or otherwise from the code in this unit, or associated =}
- {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
- {= without express permission from SwiftSoft. =}
- {= =}
- {= For more licence informations please refer to the associated =}
- {= HelpFile. =}
- {========================================================================}
- {= $Date: 20.01.1998 - 18:00:00 $ =}
- {========================================================================}
- unit MMClrBtn;
- {$I COMPILER.INC}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes,
- WinProcs,
- {$ENDIF}
- Graphics,
- Messages,
- StdCtrls,
- Classes,
- Controls,
- Dialogs,
- MMButton,
- MMObj,
- MMString;
- const
- GridRows = 5;
- GridCols = 4;
- GridCells = GridRows*GridCols;
- GridCellSize = 18;
- GridMargin = 3;
- GridWidth = GridCols * GridCellSize;
- PopupWidth = GridWidth + 2*GridMargin;
- GridHeight = GridRows * GridCellSize;
- CustomLeft = GridWidth-GridCellSize;
- DelimTop = GridHeight + GridMargin div 2;
- CustomTop = DelimTop + GridMargin div 2 + GridMargin;
- PopupHeight = CustomTop + GridCellSize + 2*GridMargin;
-
- MM_DROPCOLORDLG = WM_USER + 1;
- type
- {-- TMMColorSpeedButton --------------------------------------------------}
- TMMCustomColorButton= class;
- TMMColorSpeedButton = class(TMMSpeedButton)
- private
- function GetColorButton: TMMCustomColorButton;
- protected
- procedure Paint; override;
- procedure FocusLine(X1, Y1, X2, Y2: integer);
- procedure DrawColor(Canvas: TCanvas; const Rect: TRect);
- procedure DrawDelimiter(Canvas: TCanvas; Left, Top, Bottom: Integer);
- public
- property ColorButton: TMMCustomColorButton read GetColorButton;
- end;
- {-- TMMColorPopup --------------------------------------------------------}
- TMMColorPopUp = class(TMMCustomControl)
- public
- constructor Create(AOwner: TComponent); override;
- property ButtonCaption: string read GetButtonCaption write SetButtonCaption;
- end;
- {-- TMMCustomColorButton -------------------------------------------------}
- TMMCustomColorButton = class(TMMCustomControl)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- protected
- property Width default 43;
- property Height default 21;
- property TabStop default True;
- property FocusColor: TColor read FFocusColor write SetFocusColor default clBlack;
- property Glyph: TBitmap read GetGlyph write SetGlyph;
- property NumGlyphs: Integer read GetNumGlyphs write SetNumGlyphs default 1;
- property Value: TColor read FValue write SetValue default clBlack;
- property CustomColors: TStrings read GetCustomColors write SetCustomColors;
- property ButtonCaption: string read FButtonCaption write SetButtonCaption;
- property ShowCurrent: Boolean read FShowCurrent write FShowCurrent default False;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- end;
- {-- TMMColorButton -------------------------------------------------------}
- TMMColorButton = class(TMMCustomColorButton)
- published
- property Width;
- property Height;
- property TabStop;
- property TabOrder;
- property FocusColor;
- property Glyph;
- property NumGlyphs;
- property Value;
- property CustomColors;
- property ButtonCaption;
- property ShowCurrent;
- property OnChange;
- property Enabled;
- property Visible;
- end;
- implementation
|