Class RadioButton
radio button
Inherits from
- 
								ImageTextButton(base class)
Constructors
| Name | Description | 
|---|---|
| this | |
| this | 
Fields
| Name | Type | Description | 
|---|---|---|
| checkChange | Signal!(dlangui.widgets.widget.OnCheckHandler) | checkedstatechange event listener (bool delegate(Widget, bool)) | 
| click | Signal!(dlangui.widgets.widget.OnClickHandler) | on clickevent listener (bool delegate(Widget)) | 
| focusChange | Signal!(dlangui.widgets.widget.OnFocusHandler) | focus statechange event listener (bool delegate(Widget, bool)) | 
| FOCUS_RECT_PADDING | immutable(int) | |
| keyEvent | Signal!(dlangui.widgets.widget.OnKeyHandler) | key event listener (bool delegate( Widget, KeyEvent)) - return true if event is processed by handler | 
| mouseEvent | Signal!(dlangui.widgets.widget.OnMouseHandler) | mouse event listener (bool delegate( Widget, MouseEvent)) - return true if event is processed by handler | 
| _backgroundDrawable | Ref!(dlangui.graphics.resources.Drawable) | |
| _layoutItems | LayoutItems | |
| _acceleratorMap | ActionMap | |
| _action | Action | |
| _checkable | bool | |
| _checked | bool | |
| _children | ObjectList!(dlangui.widgets.widget.Widget) | |
| _clickable | bool | |
| _focusable | bool | |
| _focusGroup | bool | |
| _icon | ImageWidget | |
| _id | string | widget id | 
| _label | TextWidget | |
| _measuredHeight | int | heightmeasured bymeasure() | 
| _measuredWidth | int | widthmeasured bymeasure() | 
| _needDraw | bool | true to force redraw | 
| _needLayout | bool | true to force layout | 
| _orientation | Orientation | |
| _ownStyle | Style | own copy of style- to override some ofstyleproperties, null of no properties overriden | 
| _parent | Widget | parentwidget | 
| _pos | Rect | current widget position, set by layout() | 
| _state | uint | widget state(set of flags from State enum) | 
| _styleId | string | styleidto lookupstylein theme | 
| _tabOrder | ushort | |
| _tooltipText | UIString | |
| _trackHover | bool | does widget need to track mouse Hover | 
| _visibility | Visibility | widget visibility: either Visible, Invisible, Gone | 
| _window | Window | window(to be used fortoplevel widgets only!) | 
Properties
| Name | Type | Description | 
|---|---|---|
| acceleratorMap[get] | ActionMap | |
| action[get, set] | const(Action) | actionto emit onclick | 
| alignment[set] | Widget | sets alignment(combined vertical and horizontal) | 
| alignment[get] | ubyte | returns alignment(combined vertical and horizontal) | 
| alpha[set] | Widget | set widget drawing alphavalue(0=opaque .. 255=transparent) | 
| alpha[get] | uint | widget drawing alphavalue (0=opaque .. 255=transparent) | 
| animating[get] | bool | returns true is widget is being animated - need to call animate() and redraw | 
| backgroundColor[get] | uint | returns background color | 
| backgroundColor[set] | Widget | set background colorfor widget - override one fromstyle | 
| backgroundColor[set] | Widget | set background color for widget - from string like "#5599CC" or "white" | 
| backgroundDrawable[get, set] | Ref!(dlangui.graphics.resources.Drawable) | background drawable | 
| backgroundImageId[get, set] | string | background image id | 
| canCheck[get] | bool | |
| canClick[get] | bool | |
| canFocus[get] | bool | returns true if widget is focusableandvisibleandenabled | 
| checkable[get] | bool | when true, control supports Checked state | 
| checkable[set] | Widget | |
| checked[set] | Widget | set checkedstate | 
| checked[get] | bool | get checkedstate | 
| childCount[get] | int | returns number of children of this widget | 
| clickable[get] | bool | when true, user can clickthis control, and get onClick listeners called | 
| clickable[set] | Widget | |
| enabled[set] | Widget | change enabledstate | 
| enabled[get] | bool | return true if statehas State.Enabled flag set | 
| focusable[get] | bool | whether widget can be focused | 
| focusable[set] | Widget | |
| focused[get] | bool | |
| focusGroup[set] | Widget | set focus group flag for container widget | 
| focusGroup[get] | bool | When focus group is set for some parentwidget, focus from one of containing widgets can be moved using keyboard only to one of other widgets containing in it and cannot bypass bounds offocusGroup. | 
| focusRectColors[get] | const(uint[]) | returns colors to draw focus rectangle (one for solid, two for vertical gradient) or null if no focus rect should be drawn for style | 
| font[get] | Ref!(dlangui.graphics.fonts.Font) | returns fontset for widget usingstyleor set manually | 
| fontFace[set] | Widget | set fontfacefor widget - override one fromstyle | 
| fontFace[get] | string | returns fontface | 
| fontFamily[set] | Widget | set fontfamilyfor widget - override one fromstyle | 
| fontFamily[get] | FontFamily | returns fontfamily | 
| fontItalic[set] | Widget | set fontstyle(italic/normal) for widget - override one fromstyle | 
| fontItalic[get] | bool | returns fontstyle(italic/normal) | 
| fontSize[set] | Widget | set fontsizefor widget - override one fromstyle | 
| fontSize[get] | int | returns fontsize in pixels | 
| fontWeight[set] | Widget | set fontweightfor widget - override one fromstyle | 
| fontWeight[get] | ushort | returns fontweight | 
| halign[get] | Align | returns vertical alignment | 
| hasTooltip[get] | bool | returns true if widget has tooltip to show | 
| height[get] | int | returns current heightof widget in pixels | 
| id[set] | Widget | set widget id | 
| id[get] | string | returns widget id, null if not set | 
| layoutHeight[get] | int | returns layoutheightoptions (WRAP_CONTENT, FILL_PARENT, or some constant value) | 
| layoutHeight[set] | Widget | sets layoutheightoptions (WRAP_CONTENT, FILL_PARENT, or some constantvalue) | 
| layoutWeight[get] | int | returns layoutweight (while resizing to fillparent, widget will be resized proportionally to this value) | 
| layoutWeight[set] | Widget | sets layoutweight (while resizing to fillparent, widget will be resized proportionally to thisvalue) | 
| layoutWidth[get] | int | returns layoutwidthoptions (WRAP_CONTENT, FILL_PARENT, or some constant value) | 
| layoutWidth[set] | Widget | sets layoutwidthoptions (WRAP_CONTENT, FILL_PARENT, or some constantvalue) | 
| left[get] | int | returns widget rectangle leftposition | 
| margins[set] | Widget | set marginsfor widget - override one fromstyle | 
| margins[get] | Rect | get margins(between widget bounds and its background) | 
| margins[set] | Widget | set marginsfor widget with the same value forleft,top, right, bottom - override one fromstyle | 
| maxHeight[set] | Widget | set max heightconstraint (SIZE_UNSPECIFIED for no constraint) | 
| maxHeight[get] | int | returns max heightconstraint (SIZE_UNSPECIFIED if no constraint set) | 
| maxWidth[set] | Widget | set max widthconstraint (SIZE_UNSPECIFIED for no constraint) | 
| maxWidth[get] | int | returns max widthconstraint (SIZE_UNSPECIFIED if no constraint set) | 
| measuredHeight[get] | int | returns measured height(calculated duringmeasure() call) | 
| measuredWidth[get] | int | returns measured width(calculated duringmeasure() call) | 
| minHeight[get] | int | returns min heightconstraint | 
| minHeight[set] | Widget | set max heightconstraint (0 for no constraint) | 
| minWidth[get] | int | returns min widthconstraint | 
| minWidth[set] | Widget | set max widthconstraint (0 for no constraint) | 
| needDraw[get] | bool | returns true if redraw is required for widget and its children | 
| needLayout[get] | bool | returns true if layoutis required for widget and its children | 
| orientation[get] | Orientation | Returns orientation: Vertical - imagetop, Horizontal - imageleft" | 
| orientation[set] | LinearLayout | Sets orientation: Vertical - imagetop, Horizontal - imageleft" | 
| padding[get] | Rect | get padding(between background bounds and content of widget) | 
| padding[set] | Widget | set paddingfor widget to the same value forleft,top, right, bottom - override one fromstyle | 
| padding[set] | Widget | set paddingfor widget - override one fromstyle | 
| parent[get] | Widget | returns parentwidget, null fortoplevel widget | 
| parent[set] | Widget | sets parentfor widget | 
| pos[get] | Rect | returns widget rectangle | 
| resetState[set] | Widget | remove stateflags (set of flags from State enum) | 
| setState[set] | Widget | add stateflags (set of flags from State enum) | 
| state[get] | uint | widget state(set of flags from State enum) | 
| state[set] | Widget | set new widget state(set of flags from State enum) | 
| styleId[get] | string | returns widget styleid, null if not set | 
| styleId[set] | Widget | set widget styleid | 
| tabOrder[set] | Widget | |
| tabOrder[get] | ushort | tab order - hint for focus movement using Tab/Shift+Tab | 
| text[set] | Widget | Set label plain unicode string | 
| text[get] | dstring | Get label text | 
| text[set] | Widget | Set label string resource Id | 
| textColor[get] | uint | get textcolor (ARGB 32 bit value) | 
| textColor[set] | Widget | set textcolor (ARGB 32 bitvalue) | 
| textColor[set] | Widget | set textcolor for widget - from string like "#5599CC" or "white" | 
| textFlags[get] | uint | get textflags (bit set of TextFlag enum values) | 
| textFlags[set] | Widget | set textflags (bit set of TextFlag enum values) | 
| tooltipText[get, set] | dstring | tooltip text- when not empty, widget will show tooltips automatically; for advanced tooltips - overridehasTooltipandcreateTooltip | 
| top[get] | int | returns widget rectangle topposition | 
| trackHover[set] | Widget | set new trackHoverflag value (when true, widget will change Hoverstatewhile mouse is moving) | 
| trackHover[get] | bool | mouse movement processing flag (when true, widget will change Hover statewhile mouse is moving) | 
| valign[get] | Align | returns horizontal alignment | 
| visibility[get] | Visibility | returns widget visibility(Visible, Invisible, Gone) | 
| visibility[set] | Widget | sets widget visibility(Visible, Invisible, Gone) | 
| visible[get] | bool | returns true if this widget and all its parents are visible | 
| wantsKeyTracking[get] | bool | override and return true to track key events even when not focused | 
| width[get] | int | returns current widthof widget in pixels | 
| window[get] | Window | returns window(if widget or itsparentis attached towindow) | 
| window[set] | Window | sets window(to be used fortoplevel widget from Window implementation). TODO: hide it from API? | 
| ownStyle[get] | Style | enforces widget's own style- allows override some ofstyleproperties | 
| stateStyle[get] | const(Style) | returns stylefor current widgetstate | 
| style[get, set] | const(Style) | accessor to style- by lookup in theme bystyleId(ifstyleidis not set, theme basestylewill be used). | 
Methods
| Name | Description | 
|---|---|
| uncheckSiblings | |
| addChild | adds child, returns addeditem | 
| addChildren | adds child, returns added item | 
| addOnCheckChangeListener | helper function to add onCheckChangeListener in method chain | 
| addOnClickListener | helper function to add onCheckChangeListener in method chain | 
| addOnFocusChangeListener | helper function to add onFocusChangeListener in method chain | 
| animate | animates window;intervalis timeleftfrom previous draw, in hnsecs (1/10000000 of second) | 
| applyAlign | Applies alignmentfor content of sizesz- set rectanglercto aligned value of content inside of initial value ofrc. | 
| applyMargins | Helper function: applies marginsto rectangle | 
| applyPadding | Helper function: applies paddingto rectangle | 
| cancelLayout | |
| cancelTimer | cancel timer - pass value returned from setTimer() astimerIdparameter | 
| canShowPopupMenu | returns true if widget can show popup menu (e.g. by mouse right clickat pointx,y) | 
| child | returns childbyindex | 
| childById | find childof specified type T byid, returns null if not found or cannot be converted to type T | 
| childIndex | returns index of widget in childlist, -1 if passed widget is not achildof this widget | 
| compareId | compare widget idwith specified value, returs true if matches | 
| createTooltip | will be called from windowonce tooltip request timer expired; if null is returned, popup will not be shown; you can changealignmentand position of popup here | 
| dispatchAction | call to dispatch action | 
| drawFocusRect | draws focus rectangle, if enabledin styles | 
| executeInUiThread | execute delegate later in UI thread if this widget will be still available (can be used to modify UI from background thread, or just to postpone execution of action) | 
| findFocusableChild | searches children for first focusableitem, returns null if not found | 
| findKeyAction | map key to action | 
| focusGroupWidget | find nearest parentof this widget withfocusGroupflag, returns topmostparentif nofocusGroupflag set to any of parents. | 
| getCursorType | returns mouse cursor type for widget | 
| handleAction | override to handle specific actions | 
| handleActionStateChanged | called when stateofactionassigned on widget is changed | 
| handleActionStateRequest | override to handle specific actions state(e.g. changeenabledstatefor supported actions) | 
| handleMoveFocusUsingKeys | |
| invalidate | request redraw | 
| isActionEnabled | override to change popup menu items state | 
| isChild | returns true if itemischildof this widget (whendeepSearch== true - returns true ifitemis this widget or one of children inside children tree). | 
| isPointInside | returns true if point is inside of this widget | 
| layout | Set widget rectangle to specified value and layoutwidget contents. (Step 2 of two phaselayout). | 
| measure | Measure widget according to desired widthandheightconstraints. (Step 1 of two phaselayout). | 
| onDraw | Draw widget at its position to buffer | 
| onEvent | handle custom event | 
| onKeyEvent | process key event, return true ifeventis processed. | 
| onMouseEvent | process mouse event; return true ifeventis processed by widget. | 
| onThemeChanged | handle theme change: e.g. reload some themed resources | 
| onTimer | handle timer; return true to repeat timer event after next interval, false cancel timer | 
| removeAllChildren | |
| removeChild | removes childbyID, returns removed item | 
| removeChild | removes child, returns removed item | 
| removeChild | removes child, returns removed item | 
| requestActionsUpdate | set actionupdate request flag, will be cleared after redraw | 
| requestLayout | request relayout of widget and its children | 
| setBoolProperty | set string property value, for ML loaders | 
| setDoubleProperty | set double property value, for ML loaders | 
| setDstringProperty | set string property value, for ML loaders | 
| setFocus | sets focus to this widget or suitable focusablechild, returns previouslyfocusedwidget | 
| setIntProperty | set int property value, for ML loaders | 
| setRectProperty | set Rect property value, for ML loaders | 
| setStringProperty | set string property value, for ML loaders | 
| setTimer | set new timer to call onTimer() after specified interval (for recurred notifications, return true fromonTimer) | 
| setUistringProperty | set string property value, for ML loaders | 
| showPopupMenu | shows popup menu at ( x,y) | 
| updateActionState | ask for update stateof someaction(unlesforce=true, checkswindowflag actionsUpdateRequested), returns true ifactionstateis changed | 
| updateActionState | call to update stateforaction(ifactionis assigned for widget) | 
| updateStateFromAction | apply enabled, visibile andcheckedstatefor this widget fromaction'sstate | 
| handleClick | |
| initialize | |
| handleCheckChange | override to handle check changes | 
| handleFocusChange | override to handle focus changes | 
| measuredContent | helper function for implement measure() when widget's content dimensions are known | 
| scheduleTooltip | schedule tooltip | 
Authors
Vadim Lopatin, coolreader.org@gmail.com
Copyright
Vadim Lopatin, 2014
License
Boost License 1.0