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

tdeui

Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KPassivePopup Class Reference

#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:

KPassivePopup::message( "This is the message", this );
KPassivePopup::message
static KPassivePopup * message(const TQString &text, TQWidget *parent, const char *name=0)
Convenience method that displays popup with the specified message beside the icon of the specified wi...
Definition: kpassivepopup.cpp:507

We can create popups with titles and icons too, as this example shows:

TQPixmap px;
px.load( "hi32-app-logtracker.png" );
KPassivePopup::message( "Some title", "This is the main text", px, this );

For more control over the popup, you can use the setView(TQWidget *) method to create a custom popup.

KPassivePopup *pop = new KPassivePopup( parent );
TQVBox *vb = new TQVBox( pop );
(void) new TQLabel( vb, "<b>Isn't this great?</b>" );
TQHBox *box = new TQHBox( vb );
(void) new TQPushButton( box, "Yes" );
(void) new TQPushButton( box, "No" );
pop->setView( vb );
pop->show();
KPassivePopup
A dialog-like popup that displays messages without interupting the user.
Definition: kpassivepopup.h:67
KPassivePopup::KPassivePopup
KPassivePopup(TQWidget *parent=0, const char *name=0, WFlags f=0)
Creates a popup for the specified widget.
Definition: kpassivepopup.cpp:49
KPassivePopup::setView
void setView(TQWidget *child)
Sets the main view to be the specified widget (which must be a child of the popup).
Definition: kpassivepopup.cpp:108
KPassivePopup::show
virtual void show()
Reimplemented to reposition the popup.
Definition: kpassivepopup.cpp:251
Version
$Id$
Since
3.1
Author
Richard Moore, rich@.nosp@m.kde..nosp@m.org
Sascha Cunz, sasch.nosp@m.a.cu.nosp@m.nz@ti.nosp@m.scal.nosp@m.i.de

Definition at line 66 of file kpassivepopup.h.

Member Enumeration Documentation

◆ PopupStyle

enum KPassivePopup::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 
)

Creates a popup for the specified widget.

Since
3.5

Definition at line 67 of file kpassivepopup.cpp.

◆ KPassivePopup() [4/4]

KPassivePopup::KPassivePopup ( int  popupStyle,
WId  parent,
const char *  name = 0,
WFlags  f = 0 
)

Creates a popup for the specified window.

Since
3.5

Definition at line 76 of file kpassivepopup.cpp.

◆ ~KPassivePopup()

KPassivePopup::~KPassivePopup ( )
virtual

Cleans up.

Definition at line 103 of file kpassivepopup.cpp.

Member Function Documentation

◆ autoDelete()

bool KPassivePopup::autoDelete ( ) const
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]

void KPassivePopup::clicked ( )
signal

Emitted when the popup is clicked.

◆ clicked [2/2]

void KPassivePopup::clicked ( TQPoint  pos)
signal

Emitted when the popup is clicked.

◆ defaultArea()

TQRect KPassivePopup::defaultArea ( ) const
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

void KPassivePopup::hidden ( KPassivePopup *  )
signal

Emitted when the popup is hidden.

◆ hideEvent()

void KPassivePopup::hideEvent ( TQHideEvent *  )
protectedvirtual

Reimplemented to destroy the object when autoDelete() is enabled.

Definition at line 288 of file kpassivepopup.cpp.

◆ message() [1/8]

KPassivePopup * KPassivePopup::message ( const TQString &  caption,
const TQString &  text,
const TQPixmap &  icon,
TQWidget *  parent,
const char *  name = 0,
int  timeout = -1 
)
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]

KPassivePopup * KPassivePopup::message ( const TQString &  caption,
const TQString &  text,
const TQPixmap &  icon,
WId  parent,
const char *  name = 0,
int  timeout = -1 
)
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]

KPassivePopup * KPassivePopup::message ( const TQString &  caption,
const TQString &  text,
TQWidget *  parent,
const char *  name = 0 
)
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]

KPassivePopup * KPassivePopup::message ( const TQString &  text,
TQWidget *  parent,
const char *  name = 0 
)
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]

KPassivePopup * KPassivePopup::message ( int  popupStyle,
const TQString &  caption,
const TQString &  text,
const TQPixmap &  icon,
TQWidget *  parent,
const char *  name = 0,
int  timeout = -1 
)
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]

KPassivePopup * KPassivePopup::message ( int  popupStyle,
const TQString &  caption,
const TQString &  text,
const TQPixmap &  icon,
WId  parent,
const char *  name = 0,
int  timeout = -1 
)
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]

KPassivePopup * KPassivePopup::message ( int  popupStyle,
const TQString &  caption,
const TQString &  text,
TQWidget *  parent,
const char *  name = 0 
)
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]

KPassivePopup * KPassivePopup::message ( int  popupStyle,
const TQString &  text,
TQWidget *  parent,
const char *  name = 0 
)
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()

void KPassivePopup::mouseReleaseEvent ( TQMouseEvent *  e)
protectedvirtual

Reimplemented to detect mouse clicks.

Definition at line 241 of file kpassivepopup.cpp.

◆ moveNear()

void KPassivePopup::moveNear ( TQRect  target)
protected

Moves the popup to be adjacent to the icon of the specified rectangle.

Definition at line 357 of file kpassivepopup.cpp.

◆ paintEvent()

void KPassivePopup::paintEvent ( TQPaintEvent *  pe)
protectedvirtual

Overwrite to paint the border when PopupStyle == Balloon.

Unused if PopupStyle == Boxed

Definition at line 409 of file kpassivepopup.cpp.

◆ positionSelf()

void KPassivePopup::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()

void KPassivePopup::setAutoDelete ( bool  autoDelete)
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

void KPassivePopup::setTimeout ( int  delay)
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]

void KPassivePopup::setView ( const TQString &  caption,
const TQString &  text,
const TQPixmap &  icon 
)
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]

void KPassivePopup::show ( void  )
virtualslot

Reimplemented to reposition the popup.

Definition at line 251 of file kpassivepopup.cpp.

◆ show [2/2]

void KPassivePopup::show ( const TQPoint &  p)
slot

Shows the popup in the given point.

Since
3.5

Definition at line 282 of file kpassivepopup.cpp.

◆ 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
captionThe window caption (title) on the popup
textThe text for the popup
iconThe icon to use for the popup
parentThe 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()

int KPassivePopup::timeout ( ) const
inline

Returns the delay before the popup is removed automatically.

Definition at line 157 of file kpassivepopup.h.

◆ updateMask()

void KPassivePopup::updateMask ( )
protected

Updates the transparency mask.

Unused if PopupStyle == Boxed

Since
3.5

Definition at line 421 of file kpassivepopup.cpp.

◆ view()

TQWidget * KPassivePopup::view ( ) const
inline

Returns the main view.

Definition at line 152 of file kpassivepopup.h.


The documentation for this class was generated from the following files:
  • kpassivepopup.h
  • kpassivepopup.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.