Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
IntfSimple.pas
Package: delphi.rar [view]
Upload User: fh681027
Upload Date: 2022-07-23
Package Size: 1959k
Code Size: 2k
Category:
Delphi VCL
Development Platform:
Delphi
- unit IntfSimple;
- interface
- uses
- SysUtils, Windows, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls, Buttons, IntfColSel,
- ColorGrd;
- type
- TFormSimpleColor = class(TForm, IColorSelect)
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- ColorGrid1: TColorGrid;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- procedure SetSelColor (Col: TColor);
- function GetSelColor: TColor;
- public
- procedure ApplyClick (Sender: TObject);
- function Display (Modal: Boolean = True): Boolean;
- published
- property SelectedColor: TColor
- read GetSelColor write SetSelColor;
- end;
- implementation
- {$R *.DFM}
- procedure TFormSimpleColor.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- // used by the modeless form
- Action := caFree;
- end;
- procedure TFormSimpleColor.ApplyClick(Sender: TObject);
- begin
- // set the color of the main form
- Application.MainForm.Color := SelectedColor;
- end;
- // set and get properties
- function TFormSimpleColor.GetSelColor: TColor;
- begin
- Result := ColorGrid1.ForegroundColor;
- end;
- procedure TFormSimpleColor.SetSelColor (Col: TColor);
- begin
- ColorGrid1.ForegroundIndex :=
- ColorGrid1.ColorToIndex(Col)
- end;
- function TFormSimpleColor.Display(Modal: Boolean): Boolean;
- begin
- Result := True; // default
- if Modal then
- Result := (ShowModal = mrOK)
- else
- begin
- BitBtn1.Caption := 'Apply';
- BitBtn1.OnClick := ApplyClick;
- BitBtn2.Kind := bkClose;
- Show;
- end;
- end;
- initialization
- RegisterColorSelect (TFormSimpleColor);
- end.