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