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

tdeui

Public Member Functions | Protected Member Functions | List of all members
KButtonBox Class Reference

#include <kbuttonbox.h>

Inherits TQWidget.

Public Member Functions

 KButtonBox (TQWidget *parent, Orientation _orientation=TQt::Horizontal, int border=0, int _autoborder=6)
 
 ~KButtonBox ()
 
virtual TQSize sizeHint () const
 
virtual TQSizePolicy sizePolicy () const
 
virtual void resizeEvent (TQResizeEvent *)
 
TQPushButton * addButton (const TQString &text, bool noexpand=false)
 
TQPushButton * addButton (const TQString &text, TQObject *receiver, const char *slot, bool noexpand=false)
 
TQPushButton * addButton (const KGuiItem &guiitem, bool noexpand=false)
 
TQPushButton * addButton (const KGuiItem &guiitem, TQObject *receiver, const char *slot, bool noexpand=false)
 
void addStretch (int scale=1)
 
void layout ()
 

Protected Member Functions

TQSize bestButtonSize () const
 
void placeButtons ()
 
TQSize buttonSizeHint (TQPushButton *) const
 
virtual void virtual_hook (int id, void *data)
 

Detailed Description

Container widget for buttons.

This class uses Qt layout control to place the buttons; can handle both vertical and horizontal button placement. The default border is now 0 (making it easier to deal with layouts). The space between buttons is now more Motif compliant.

Author
Mario Weilguni mweil.nosp@m.guni.nosp@m.@sime.nosp@m..com
Version
$Id$

Definition at line 42 of file kbuttonbox.h.

Constructor & Destructor Documentation

◆ KButtonBox()

KButtonBox::KButtonBox ( TQWidget *  parent,
Orientation  _orientation = TQt::Horizontal,
int  border = 0,
int  _autoborder = 6 
)

Create an empty container for buttons.

If _orientation is Vertical, the buttons inserted with addButton() are laid out from top to bottom, otherwise they are laid out from left to right.

Definition at line 82 of file kbuttonbox.cpp.

◆ ~KButtonBox()

KButtonBox::~KButtonBox ( )

Free private data field.

Definition at line 94 of file kbuttonbox.cpp.

Member Function Documentation

◆ addButton() [1/4]

TQPushButton * KButtonBox::addButton ( const KGuiItem &  guiitem,
bool  noexpand = false 
)

Add a new TQPushButton.

Parameters
guiitemtext and icon on the button
noexpandIf noexpand is false, the width of the button is adjusted to fit the other buttons (the maximum of all buttons is taken). If noexpand is true, the width of this button will be set to the minimum width needed for the given text).
Returns
A pointer to the new button.
Since
3.3

Definition at line 110 of file kbuttonbox.cpp.

◆ addButton() [2/4]

TQPushButton * KButtonBox::addButton ( const KGuiItem &  guiitem,
TQObject *  receiver,
const char *  slot,
bool  noexpand = false 
)

Add a new TQPushButton.

Parameters
guiitemtext and icon on the button
receiverAn object to connect to.
slotA Qt slot to connect the 'clicked()' signal to.
noexpandIf noexpand is false, the width of the button is adjusted to fit the other buttons (the maximum of all buttons is taken). If noexpand true, the width of this button will be set to the minimum width needed for the given text).
Returns
A pointer to the new button.
Since
3.3

Definition at line 139 of file kbuttonbox.cpp.

◆ addButton() [3/4]

TQPushButton * KButtonBox::addButton ( const TQString &  text,
bool  noexpand = false 
)

Add a new TQPushButton.

Parameters
textthe text of the button to add
noexpandIf noexpand is false, the width of the button is adjusted to fit the other buttons (the maximum of all buttons is taken). If noexpand is true, the width of this button will be set to the minimum width needed for the given text).
Returns
A pointer to the new button.

Definition at line 98 of file kbuttonbox.cpp.

◆ addButton() [4/4]

TQPushButton * KButtonBox::addButton ( const TQString &  text,
TQObject *  receiver,
const char *  slot,
bool  noexpand = false 
)

Add a new TQPushButton.

Parameters
textthe text of the button to add.
receiverAn object to connect to.
slotA Qt slot to connect the 'clicked()' signal to.
noexpandIf noexpand is false, the width of the button is adjusted to fit the other buttons (the maximum of all buttons is taken). If noexpand true, the width of this button will be set to the minimum width needed for the given text).
Returns
A pointer to the new button.

Definition at line 123 of file kbuttonbox.cpp.

◆ addStretch()

void KButtonBox::addStretch ( int  scale = 1)

Add a stretch to the buttonbox.

Can be used to separate buttons. That is, if you add the buttons OK and Cancel, add a stretch, and then add the button Help, the buttons OK and Cancel will be left-aligned (or top-aligned for vertical) whereas Help will be right-aligned (or bottom-aligned for vertical).

See also
QBoxLayout

Definition at line 154 of file kbuttonbox.cpp.

◆ bestButtonSize()

TQSize KButtonBox::bestButtonSize ( ) const
protected
Returns
the best size for a button. Checks all buttons and takes the maximum width/height.

Definition at line 276 of file kbuttonbox.cpp.

◆ buttonSizeHint()

TQSize KButtonBox::buttonSizeHint ( TQPushButton *  b) const
protected

Definition at line 357 of file kbuttonbox.cpp.

◆ layout()

void KButtonBox::layout ( )

This function must be called once after all buttons have been inserted.

It will start layout control.

Definition at line 163 of file kbuttonbox.cpp.

◆ placeButtons()

void KButtonBox::placeButtons ( )
protected

Definition at line 184 of file kbuttonbox.cpp.

◆ resizeEvent()

void KButtonBox::resizeEvent ( TQResizeEvent *  )
virtual

Definition at line 272 of file kbuttonbox.cpp.

◆ sizeHint()

TQSize KButtonBox::sizeHint ( void  ) const
virtual
Returns
The minimum size needed to fit all buttons.

This size is calculated by the width/height of all buttons plus border/autoborder.

Definition at line 303 of file kbuttonbox.cpp.

◆ sizePolicy()

TQSizePolicy KButtonBox::sizePolicy ( ) const
virtual

Definition at line 345 of file kbuttonbox.cpp.

◆ virtual_hook()

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

Definition at line 375 of file kbuttonbox.cpp.


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