diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-06-17 15:39:39 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-06-17 15:39:39 +0200 |
commit | 8d2fea73917ff5edb82fe48d96c8031d1b4bd14d (patch) | |
tree | 32559c9d6910aa003464b08b8dfa08b30a15d6f0 /src/gui/fpg_popupcalendar.pas | |
parent | 02aea871f5c2c525595c064f24b0c9044e94dc74 (diff) | |
download | fpGUI-8d2fea73917ff5edb82fe48d96c8031d1b4bd14d.tar.xz |
Calendar Combo: Selecting dates outside current month is now ignored
Before if you select for example 29 of previous month, it selects
the 29th of the current month. This could cause problems with
shorter months so now selecting days in grey (previous or next month)
are ignored.
Diffstat (limited to 'src/gui/fpg_popupcalendar.pas')
-rw-r--r-- | src/gui/fpg_popupcalendar.pas | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/fpg_popupcalendar.pas b/src/gui/fpg_popupcalendar.pas index dff3e569..1a970916 100644 --- a/src/gui/fpg_popupcalendar.pas +++ b/src/gui/fpg_popupcalendar.pas @@ -315,6 +315,10 @@ begin if s = '' then Exit; //==> lD := StrToInt(s); + if (grdName1.FocusRow = 0) and (lD > 7) then + Exit; // clicked in previous month + if (grdName1.FocusRow >= 4) and (lD < 15) then + Exit; // clicked in next month d := EncodeDate(Year, Month, lD); if (d >= FMinDate) and (d <= FMaxDate) then begin |