You've already forked lazarus-ccr
jvcllaz: ReadOnly support in TJvYearGrid. YearGridEditForm contains a color box for color selection. Extended YearGrid demo.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8374 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -30,13 +30,16 @@ unit JvYearGridEditForm;
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls;
|
||||
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons,
|
||||
ExtCtrls, ColorBox;
|
||||
|
||||
type
|
||||
|
||||
{ TYearGridEditForm }
|
||||
|
||||
TYearGridEditForm = class(TForm) //JvForm)
|
||||
ColorBox: TColorBox;
|
||||
LblColor: TLabel;
|
||||
Panel1: TPanel;
|
||||
BtnOK: TBitBtn;
|
||||
BitCancel: TBitBtn;
|
||||
@ -44,9 +47,11 @@ type
|
||||
BtnLoad: TButton;
|
||||
BtnSave: TButton;
|
||||
OpenDialog: TOpenDialog;
|
||||
Panel2: TPanel;
|
||||
SaveDialog: TSaveDialog;
|
||||
procedure BtnLoadClick(Sender: TObject);
|
||||
procedure BtnSaveClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
public
|
||||
end;
|
||||
@ -56,6 +61,9 @@ implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
const
|
||||
DEFAULT_COLOR = 206 + 250 shl 8 + 253 shl 16;
|
||||
|
||||
procedure TYearGridEditForm.BtnLoadClick(Sender: TObject);
|
||||
begin
|
||||
if OpenDialog.Execute then
|
||||
@ -70,10 +78,16 @@ begin
|
||||
MemoText.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TYearGridEditForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
ColorBox.DefaultColorColor := DEFAULT_COLOR;
|
||||
ColorBox.Selected := DEFAULT_COLOR;
|
||||
end;
|
||||
|
||||
procedure TYearGridEditForm.FormShow(Sender: TObject);
|
||||
begin
|
||||
MemoText.SetFocus;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
Reference in New Issue
Block a user