summaryrefslogtreecommitdiff
path: root/examples/gui
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-11-08 14:41:21 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-11-08 14:41:21 +0000
commit6717b45ffef4638f9c08b3802454f79b7415293a (patch)
treefc069eec25355d4d259a50d72fdc863fbe936105 /examples/gui
parentfb7cc21f0b94f77746dc17d74a1a0e95f5fdc062 (diff)
downloadfpGUI-6717b45ffef4638f9c08b3802454f79b7415293a.tar.xz
* Implemented a new mediator for use with tiOPF for the Calendar
component. * Removed the ColResize property from BaseGrid. It doesn't work as advertised. It needs to be implemented correctly. * Implemented MinDate, MaxDate properies for Calendar and did a lot more testing with a few more bugfixes. Still plenty outstanding.
Diffstat (limited to 'examples/gui')
-rw-r--r--examples/gui/calendar/calendartest.lpi9
-rw-r--r--examples/gui/calendar/calendartest.lpr90
-rw-r--r--examples/gui/gridtest/gridtest.lpi2
-rw-r--r--examples/gui/modalforms/modalforms.lpr12
4 files changed, 97 insertions, 16 deletions
diff --git a/examples/gui/calendar/calendartest.lpi b/examples/gui/calendar/calendartest.lpi
index 663eb890..431c61ee 100644
--- a/examples/gui/calendar/calendartest.lpi
+++ b/examples/gui/calendar/calendartest.lpi
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="\"/>
- <Version Value="5"/>
+ <PathDelim Value="/"/>
+ <Version Value="6"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value=".\"/>
+ <IconPath Value="./"/>
<TargetFileExt Value=""/>
</General>
<VersionInfo>
@@ -23,7 +23,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -42,7 +42,6 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
- <PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
diff --git a/examples/gui/calendar/calendartest.lpr b/examples/gui/calendar/calendartest.lpr
index 4ac8c3eb..f45ac7c6 100644
--- a/examples/gui/calendar/calendartest.lpr
+++ b/examples/gui/calendar/calendartest.lpr
@@ -19,6 +19,8 @@ type
procedure btnDownClicked(Sender: TObject);
procedure btnDateFormatClicked(Sender: TObject);
procedure btnTodayClicked(Sender: TObject);
+ procedure btnMinDateClicked(Sender: TObject);
+ procedure btnMaxDateClicked(Sender: TObject);
procedure DoDropDown;
public
{@VFD_HEAD_BEGIN: MainForm}
@@ -27,7 +29,7 @@ type
lblName1: TfpgLabel;
lblName2: TfpgLabel;
cbName1: TfpgComboBox;
- cbCalendar: TfpgCalendarCombo;
+ cal: TfpgCalendarCombo;
btnDateFormat: TfpgButton;
edtDateFormat: TfpgEdit;
lblName3: TfpgLabel;
@@ -35,6 +37,10 @@ type
lblName5: TfpgLabel;
btnToday: TfpgButton;
lblName6: TfpgLabel;
+ edtMinDate: TfpgEdit;
+ edtMaxDate: TfpgEdit;
+ btnMinDate: TfpgButton;
+ btnMaxDate: TfpgButton;
{@VFD_HEAD_END: MainForm}
FDropDown: TfpgPopupCalendar;
procedure AfterCreate; override;
@@ -51,12 +57,38 @@ end;
procedure TMainForm.btnDateFormatClicked(Sender: TObject);
begin
- cbCalendar.DateFormat := edtDateFormat.Text;
+ cal.DateFormat := edtDateFormat.Text;
end;
procedure TMainForm.btnTodayClicked(Sender: TObject);
begin
- cbCalendar.DateValue := Now;
+ cal.DateValue := Now;
+end;
+
+procedure TMainForm.btnMinDateClicked(Sender: TObject);
+var
+ old: string;
+begin
+ old := ShortDateFormat;
+ ShortDateFormat := 'yyyy-mm-dd';
+ try
+ cal.MinDate := StrToDate(edtMinDate.Text);
+ finally
+ ShortDateFormat := old;
+ end;
+end;
+
+procedure TMainForm.btnMaxDateClicked(Sender: TObject);
+var
+ old: string;
+begin
+ old := ShortDateFormat;
+ ShortDateFormat := 'yyyy-mm-dd';
+ try
+ cal.MaxDate := StrToDate(edtMaxDate.Text);
+ finally
+ ShortDateFormat := old;
+ end;
end;
procedure TMainForm.DoDropDown;
@@ -136,10 +168,10 @@ begin
FontDesc := '#List';
end;
- cbCalendar := TfpgCalendarCombo.Create(self);
- with cbCalendar do
+ cal := TfpgCalendarCombo.Create(self);
+ with cal do
begin
- Name := 'cbCalendar';
+ Name := 'cal';
SetPosition(132, 196, 120, 23);
FontDesc := '#List';
DateFormat := 'yyyy-mm-dd';
@@ -149,7 +181,7 @@ begin
with btnDateFormat do
begin
Name := 'btnDateFormat';
- SetPosition(300, 168, 75, 23);
+ SetPosition(388, 148, 75, 23);
Text := 'Set Format';
FontDesc := '#Label1';
ImageName := '';
@@ -160,7 +192,7 @@ begin
with edtDateFormat do
begin
Name := 'edtDateFormat';
- SetPosition(300, 196, 120, 21);
+ SetPosition(288, 148, 92, 21);
Text := 'yy-mm-d';
FontDesc := '#Edit1';
end;
@@ -197,7 +229,7 @@ begin
with btnToday do
begin
Name := 'btnToday';
- SetPosition(384, 168, 75, 23);
+ SetPosition(388, 120, 75, 23);
Text := 'Today';
FontDesc := '#Label1';
ImageName := '';
@@ -213,6 +245,46 @@ begin
FontDesc := '#Label1';
end;
+ edtMinDate := TfpgEdit.Create(self);
+ with edtMinDate do
+ begin
+ Name := 'edtMinDate';
+ SetPosition(288, 176, 92, 21);
+ Text := '2005-01-01';
+ FontDesc := '#Edit1';
+ end;
+
+ edtMaxDate := TfpgEdit.Create(self);
+ with edtMaxDate do
+ begin
+ Name := 'edtMaxDate';
+ SetPosition(288, 204, 92, 21);
+ Text := '2009-01-01';
+ FontDesc := '#Edit1';
+ end;
+
+ btnMinDate := TfpgButton.Create(self);
+ with btnMinDate do
+ begin
+ Name := 'btnMinDate';
+ SetPosition(388, 176, 75, 23);
+ Text := 'Min Date';
+ FontDesc := '#Label1';
+ ImageName := '';
+ OnClick := @btnMinDateClicked;
+ end;
+
+ btnMaxDate := TfpgButton.Create(self);
+ with btnMaxDate do
+ begin
+ Name := 'btnMaxDate';
+ SetPosition(388, 204, 75, 23);
+ Text := 'Max Date';
+ FontDesc := '#Label1';
+ ImageName := '';
+ OnClick := @btnMaxDateClicked;
+ end;
+
{@VFD_BODY_END: MainForm}
end;
diff --git a/examples/gui/gridtest/gridtest.lpi b/examples/gui/gridtest/gridtest.lpi
index 9b698ffe..c22c0856 100644
--- a/examples/gui/gridtest/gridtest.lpi
+++ b/examples/gui/gridtest/gridtest.lpi
@@ -2,7 +2,7 @@
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
- <Version Value="5"/>
+ <Version Value="6"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
diff --git a/examples/gui/modalforms/modalforms.lpr b/examples/gui/modalforms/modalforms.lpr
index 91b1b840..2be19773 100644
--- a/examples/gui/modalforms/modalforms.lpr
+++ b/examples/gui/modalforms/modalforms.lpr
@@ -16,7 +16,9 @@ uses
gui_form,
gui_dialogs,
gui_button,
- gui_label;
+ gui_label,
+ gui_popupcalendar,
+ gui_combobox;
type
// forward declaration
@@ -25,6 +27,7 @@ type
TMainForm = class(TfpgForm)
private
+ cal: TfpgComboBox;
btnClose: TfpgButton;
btnOpenForm1: TfpgButton;
procedure btnCloseClick(Sender: TObject);
@@ -36,6 +39,7 @@ type
TForm1 = class(TfpgForm)
private
+ cal: TfpgComboBox;
Label1: TfpgLabel;
btnClose: TfpgButton;
btnOpenForm2: TfpgButton;
@@ -111,6 +115,9 @@ begin
btnClose.ShowImage := True;
btnOpenForm2 := CreateButton(self, 70, 100, 80, 'Open Form2', @btnOpenForm2Click);
+
+ cal := TfpgComboBox.Create(self);
+ cal.SetPosition(10, 10, 120, 23);
end;
@@ -146,6 +153,9 @@ begin
btnClose.ShowImage := True;
btnOpenForm1 := CreateButton(self, 100, 100, 80, 'Open Form1', @btnOpenForm1Click);
+
+ cal := TfpgComboBox.Create(self);
+ cal.SetPosition(10, 10, 120, 23);
end;