summaryrefslogtreecommitdiffstats
path: root/kfind/kdatecombo.h
blob: 3a3f8d1940d9f15ee3b23b008c09e7ab70aec354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/***********************************************************************
 *
 *  kdatecombo.h
 *
 ***********************************************************************/

#ifndef KDATECOMBO_H
#define KDATECOMBO_H

#include <tqwidget.h>
#include <tqcombobox.h>
#include <tqdatetime.h>

/**
  *@author Beppe Grimaldi
  */

class KDatePicker;
class TDEPopupFrame;

class KDateCombo : public TQComboBox  {
   TQ_OBJECT

public:
	KDateCombo(TQWidget *parent=0, const char *name=0);
	KDateCombo(const TQDate & date, TQWidget *parent=0, const char *name=0);
	~KDateCombo();

	TQDate & getDate(TQDate *currentDate);
	bool setDate(const TQDate & newDate);

private:
   TDEPopupFrame * popupFrame;
   KDatePicker * datePicker;

   void initObject(const TQDate & date, TQWidget *parent, const char *name);

   TQString date2String(const TQDate &);
   TQDate & string2Date(const TQString &, TQDate * );

protected:
  bool eventFilter (TQObject*, TQEvent*);
  virtual void mousePressEvent (TQMouseEvent * e);
   
protected slots:
   void dateEnteredEvent(TQDate d=TQDate());
};

#endif