• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KDateTable Class Reference

#include <kdatetbl.h>

Inherits TQGridView.

Public Types

enum  BackgroundMode { NoBgMode =0 , RectangleMode , CircleMode }
 

Signals

void dateChanged (TQDate)
 
void dateChanged (const TQDate &cur, const TQDate &old)
 
void tableClicked ()
 
void aboutToShowContextMenu (TDEPopupMenu *menu, const TQDate &date)
 

Public Member Functions

 KDateTable (TQWidget *parent=0, TQDate date=TQDate::currentDate(), const char *name=0, WFlags f=0)
 
 KDateTable (TQWidget *parent, const char *name, WFlags f=0)
 
 ~KDateTable ()
 
virtual TQSize sizeHint () const
 
void setFontSize (int size)
 
bool setDate (const TQDate &)
 
const TQDate & getDate () const
 
void setPopupMenuEnabled (bool enable)
 
bool popupMenuEnabled () const
 
void setCustomDatePainting (const TQDate &date, const TQColor &fgColor, BackgroundMode bgMode=NoBgMode, const TQColor &bgColor=TQColor())
 
void unsetCustomDatePainting (const TQDate &date)
 

Protected Member Functions

int posFromDate (const TQDate &date)
 
TQDate dateFromPos (int pos)
 
virtual void paintCell (TQPainter *, int, int)
 
virtual void paintEmptyArea (TQPainter *, int, int, int, int)
 
virtual void viewportResizeEvent (TQResizeEvent *)
 
virtual void contentsMousePressEvent (TQMouseEvent *)
 
virtual void wheelEvent (TQWheelEvent *e)
 
virtual void keyPressEvent (TQKeyEvent *e)
 
virtual void focusInEvent (TQFocusEvent *e)
 
virtual void focusOutEvent (TQFocusEvent *e)
 
virtual void virtual_hook (int id, void *data)
 

Protected Attributes

int fontsize
 
TQDate date
 
int firstday
 
int numdays
 
int numDaysPrevMonth
 
bool unused_hasSelection
 
TQRect maxCell
 

Detailed Description

Date selection table.

This is a support class for the KDatePicker class. It just draws the calender table without titles, but could theoretically be used as a standalone.

When a date is selected by the user, it emits a signal: dateSelected(TQDate)

Version
$Id$
Author
Tim Gilman, Mirko Boehm

Definition at line 263 of file kdatetbl.h.

Member Enumeration Documentation

◆ BackgroundMode

enum KDateTable::BackgroundMode

Definition at line 321 of file kdatetbl.h.

Constructor & Destructor Documentation

◆ KDateTable() [1/2]

KDateTable::KDateTable ( TQWidget *  parent = 0,
TQDate  date = TQDate::currentDate(),
const char *  name = 0,
WFlags  f = 0 
)

The constructor.

Definition at line 117 of file kdatetbl.cpp.

◆ KDateTable() [2/2]

KDateTable::KDateTable ( TQWidget *  parent,
const char *  name,
WFlags  f = 0 
)

The constructor.

Since
3.4

Definition at line 138 of file kdatetbl.cpp.

◆ ~KDateTable()

KDateTable::~KDateTable ( )

The destructor.

Definition at line 153 of file kdatetbl.cpp.

Member Function Documentation

◆ aboutToShowContextMenu

void KDateTable::aboutToShowContextMenu ( TDEPopupMenu *  menu,
const TQDate &  date 
)
signal

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).

Connect the slot where you fill the menu to this signal.

Since
3.2

◆ contentsMousePressEvent()

void KDateTable::contentsMousePressEvent ( TQMouseEvent *  e)
protectedvirtual

React on mouse clicks that select a date.

Definition at line 455 of file kdatetbl.cpp.

◆ dateChanged [1/2]

void KDateTable::dateChanged ( const TQDate &  cur,
const TQDate &  old 
)
signal

This function behaves essentially like the one above.

The selected date changed.

Parameters
curThe current date
oldThe date before the date was changed

◆ dateChanged [2/2]

void KDateTable::dateChanged ( TQDate  )
signal

The selected date changed.

◆ dateFromPos()

TQDate KDateTable::dateFromPos ( int  pos)
protected

calculate the date that is displayed at a given cell in the matrix.

pos is the 0-based index in the matrix. Inverse function to posForDate().

Definition at line 182 of file kdatetbl.cpp.

◆ focusInEvent()

void KDateTable::focusInEvent ( TQFocusEvent *  e)
protectedvirtual

Definition at line 551 of file kdatetbl.cpp.

◆ focusOutEvent()

void KDateTable::focusOutEvent ( TQFocusEvent *  e)
protectedvirtual

Definition at line 557 of file kdatetbl.cpp.

◆ getDate()

const TQDate & KDateTable::getDate ( ) const

Definition at line 545 of file kdatetbl.cpp.

◆ keyPressEvent()

void KDateTable::keyPressEvent ( TQKeyEvent *  e)
protectedvirtual

Definition at line 373 of file kdatetbl.cpp.

◆ paintCell()

void KDateTable::paintCell ( TQPainter *  painter,
int  row,
int  col 
)
protectedvirtual

Paint a cell.

Definition at line 212 of file kdatetbl.cpp.

◆ paintEmptyArea()

void KDateTable::paintEmptyArea ( TQPainter *  paint,
int  ,
int  ,
int  ,
int   
)
protectedvirtual

Paint the empty area (background).

Definition at line 198 of file kdatetbl.cpp.

◆ popupMenuEnabled()

bool KDateTable::popupMenuEnabled ( ) const

Returns if the popup menu is enabled or not.

Definition at line 581 of file kdatetbl.cpp.

◆ posFromDate()

int KDateTable::posFromDate ( const TQDate &  date)
protected

calculate the position of the cell in the matrix for the given date.

The result is the 0-based index.

Definition at line 170 of file kdatetbl.cpp.

◆ setCustomDatePainting()

void KDateTable::setCustomDatePainting ( const TQDate &  date,
const TQColor &  fgColor,
BackgroundMode  bgMode = NoBgMode,
const TQColor &  bgColor = TQColor() 
)

Makes a given date be painted with a given foregroundColor, and background (a rectangle, or a circle/ellipse) in a given color.

Since
3.2

Definition at line 586 of file kdatetbl.cpp.

◆ setDate()

bool KDateTable::setDate ( const TQDate &  date_)

Select and display this date.

Definition at line 510 of file kdatetbl.cpp.

◆ setFontSize()

void KDateTable::setFontSize ( int  size)

Set the font size of the date table.

Definition at line 424 of file kdatetbl.cpp.

◆ setPopupMenuEnabled()

void KDateTable::setPopupMenuEnabled ( bool  enable)

Enables a popup menu when right clicking on a date.

When it's enabled, this object emits a aboutToShowContextMenu signal where you can fill in the menu items.

Since
3.2

Definition at line 576 of file kdatetbl.cpp.

◆ sizeHint()

TQSize KDateTable::sizeHint ( void  ) const
virtual

Returns a recommended size for the widget.

To save some time, the size of the largest used cell content is calculated in each paintCell() call, since all calculations have to be done there anyway. The size is stored in maxCell. The sizeHint() simply returns a multiple of maxCell.

Definition at line 564 of file kdatetbl.cpp.

◆ tableClicked

void KDateTable::tableClicked ( )
signal

A date has been selected by clicking on the table.

◆ unsetCustomDatePainting()

void KDateTable::unsetCustomDatePainting ( const TQDate &  date)

Unsets the custom painting of a date so that the date is painted as usual.

Since
3.2

Definition at line 604 of file kdatetbl.cpp.

◆ viewportResizeEvent()

void KDateTable::viewportResizeEvent ( TQResizeEvent *  e)
protectedvirtual

Handle the resize events.

Definition at line 415 of file kdatetbl.cpp.

◆ virtual_hook()

void KDateTable::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 1028 of file kdatetbl.cpp.

◆ wheelEvent()

void KDateTable::wheelEvent ( TQWheelEvent *  e)
protectedvirtual

Definition at line 448 of file kdatetbl.cpp.

Member Data Documentation

◆ date

TQDate KDateTable::date
protected

The currently selected date.

Definition at line 381 of file kdatetbl.h.

◆ firstday

int KDateTable::firstday
protected

The day of the first day in the month [1..7].

Definition at line 385 of file kdatetbl.h.

◆ fontsize

int KDateTable::fontsize
protected

The font size of the displayed text.

Definition at line 377 of file kdatetbl.h.

◆ maxCell

TQRect KDateTable::maxCell
protected

Save the size of the largest used cell content.

Definition at line 402 of file kdatetbl.h.

◆ numdays

int KDateTable::numdays
protected

The number of days in the current month.

Definition at line 389 of file kdatetbl.h.

◆ numDaysPrevMonth

int KDateTable::numDaysPrevMonth
protected

The number of days in the previous month.

Definition at line 393 of file kdatetbl.h.

◆ unused_hasSelection

bool KDateTable::unused_hasSelection
protected

unused

remove in KDE 4.0

Definition at line 398 of file kdatetbl.h.


The documentation for this class was generated from the following files:
  • kdatetbl.h
  • kdatetbl.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.