-rw-r--r-- | korganizer/koagendaview.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index cbe86b6..e9e85cc 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -24,8 +24,9 @@ #define KOAGENDAVIEW_H #include <qscrollview.h> #include <qdatetime.h> +#include <qpushbutton.h> #include <qlayout.h> #ifndef DESKTOP_VERSION #include <qksplitter.h> #else @@ -34,9 +35,8 @@ #include <qmemarray.h> #include "koeventview.h" - class QHBox; class QFrame; class QLabel; class QPushButton; @@ -44,8 +44,33 @@ class CalendarView; class KOAgenda; class KOAgendaItem; class KConfig; class KDGanttMinimizeSplitter; + +class KOAgendaButton : public QPushButton +{ + Q_OBJECT + public: + KOAgendaButton( QWidget *parent=0, const char *name=0 ) : + QPushButton( parent, name ) + { + mNum = -3; + setFlat( true ); + setFocusPolicy(NoFocus); + setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); + connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) ); + }; + + QSize sizeHint () const { return QSize( 5,5) ;} + void setNum( int n) { mNum = n; } +private slots: + void bClicked() {emit numClicked( mNum);} +signals: + void numClicked( int ); +private: + int mNum; +}; + class TimeLabels : public QScrollView { Q_OBJECT public: TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); @@ -189,9 +214,9 @@ class KOAgendaView : public KOEventView { void incidenceChanged(Incidence * , int ); // void cloneIncidenceSignal(Incidence *); protected: - QPushButton* getNewDaylabel(); + KOAgendaButton* getNewDaylabel(); bool mBlockUpdating; int mUpcomingWidth; /** Fill agenda beginning with date startDate */ void fillAgenda(const QDate &startDate); @@ -207,9 +232,9 @@ class KOAgendaView : public KOEventView { */ void setHolidayMasks(); protected slots: - void slotDaylabelClicked(); + void slotDaylabelClicked( int ); /** Update event belonging to agenda item */ void updateEventDates(KOAgendaItem *item, int mode = -1); //void updateMovedTodo(); @@ -253,9 +278,9 @@ class KOAgendaView : public KOEventView { QMemArray<bool> mHolidayMask; QPixmap mExpandedPixmap; QPixmap mNotExpandedPixmap; - QPtrList<QPushButton> mDayLabelsList; + QPtrList<KOAgendaButton> mDayLabelsList; QDateTime mTimeSpanBegin; QDateTime mTimeSpanEnd; bool mTimeSpanInAllDay; void keyPressEvent ( QKeyEvent * e ); |