public class CardPanel extends Container implements MultiCardPanel
There are no methods to remove items from the CardPanel, but you can do this manually by removing the card from the cards Vector. If the item you are removing happens to be selected, then call select(-1) to deselect it (or select a different item) before removing it. You will then need to repaint the control using the CardPanel again.
Modifier and Type | Field and Description |
---|---|
boolean |
autoScroll
Deprecated.
use modifyCardOptions(OPTION_AUTO_SCROLL,0) instead;
|
Vector |
cards
The cards.
|
boolean |
clearSipOnChange
If this is set true, then when the displayed control is changed, the SIP will be turned off.
|
protected Card |
curCard
Focus on the first control on the active panel.
|
boolean |
dontFocusOnNextSelect
Deprecated.
use modifyCardOptions(OPTION_DONT_FOCUS_ON_NEXT_SELECT,0) instead;
|
boolean |
focusOnControlsAfterSelectHotKey
Deprecated.
use modifyCardOptions(OPTION_FOCUS_ON_CONTROLS_AFTER_SELECTION_HOT_KEY,0) instead;
|
Control |
focusOnHide
If this is set to a control, then that control will gain the focus if a control
within the card panel has the focus, and then the CardPanel is set such that no
item is selected (using select(-1)), then the focusOnHide control will be given
the focus.
|
protected boolean |
gotSize |
protected boolean |
made |
int |
selectedItem
The selected card, or -1 if none is selected.
|
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren, FIND_FOR_MOUSE_PRESS, takeNextFocus
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
ADD_OPTION_DONT_SHOW_TEXT_WITH_ICON, EXTRA_CONTROL_BOTTOM, EXTRA_CONTROL_EXTREME, EXTRA_CONTROL_LEFT, EXTRA_CONTROL_RIGHT, EXTRA_CONTROL_TOP, OPTION_AUTO_SCROLL, OPTION_DONT_FOCUS_ON_ANY_SELECT, OPTION_DONT_FOCUS_ON_NEXT_SELECT, OPTION_FOCUS_ON_CONTROLS_AFTER_SELECTION_HOT_KEY, OPTION_ITEM_SELECTOR_ALWAYS_ENABLED, OPTION_SWIPABLE_HORIZONTALLY, OPTION_SWIPABLE_VERTICALLY, OPTION_SWIPE_USING_CONTROL, OPTION_VERTICAL_SCROLLER
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Constructor and Description |
---|
CardPanel() |
Modifier and Type | Method and Description |
---|---|
Card |
addCard(Control toAdd,
IImage icon,
String cardName,
String longCardName,
int options)
Add a Card with an icon and card name.
|
Card |
addCard(Control toAdd,
String cardName,
String longCardName)
Add a new item to the MultiCardPanel.
|
Card |
addCard(Control toAdd,
String cardName,
String longCardName,
int cardOptionsToSet,
int cardOptionsToClear)
Add a Card, but temporarily modify the card options before adding and restore after adding.
|
Control |
addItem(Control item,
String tabName,
String longName)
This adds a control to the MultiPanel with a specified short (Tab) name and
optional long name.
|
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control.
|
Card |
createNewCard() |
protected Card |
findCard(Control item,
String tabName) |
static long |
getAddCardFlags() |
CardPanel |
getCardPanel()
Return the CardPanel associated with this MultiCardPanel (which may be null).
|
CellPanel |
getExtraControlArea(int whichArea)
If this MultiCardPanel supports an extra area for placing controls
which are not within the dynamic display area, then this will return
a CellPanel that you can add controls to which will be displayed in
that area.
|
protected Control |
getFirstFocus() |
Card |
getItem(Control item)
This returns a Card object holding information about the item added for the
specified control.
|
Card |
getItem(int index)
This returns a Card object holding information about the item added at the
specified index.
|
Card |
getItem(String tabName) |
int |
getItemCount()
This returns the number of items added to the MultiPanel.
|
int |
getSelectedItem()
This returns the index for the currently selected item.
|
ControlIterator |
getSubControls(ControlIterator it)
This returns an Iterator that goes forwards through the components
which are considered a sub-control of this Control, even though they
may not be a "child" of the control -
i.e. it may not have been added into the Control heirarchy.
|
void |
make(boolean remake)
This is used to "make" the control before being displayed.
|
long |
modifyAndSaveCardOptions(int optionsToSet,
int optionsToClear)
Set and/or clear card options and return a value that can be used with
restoreCardOptions() to restore the changed bits back to their original state.
|
int |
modifyCardOptions(int toSet,
int toClear)
Set and/or clear card options - or return the current options (if
optionsToSet and optionsToClear are zero).
|
static Closes |
modifyNextNewCard(int flagsToSet,
int flagsToClear) |
Card |
newCard(Control toAdd,
String cardName,
String longCardName,
boolean autoScroll) |
void |
resizeTo(int width,
int height)
This is called to change the width and height values.
|
int |
restoreCardOptions(long savedOptions)
Restore the card option bits changed by modifyAndSaveCardOptions().
|
void |
select(Card card)
Select the specified card.
|
void |
select(Control item)
This selects for display one of the previously added Controls.
|
void |
select(int index)
This selects for display one of the previously added Controls, given the
index of the item.
|
void |
select(String tabName)
This selects for display one of the previously added Controls, given the
short (tab) name for the item.
|
protected void |
selectACard(Card who)
This is the bottom level method that selects a new card but it does not generate a Select event.
|
protected void |
selectAndPaint(Card c) |
void |
setRect(int x,
int y,
int width,
int height)
Set the on-screen coordinates of this Control.
|
void |
shown()
This is called when a Control is shown in a Window.
|
void |
updateCard(Card card)
This can be called explicitly if a change has been made to the Card.
|
add, addDirectly, completeAddPopupControl, containerHasFocus, dismantle, dismantle, doHotKey, doPaint, findChild, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getNextKeyFocus, gotFocus, grayOut, hide, lostFocus, relayout, remove, removeAll, removePopupControl, repaintDataNow, reShow, scrollToVisible, setHidden, startAddPopupControl, takeFocus, takePromptControl, unhide
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculatedSizes, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doBorder, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, formClosing, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onControlEvent, onEvent, onKeyEvent, onLabelPenEvent, onPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setText, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
public Vector cards
public int selectedItem
public boolean autoScroll
public Control focusOnHide
public boolean clearSipOnChange
public boolean dontFocusOnNextSelect
public boolean focusOnControlsAfterSelectHotKey
protected Card curCard
protected boolean made
protected boolean gotSize
public static long getAddCardFlags()
public static Closes modifyNextNewCard(int flagsToSet, int flagsToClear)
public int modifyCardOptions(int toSet, int toClear)
MultiCardPanel
modifyCardOptions
in interface MultiCardPanel
toSet
- the option bits to set - any of the OPTION_XXX values, but none that are included in options to clear.toClear
- the option bits to clear - any of the OPTION_XXX values, but none that are included in options to set.public int getSelectedItem()
MultiPanel
getSelectedItem
in interface MultiPanel
public ControlIterator getSubControls(ControlIterator it)
Control
getSubControls
in class Control
public Control addItem(Control item, String tabName, String longName)
MultiPanel
addItem
in interface MultiPanel
public Card createNewCard()
public Card newCard(Control toAdd, String cardName, String longCardName, boolean autoScroll)
public Card addCard(Control toAdd, String cardName, String longCardName)
MultiCardPanel
addCard
in interface MultiCardPanel
toAdd
- The item to be addedcardName
- The name to appear on the tab.protected Control getFirstFocus()
getFirstFocus
in class Container
public void select(Card card)
MultiCardPanel
select
in interface MultiCardPanel
protected void selectACard(Card who)
who
- the Card to be selected.protected void selectAndPaint(Card c)
public void select(Control item)
MultiPanel
select
in interface MultiPanel
public void select(String tabName)
MultiPanel
select
in interface MultiPanel
public void select(int index)
MultiPanel
select
in interface MultiPanel
public Card getItem(int index)
MultiCardPanel
getItem
in interface MultiCardPanel
public Card getItem(Control item)
MultiCardPanel
getItem
in interface MultiCardPanel
public int getItemCount()
MultiPanel
getItemCount
in interface MultiPanel
public void make(boolean remake)
Container
public void shown()
Control
protected void calculateSizes()
Control
calculateSizes
in class Control
public void setRect(int x, int y, int width, int height)
Control
public CardPanel getCardPanel()
MultiCardPanel
getCardPanel
in interface MultiCardPanel
public Card addCard(Control toAdd, IImage icon, String cardName, String longCardName, int options)
MultiCardPanel
addCard
in interface MultiCardPanel
toAdd
- the item to add.icon
- an optional icon to associate with the item.cardName
- the display name of item.longCardName
- a longer title for the item.options
- any combination of the ADD_OPTIONS.public CellPanel getExtraControlArea(int whichArea)
MultiCardPanel
getExtraControlArea
in interface MultiCardPanel
whichArea
- one of the EXTRA_CONTROL_XXX values possibly OR'ed with
the EXTRA_CONTROL_EXTREME option.public Card addCard(Control toAdd, String cardName, String longCardName, int cardOptionsToSet, int cardOptionsToClear)
addCard
in interface MultiCardPanel
toAdd
- The item to be addedcardName
- The name to appear on the tab.longName
- A longer descriptive name for the tab. If this is null it will be set to tabName.cardOptionsToSet
- any combination of the OPTION_XXX values. These will be set before adding and then restored
to original condition after.cardOptionsToClear
- any combination of the OPTION_XXX values. These will be cleared before adding and then restored
to original condition after.public long modifyAndSaveCardOptions(int optionsToSet, int optionsToClear)
modifyAndSaveCardOptions
in interface MultiCardPanel
optionsToSet
- the option bits to set - any of the OPTION_XXX values, but none that are included in options to clear.optionsToClear
- the option bits to clear - any of the OPTION_XXX values, but none that are included in options to set.public int restoreCardOptions(long savedOptions)
restoreCardOptions
in interface MultiCardPanel
savedOptions
- the value returned by modifyAndSaveCardOptions().public void resizeTo(int width, int height)
Control
public void updateCard(Card card)
MultiCardPanel
updateCard
in interface MultiCardPanel