2010-07-10 16:34:30 +02:00
|
|
|
/*
|
2010-08-26 21:28:15 +02:00
|
|
|
Copyright 2010 Grégory Soutadé
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
This file is part of KissCount.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
KissCount is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
KissCount is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with KissCount. If not, see <http://www.gnu.org/licenses/>.
|
2010-07-10 16:34:30 +02:00
|
|
|
*/
|
|
|
|
|
2010-06-05 14:33:19 +02:00
|
|
|
#ifndef CALENDAREDITOR_H
|
|
|
|
#define CALENDAREDITOR_H
|
|
|
|
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#include <wx/grid.h>
|
|
|
|
#include <wx/calctrl.h>
|
|
|
|
#include <wx/datetime.h>
|
|
|
|
#include <wx/event.h>
|
2010-06-29 21:43:29 +02:00
|
|
|
#include <wx/choice.h>
|
2010-06-05 14:33:19 +02:00
|
|
|
|
2010-06-29 21:43:29 +02:00
|
|
|
class CalendarEditor : public wxGridCellChoiceEditor, public wxEvtHandler
|
2010-06-05 14:33:19 +02:00
|
|
|
{
|
2010-08-26 21:28:15 +02:00
|
|
|
public:
|
2010-06-05 14:33:19 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
CalendarEditor(int day, int month, int year);
|
|
|
|
~CalendarEditor();
|
|
|
|
|
|
|
|
void BeginEdit(int row, int col, wxGrid *grid);
|
|
|
|
wxGridCellEditor* Clone () const;
|
|
|
|
void Create(wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler);
|
|
|
|
bool EndEdit(int row, int col, wxGrid *grid);
|
|
|
|
void ApplyEdit(int row, int col, wxGrid *grid);
|
|
|
|
wxString GetValue() const;
|
|
|
|
void Reset();
|
|
|
|
void Show(bool show, wxGridCellAttr *attr=NULL);
|
|
|
|
void SetSize (const wxRect &rect);
|
|
|
|
/* void OnCalendarChange(wxCommandEvent& event); */
|
|
|
|
void OnDateChanged(wxCommandEvent& event);
|
|
|
|
void StartingClick();
|
|
|
|
bool IsAcceptedKey(wxKeyEvent &event);
|
2010-06-05 14:33:19 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
private:
|
|
|
|
int _day;
|
|
|
|
int _month;
|
|
|
|
int _year;
|
|
|
|
wxWindow *_parent;
|
|
|
|
wxString* _days;
|
|
|
|
int _maxDay;
|
|
|
|
wxChoice* _editor;
|
2010-06-05 14:33:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|