public class Alignment extends Bin
The alignment settings are used to place the child within the available
area. The values range from 0.0f
(top or left) to
1.0f
(bottom or right).
The scale settings are used to specify how much the child should expand to
fill the space allocated to the Alignment. The values can range from
0.0f
(meaning the child doesn't expand at all) to
1.0f
(meaning the child will expand to fill all of the
allocated space). If both scale settings are set to 1.0f
, the
two alignment values will have no effect on the child Widget.
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.Destroy, Widget.Draw, Widget.EnterNotifyEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.QueryTooltip, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
Modifier and Type | Field and Description |
---|---|
static float |
BOTTOM
Align to the bottom.
|
static float |
CENTER
Align to the center.
|
static float |
LEFT
Align to the left.
|
static float |
RIGHT
Align to the right.
|
static float |
TOP
Align to the top.
|
Constructor and Description |
---|
Alignment()
Creates an empty Alignment.
|
Alignment(float xalign,
float yalign,
float xscale,
float yscale)
Creates an empty Alignment.
|
Alignment(float xalign,
float yalign,
float xscale,
float yscale,
Widget child)
Creates an Alignment wrapping an existing Widget.
|
Modifier and Type | Method and Description |
---|---|
float |
getAlignmentX()
Get the xalign value.
|
float |
getAlignmentY()
Get the yalign value.
|
int |
getPaddingBottom()
Returns the padding being added below the bottom of the child.
|
int |
getPaddingLeft()
Returns the padding being added to the left of the child.
|
int |
getPaddingRight()
Returns the padding being added to the right of the child.
|
int |
getPaddingTop()
Returns the padding being added to the top of the child.
|
float |
getScaleX()
Get the xscale value.
|
float |
getScaleY()
Get the yscale value.
|
void |
setAlignment(float xalign,
float yalign,
float xscale,
float yscale)
Set the alignment and scale values.
|
void |
setPadding(int paddingTop,
int paddingBottom,
int paddingLeft,
int paddingRight)
Set the padding on the different sides of the Widget.
|
add, getChildren, remove, setBorderWidth
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, destroy, getAllocatedHeight, getAllocatedWidth, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getPreferredHeightForWidthMinimum, getPreferredHeightForWidthNatural, getPreferredHeightMinimum, getPreferredHeightNatural, getPreferredWidthForHeightMinimum, getPreferredWidthForHeightNatural, getPreferredWidthMinimum, getPreferredWidthNatural, getRequestMode, getRequisition, getSensitive, getStyleContext, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, overrideBackground, overrideColor, overrideFont, queueDraw, queueDrawArea, realize, setAlignHorizontal, setAlignVertical, setCanDefault, setCanFocus, setEvents, setExpandHorizontal, setExpandVertical, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
public static final float BOTTOM
1.0f
.public static final float CENTER
0.5f
.public static final float LEFT
0.0f
.public static final float RIGHT
1.0f
.public static final float TOP
0.0f
.public Alignment()
This is here so that calling
setAlignment()
after
constructing looks a little cleaner. It's not more "efficient" to use
this.
public Alignment(float xalign, float yalign, float xscale, float yscale)
add()
method.public Alignment(float xalign, float yalign, float xscale, float yscale, Widget child)
public float getAlignmentX()
public float getAlignmentY()
public int getPaddingBottom()
public int getPaddingLeft()
public int getPaddingRight()
public int getPaddingTop()
public float getScaleX()
public float getScaleY()
public void setAlignment(float xalign, float yalign, float xscale, float yscale)
top
for the interpretation of the values. All
parameters must be within the range of 0.0f
to
1.0f
.public void setPadding(int paddingTop, int paddingBottom, int paddingLeft, int paddingRight)
WARNING
Pay close attention to the order of the sides; it might be different
than you are expecting.