From kde-core-devel Wed Feb 27 20:59:11 2002 From: Richard Moore Date: Wed, 27 Feb 2002 20:59:11 +0000 To: kde-core-devel Subject: Improving task manager interaction - KWindowInfo and KPassivePopup X-MARC-Message: https://marc.info/?l=kde-core-devel&m=101484426513917 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------Boundary-00=_NAM7UTLPKTKEXLO2BKNH" --------------Boundary-00=_NAM7UTLPKTKEXLO2BKNH Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, I've continued working on the WM/taskbar interaction issues I reported he= re=20 previously, see http://lists.kde.org/?l=3Dkde-core-devel&m=3D100647529603= 734&w=3D2=20 I've addressed the issues that were raised at the time, so now the class= es=20 can be used with system tray windows, windows that use the SkipTaskbar fl= ag=20 etc. and in addition I've included a preliminary patch that glues them to= =20 KNotify. Anyone wanting to check things out can download the code from=20 http://xmelegance.org/devel/ as it's too late to include this stuff in 3.= 0,=20 how about adding it to kdelibs for 3.1? Cheers Rich. --------------Boundary-00=_NAM7UTLPKTKEXLO2BKNH Content-Type: text/html; charset="us-ascii"; name="KWindowInfo.html" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="KWindowInfo.html" class KWindowInfo

class KWindowInfo

Displays messages in the window icon and title. More...

Definition#include <kwindowinfo.h>
InheritsQObject (unknown) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Public Static Methods


Detailed Description

Displays messages in the window icon and title. The simplest use displays a text message in the window title:


    KWindowInfo::showMessage( this, "Message Body" );

This more complex example changes the window icon, as well as displaying the text. In addition, this example overrides the default timeout to ensure the message is only displayed for 1 second.


    QPixmap px;
    px.load( "lo16-app-logtracker.png" );
    KWindowInfo::showMessage( this, "Message Body", px, 1000 );

 KWindowInfo ( QWidget *parent, const char *name=0 )

KWindowInfo

Creates a KWindowInfo with the specified parent.

 ~KWindowInfo ()

~KWindowInfo

[virtual]

Cleans up.

bool  autoDelete ()

autoDelete

[const]

Returns true iff the object should delete itself when it resets.

void  setAutoDelete ( bool enable )

setAutoDelete

Set to true if you want the object to delete itself when the message timeout occurs.

void  showMessage ( QWidget *window, const QString &text, int timeout = -1 )

showMessage

[static]

Utility method to display a title bar message for the specified window.

void  showMessage ( QWidget *window, const QString &text, const QPixmap &pix, int timeout = -1 )

showMessage

[static]

Utility method to display a title bar message and icon for the specified window.

void  message ( const QString &text )

message

[slot]

Shows the specified text in the window title.

void  message ( const QString &text, const QPixmap &pix )

message

[slot]

Shows the specified text in the window title, and sets the window icon.

void  message ( const QString &text, int timeout )

message

[slot]

Shows the specified text in the window title for the specified time. The time is specified in milliseconds.

void  message ( const QString &text, const QPixmap &pix, int timeout )

message

[slot]

Shows the specified icon and text in the window title and WM icon, for the specified time. The time is specified in milliseconds.

void  save ()

save

[slot]

Saves the window title and icon

void  restore ()

restore

[slot]

Resets the window title and icon to the saved values. If auto-delete is enabled then the object is deleted.


--------------Boundary-00=_NAM7UTLPKTKEXLO2BKNH Content-Type: text/html; charset="us-ascii"; name="KPassivePopup.html" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="KPassivePopup.html" class KPassivePopup

class KPassivePopup

A dialog-like popup that displays messages without interupting the user. More...

Definition#include <kpassivepopup.h>
InheritsQFrame (unknown) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Signals

Public Static Methods

Protected Methods


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:

The most basic use of KPassivePopup displays a popup containing a piece of text:


    KPassivePopup::message( "This is the message", this );

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


    QPixmap px;
    px.load( "lo32-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(QWidget *) method to create a custom popup.


    KPassivePopup *pop = new KPassivePopup( parent );

    QVBox *vb = new QVBox( pop );
    (void) new QLabel( "<b>Isn't this great?</b>", vb );

    QHBox *box = new QHBox( vb );
    (void) new QPushButton( "Yes", box );
    (void) new QPushButton( "No", box );

    pop->setView( vb );
    pop->show();

 KPassivePopup ( QWidget *parent=0, const char *name=0 )

KPassivePopup

Creates a popup for the specified widget.

 KPassivePopup ( WId parent, const char *name=0 )

KPassivePopup

Creates a popup for the specified window.

 ~KPassivePopup ()

~KPassivePopup

[virtual]

Cleans up.

void  setView ( QWidget *child )

setView

Sets the main view to be the specified widget (which must be a child of the popup).

void  setView ( const QString &text, const QString &caption = QString::null )

setView

Creates a standard view then calls setView(QWidget*) .

void  setView ( const QString &text, const QString &caption, const QPixmap &icon )

setView

[virtual]

Creates a standard view then calls setView(QWidget*) .

QWidget * view ()

view

[const]

Returns the main view

int  timeout ()

timeout

[const]

Returns the delay before the popup is removed automatically.

KPassivePopupmessage ( const QString &text, QWidget *parent, const char *name=0 )

message

[static]

Convenience method that displays popup with the specified message beside the icon of the specified widget.

KPassivePopupmessage ( const QString &text, const QString &caption, QWidget *parent, const char *name=0 )

message

[static]

Convenience method that displays popup with the specified caption and message beside the icon of the specified widget.

KPassivePopupmessage ( const QString &text, const QString &caption, const QPixmap &icon, QWidget *parent, const char *name=0 )

message

[static]

Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified widget.

void  setTimeout ( int delay )

setTimeout

[slot]

Sets the delay for the popup is removed automatically. Setting the delay to -1 disables the timeout, if you're doing this, you may want to connect the clicked() signal to the hide() slot.

void  show ()

show

[virtual slot]

Reimplemented to reposition the popup.

void  clicked ()

clicked

[signal]

Emitted when the popup is clicked.

void  clicked ( QPoint pos )

clicked

[signal]

Emitted when the popup is clicked.

void  positionSelf ()

positionSelf

[protected virtual]

This method positions the popup.

void  moveNear ( QRect target )

moveNear

[protected]

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

void  mouseReleaseEvent ( QMouseEvent *e )

mouseReleaseEvent

[protected virtual]

Reimplemented to detect mouse clicks.


--------------Boundary-00=_NAM7UTLPKTKEXLO2BKNH--