Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • AbstractControl_CodeGenerator
  • AjaxTimingForm
  • BasicForm
  • BasicOrmTests
  • BBCodeParser
  • CacheTests
  • CalculatorForm
  • CalculatorWidget
  • ComplexColumn
  • DataRepeaterExample
  • Event
  • ExampleCheckColumn1
  • ExampleCheckColumn2
  • ExampleForm
  • Examples
  • ExampleService
  • ExamplesForm
  • ExampleSingleForm
  • ExpandAsArrayTests
  • HtmlJqDoc
  • InjectForm
  • JavaScriptHelper
  • JqAttributes
  • JqControlGen
  • JqDoc
  • JqIcon
  • Method
  • ModelConnectorTests
  • MyControl
  • MyQSlider_ChangeEvent
  • NavPanel
  • NestedTabForm
  • Option
  • Order
  • PaginatorForm
  • ParamsForm
  • PersistentExampleForm
  • PersonEditPanel
  • PluginEditForm
  • PluginManagerForm
  • Project
  • ProjectEditPanel
  • ProjectListForm
  • ProjectPickerListBox
  • ProjectViewPanel
  • QAbstractCacheProvider
  • QAbstractHtmlTableColumn
  • QAbstractHtmlTableDataColumn
  • QAccordion
  • QAccordion_ActivateEvent
  • QAccordion_BeforeActivateEvent
  • QAccordion_CreateEvent
  • QAccordionBase
  • QAccordionGen
  • QAction
  • QActionControl
  • QAjaxAction
  • QAjaxControlAction
  • QAjaxResponse
  • QAlertAction
  • QApplication
  • QApplicationBase
  • QArchive
  • QAutocomplete
  • QAutocomplete_ChangeEvent
  • QAutocomplete_CloseEvent
  • QAutocomplete_CodeGenerator
  • QAutocomplete_CreateEvent
  • QAutocomplete_FocusEvent
  • QAutocomplete_OpenEvent
  • QAutocomplete_ResponseEvent
  • QAutocomplete_SearchEvent
  • QAutocomplete_SelectEvent
  • QAutocomplete_SourceEvent
  • QAutocompleteBase
  • QAutocompleteBase_CodeGenerator
  • QAutocompleteGen
  • QAutocompleteListItem
  • QBackspaceKeyEvent
  • QBaseClass
  • QBlockControl
  • QBlurControlAction
  • QBlurEvent
  • QBorderCollapse
  • QBorderStyle
  • QBrowserType
  • QButton
  • QButtonBase
  • QCache
  • QCacheDeleteAction
  • QCacheDeleteAllAction
  • QCacheProviderAPC
  • QCacheProviderLocalMemory
  • QCacheProviderLocalMemoryTest
  • QCacheProviderMemcache
  • QCacheProviderNoCache
  • QCacheProviderProxy
  • QCacheSetAction
  • QCalendar
  • QCalendarType
  • QCallType
  • QCausesValidation
  • QCellClickEvent
  • QChangeEvent
  • QCheckBox
  • QCheckBox_CodeGenerator
  • QCheckBoxBase_CodeGenerator
  • QCheckBoxLegacyColumn
  • QCheckBoxList
  • QCheckBoxList_CodeGenerator
  • QCheckBoxListBase_CodeGenerator
  • QClickEvent
  • QCodeGen
  • QCodeGenBase
  • QConfirmAction
  • QContextMenuEvent
  • QControl
  • QControl_CodeGenerator
  • QControlBase
  • QControlBase_CodeGenerator
  • QControlBaseTests
  • QControlCategoryType
  • QControlGrouping
  • QControlLabel
  • QControlProxy
  • QConvertNotation
  • QConvertNotationBase
  • QCrossScripting
  • QCryptography
  • QCss
  • QCssAction
  • QCssClassAction
  • QCssTests
  • QCsvTextBox
  • QCursor
  • QDatabaseBase
  • QDatabaseCodeGen
  • QDatabaseFieldBase
  • QDatabaseFieldType
  • QDatabaseForeignKey
  • QDatabaseIndex
  • QDatabaseResultBase
  • QDatabaseRowBase
  • QDatabaseTests
  • QDataGrid
  • QDataGrid_CheckBoxColumn
  • QDataGrid_CodeGenerator
  • QDataGrid_SortEvent
  • QDataGridBase
  • QDataGridBase_CodeGenerator
  • QDataGridLegacy
  • QDataGridLegacyBase
  • QDataGridLegacyColumn
  • QDataGridLegacyRow
  • QDataGridLegacyRowStyle
  • QDataRepeater
  • QDatepicker
  • QDatepicker_BeforeShowDayEvent
  • QDatepicker_BeforeShowEvent
  • QDatepicker_CalculateWeekEvent
  • QDatepicker_ChangeMonthYearEvent
  • QDatepicker_CloseEvent
  • QDatepicker_SelectEvent
  • QDatepicker_SelectEvent2
  • QDatepickerBase
  • QDatepickerBox
  • QDatepickerBox_BeforeShowDayEvent
  • QDatepickerBox_BeforeShowEvent
  • QDatepickerBox_CalculateWeekEvent
  • QDatepickerBox_ChangeMonthYearEvent
  • QDatepickerBox_CloseEvent
  • QDatepickerBox_CodeGenerator
  • QDatepickerBox_SelectEvent
  • QDatepickerBoxBase
  • QDatepickerBoxBase_CodeGenerator
  • QDatepickerBoxGen
  • QDatepickerGen
  • QDateTime
  • QDateTimePicker
  • QDateTimePicker_CodeGenerator
  • QDateTimePickerBase_CodeGenerator
  • QDateTimePickerFormat
  • QDateTimePickerType
  • QDateTimeSpan
  • QDateTimeTests
  • QDateTimeTextBox
  • QDbBackedFormStateHandler
  • QDbBackedSessionHandler
  • QDialog
  • QDialog_BeforeCloseEvent
  • QDialog_ButtonEvent
  • QDialog_CloseEvent
  • QDialog_CreateEvent
  • QDialog_DragEvent
  • QDialog_DragStartEvent
  • QDialog_DragStopEvent
  • QDialog_FocusEvent
  • QDialog_OpenEvent
  • QDialog_ResizeEvent
  • QDialog_ResizeStartEvent
  • QDialog_ResizeStopEvent
  • QDialogBase
  • QDialogBox
  • QDialogGen
  • QDisplayStyle
  • QDoubleClickEvent
  • QDownArrowKeyEvent
  • QDragDropEvent
  • QDraggable
  • QDraggable_CreateEvent
  • QDraggable_DragEvent
  • QDraggable_StartEvent
  • QDraggable_StopEvent
  • QDraggableBase
  • QDraggableGen
  • QDroppable
  • QDroppable_ActivateEvent
  • QDroppable_CreateEvent
  • QDroppable_DeactivateEvent
  • QDroppable_DropEvent
  • QDroppable_OutEvent
  • QDroppable_OverEvent
  • QDroppableBase
  • QDroppableGen
  • QDropZoneGrouping
  • QEmailAttachment
  • QEmailMessage
  • QEmailServer
  • QEmailStringAttachment
  • QEmailTextBox
  • QEnterKeyEvent
  • QErrorAttribute
  • QEscapeKeyEvent
  • QEvent
  • QFieldset
  • QFile
  • QFileAsset
  • QFileAssetBase
  • QFileAssetDialog
  • QFileAssetType
  • QFileControl
  • QFileFormStateHandler
  • QFilterType
  • QFloatTextBox
  • QFloatTextBox_CodeGenerator
  • QFloatTextBoxBase_CodeGenerator
  • QFocusControlAction
  • QFocusEvent
  • QFocusInEvent
  • QFocusOutEvent
  • QFolder
  • QFontFamily
  • QForm
  • QFormBase
  • QFormGen
  • QFormStateHandler
  • QGridLines
  • QHideCalendarAction
  • QHideDialog
  • QHideDialogBox
  • QHListControl
  • QHListItem
  • QHorizontalAlign
  • QHtml
  • QHtmlAttributeManager
  • QHtmlAttributeManagerBase
  • QHtmlReporter
  • QHtmlTable
  • QHtmlTable_CodeGenerator
  • QHtmlTableBase
  • QHtmlTableCallableColumn
  • QHtmlTableCheckBoxColumn
  • QHtmlTableCheckBoxColumn_ClickEvent
  • QHtmlTableIndexedColumn
  • QHtmlTableLinkColumn
  • QHtmlTableNodeColumn
  • QHtmlTablePropertyColumn
  • QI18n
  • QI18nTests
  • QImageBase
  • QImageBrowser
  • QImageBrowserBase
  • QImageBrowserNav
  • QImageBrowserThumbnails
  • QImageButton
  • QImageControl
  • QImageControlBase
  • QImageFileAsset
  • QImageLabel
  • QImageLabelBase
  • QImageRollover
  • QImageType
  • QIndex
  • QInformixPdoDatabase
  • QInformixPdoDatabaseField
  • QInformixPdoDatabaseResult
  • QInformixPdoDatabaseRow
  • QInputEvent
  • QInstallationValidationResult
  • QInstallationValidator
  • QIntegerTextBox
  • QIntegerTextBox_CodeGenerator
  • QIntegerTextBoxBase_CodeGenerator
  • QJavaScriptAction
  • QJQAction
  • QJQBounceAction
  • QJqButton
  • QJqButton_CreateEvent
  • QJqButtonBase
  • QJqButtonGen
  • QJqCheckBox
  • QJqCheckBox_CreateEvent
  • QJqCheckBoxBase
  • QJqCheckBoxGen
  • QJQHideAction
  • QJQHideEffectAction
  • QJQHighlightAction
  • QJQPulsateAction
  • QJqRadioButton
  • QJqRadioButton_CreateEvent
  • QJqRadioButtonBase
  • QJqRadioButtonGen
  • QJQShakeAction
  • QJQShowAction
  • QJQShowEffectAction
  • QJQSizeAction
  • QJQToggleAction
  • QJQToggleEffectAction
  • QJQTransferAction
  • QJqUiEvent
  • QJqUiPropertyEvent
  • QJsClosure
  • QJsFunction
  • QJsNoQuoteKey
  • QJsParameterList
  • QJsPriority
  • QJsTimer
  • QJsTimerBase
  • QJsVarName
  • QKeyDownEvent
  • QKeyPressEvent
  • QKeyUpEvent
  • QLabel
  • QLabel_CodeGenerator
  • QLabelBase_CodeGenerator
  • QLexer
  • QLinkButton
  • QListBox
  • QListBox_CodeGenerator
  • QListBoxBase
  • QListBoxBase_CodeGenerator
  • QListControl
  • QListControl_CodeGenerator
  • QListControlBase_CodeGenerator
  • QListItem
  • QListItemBase
  • QListItemStyle
  • QManyToManyReference
  • QMenu
  • QMenu_BlurEvent
  • QMenu_CreateEvent
  • QMenu_FocusEvent
  • QMenu_SelectEvent
  • QMenuBase
  • QMenuGen
  • QMimeType
  • QModelConnectorArgumentType
  • QModelConnectorCreateType
  • QModelConnectorEditDlg
  • QModelConnectorOptions
  • QModelConnectorParam
  • QMouseDownEvent
  • QMouseEnterEvent
  • QMouseLeaveEvent
  • QMouseMoveEvent
  • QMouseOutEvent
  • QMouseOverEvent
  • QMouseUpEvent
  • QMultiLevelCacheProvider
  • QMySqlDatabase
  • QMySqlDatabaseField
  • QMySqlDatabaseResult
  • QMySqli5ClusterDatabase
  • QMySqli5Database
  • QMySqli5DatabaseField
  • QMySqli5DatabaseResult
  • QMySqliDatabase
  • QMySqliDatabaseField
  • QMySqliDatabaseResult
  • QMySqliDatabaseRow
  • QNoScriptAjaxAction
  • QNumericTextBox
  • QOnEvent
  • QOracleDatabase
  • QOracleDatabaseField
  • QOracleDatabaseResult
  • QOracleDatabaseRow
  • QOrderedListType
  • QOverflow
  • QPaginatedControl
  • QPaginator
  • QPaginatorBase
  • QPanel
  • QPartialQueryBuilder
  • QPdoDatabase
  • QPdoDatabaseResult
  • QPgConditionILike
  • QPgConditionJsonContains
  • QPgQ
  • QPosition
  • QPostgreSqlDatabase
  • QPostgreSqlDatabaseField
  • QPostgreSqlDatabaseResult
  • QPostgreSqlDatabaseRow
  • QPostgreSqlPdoDatabase
  • QPostgreSqlPdoDatabaseField
  • QPostgreSqlPdoDatabaseResult
  • QPostgreSqlPdoDatabaseRow
  • QProgressbar
  • QProgressbar_ChangeEvent
  • QProgressbar_CompleteEvent
  • QProgressbar_CreateEvent
  • QProgressbarBase
  • QProgressbarGen
  • QQ
  • QQAggregationClause
  • QQAliasTests
  • QQAssociationNode
  • QQAverage
  • QQClause
  • QQColumnNode
  • QQCondition
  • QQConditionAll
  • QQConditionAnd
  • QQConditionBetween
  • QQConditionComparison
  • QQConditionEqual
  • QQConditionExists
  • QQConditionGreaterOrEqual
  • QQConditionGreaterThan
  • QQConditionIn
  • QQConditionIsNotNull
  • QQConditionIsNull
  • QQConditionLessOrEqual
  • QQConditionLessThan
  • QQConditionLike
  • QQConditionLogical
  • QQConditionNone
  • QQConditionNot
  • QQConditionNotBetween
  • QQConditionNotEqual
  • QQConditionNotExists
  • QQConditionNotIn
  • QQConditionNotLike
  • QQConditionOr
  • QQCount
  • QQDistinct
  • QQExpand
  • QQExpandAsArray
  • QQExpandVirtualNode
  • QQFuncTests
  • QQFunctionNode
  • QQGroupBy
  • QQHavingClause
  • QQLimitInfo
  • QQMathNode
  • QQMathOpTests
  • QQMaximum
  • QQMinimum
  • QQNamedValue
  • QQNode
  • QQNoParentNode
  • QQOrderBy
  • QQReverseReferenceNode
  • QQSelect
  • QQSubQueryCountNode
  • QQSubQueryNode
  • QQSubQuerySqlNode
  • QQSum
  • QQTableNode
  • QQuery
  • QQueryBuilder
  • QQueryExpansion
  • QQVirtualNode
  • QRadioButton
  • QRadioButtonList
  • QRadioButtonList_CodeGenerator
  • QRadioButtonListBase_CodeGenerator
  • QRedirectAction
  • QReference
  • QRegex
  • QRegisterClickPositionAction
  • QRepeatDirection
  • QRequestMode
  • QResetTimerAction
  • QResizable
  • QResizable_CreateEvent
  • QResizable_ResizeEvent
  • QResizable_StartEvent
  • QResizable_StopEvent
  • QResizableBase
  • QResizableGen
  • QResizeHandleDirection
  • QRestServiceCodeGen
  • QReverseReference
  • QRssCategory
  • QRssFeed
  • QRssImage
  • QRssItem
  • QSampleControl
  • QSampleTranslation
  • QSelectable
  • QSelectable_CreateEvent
  • QSelectable_SelectedEvent
  • QSelectable_SelectingEvent
  • QSelectable_StartEvent
  • QSelectable_StopEvent
  • QSelectable_UnselectedEvent
  • QSelectable_UnselectingEvent
  • QSelectableBase
  • QSelectableGen
  • QSelectControlAction
  • QSelectEvent
  • QSelectionMode
  • QSelectMenu
  • QSelectMenu_ChangeEvent
  • QSelectMenu_CloseEvent
  • QSelectMenu_CreateEvent
  • QSelectMenu_FocusEvent
  • QSelectMenu_OpenEvent
  • QSelectMenu_SelectEvent
  • QSelectMenuBase
  • QSelectMenuGen
  • QServerAction
  • QServerControlAction
  • QSessionFormStateHandler
  • QSetValueAction
  • QShowCalendarAction
  • QShowDialog
  • QShowDialogBox
  • QSlider
  • QSlider_ChangeEvent
  • QSlider_CodeGenerator
  • QSlider_CreateEvent
  • QSlider_SlideEvent
  • QSlider_StartEvent
  • QSlider_StopEvent
  • QSliderBase
  • QSliderBase_CodeGenerator
  • QSliderGen
  • QSoapMethod
  • QSoapParameter
  • QSoapService
  • QSortable
  • QSortable_ActivateEvent
  • QSortable_BeforeStopEvent
  • QSortable_ChangeEvent
  • QSortable_CreateEvent
  • QSortable_DeactivateEvent
  • QSortable_OutEvent
  • QSortable_OverEvent
  • QSortable_ReceiveEvent
  • QSortable_RemoveEvent
  • QSortable_SortEvent
  • QSortable_StartEvent
  • QSortable_StopEvent
  • QSortable_UpdateEvent
  • QSortableBase
  • QSortableGen
  • QSpinner
  • QSpinner_ChangeEvent
  • QSpinner_CreateEvent
  • QSpinner_SpinEvent
  • QSpinner_StartEvent
  • QSpinner_StopEvent
  • QSpinnerBase
  • QSpinnerGen
  • QSqlColumn
  • QSqLite3PdoDatabase
  • QSqLite3PdoDatabaseField
  • QSqLite3PdoDatabaseResult
  • QSqLite3PdoDatabaseRow
  • QSqlServer2005Database
  • QSqlServer2005DatabaseField
  • QSqlServer2005DatabaseResult
  • QSqlServer2005DatabaseRow
  • QSqlServerDatabase
  • QSqlServerDatabaseField
  • QSqlServerDatabaseResult
  • QSqlServerDatabaseRow
  • QSqlTable
  • QStack
  • QStopPropagationAction
  • QString
  • QStringTest
  • QTabKeyEvent
  • QTabs
  • QTabs_ActivateEvent
  • QTabs_BeforeActivateEvent
  • QTabs_BeforeLoadEvent
  • QTabs_CreateEvent
  • QTabs_LoadEvent
  • QTabsBase
  • QTabsGen
  • QTag
  • QTagStyler
  • QTerminateAction
  • QTestControl
  • QTestForm
  • QTextAlign
  • QTextBox
  • QTextBox_CodeGenerator
  • QTextBoxBase
  • QTextBoxBase_CodeGenerator
  • QTextMode
  • QTimer
  • QTimerExpiredEvent
  • QTimerTests
  • QToggleCssClassAction
  • QToggleDisplayAction
  • QToggleEnableAction
  • QTranslationPoParser
  • QTreeNav
  • QTreeNavItem
  • QType
  • QTypeTable
  • QTypeTests
  • QUnitTestCaseBase
  • QUnorderedListStyle
  • QUpArrowKeyEvent
  • QUrlTextBox
  • QVerticalAlign
  • QVirtualAttributeColumn
  • QWaitIcon
  • QWatcher
  • QWatcherBase
  • QWatcherCache
  • QWatcherDB
  • QWatcherNone
  • QWriteBox
  • RecordsSummary
  • RefreshForm
  • SampleComposite
  • SampleForm
  • SelectableLabel
  • SelectForm
  • SpeedForm
  • TestImageBrowser
  • UrlForm

Interfaces

  • ICacheAction
  • QDataList_CodeGenerator_Interface
  • QTranslationBase

Traits

  • QDataBinder
  • QListItemManager
  • QModelTrait

Exceptions

  • QCallerException
  • QCrossScriptingException
  • QCryptographyException
  • QDatabaseExceptionBase
  • QDataBindException
  • QDateTimeNullException
  • QEmailException
  • QIndexOutOfRangeException
  • QInformixPdoDatabaseException
  • QInvalidCastException
  • QInvalidFormStateException
  • QMySqliDatabaseException
  • QOptimisticLockingException
  • QOracleDatabaseException
  • QPdoDatabaseException
  • QPoParserException
  • QPostgreSqlDatabaseException
  • QPostgreSqlPdoDatabaseException
  • QRemoteAdminDeniedException
  • QSqLite3PdoDatabaseException
  • QSqlServer2005DatabaseException
  • QSqlServerDatabaseException
  • QUndefinedMethodException
  • QUndefinedPrimaryKeyException
  • QUndefinedPropertyException

Functions

  • __database_check_error
  • __QForm_EvaluateTemplate_ObHandler
  • _b
  • _indent
  • _nl
  • _p
  • _r
  • _t
  • _tp
  • _tr
  • array_trim
  • beginsWith
  • CamelCaseFromDash
  • CastToInt
  • DataGridEvalHandleError
  • DisplayMonospacedText
  • endsWith
  • GO_BACK
  • jq_anytime_gen
  • jq_control_gen
  • jq_inc_gen
  • jq_indent
  • PrintExplainStatement
  • PrintInstructions
  • QcubedHandleCodeGenParseError
  • QcubedHandleError
  • QcubedHandleException
  • QCubedShutdown
  • QDateTimeErrorHandler
  • trimOffEnd
  • trimOffFront
  • Overview
  • Package
  • Class
  1: <?php
  2:     /**
  3:      * This file contains the QRadioButtonList class.
  4:      *
  5:      * @package Controls
  6:      */
  7: 
  8:     /**
  9:      * This class will render a List of HTML Radio Buttons (inhereting from ListControl).
 10:      * By definition, radio button lists are single-select ListControls.
 11:      *
 12:      * So assuming you have a list of 10 items, and you have RepeatColumn set to 3:
 13:      *
 14:      *  RepeatDirection::Horizontal would render as:
 15:      *  1   2   3
 16:      *  4   5   6
 17:      *  7   8   9
 18:      *  10
 19:      *
 20:      *  RepeatDirection::Vertical would render as:
 21:      *  1   5   8
 22:      *  2   6   9
 23:      *  3   7   10
 24:      *  4
 25:      *
 26:      * @package Controls
 27:      *
 28:      * @property string $TextAlign specifies if each ListItem's Name should be displayed to the left or to the right of the radio button.
 29:      * @property boolean $HtmlEntities
 30:      * @property integer $CellPadding specified the HTML Table's CellPadding
 31:      * @property integer $CellSpacing specified the HTML Table's CellSpacing
 32:      * @property integer $RepeatColumns specifies how many columns should be rendered in the HTML Table
 33:      * @property string $RepeatDirection specifies which direction should the list go first: horizontal or vertical
 34:      * @property integer $ButtonMode specifies how to render buttons
 35:      */
 36:     class QRadioButtonList extends QListControl {
 37:         const ButtonModeNone = 0;
 38:         const ButtonModeJq = 1;
 39:         const ButtonModeSet = 2;
 40:         const ButtonModeList = 3;   // just a vanilla list of radio buttons with no row or column styling
 41: 
 42:         ///////////////////////////
 43:         // Private Member Variables
 44:         ///////////////////////////
 45: 
 46:         // APPEARANCE
 47:         protected $strTextAlign = QTextAlign::Right;
 48: 
 49:         /** @var  string The class to use when wrapping a button-label group */
 50:         protected $strButtonGroupClass;
 51: 
 52:         // BEHAVIOR
 53:         protected $blnHtmlEntities = true;
 54: 
 55:         // LAYOUT
 56:         protected $intCellPadding = -1;
 57:         protected $intCellSpacing = -1;
 58:         protected $intRepeatColumns = 1;
 59:         protected $strRepeatDirection = QRepeatDirection::Vertical;
 60:         protected $objItemStyle = null;
 61:         protected $intButtonMode;
 62:         protected $strMaxHeight; // will create a scroll pane if height is exceeded
 63: 
 64:         public function __construct($objParentObject, $strControlId = null) {
 65:             parent::__construct($objParentObject, $strControlId);
 66:             $this->objItemStyle = new QListItemStyle();
 67:         }
 68: 
 69:         //////////
 70:         // Methods
 71:         //////////
 72:         public function ParsePostData() {
 73:             $val = $this->objForm->CheckableControlValue($this->strControlId);
 74:             if ($val === null) {
 75:                 $this->UnselectAllItems(false);
 76:             } else {
 77:                 $this->SetSelectedItemsByIndex(array($val), false);
 78:             }
 79:         }
 80: 
 81:         public function GetEndScript() {
 82:             $ctrlId = $this->ControlId;
 83:             if ($this->intButtonMode == self::ButtonModeSet) {
 84:                 QApplication::ExecuteControlCommand($ctrlId, 'buttonset', QJsPriority::High);
 85:             } elseif ($this->intButtonMode == self::ButtonModeJq) {
 86:                 QApplication::ExecuteSelectorFunction(["input:radio", "#" . $ctrlId], 'button', QJsPriority::High);
 87:             }
 88:             $strScript = parent::GetEndScript();
 89:             return $strScript;
 90:         }
 91: 
 92:         protected function GetItemHtml($objItem, $intIndex, $strTabIndex, $blnWrapLabel) {
 93:             $objLabelStyles = new QTagStyler();
 94:             if ($this->objItemStyle) {
 95:                 $objLabelStyles->Override($this->objItemStyle); // default style
 96:             }
 97:             if ($objItemStyle = $objItem->ItemStyle) {
 98:                 $objLabelStyles->Override($objItemStyle); // per item styling
 99:             }
100: 
101:             $objStyles = new QTagStyler();
102:             $objStyles->SetHtmlAttribute('type', 'radio');
103:             $objStyles->SetHtmlAttribute('value', $intIndex);
104:             $objStyles->SetHtmlAttribute('name', $this->strControlId);
105:             $strIndexedId = $this->strControlId . '_' . $intIndex;
106:             $objStyles->SetHtmlAttribute('id', $strIndexedId);
107: 
108:             if ($strTabIndex) {
109:                 $objStyles->TabIndex = $strTabIndex;    // Use parent control tabIndex, which will cause the browser to take them in order of drawing
110:             }
111:             if (!$this->Enabled) {
112:                 $objStyles->Enabled = false;
113:             }
114: 
115:             $strLabelText = $this->GetLabelText($objItem);
116: 
117:             if ($objItem->Selected) {
118:                 $objStyles->SetHtmlAttribute('checked', 'checked');
119:             }
120: 
121:             $objStyles->SetHtmlAttribute("autocomplete", "off"); // recommended bugfix for firefox in certain situations
122: 
123:             if (!$blnWrapLabel) {
124:                 $objLabelStyles->SetHtmlAttribute('for', $strIndexedId);
125:             }
126: 
127:             $this->OverrideItemAttributes($objItem, $objStyles, $objLabelStyles);
128: 
129:             $strHtml = QHtml::RenderLabeledInput(
130:                 $strLabelText,
131:                 $this->strTextAlign == QTextAlign::Left,
132:                 $objStyles->RenderHtmlAttributes(),
133:                 $objLabelStyles->RenderHtmlAttributes(),
134:                 $blnWrapLabel);
135: 
136:             return $strHtml;
137:         }
138: 
139:         /**
140:          * Provides a way for subclasses to override the attributes on specific items just before they are drawn.
141:          *
142:          * @param $objItem
143:          * @param $objItemAttributes
144:          * @param $objLabelAttributes
145:          */
146:         protected function OverrideItemAttributes ($objItem, QTagStyler $objItemAttributes, QTagStyler $objLabelAttributes) {}
147: 
148:         /**
149:          * Return the escaped text of the label.
150:          *
151:          * @param $objItem
152:          * @return string
153:          */
154:         protected function GetLabelText ($objItem) {
155:             $strLabelText = $objItem->Label;
156:             if (empty($strLabelText)) {
157:                 $strLabelText = $objItem->Name;
158:             }
159:             if ($this->blnHtmlEntities) {
160:                 $strLabelText = QApplication::HtmlEntities($strLabelText);
161:             }
162:             return $strLabelText;
163:         }
164: 
165:         protected function GetControlHtml() {
166:             $intItemCount = $this->GetItemCount();
167:             if (!$intItemCount) return '';
168: 
169:             if ($this->intButtonMode == self::ButtonModeSet || $this->intButtonMode == self::ButtonModeList) {
170:                 return $this->RenderButtonSet();
171:             }
172:             elseif ($this->intRepeatColumns == 1) {
173:                 $strToReturn = $this->RenderButtonColumn();
174:             }
175:             else {
176:                 $strToReturn = $this->RenderButtonTable();
177:             }
178: 
179:             if ($this->strMaxHeight) {
180:                 $objStyler = new QTagStyler();
181:                 $objStyler->SetCssStyle('max-height', $this->strMaxHeight, true);
182:                 $objStyler->SetCssStyle('overflow-y', 'scroll');
183: 
184:                 $strToReturn = QHtml::RenderTag('div', $objStyler->RenderHtmlAttributes(), $strToReturn);
185:             }
186:             return $strToReturn;
187: 
188:         }
189: 
190:         /**
191:          * Renders the button group as a table, paying attention to the number of columns wanted.
192:          * @return string
193:          */
194:         public function RenderButtonTable() {
195:             // TODO: Do this without using a table, since this is really not a correct use of html
196:             $strToReturn = '';
197:             if ($this->ItemCount > 0) {
198:                 // Figure out the number of ROWS for this table
199:                 $intRowCount = floor($this->ItemCount / $this->intRepeatColumns);
200:                 $intWidowCount = ($this->ItemCount % $this->intRepeatColumns);
201:                 if ($intWidowCount > 0)
202:                     $intRowCount++;
203: 
204:                 // Iterate through Table Rows
205:                 for ($intRowIndex = 0; $intRowIndex < $intRowCount; $intRowIndex++) {
206:                     // Figure out the number of COLUMNS for this particular ROW
207:                     if (($intRowIndex == $intRowCount - 1) && ($intWidowCount > 0))
208:                         // on the last row for a table with widowed-columns, ColCount is the number of widows
209:                         $intColCount = $intWidowCount;
210:                     else
211:                         // otherwise, ColCount is simply intRepeatColumns
212:                         $intColCount = $this->intRepeatColumns;
213: 
214:                     // Iterate through Table Columns
215:                     $strRowHtml = '';
216:                     for ($intColIndex = 0; $intColIndex < $intColCount; $intColIndex++) {
217:                         if ($this->strRepeatDirection == QRepeatDirection::Horizontal)
218:                             $intIndex = $intColIndex + $this->intRepeatColumns * $intRowIndex;
219:                         else
220:                             $intIndex = (floor($this->ItemCount / $this->intRepeatColumns) * $intColIndex)
221:                                 + min(($this->ItemCount % $this->intRepeatColumns), $intColIndex)
222:                                 + $intRowIndex;
223: 
224:                         $strItemHtml = $this->GetItemHtml($this->GetItem($intIndex), $intIndex, $this->GetHtmlAttribute('tabindex'), $this->blnWrapLabel);
225:                         $strCellHtml = QHtml::RenderTag ('td', null, $strItemHtml);
226:                         $strRowHtml .= $strCellHtml;
227:                     }
228: 
229:                     $strRowHtml = QHtml::RenderTag('tr', null, $strRowHtml);
230:                     $strToReturn .= $strRowHtml;
231:                 }
232:             }
233: 
234:             return $this->RenderTag('table',
235:                 null,
236:                 null,
237:                 $strToReturn);
238:         }
239: 
240:         /**
241:          * Renders the checkbox list as a buttonset, rendering just as a list of checkboxes and allowing css or javascript
242:          * to format the rest.
243:          * @return string
244:          */
245:         public function RenderButtonSet() {
246:             $count = $this->ItemCount;
247:             $strToReturn = '';
248:             for ($intIndex = 0; $intIndex < $count; $intIndex++) {
249:                 $strToReturn .= $this->GetItemHtml($this->GetItem($intIndex), $intIndex, $this->GetHtmlAttribute('tabindex'), $this->blnWrapLabel) . "\n";
250:             }
251:             return $this->RenderTag('div',
252:                 null,
253:                 null,
254:                 $strToReturn);
255:         }
256: 
257:         /**
258:          * Render as a single column. This implementation simply wraps the rows in divs.
259:          * @return string
260:          */
261:         public function RenderButtonColumn() {
262:             $count = $this->ItemCount;
263:             $strToReturn = '';
264:             $groupAttributes = null;
265:             if ($this->strButtonGroupClass) {
266:                 $groupAttributes = ["class"=>$this->strButtonGroupClass];
267:             }
268:             for ($intIndex = 0; $intIndex < $count; $intIndex++) {
269:                 $strHtml = $this->GetItemHtml($this->GetItem($intIndex), $intIndex, $this->GetHtmlAttribute('tabindex'), $this->blnWrapLabel);
270:                 $strToReturn .= QHtml::RenderTag('div', $groupAttributes, $strHtml);
271:             }
272:             return $this->RenderTag('div',
273:                 null,
274:                 null,
275:                 $strToReturn);
276:         }
277: 
278:         public function Validate() {
279:             if ($this->blnRequired) {
280:                 if ($this->SelectedIndex == -1) {
281:                     $this->ValidationError = sprintf(QApplication::Translate('%s is required'), $this->strName);
282:                     return false;
283:                 }
284:             }
285: 
286:             return true;
287:         }
288: 
289:         /**
290:          * Override of superclass that will update the selection using javascript so that the whole control does
291:          * not need to be redrawn.
292:          */
293:         protected function RefreshSelection() {
294:             $index = $this->SelectedIndex;
295:             QApplication::ExecuteSelectorFunction(['input', '#' . $this->ControlId], 'val', [$index]);
296:             if ($this->intButtonMode == self::ButtonModeSet ||
297:                     $this->intButtonMode == self::ButtonModeJq) {
298:                 QApplication::ExecuteSelectorFunction(['input', '#' . $this->ControlId], 'button', "refresh");
299:             }
300:         }
301: 
302:         /////////////////////////
303:         // Public Properties: GET
304:         /////////////////////////
305:         public function __get($strName) {
306:             switch ($strName) {
307:                 // APPEARANCE
308:                 case "TextAlign": return $this->strTextAlign;
309: 
310:                 // BEHAVIOR
311:                 case "HtmlEntities": return $this->blnHtmlEntities;
312: 
313:                 // LAYOUT
314:                 case "CellPadding": return $this->intCellPadding;
315:                 case "CellSpacing": return $this->intCellSpacing;
316:                 case "RepeatColumns": return $this->intRepeatColumns;
317:                 case "RepeatDirection": return $this->strRepeatDirection;
318:                 case "ItemStyle": return $this->objItemStyle;
319:                 case "ButtonMode": return $this->intButtonMode;
320:                 
321:                 default:
322:                     try {
323:                         return parent::__get($strName);
324:                     } catch (QCallerException $objExc) {
325:                         $objExc->IncrementOffset();
326:                         throw $objExc;
327:                     }
328:             }
329:         }
330: 
331:         /////////////////////////
332:         // Public Properties: SET
333:         /////////////////////////
334:         public function __set($strName, $mixValue) {
335:             switch ($strName) {
336:                 // APPEARANCE
337:                 case "TextAlign":
338:                     try {
339:                         if ($this->strTextAlign !== ($mixValue = QType::Cast($mixValue, QType::String))) {
340:                             $this->blnModified = true;
341:                             $this->strTextAlign = $mixValue;
342:                         }
343:                         break;
344:                     } catch (QInvalidCastException $objExc) {
345:                         $objExc->IncrementOffset();
346:                         throw $objExc;
347:                     }
348: 
349:                 case "HtmlEntities":
350:                     try {
351:                         if ($this->blnHtmlEntities !== ($mixValue = QType::Cast($mixValue, QType::Boolean))) {
352:                             $this->blnModified = true;
353:                             $this->blnHtmlEntities = $mixValue;
354:                         }
355:                         break;
356:                     } catch (QInvalidCastException $objExc) {
357:                         $objExc->IncrementOffset();
358:                         throw $objExc;
359:                     }
360: 
361:                 // LAYOUT
362:                 case "CellPadding":
363:                     try {
364:                         $this->intCellPadding = QType::Cast($mixValue, QType::Integer);
365:                         break;
366:                     } catch (QInvalidCastException $objExc) {
367:                         $objExc->IncrementOffset();
368:                         throw $objExc;
369:                     }
370:                 case "CellSpacing":
371:                     try {
372:                         $this->intCellSpacing = QType::Cast($mixValue, QType::Integer);
373:                         break;
374:                     } catch (QInvalidCastException $objExc) {
375:                         $objExc->IncrementOffset();
376:                         throw $objExc;
377:                     }
378:                 case "RepeatColumns":
379:                     try {
380:                         $this->intRepeatColumns = QType::Cast($mixValue, QType::Integer);
381:                     } catch (QInvalidCastException $objExc) {
382:                         $objExc->IncrementOffset();
383:                         throw $objExc;
384:                     }
385:                     if ($this->intRepeatColumns < 1)
386:                         throw new QCallerException("RepeatColumns must be greater than 0");
387:                     break;
388:                 case "RepeatDirection":
389:                     try {
390:                         $this->strRepeatDirection = QType::Cast($mixValue, QType::String);
391:                         break;
392:                     } catch (QInvalidCastException $objExc) {
393:                         $objExc->IncrementOffset();
394:                         throw $objExc;
395:                     }
396:                 case "ItemStyle":
397:                     try {
398:                         $this->objItemStyle = QType::Cast($mixValue, "QListItemStyle");
399:                     } catch (QInvalidCastException $objExc) {
400:                         $objExc->IncrementOffset();
401:                         throw $objExc;
402:                     }
403:                     break;
404: 
405:                 case "ButtonMode":
406:                     try {
407:                         $this->intButtonMode = QType::Cast($mixValue, QType::Integer);
408:                     } catch (QInvalidCastException $objExc) {
409:                         $objExc->IncrementOffset();
410:                         throw $objExc;
411:                     }
412:                     break;
413: 
414:                 default:
415:                     try {
416:                         parent::__set($strName, $mixValue);
417:                         break;
418:                     } catch (QCallerException $objExc) {
419:                         $objExc->IncrementOffset();
420:                         throw $objExc;
421:                     }
422:             }
423:         }
424: 
425:         /**
426:          * Returns an description of the options available to modify by the designer for the code generator.
427:          *
428:          * @return QModelConnectorParam[]
429:          */
430:         public static function GetModelConnectorParams() {
431:             return array_merge(parent::GetModelConnectorParams(), array(
432:                 new QModelConnectorParam (get_called_class(), 'TextAlign', '', QModelConnectorParam::SelectionList,
433:                     array (null=>'Default',
434:                         'QTextAlign::Left'=>'Left',
435:                         'QTextAlign::Right'=>'Right'
436:                     )),
437:                 new QModelConnectorParam (get_called_class(), 'HtmlEntities', 'Set to false to have the browser interpret the labels as HTML', QType::Boolean),
438:                 new QModelConnectorParam (get_called_class(), 'RepeatColumns', 'The number of columns of checkboxes to display', QType::Integer),
439:                 new QModelConnectorParam (get_called_class(), 'RepeatDirection', 'Whether to repeat horizontally or vertically', QModelConnectorParam::SelectionList,
440:                     array (null=>'Default',
441:                         'QRepeatDirection::Horizontal'=>'Horizontal',
442:                         'QRepeatDirection::Vertical'=>'Vertical'
443:                     )),
444:                 new QModelConnectorParam (get_called_class(), 'ButtonMode', 'How to display the buttons', QModelConnectorParam::SelectionList,
445:                     array (null=>'Default',
446:                         'QRadioButtonList::ButtonModeJq'=>'JQuery UI Buttons',
447:                         'QRadioButtonList::ButtonModeSet'=>'JQuery UI Buttonset'
448:                     )),
449:                 new QModelConnectorParam (get_called_class(), 'MaxHeight', 'If set, will wrap it in a scrollable pane with the given max height', QType::Integer)
450:             ));
451:         }
452: 
453:     }
API documentation generated by ApiGen