org.kde.koala

Class KButtonBox

public class KButtonBox extends QWidget

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.

Version: $Id: KButtonBox.java 473384 2005-10-23 14:17:09Z rdale $

Author: Mario Weilguni

UNKNOWN: Container widget for buttons.

Constructor Summary
protected KButtonBox(Class dummy)
KButtonBox(QWidget parent, int _orientation, int border, int _autoborder)
Create an empty container for buttons.
KButtonBox(QWidget parent, int _orientation, int border)
KButtonBox(QWidget parent, int _orientation)
KButtonBox(QWidget parent)
Method Summary
QPushButtonaddButton(String text, boolean noexpand)
Add a new QPushButton.
QPushButtonaddButton(String text)
QPushButtonaddButton(String text, QObject receiver, String slot, boolean noexpand)
Add a new QPushButton.
QPushButtonaddButton(String text, QObject receiver, String slot)
QPushButtonaddButton(KGuiItem guiitem, boolean noexpand)
Add a new QPushButton.
QPushButtonaddButton(KGuiItem guiitem)
QPushButtonaddButton(KGuiItem guiitem, QObject receiver, String slot, boolean noexpand)
Add a new QPushButton.
QPushButtonaddButton(KGuiItem guiitem, QObject receiver, String slot)
voidaddStretch(int scale)
Add a stretch to the buttonbox.
voidaddStretch()
protected QSizebestButtonSize()
protected QSizebuttonSizeHint(QPushButton arg1)
StringclassName()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
booleanisDisposed()
Has the wrapped C++ instance been deleted?
QMetaObjectmetaObject()
protected voidplaceButtons()
voidresizeEvent(QResizeEvent arg1)
QSizesizeHint()
This size is calculated by the width/height of all buttons plus border/autoborder.
QSizePolicysizePolicy()
voidupdateLayout()
This function must be called once after all buttons have been inserted.

Constructor Detail

KButtonBox

protected KButtonBox(Class dummy)

KButtonBox

public KButtonBox(QWidget parent, int _orientation, int border, int _autoborder)
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.

UNKNOWN: Create an empty container for buttons.

KButtonBox

public KButtonBox(QWidget parent, int _orientation, int border)

KButtonBox

public KButtonBox(QWidget parent, int _orientation)

KButtonBox

public KButtonBox(QWidget parent)

Method Detail

addButton

public QPushButton addButton(String text, boolean noexpand)
Add a new QPushButton.

Parameters: text the text of the button to add noexpand If 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.

UNKNOWN: Add a new QPushButton.

addButton

public QPushButton addButton(String text)

addButton

public QPushButton addButton(String text, QObject receiver, String slot, boolean noexpand)
Add a new QPushButton.

Parameters: text the text of the button to add. receiver An object to connect to. slot A Qt slot to connect the 'clicked()' signal to. noexpand If 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.

UNKNOWN: Add a new QPushButton.

addButton

public QPushButton addButton(String text, QObject receiver, String slot)

addButton

public QPushButton addButton(KGuiItem guiitem, boolean noexpand)
Add a new QPushButton.

Parameters: guiitem text and icon on the button noexpand If 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.

UNKNOWN: Add a new QPushButton.

addButton

public QPushButton addButton(KGuiItem guiitem)

addButton

public QPushButton addButton(KGuiItem guiitem, QObject receiver, String slot, boolean noexpand)
Add a new QPushButton.

Parameters: guiitem text and icon on the button receiver An object to connect to. slot A Qt slot to connect the 'clicked()' signal to. noexpand If 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.

UNKNOWN: Add a new QPushButton.

addButton

public QPushButton addButton(KGuiItem guiitem, QObject receiver, String slot)

addStretch

public void addStretch(int scale)
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: org.kde.qt.QBoxLayout

UNKNOWN: Add a stretch to the buttonbox.

addStretch

public void addStretch()

bestButtonSize

protected QSize bestButtonSize()

Returns: the best size for a button. Checks all buttons and takes the maximum width/height.

UNKNOWN:

buttonSizeHint

protected QSize buttonSizeHint(QPushButton arg1)

className

public String className()

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

metaObject

public QMetaObject metaObject()

placeButtons

protected void placeButtons()

resizeEvent

public void resizeEvent(QResizeEvent arg1)

sizeHint

public QSize sizeHint()
This size is calculated by the width/height of all buttons plus border/autoborder.

Returns: The minimum size needed to fit all buttons.

UNKNOWN:

sizePolicy

public QSizePolicy sizePolicy()

updateLayout

public void updateLayout()
This function must be called once after all buttons have been inserted. It will start layout control.

UNKNOWN: This function must be called @em once after all buttons have been inserted.