java-gnome version 4.0.19

org.gnome.gtk
Class ButtonBox

Object
  extended by org.freedesktop.bindings.Pointer
      extended by org.freedesktop.bindings.Proxy
          extended by org.gnome.glib.Object
              extended by org.gnome.gtk.Object
                  extended by org.gnome.gtk.Widget
                      extended by org.gnome.gtk.Container
                          extended by org.gnome.gtk.Box
                              extended by org.gnome.gtk.ButtonBox
Direct Known Subclasses:
HButtonBox, VButtonBox

public abstract class ButtonBox
extends Box

Provide a consistent layout of Buttons throughout your application. Use an HButtonBox to lay buttons out horizontally or a VButtonBox to lay buttons out vertically.

Buttons are packed into a ButtonBox the same way widgets are added to any other Container, using add(). You can also use Box's packStart() or packEnd(), but for ButtonBoxes both these functions work just like add(), ie., they pack the button in a way that depends on the current layout style and on whether the button has had setChildSecondary() called for it.

The layout/spacing can be altered in a programmatic way in order to alter the 'feel' of a program to a small degree, although in general overriding the defaults used by every other application on the desktop will impact the user's experience and so is not recommended. If you do need to make adjustments, the arrangement and layout of the Buttons can be changed with setLayout().

Since:
4.0.4
Author:
Nat Pryce, Andrew Cowie

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.EnterNotifyEvent, Widget.ExposeEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
 
Nested classes/interfaces inherited from class org.gnome.gtk.Object
Object.Destroy
 
Method Summary
 boolean getChildSecondary(Widget child)
          Returns whether child should appear in a secondary group of children.
 ButtonBoxStyle getLayout()
          Returns the method currently being used to govern arrangement child Buttons in this ButtonBox.
 void setChildSecondary(Widget child, boolean isSecondary)
          Sets whether child should appear in the "secondary" group of children.
 void setLayout(ButtonBoxStyle layout)
          Change the way the child Buttons are arranged in this ButtonBox.
 
Methods inherited from class org.gnome.gtk.Box
getSpacing, packEnd, packStart, reorderChild, setSpacing
 
Methods inherited from class org.gnome.gtk.Container
add, getChildren, remove, setBorderWidth
 
Methods inherited from class org.gnome.gtk.Widget
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getRequisition, getSensitive, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, realize, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
 
Methods inherited from class org.gnome.gtk.Object
connect, destroy
 
Methods inherited from class org.freedesktop.bindings.Pointer
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getChildSecondary

public boolean getChildSecondary(Widget child)
Returns whether child should appear in a secondary group of children.

Parameters:
child - a widget that is a child of this button box
Returns:
whether child should appear in a secondary group of children

getLayout

public ButtonBoxStyle getLayout()
Returns the method currently being used to govern arrangement child Buttons in this ButtonBox.


setChildSecondary

public void setChildSecondary(Widget child,
                              boolean isSecondary)
Sets whether child should appear in the "secondary" group of children. A typical use of the secondary child mechanism is to place the 'Help' Button in a Dialog; placing it on the far left side while the 'Ok' and 'Cancel' Buttons are on the far right.

The secondary group appears after the other children if the ButtonBoxStyle is START, SPREAD, or EDGE, and before the other children if the it is END. For horizontal ButtonBoxes, the definition of before/after depends on direction in place (see setDirection() on Widget). If the style is START or END, then the secondary children are aligned at the other end of the ButtonBox from the main children. For the other styles, they appear immediately next to the main children.

Parameters:
child - a Widget that is a child of this ButtonBox
isSecondary - if true, the child appears in a secondary group of the ButtonBox

setLayout

public void setLayout(ButtonBoxStyle layout)
Change the way the child Buttons are arranged in this ButtonBox. See ButtonBoxStyle for the list of possible constants; and see also setChildSecondary() for discussion of the impact of these different possibilities.



java-gnome