| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KPopupFrame Class Reference

Frame with popup menu behaviour. More...

`#include <kdatetbl.h>`

Inheritance diagram for KPopupFrame:

[legend]
Collaboration diagram for KPopupFrame:

[legend]
List of all members.

## Public Slots
void | close (int r)
| Close the popup window.
## Public Member Functions
| KPopupFrame (QWidget *parent=0, const char *name=0)
| The contructor.
void | setMainWidget (QWidget *m)
| Set the main widget.
virtual void | resizeEvent (QResizeEvent *)
| The resize event.
void | popup (const QPoint &pos)
| Open the popup window at position pos.
int | exec (QPoint p)
| Execute the popup window.
int | exec (int x, int y)
| Dito.
## Protected Member Functions
virtual void | keyPressEvent (QKeyEvent *e)
| Catch key press events.
virtual void | virtual_hook (int id, void *data)
## Protected Attributes
int | result
| The result.
QWidget * | main
| The only subwidget that uses the whole dialog window.

## Detailed Description

Frame with popup menu behaviour.

Author:
  Tim Gilman, Mirko Boehm

Version:
  Id
    kdatetbl.h,v 1.31 2002/07/25 13:26:37 lukas Exp

Definition at line 157 of file kdatetbl.h.

## Constructor & Destructor Documentation

KPopupFrame::KPopupFrame | ( | QWidget * | parent = 0,
|  | const char * | name = 0
| ) |

| The contructor. Creates a dialog without buttons. Definition at line 688 of file kdatetbl.cpp. References KStdAccel::name(), QFrame::setFrameStyle(), and QFrame::setMidLineWidth().

## Member Function Documentation

void KPopupFrame::keyPressEvent | ( | QKeyEvent * | e | ) | `[protected, virtual]`

| Catch key press events. Definition at line 698 of file kdatetbl.cpp. References QKeyEvent::key(), and result.

void KPopupFrame::close | ( | int | r | ) | `[slot]`

| Close the popup window. This is called from the main widget, usually. `r` is the result returned from exec(). Definition at line 708 of file kdatetbl.cpp. References result.

void KPopupFrame::setMainWidget | ( | QWidget * | m | ) |

| Set the main widget. You cannot set the main widget from the constructor, since it must be a child of the frame itselfes. Be careful: the size is set to the main widgets size. It is up to you to set the main widgets correct size before setting it as the main widget. Definition at line 715 of file kdatetbl.cpp. References QFrame::frameWidth(), QWidget::height(), main, and QWidget::width(). Referenced by KDatePicker::selectWeekClicked().

void KPopupFrame::resizeEvent | ( | QResizeEvent * |  | ) | `[virtual]`

| The resize event. Simply resizes the main widget to the whole widgets client size. Reimplemented from QFrame. Definition at line 725 of file kdatetbl.cpp. References QFrame::frameWidth(), main, and QWidget::setGeometry().

void KPopupFrame::popup | ( | const QPoint & | pos | ) |

| Open the popup window at position pos. Definition at line 735 of file kdatetbl.cpp. References QApplication::desktop(), QRect::height(), KIO::move(), QRect::width(), QRect::x(), QPoint::x(), QRect::y(), and QPoint::y(). Referenced by exec().

int KPopupFrame::exec | ( | QPoint | p | ) |

| Execute the popup window. Definition at line 758 of file kdatetbl.cpp. References popup(), and result. Referenced by exec(), and KDatePicker::selectWeekClicked().

int KPopupFrame::exec | ( | int | x,
|  | int | y
| ) |

| Dito. Definition at line 768 of file kdatetbl.cpp. References exec().

## Member Data Documentation

int KPopupFrame::result`[protected]`

| The result. It is returned from exec() when the popup window closes. Definition at line 164 of file kdatetbl.h. Referenced by close(), exec(), and keyPressEvent().

QWidget* KPopupFrame::main`[protected]`

| The only subwidget that uses the whole dialog window. Definition at line 172 of file kdatetbl.h. Referenced by resizeEvent(), and setMainWidget().

The documentation for this class was generated from the following files:

- kdatetbl.h
- kdatetbl.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:03:50 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001