.TH "KDateTable" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDateTable \- Date selection table.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kdatetbl.h>\fP
.PP
Inherits \fBQGridView\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBBackgroundMode\fP { \fBNoBgMode\fP = 0, \fBRectangleMode\fP, \fBCircleMode\fP }"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBdateChanged\fP (\fBQDate\fP)"
.br
.ti -1c
.RI "void \fBdateChanged\fP (const \fBQDate\fP &cur, const \fBQDate\fP &old)"
.br
.ti -1c
.RI "void \fBtableClicked\fP ()"
.br
.ti -1c
.RI "void \fBaboutToShowContextMenu\fP (\fBKPopupMenu\fP *menu, const \fBQDate\fP &date)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDateTable\fP (\fBQWidget\fP *parent=0, \fBQDate\fP date=\fBQDate::currentDate\fP(), const char *name=0, WFlags f=0)"
.br
.ti -1c
.RI "\fBKDateTable\fP (\fBQWidget\fP *parent, const char *name, WFlags f=0)"
.br
.ti -1c
.RI "\fB~KDateTable\fP ()"
.br
.ti -1c
.RI "virtual \fBQSize\fP \fBsizeHint\fP () const "
.br
.ti -1c
.RI "void \fBsetFontSize\fP (int size)"
.br
.ti -1c
.RI "bool \fBsetDate\fP (const \fBQDate\fP &)"
.br
.ti -1c
.RI "const \fBQDate\fP & \fBgetDate\fP () const "
.br
.ti -1c
.RI "void \fBsetPopupMenuEnabled\fP (bool enable)"
.br
.ti -1c
.RI "bool \fBpopupMenuEnabled\fP () const "
.br
.ti -1c
.RI "void \fBsetCustomDatePainting\fP (const \fBQDate\fP &date, const \fBQColor\fP &fgColor, BackgroundMode bgMode=NoBgMode, const \fBQColor\fP &bgColor=\fBQColor\fP())"
.br
.ti -1c
.RI "void \fBunsetCustomDatePainting\fP (const \fBQDate\fP &date)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "int \fBposFromDate\fP (const \fBQDate\fP &date)"
.br
.ti -1c
.RI "\fBQDate\fP \fBdateFromPos\fP (int pos)"
.br
.ti -1c
.RI "virtual void \fBpaintCell\fP (\fBQPainter\fP *, int, int)"
.br
.ti -1c
.RI "virtual void \fBviewportResizeEvent\fP (\fBQResizeEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBcontentsMousePressEvent\fP (\fBQMouseEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBwheelEvent\fP (\fBQWheelEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBkeyPressEvent\fP (\fBQKeyEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBfocusInEvent\fP (\fBQFocusEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBfocusOutEvent\fP (\fBQFocusEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "int \fBfontsize\fP"
.br
.ti -1c
.RI "int \fBfirstday\fP"
.br
.ti -1c
.RI "int \fBnumdays\fP"
.br
.ti -1c
.RI "int \fBnumDaysPrevMonth\fP"
.br
.ti -1c
.RI "bool \fBunused_hasSelection\fP"
.br
.ti -1c
.RI "\fBQRect\fP \fBmaxCell\fP"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "\fBQDate\fP \fBdate\fP"
.br
.ti -1c
.RI "bool \fBpopupMenu\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
Date selection table. 

This is a support class for the \fBKDatePicker\fP class. It just draws the calender table without titles, but could theoretically be used as a standalone.
.PP
When a date is selected by the user, it emits a signal: dateSelected(QDate) 
.PP
Definition at line 254 of file kdatetbl.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDateTable::KDateTable (\fBQWidget\fP * parent = \fC0\fP, \fBQDate\fP date = \fC\fBQDate::currentDate\fP()\fP, const char * name = \fC0\fP, WFlags f = \fC0\fP)"
.PP
The constructor. 
.PP
Definition at line 116 of file kdatetbl.cpp.
.PP
References QDate::currentDate(), endl(), QDate::isValid(), kdDebug(), setDate(), setFontSize(), QGridView::setNumCols(), and QGridView::setNumRows().
.SS "KDateTable::KDateTable (\fBQWidget\fP * parent, const char * name, WFlags f = \fC0\fP)"
.PP
The constructor. 
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 136 of file kdatetbl.cpp.
.PP
References setDate(), setFontSize(), QGridView::setNumCols(), and QGridView::setNumRows().
.SS "KDateTable::~\fBKDateTable\fP ()"
.PP
The destructor. 
.PP
Definition at line 151 of file kdatetbl.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQSize\fP KDateTable::sizeHint () const\fC [virtual]\fP"
.PP
Returns a recommended size for the widget. 
.PP
To save some time, the size of the largest used cell content is calculated in each \fBpaintCell()\fP call, since all calculations have to be done there anyway. The size is stored in maxCell. The \fBsizeHint()\fP simply returns a multiple of maxCell. 
.PP
Definition at line 548 of file kdatetbl.cpp.
.PP
References endl(), QRect::height(), kdDebug(), maxCell, QGridView::numCols(), QGridView::numRows(), and QRect::width().
.SS "void KDateTable::setFontSize (int size)"
.PP
Set the font size of the date table. 
.PP
Definition at line 408 of file kdatetbl.cpp.
.PP
References QFontMetrics::boundingRect(), fontsize, QRect::height(), maxCell, QRect::setHeight(), QRect::setWidth(), and QRect::width().
.PP
Referenced by KDateTable(), and KDatePicker::setFontSize().
.SS "bool KDateTable::setDate (const \fBQDate\fP &)"
.PP
Select and display this date. 
.PP
Definition at line 494 of file kdatetbl.cpp.
.PP
References KCalendarSystem::addMonths(), KLocale::calendar(), date, dateChanged(), QDate::dayOfWeek(), KCalendarSystem::daysInMonth(), endl(), firstday, kdDebug(), KGlobal::locale(), KCalendarSystem::month(), numdays, numDaysPrevMonth, KCalendarSystem::setYMD(), and KCalendarSystem::year().
.PP
Referenced by contentsMousePressEvent(), KDateTable(), and KDatePicker::setDate().
.SS "void KDateTable::setPopupMenuEnabled (bool enable)"
.PP
Enables a popup menu when right clicking on a date. 
.PP
When it's enabled, this object emits a aboutToShowContextMenu signal where you can fill in the menu items.
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 560 of file kdatetbl.cpp.
.SS "bool KDateTable::popupMenuEnabled () const"
.PP
Returns if the popup menu is enabled or not. 
.PP
Definition at line 565 of file kdatetbl.cpp.
.SS "void KDateTable::setCustomDatePainting (const \fBQDate\fP & date, const \fBQColor\fP & fgColor, BackgroundMode bgMode = \fCNoBgMode\fP, const \fBQColor\fP & bgColor = \fC\fBQColor\fP()\fP)"
.PP
Makes a given date be painted with a given foregroundColor, and background (a rectangle, or a circle/ellipse) in a given color. 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 570 of file kdatetbl.cpp.
.PP
References date, QDate::toString(), and unsetCustomDatePainting().
.SS "void KDateTable::unsetCustomDatePainting (const \fBQDate\fP & date)"
.PP
Unsets the custom painting of a date so that the date is painted as usual. 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 588 of file kdatetbl.cpp.
.PP
References date, and QDate::toString().
.PP
Referenced by setCustomDatePainting().
.SS "int KDateTable::posFromDate (const \fBQDate\fP & date)\fC [protected]\fP"
.PP
calculate the position of the cell in the matrix for the given date. 
.PP
The result is the 0-based index. 
.PP
Definition at line 168 of file kdatetbl.cpp.
.PP
References KLocale::calendar(), KCalendarSystem::day(), firstday, KGlobal::locale(), and KLocale::weekStartDay().
.PP
Referenced by contentsMousePressEvent().
.SS "\fBQDate\fP KDateTable::dateFromPos (int pos)\fC [protected]\fP"
.PP
calculate the date that is displayed at a given cell in the matrix. 
.PP
pos is the 0-based index in the matrix. Inverse function to posForDate(). 
.PP
Definition at line 180 of file kdatetbl.cpp.
.PP
References KCalendarSystem::addDays(), KLocale::calendar(), date, firstday, KGlobal::locale(), KCalendarSystem::month(), KCalendarSystem::setYMD(), KLocale::weekStartDay(), and KCalendarSystem::year().
.PP
Referenced by contentsMousePressEvent(), and paintCell().
.SS "void KDateTable::paintCell (\fBQPainter\fP *, int, int)\fC [protected, virtual]\fP"
.PP
Paint a cell. 
.PP
Reimplemented from \fBQGridView\fP.
.PP
Definition at line 196 of file kdatetbl.cpp.
.PP
References KLocale::calendar(), KCalendarSystem::calendarName(), QGridView::cellHeight(), QGridView::cellWidth(), date, dateFromPos(), KCalendarSystem::day(), KCalendarSystem::dayString(), firstday, KGlobalSettings::generalFont(), QRect::height(), KGlobal::locale(), maxCell, KCalendarSystem::month(), QFont::setBold(), QRect::setHeight(), QRect::setWidth(), QDate::toString(), KCalendarSystem::weekDayName(), KCalendarSystem::weekDayOfPray(), KLocale::weekStartDay(), and QRect::width().
.SS "void KDateTable::viewportResizeEvent (\fBQResizeEvent\fP *)\fC [protected, virtual]\fP"
.PP
Handle the resize events. 
.PP
Definition at line 399 of file kdatetbl.cpp.
.PP
References QGridView::setCellHeight(), and QGridView::setCellWidth().
.SS "void KDateTable::contentsMousePressEvent (\fBQMouseEvent\fP *)\fC [protected, virtual]\fP"
.PP
React on mouse clicks that select a date. 
.PP
Definition at line 439 of file kdatetbl.cpp.
.PP
References aboutToShowContextMenu(), KNotifyClient::beep(), QGridView::columnAt(), date, dateFromPos(), KPopupMenu::insertTitle(), QPopupMenu::popup(), posFromDate(), QGridView::rowAt(), setDate(), tableClicked(), QGridView::updateCell(), QPoint::x(), and QPoint::y().
.SS "void KDateTable::dateChanged (\fBQDate\fP)\fC [signal]\fP"
.PP
The selected date changed. 
.PP
Referenced by setDate().
.SS "void KDateTable::dateChanged (const \fBQDate\fP & cur, const \fBQDate\fP & old)\fC [signal]\fP"
.PP
This function behaves essentially like the one above. 
.PP
The selected date changed. 
.PP
\fBParameters:\fP
.RS 4
\fIcur\fP The current date 
.br
\fIold\fP The date before the date was changed 
.RE
.PP

.SS "void KDateTable::tableClicked ()\fC [signal]\fP"
.PP
A date has been selected by clicking on the table. 
.PP
Referenced by contentsMousePressEvent().
.SS "void KDateTable::aboutToShowContextMenu (\fBKPopupMenu\fP * menu, const \fBQDate\fP & date)\fC [signal]\fP"
.PP
A popup menu for a given date is about to be shown (as when the user right clicks on that date and the popup menu is enabled). 
.PP
Connect the slot where you fill the menu to this signal.
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Referenced by contentsMousePressEvent().
.SH "Member Data Documentation"
.PP 
.SS "int \fBKDateTable::fontsize\fP\fC [protected]\fP"
.PP
The font size of the displayed text. 
.PP
Definition at line 362 of file kdatetbl.h.
.PP
Referenced by setFontSize().
.SS "int \fBKDateTable::firstday\fP\fC [protected]\fP"
.PP
The day of the first day in the month [1..7]. 
.PP
Definition at line 370 of file kdatetbl.h.
.PP
Referenced by dateFromPos(), paintCell(), posFromDate(), and setDate().
.SS "int \fBKDateTable::numdays\fP\fC [protected]\fP"
.PP
The number of days in the current month. 
.PP
Definition at line 374 of file kdatetbl.h.
.PP
Referenced by setDate().
.SS "int \fBKDateTable::numDaysPrevMonth\fP\fC [protected]\fP"
.PP
The number of days in the previous month. 
.PP
Definition at line 378 of file kdatetbl.h.
.PP
Referenced by setDate().
.SS "bool \fBKDateTable::unused_hasSelection\fP\fC [protected]\fP"
.PP
unused ### remove in \fBKDE\fP 4.0 
.PP
Definition at line 383 of file kdatetbl.h.
.SS "\fBQRect\fP \fBKDateTable::maxCell\fP\fC [protected]\fP"
.PP
Save the size of the largest used cell content. 
.PP
Definition at line 387 of file kdatetbl.h.
.PP
Referenced by paintCell(), setFontSize(), and sizeHint().
.SH "Property Documentation"
.PP 
.SS "\fBQDate\fP KDateTable::date\fC [read, write]\fP"
.PP
The currently selected date. 
.PP
Definition at line 257 of file kdatetbl.h.
.PP
Referenced by contentsMousePressEvent(), dateFromPos(), paintCell(), setCustomDatePainting(), setDate(), and unsetCustomDatePainting().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
