added TCalendarDialog and TCalculatorDialog from Michael V.C.

git-svn-id: trunk@4949 -
This commit is contained in:
mattias 2003-12-23 23:38:11 +00:00
parent 4976a7fdca
commit 2b6d885985
6 changed files with 172 additions and 22 deletions

2
.gitattributes vendored
View File

@ -537,8 +537,10 @@ images/components/tbitbtn.xpm -text svneol=native#image/x-xpixmap
images/components/tbutton.ico -text svneol=unset#image/x-icon
images/components/tbutton.xpm -text svneol=native#image/x-xpixmap
images/components/tcalcedit.xpm -text svneol=native#image/x-xpixmap
images/components/tcalculatordialog.xpm -text svneol=native#image/x-xpixmap
images/components/tcalendar.ico -text svneol=unset#image/x-icon
images/components/tcalendar.xpm -text svneol=native#image/x-xpixmap
images/components/tcalendardialog.xpm -text svneol=native#image/x-xpixmap
images/components/tcheckbox.ico -text svneol=unset#image/x-icon
images/components/tcheckbox.xpm -text svneol=native#image/x-xpixmap
images/components/tcheckgroup.xpm -text svneol=native#image/x-xpixmap

View File

@ -0,0 +1,48 @@
/* XPM */
static char * tcalculator_xpm[] = {
"22 20 25 1",
" c None",
". c #848484",
"+ c #FFFFFF",
"@ c #000000",
"# c #0000FF",
"$ c #D6D6CE",
"% c #018467",
"& c #00A98B",
"* c #00AC8D",
"= c #00AE8B",
"- c #00AF8C",
"; c #00B18A",
"> c #00B68D",
", c #00B78E",
"' c #00B98C",
") c #00BC89",
"! c #00BF90",
"~ c #00C18D",
"{ c #00C48E",
"] c #00C68B",
"^ c #00A66D",
"/ c #CECECE",
"( c #00A78A",
"_ c #00C78D",
": c #F4EDE7",
"......................",
".+@##############@+@+@",
".@@@@@@@@@@@@@@@@@@@@@",
".+$+$+$+$+$+$+$+$+$+$@",
".$+%&*=-;>,'')!~{]^$+@",
".+/(&*=-;>,'')!~{]_+$@",
"./+::::::::::::::::$+@",
".+$((((((((((((((((+$@",
"./+(^_(^_(^_(^_(^_($+@",
".+$(__(__(__(__(__(+$@",
"./+(((((((((((((((($+@",
".+$(^_(^_(^_(^_(^_(+$@",
"./+(__(__(__(__(__($+@",
".+$((((((((((((((((+$@",
"./+(^_(^_(^_(^_(^_($+@",
".+$(__(__(__(__(__(+$@",
"./+(((((((((((((((($+@",
".+$+$+$+$+$+$+$+$+$+$@",
"./+$+$+$+$+$+$+$+$+$+@",
".@@@@@@@@@@@@@@@@@@@@@"};

View File

@ -0,0 +1,49 @@
/* XPM */
static char * tcalendardialog_xpm[] = {
"22 20 26 1",
" c None",
". c #848484",
"+ c #FFFFFF",
"@ c #000000",
"# c #0000FF",
"$ c #D6D6CE",
"% c #1A506D",
"& c #1B618F",
"* c #1B6391",
"= c #1B6694",
"- c #1B6896",
"; c #1B6B97",
"> c #1C6D9A",
", c #1C709C",
"' c #1C729E",
") c #1C749F",
"! c #1C77A1",
"~ c #1D79A4",
"{ c #1D7CA6",
"] c #1D7EA7",
"^ c #1D81AA",
"/ c #1A718C",
"( c #CECECE",
"_ c #1B5F8E",
": c #1D83AC",
"< c #F2F2EA",
"......................",
".+@##############@+@+@",
".@@@@@@@@@@@@@@@@@@@@@",
".+$+$+$+$+$+$+$+$+$+$@",
".$+%&*=-;>,')!~{]^/$+@",
".+(_&*=-;>,')!~{]^:+$@",
".(+<<<<<<<<<<<<<<<<$+@",
".+$________________+$@",
".(+_/:_/:_/:_/:_/:_$+@",
".+$_::_::_::_::_::_+$@",
".(+________________$+@",
".+$_/:_/:_/:_/:_/:_+$@",
".(+_::_::_::_::_::_$+@",
".+$________________+$@",
".(+_/:_/:_/:_/:_/:_$+@",
".+$_::_::_::_::_::_+$@",
".(+________________$+@",
".+$+$+$+$+$+$+$+$+$+$@",
".(+$+$+$+$+$+$+$+$+$+@",
".@@@@@@@@@@@@@@@@@@@@@"};

View File

@ -144,6 +144,44 @@ LazarusResources.Add('tcalcedit','XPM',[
+'O o",'#10'"ooooooo@:@@@@@@@@@@@@O o",'#10'"ooooooo@@OOOOOOOOOOOOO o",'#10'"'
+'oooooooo oo",'#10'"oooooooooooooooooooooooo"'#10'};'#10
]);
LazarusResources.Add('tcalculatordialog','XPM',[
'/* XPM */'#10'static char * tcalculator_xpm[] = {'#10'"22 20 25 1",'#10'" '#9
+'c None",'#10'".'#9'c #848484",'#10'"+'#9'c #FFFFFF",'#10'"@'#9'c #000000",'
+#10'"#'#9'c #0000FF",'#10'"$'#9'c #D6D6CE",'#10'"%'#9'c #018467",'#10'"&'#9
+'c #00A98B",'#10'"*'#9'c #00AC8D",'#10'"='#9'c #00AE8B",'#10'"-'#9'c #00AF8C'
+'",'#10'";'#9'c #00B18A",'#10'">'#9'c #00B68D",'#10'",'#9'c #00B78E",'#10'"'
+''''#9'c #00B98C",'#10'")'#9'c #00BC89",'#10'"!'#9'c #00BF90",'#10'"~'#9'c #'
+'00C18D",'#10'"{'#9'c #00C48E",'#10'"]'#9'c #00C68B",'#10'"^'#9'c #00A66D",'
+#10'"/'#9'c #CECECE",'#10'"('#9'c #00A78A",'#10'"_'#9'c #00C78D",'#10'":'#9
+'c #F4EDE7",'#10'"......................",'#10'".+@##############@+@+@",'#10
+'".@@@@@@@@@@@@@@@@@@@@@",'#10'".+$+$+$+$+$+$+$+$+$+$@",'#10'".$+%&*=-;>,'''
+''')!~{]^$+@",'#10'".+/(&*=-;>,'''')!~{]_+$@",'#10'"./+::::::::::::::::$+@",'
+#10'".+$((((((((((((((((+$@",'#10'"./+(^_(^_(^_(^_(^_($+@",'#10'".+$(__(__(_'
+'_(__(__(+$@",'#10'"./+(((((((((((((((($+@",'#10'".+$(^_(^_(^_(^_(^_(+$@",'
+#10'"./+(__(__(__(__(__($+@",'#10'".+$((((((((((((((((+$@",'#10'"./+(^_(^_(^'
+'_(^_(^_($+@",'#10'".+$(__(__(__(__(__(+$@",'#10'"./+(((((((((((((((($+@",'
+#10'".+$+$+$+$+$+$+$+$+$+$@",'#10'"./+$+$+$+$+$+$+$+$+$+@",'#10'".@@@@@@@@@@'
+'@@@@@@@@@@@"};'#10
]);
LazarusResources.Add('tcalendardialog','XPM',[
'/* XPM */'#10'static char * tcalendardialog_xpm[] = {'#10'"22 20 26 1",'#10
+'" '#9'c None",'#10'".'#9'c #848484",'#10'"+'#9'c #FFFFFF",'#10'"@'#9'c #000'
+'000",'#10'"#'#9'c #0000FF",'#10'"$'#9'c #D6D6CE",'#10'"%'#9'c #1A506D",'#10
+'"&'#9'c #1B618F",'#10'"*'#9'c #1B6391",'#10'"='#9'c #1B6694",'#10'"-'#9'c #'
+'1B6896",'#10'";'#9'c #1B6B97",'#10'">'#9'c #1C6D9A",'#10'",'#9'c #1C709C",'
+#10'"'''#9'c #1C729E",'#10'")'#9'c #1C749F",'#10'"!'#9'c #1C77A1",'#10'"~'#9
+'c #1D79A4",'#10'"{'#9'c #1D7CA6",'#10'"]'#9'c #1D7EA7",'#10'"^'#9'c #1D81AA'
+'",'#10'"/'#9'c #1A718C",'#10'"('#9'c #CECECE",'#10'"_'#9'c #1B5F8E",'#10'":'
+#9'c #1D83AC",'#10'"<'#9'c #F2F2EA",'#10'"......................",'#10'".+@#'
+'#############@+@+@",'#10'".@@@@@@@@@@@@@@@@@@@@@",'#10'".+$+$+$+$+$+$+$+$+$'
+'+$@",'#10'".$+%&*=-;>,'')!~{]^/$+@",'#10'".+(_&*=-;>,'')!~{]^:+$@",'#10'".('
+'+<<<<<<<<<<<<<<<<$+@",'#10'".+$________________+$@",'#10'".(+_/:_/:_/:_/:_/'
+':_$+@",'#10'".+$_::_::_::_::_::_+$@",'#10'".(+________________$+@",'#10'".+'
+'$_/:_/:_/:_/:_/:_+$@",'#10'".(+_::_::_::_::_::_$+@",'#10'".+$______________'
+'__+$@",'#10'".(+_/:_/:_/:_/:_/:_$+@",'#10'".+$_::_::_::_::_::_+$@",'#10'".('
+'+________________$+@",'#10'".+$+$+$+$+$+$+$+$+$+$@",'#10'".(+$+$+$+$+$+$+$+'
+'$+$+@",'#10'".@@@@@@@@@@@@@@@@@@@@@"};'#10
]);
LazarusResources.Add('tcalendar','XPM',[
'/* XPM */'#10'static char *tcalendar[]={'#10'"20 19 53 1",'#10'"k c #000000"'
+','#10'"A c #000004",'#10'"a c #000005",'#10'"M c #000007",'#10'"X c #000009'

View File

@ -27,10 +27,12 @@ unit EditBtn;
interface
uses
Classes, SysUtils, LCLStrConsts, LCLType, LMessages, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, Calendar, ExtDlgs;
Classes, SysUtils, LResources, LCLStrConsts, LCLType, LMessages, Graphics,
Controls, Forms, Dialogs, StdCtrls, Buttons, Calendar, ExtDlgs;
type
{ TCustomEditButton }
TCustomEditButton = class(TEdit)
private
FButton: TSpeedButton;
@ -73,6 +75,9 @@ type
Property ButtonOnlyWhenFocused : Boolean Read FButtonNeedsFocus Write SetButtonNeedsFocus;
end;
{ TEditButton }
TEditButton = Class(TCustomEditButton)
Public
Property Button;
@ -121,6 +126,9 @@ type
property OnStartDrag;
end;
{ TFileNameEdit }
TAcceptFileNameEvent = Procedure (Sender : TObject; Var Value : String) of Object;
TDialogKind = (dkOpen,dkSave,dkPictureOpen,dkPictureSave);
@ -200,6 +208,9 @@ type
property OnStartDrag;
end;
{ TDirectoryEdit }
TDirectoryEdit = Class(TCustomEditButton)
private
FDialogTitle: String;
@ -267,6 +278,9 @@ type
property OnStartDrag;
end;
{ TDateEdit }
TAcceptDateEvent = Procedure (Sender : TObject; Var ADate : TDateTime; Var Action : Boolean) of Object;
TDateEdit = Class(TCustomEditButton)
private
@ -332,6 +346,9 @@ type
property OnStartDrag;
end;
{ TCalcEdit }
TAcceptValueEvent = Procedure (Sender : TObject; Var AValue : Double; Var Action : Boolean) of Object;
TCalcEdit = Class(TCustomEditButton)
private
@ -401,8 +418,6 @@ type
property OnStartDrag;
end;
procedure Register;
Var
FileOpenGlyph : TBitmap;
DateGlyph : TBitmap;
@ -414,12 +429,12 @@ Const
ResBtnCalendar = 'btncalendar';
ResBtnCalculator = 'btncalculator';
procedure Register;
implementation
uses lresources;
Function GlyphFromBitmapOrResource(B : TBitmap; ResourceName : String) : TBitmap;
Function GlyphFromBitmapOrResource(B : TBitmap;
const ResourceName : String) : TBitmap;
begin
Result:=TBitmap.Create;
If Assigned(B) then
@ -454,7 +469,6 @@ end;
{ TEditBtn }
constructor TCustomEditButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
@ -523,17 +537,17 @@ end;
function TCustomEditButton.GetGlyph : TBitmap;
Begin
Result:=FButton.Glyph;
Result:=FButton.Glyph;
end;
procedure TCustomEditButton.SetNumGlyphs(ANumber: Integer);
Begin
FButton.NumGlyphs:=ANumber;
FButton.NumGlyphs:=ANumber;
end;
function TCustomEditButton.GetNumGlyphs:Integer;
begin
Result:=FButton.NumGlyphs;
Result:=FButton.NumGlyphs;
end;
procedure TCustomEditButton.Notification(AComponent: TComponent; Operation: TOperation);

View File

@ -251,7 +251,8 @@ implementation
procedure Register;
begin
RegisterComponents('Dialogs',[TOpenPictureDialog,TSavePictureDialog]);
RegisterComponents('Dialogs',[TOpenPictureDialog,TSavePictureDialog,
TCalendarDialog,TCalculatorDialog]);
end;
{ TPreviewFileControl }
@ -1208,19 +1209,17 @@ end;
procedure TCalendarDialogForm.InitForm;
begin
ClientHeight:=150;
ClientWidth:=200;
Height:=150;
Width:=200;
Position:=poScreenCenter;
BorderStyle:=bsDialog;
FCalendar:=TCalendar.Create(Self);
With FCalendar do
begin
Parent:=Self;
Top:=0;
Left:=0;
Width:=Width;
Height:=98;
SetBounds(0,0,Self.Width,98);
Align:=alClient;
Anchors:=[akLeft,akRight,aktop,akbottom];
//Anchors:=[akLeft,akRight,akTop,akBottom];
end;
FPanel:=TPanel.Create(Self);
With FPanel do
@ -1230,7 +1229,7 @@ begin
Height:=32;
Width:=200;
Align:=alBottom;
Anchors:=[akLeft,akRight,akbottom];
Anchors:=[akLeft,akRight,akBottom];
Caption:='';
BevelOuter:=bvLowered;
end;
@ -1243,7 +1242,7 @@ begin
Height:=24;
Width:=50;
Left:=Self.Width-FOK.Width-4;
Anchors:=[akright,aktop];
Anchors:=[akRight,akTop];
Default:=True;
ModalResult:=MrOK;
end;