#include <kpassivepopup.h>
Inherits TQFrame.
Public Types | |
enum | PopupStyle { Boxed , Balloon , CustomStyle =128 } |
Public Slots | |
void | setTimeout (int delay) |
virtual void | show () |
void | show (const TQPoint &p) |
Signals | |
void | clicked () |
void | clicked (TQPoint pos) |
void | hidden (KPassivePopup *) |
Public Member Functions | |
KPassivePopup (TQWidget *parent=0, const char *name=0, WFlags f=0) | |
KPassivePopup (WId parent, const char *name=0, WFlags f=0) | |
KPassivePopup (int popupStyle, TQWidget *parent=0, const char *name=0, WFlags f=0) | |
KPassivePopup (int popupStyle, WId parent, const char *name=0, WFlags f=0) | |
virtual | ~KPassivePopup () |
void | setView (TQWidget *child) |
void | setView (const TQString &caption, const TQString &text=TQString::null) |
virtual void | setView (const TQString &caption, const TQString &text, const TQPixmap &icon) |
TQVBox * | standardView (const TQString &caption, const TQString &text, const TQPixmap &icon, TQWidget *parent=0L) |
TQWidget * | view () const |
int | timeout () const |
virtual void | setAutoDelete (bool autoDelete) |
bool | autoDelete () const |
void | setAnchor (const TQPoint &anchor) |
Static Public Member Functions | |
static KPassivePopup * | message (const TQString &text, TQWidget *parent, const char *name=0) |
static KPassivePopup * | message (const TQString &caption, const TQString &text, TQWidget *parent, const char *name=0) |
static KPassivePopup * | message (const TQString &caption, const TQString &text, const TQPixmap &icon, TQWidget *parent, const char *name=0, int timeout=-1) |
static KPassivePopup * | message (const TQString &caption, const TQString &text, const TQPixmap &icon, WId parent, const char *name=0, int timeout=-1) |
static KPassivePopup * | message (int popupStyle, const TQString &text, TQWidget *parent, const char *name=0) |
static KPassivePopup * | message (int popupStyle, const TQString &caption, const TQString &text, TQWidget *parent, const char *name=0) |
static KPassivePopup * | message (int popupStyle, const TQString &caption, const TQString &text, const TQPixmap &icon, TQWidget *parent, const char *name=0, int timeout=-1) |
static KPassivePopup * | message (int popupStyle, const TQString &caption, const TQString &text, const TQPixmap &icon, WId parent, const char *name=0, int timeout=-1) |
Protected Member Functions | |
virtual void | positionSelf () |
virtual void | hideEvent (TQHideEvent *) |
void | moveNear (TQRect target) |
virtual void | mouseReleaseEvent (TQMouseEvent *e) |
TQRect | defaultArea () const |
void | updateMask () |
virtual void | paintEvent (TQPaintEvent *pe) |
Detailed Description
A dialog-like popup that displays messages without interupting the user.
The simplest uses of KPassivePopup are by using the various message() static methods. The position the popup appears at depends on the type of the parent window:
- Normal Windows: The popup is placed adjacent to the icon of the window.
- System Tray Windows: The popup is placed adjact to the system tray window itself.
- Skip Taskbar Windows: The popup is placed adjact to the window itself if it is visible, and at the edge of the desktop otherwise.
You also have the option of calling show with a TQPoint as a parameter that removes the automatic placing of KPassivePopup and shows it in the point you want.
The most basic use of KPassivePopup displays a popup containing a piece of text:
We can create popups with titles and icons too, as this example shows:
For more control over the popup, you can use the setView(TQWidget *) method to create a custom popup.
- Version
- $Id$
- Since
- 3.1
Definition at line 66 of file kpassivepopup.h.
Member Enumeration Documentation
◆ PopupStyle
Styles that a KPassivePopup can have.
- Since
- 3.5
Enumerator | |
---|---|
Boxed | Information will appear in a framed box (default) |
Balloon | Information will appear in a comic-alike balloon. |
CustomStyle | Ids greater than this are reserved for use by subclasses. |
Definition at line 77 of file kpassivepopup.h.
Constructor & Destructor Documentation
◆ KPassivePopup() [1/4]
KPassivePopup::KPassivePopup | ( | TQWidget * | parent = 0 , |
const char * | name = 0 , |
||
WFlags | f = 0 |
||
) |
Creates a popup for the specified widget.
Definition at line 49 of file kpassivepopup.cpp.
◆ KPassivePopup() [2/4]
KPassivePopup::KPassivePopup | ( | WId | parent, |
const char * | name = 0 , |
||
WFlags | f = 0 |
||
) |
Creates a popup for the specified window.
Definition at line 58 of file kpassivepopup.cpp.
◆ KPassivePopup() [3/4]
KPassivePopup::KPassivePopup | ( | int | popupStyle, |
TQWidget * | parent = 0 , |
||
const char * | name = 0 , |
||
WFlags | f = 0 |
||
) |
◆ KPassivePopup() [4/4]
KPassivePopup::KPassivePopup | ( | int | popupStyle, |
WId | parent, | ||
const char * | name = 0 , |
||
WFlags | f = 0 |
||
) |
◆ ~KPassivePopup()
|
virtual |
Cleans up.
Definition at line 103 of file kpassivepopup.cpp.
Member Function Documentation
◆ autoDelete()
|
inline |
- Returns
- true if the widget auto-deletes itself when the timeout occurs.
- See also
- setAutoDelete
Definition at line 171 of file kpassivepopup.h.
◆ clicked [1/2]
|
signal |
Emitted when the popup is clicked.
◆ clicked [2/2]
|
signal |
Emitted when the popup is clicked.
◆ defaultArea()
|
protected |
If no relative window (eg taskbar button, system tray window) is available, use this rectangle (pass it to moveNear()).
Basically KWinModule::workArea() with width and height set to 0 so that moveNear uses the upper-left position.
- Returns
- The TQRect to be passed to moveNear() if no other is available.
Definition at line 296 of file kpassivepopup.cpp.
◆ hidden
|
signal |
Emitted when the popup is hidden.
◆ hideEvent()
|
protectedvirtual |
Reimplemented to destroy the object when autoDelete() is enabled.
Definition at line 288 of file kpassivepopup.cpp.
◆ message() [1/8]
|
static |
Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified widget.
Note that the returned object is destroyed when it is hidden.
- See also
- setAutoDelete
Definition at line 500 of file kpassivepopup.cpp.
◆ message() [2/8]
|
static |
Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified window.
Note that the returned object is destroyed when it is hidden.
- See also
- setAutoDelete
Definition at line 518 of file kpassivepopup.cpp.
◆ message() [3/8]
|
static |
Convenience method that displays popup with the specified caption and message beside the icon of the specified widget.
Note that the returned object is destroyed when it is hidden.
- See also
- setAutoDelete
Definition at line 512 of file kpassivepopup.cpp.
◆ message() [4/8]
|
static |
Convenience method that displays popup with the specified message beside the icon of the specified widget.
Note that the returned object is destroyed when it is hidden.
- See also
- setAutoDelete
Definition at line 507 of file kpassivepopup.cpp.
◆ message() [5/8]
|
static |
Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified widget.
Note that the returned object is destroyed when it is hidden.
- See also
- setAutoDelete
Definition at line 524 of file kpassivepopup.cpp.
◆ message() [6/8]
|
static |
Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified window.
Note that the returned object is destroyed when it is hidden.
- See also
- setAutoDelete
Definition at line 548 of file kpassivepopup.cpp.
◆ message() [7/8]
|
static |
Convenience method that displays popup with the specified popup-style, caption and message beside the icon of the specified widget.
Note that the returned object is destroyed when it is hidden.
- See also
- setAutoDelete
Definition at line 542 of file kpassivepopup.cpp.
◆ message() [8/8]
|
static |
Convenience method that displays popup with the specified popup-style and message beside the icon of the specified widget.
Note that the returned object is destroyed when it is hidden.
- See also
- setAutoDelete
Definition at line 537 of file kpassivepopup.cpp.
◆ mouseReleaseEvent()
|
protectedvirtual |
Reimplemented to detect mouse clicks.
Definition at line 241 of file kpassivepopup.cpp.
◆ moveNear()
|
protected |
Moves the popup to be adjacent to the icon of the specified rectangle.
Definition at line 357 of file kpassivepopup.cpp.
◆ paintEvent()
|
protectedvirtual |
Overwrite to paint the border when PopupStyle == Balloon.
Unused if PopupStyle == Boxed
Definition at line 409 of file kpassivepopup.cpp.
◆ positionSelf()
|
protectedvirtual |
This method positions the popup.
Definition at line 316 of file kpassivepopup.cpp.
◆ setAnchor()
void KPassivePopup::setAnchor | ( | const TQPoint & | anchor | ) |
Sets the anchor of this balloon.
The balloon tries automatically to adjust itself somehow around the point.
- Since
- 3.5
Definition at line 403 of file kpassivepopup.cpp.
◆ setAutoDelete()
|
virtual |
Enables / disables auto-deletion of this widget when the timeout occurs.
The default is false. If you use the class-methods message(), auto-delection is turned on by default.
Definition at line 236 of file kpassivepopup.cpp.
◆ setTimeout
|
slot |
Sets the delay for the popup is removed automatically.
Setting the delay to 0 disables the timeout, if you're doing this, you may want to connect the clicked() signal to the hide() slot. Setting the delay to -1 makes it use the default value.
- See also
- timeout
Definition at line 223 of file kpassivepopup.cpp.
◆ setView() [1/3]
|
virtual |
Creates a standard view then calls setView(TQWidget*) .
Definition at line 119 of file kpassivepopup.cpp.
◆ setView() [2/3]
void KPassivePopup::setView | ( | const TQString & | caption, |
const TQString & | text = TQString::null |
||
) |
Creates a standard view then calls setView(TQWidget*) .
Definition at line 218 of file kpassivepopup.cpp.
◆ setView() [3/3]
void KPassivePopup::setView | ( | TQWidget * | child | ) |
Sets the main view to be the specified widget (which must be a child of the popup).
Definition at line 108 of file kpassivepopup.cpp.
◆ show [1/2]
|
virtualslot |
Reimplemented to reposition the popup.
Definition at line 251 of file kpassivepopup.cpp.
◆ show [2/2]
|
slot |
◆ standardView()
TQVBox * KPassivePopup::standardView | ( | const TQString & | caption, |
const TQString & | text, | ||
const TQPixmap & | icon, | ||
TQWidget * | parent = 0L |
||
) |
Returns a widget that is used as standard view if one of the setView() methods taking the TQString arguments is used.
You can use the returned widget to customize the passivepopup while keeping the look similar to the "standard" passivepopups.
After customizing the widget, pass it to setView( TQWidget* )
- Parameters
-
caption The window caption (title) on the popup text The text for the popup icon The icon to use for the popup parent The parent widget used for the returned TQVBox. If left 0L, then "this", i.e. the passive popup object will be used.
- Returns
- a TQVBox containing the given arguments, looking like the standard passivepopups.
- See also
- setView( TQWidget * )
- setView( const TQString&, const TQString& )
- setView( const TQString&, const TQString&, const TQPixmap& )
Definition at line 138 of file kpassivepopup.cpp.
◆ timeout()
|
inline |
Returns the delay before the popup is removed automatically.
Definition at line 157 of file kpassivepopup.h.
◆ updateMask()
|
protected |
Updates the transparency mask.
Unused if PopupStyle == Boxed
- Since
- 3.5
Definition at line 421 of file kpassivepopup.cpp.
◆ view()
|
inline |
Returns the main view.
Definition at line 152 of file kpassivepopup.h.
The documentation for this class was generated from the following files: