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 QCheckBox class.
  4:      *
  5:      * @package Controls
  6:      */
  7: 
  8:     /**
  9:      * This class will render an HTML Checkbox.
 10:      *
 11:      * Labels are a little tricky with checkboxes. There are two built-in ways to make labels:
 12:      * 1) Assign a Name property, and render using something like RenderWithName
 13:      * 2) Assign a Text property, in which case the checkbox will be wrapped with a label and the text you assign.
 14:      *
 15:      * @package Controls
 16:      *
 17:      * @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.
 18:      * @property string $TextAlign specifies if "Text" should be displayed to the left or to the right of the checkbox.
 19:      * @property boolean $Checked specifices whether or not hte checkbox is checked
 20:      * @property boolean $HtmlEntities specifies whether the checkbox text will have to be run through htmlentities or not.
 21:      */
 22:     class QCheckBox extends QControl {
 23:         /** @var string Tag for rendering the control */
 24:         protected $strTag = 'input';
 25:         protected $blnIsVoidElement = true;
 26: 
 27:         // APPEARANCE
 28:         /** @var string Text opposite to the checkbox */
 29:         protected $strText = null;
 30:         /** @var QTextAlign|string the alignment of the string */
 31:         protected $strTextAlign = QTextAlign::Right;
 32:         
 33:         // BEHAVIOR
 34:         /** @var bool Should the htmlentities function be run on the control's text (strText)? */
 35:         protected $blnHtmlEntities = true;
 36: 
 37:         // MISC
 38:         /** @var bool Determines whether the checkbox is checked? */
 39:         protected $blnChecked = false;
 40: 
 41:         /**
 42:          * @var  QTagStyler for labels of checkboxes. If side-by-side labeling, the styles will be applied to a
 43:          * span that wraps both the checkbox and the label.
 44:          */
 45:         protected $objLabelStyle;
 46: 
 47: 
 48:         //////////
 49:         // Methods
 50:         //////////
 51: 
 52:         /**
 53:          * Parses the Post Data submitted for the control and sets the values
 54:          * according to the data submitted
 55:          */
 56:         public function ParsePostData() {
 57:             $val = $this->objForm->CheckableControlValue($this->strControlId);
 58:             if ($val !== null) {
 59:                 $this->blnChecked = QType::Cast($val, QType::Boolean);
 60:             }
 61:         }
 62: 
 63:         /**
 64:          * Returns the HTML code for the control which can be sent to the client.
 65:          *
 66:          * Note, previous version wrapped this in a div and made the control a block level control unnecessarily. To
 67:          * achieve a block control, set blnUseWrapper and blnIsBlockElement.
 68:          *
 69:          * @return string THe HTML for the control
 70:          */
 71:         protected function GetControlHtml() {
 72:             $attrOverride = array('type'=>'checkbox', 'name'=>$this->strControlId, 'value'=>'true');
 73:             return $this->RenderButton($attrOverride);
 74:         }
 75: 
 76:         /**
 77:          * Render the button code. Broken out to allow QRadioButton to use it too.
 78:          *
 79:          * @param $attrOverride
 80:          * @return string
 81:          */
 82:         protected function RenderButton ($attrOverride) {
 83:             if ($this->blnChecked) {
 84:                 $attrOverride['checked']='checked';
 85:             }
 86: 
 87:             if (strlen($this->strText)) {
 88:                 $strText = ($this->blnHtmlEntities) ? QApplication::HtmlEntities($this->strText) : $this->strText;
 89:                 if (!$this->blnWrapLabel) {
 90:                     $strLabelAttributes = ' for="' . $this->strControlId .'"';
 91:                 } else {
 92:                     $strLabelAttributes = $this->RenderLabelAttributes();
 93:                 }
 94:                 $strCheckHtml = QHtml::RenderLabeledInput(
 95:                     $strText,
 96:                     $this->strTextAlign == QTextAlign::Left,
 97:                     $this->RenderHtmlAttributes($attrOverride),
 98:                     $strLabelAttributes,
 99:                     $this->blnWrapLabel
100:                 );
101:                 if (!$this->blnWrapLabel) {
102:                     // Additionally wrap in a span so we can associate the label with the checkbox visually and apply the styles
103:                     $strCheckHtml = QHtml::RenderTag('span',  $this->RenderLabelAttributes(), $strCheckHtml);
104:                 }
105:             }
106:             else {
107:                 $strCheckHtml = $this->RenderTag('input', $attrOverride, null, null, true);
108:             }
109:             return $strCheckHtml;
110:         }
111: 
112:         /**
113:          * Return a styler to style the label that surrounds the control if the control has text.
114:          * @return QTagStyler
115:          */
116:         public function getCheckLabelStyler() {
117:             if (!$this->objLabelStyle) {
118:                 $this->objLabelStyle = new QTagStyler();
119:             }
120:             return $this->objLabelStyle;
121:         }
122: 
123:         /**
124:          * There is a little bit of a conundrum here. If there is text assigned to the checkbox, we wrap
125:          * the checkbox in a label. However, in this situation, its unclear what to do with the class and style
126:          * attributes that are for the checkbox. We are going to let the developer use the label styler to make
127:          * it clear what their intentions are.
128:          * @return string
129:          */
130:         protected function RenderLabelAttributes() {
131:             $objStyler = new QTagStyler();
132:             $attributes = $this->GetHtmlAttributes(null, null, ['title']); // copy tooltip to wrapping label
133:             $objStyler->SetAttributes($attributes);
134:             $objStyler->Override($this->getCheckLabelStyler());
135: 
136:             if (!$this->Enabled) {
137:                 $objStyler->AddCssClass('disabled');    // add the disabled class to the label for styling
138:             }
139:             if (!$this->Display) {
140:                 $objStyler->Display = false;
141:             }
142:             return $objStyler->RenderHtmlAttributes();
143:         }
144: 
145:         /**
146:          * Checks whether the post data submitted for the control is valid or not
147:          * Right now it tests whether or not the control was marked as required and then tests whether it
148:          * was checked or not
149:          * @return bool
150:          */
151:         public function Validate() {
152:             if ($this->blnRequired) {
153:                 if (!$this->blnChecked) {
154:                     if ($this->strName)
155:                         $this->ValidationError = QApplication::Translate($this->strName) . ' ' . QApplication::Translate('is required');
156:                     else
157:                         $this->ValidationError = QApplication::Translate('Required');
158:                     return false;
159:                 }
160:             }
161:             return true;
162:         }
163: 
164:         /**
165:          * Returns the current state of the control to be able to restore it later.
166:          */
167:         public function GetState(){
168:             return array('checked'=>$this->Checked);
169:         }
170: 
171:         /**
172:          * Restore the  state of the control.
173:          *
174:          * @param mixed $state
175:          */
176:         public function PutState($state) {
177:             if (isset($state['checked'])) {
178:                 $this->Checked = $state['checked'];
179:             }
180:         }
181: 
182:         /////////////////////////
183:         // Public Properties: GET
184:         /////////////////////////
185:         /**
186:          * PHP __get magic method implementation
187:          * @param string $strName Name of the property
188:          *
189:          * @return mixed
190:          * @throws QCallerException
191:          */
192:         public function __get($strName) {
193:             switch ($strName) {
194:                 // APPEARANCE
195:                 case "Text": return $this->strText;
196:                 case "TextAlign": return $this->strTextAlign;
197: 
198:                 // BEHAVIOR
199:                 case "HtmlEntities": return $this->blnHtmlEntities;
200: 
201:                 // MISC
202:                 case "Checked": return $this->blnChecked;
203:                 default:
204:                     try {
205:                         return parent::__get($strName);
206:                     } catch (QCallerException $objExc) {
207:                         $objExc->IncrementOffset();
208:                         throw $objExc;
209:                     }
210:             }
211:         }
212: 
213:         /////////////////////////
214:         // Public Properties: SET
215:         /////////////////////////
216:         /**
217:          * PHP __set magic method implementation
218:          * @param string $strName
219:          * @param string $mixValue
220:          *
221:          * @return mixed
222:          * @throws QInvalidCastException|QCallerException
223:          */
224:         public function __set($strName, $mixValue) {
225:             switch ($strName) {
226:                 // APPEARANCE
227: 
228:                 case "Text":
229:                     try {
230:                         $val = QType::Cast($mixValue, QType::String);
231:                         if ($val !== $this->strText) {
232:                             $this->strText = $val;
233:                             $this->blnModified = true;
234:                         }
235:                         return $this->strText;
236:                     } catch (QInvalidCastException $objExc) {
237:                         $objExc->IncrementOffset();
238:                         throw $objExc;
239:                     }
240: 
241:                 case "TextAlign":
242:                     try {
243:                         $val = QType::Cast($mixValue, QType::String);
244:                         if ($val !== $this->strTextAlign) {
245:                             $this->strTextAlign = $val;
246:                             $this->blnModified = true;
247:                         }
248:                         break;
249:                     } catch (QInvalidCastException $objExc) {
250:                         $objExc->IncrementOffset();
251:                         throw $objExc;
252:                     }
253: 
254:                 case "HtmlEntities":
255:                     try {
256:                         $this->blnHtmlEntities = QType::Cast($mixValue, QType::Boolean);
257:                         break;
258:                     } catch (QInvalidCastException $objExc) {
259:                         $objExc->IncrementOffset();
260:                         throw $objExc;
261:                     }
262: 
263:                 // MISC
264:                 case "Checked":
265:                     try {
266:                         $val = QType::Cast($mixValue, QType::Boolean);
267:                         if ($val != $this->blnChecked) {
268:                             $this->blnChecked = $val;
269:                             $this->AddAttributeScript('prop', 'checked', $val);
270:                         }
271:                         break;
272:                     } catch (QInvalidCastException $objExc) {
273:                         $objExc->IncrementOffset();
274:                         throw $objExc;
275:                     }
276: 
277:                 // Copy certain attributes to the label styler when assigned since its part of the control.
278:                 case 'CssClass':
279:                     try {
280:                         parent::__set($strName, $mixValue);
281:                         $this->getCheckLabelStyler()->CssClass = $mixValue; // assign to both checkbox and label so they can be styled together using css
282:                         $this->blnModified = true;
283:                         break;
284:                     } catch (QInvalidCastException $objExc) {
285:                         $objExc->IncrementOffset();
286:                         throw $objExc;
287:                     }
288: 
289:                 default:
290:                     try {
291:                         parent::__set($strName, $mixValue);
292:                         break;
293:                     } catch (QCallerException $objExc) {
294:                         $objExc->IncrementOffset();
295:                         throw $objExc;
296:                     }
297:             }
298:         }
299: 
300:         /**
301:          * Returns an description of the options available to modify by the designer for the code generator.
302:          *
303:          * @return QModelConnectorParam[]
304:          */
305:         public static function GetModelConnectorParams() {
306:             return array_merge(parent::GetModelConnectorParams(), array(
307:                 new QModelConnectorParam (get_called_class(), 'Text', 'Label on checkbox', QType::String),
308:                 new QModelConnectorParam (get_called_class(), 'TextAlign', 'Left or right alignment of label', QModelConnectorParam::SelectionList,
309:                     array ('QTextAlign::Right'=>'QTextAlign::Right',
310:                         'QTextAlign::Left'=>'QTextAlign::Left'
311:                     )),
312:                 new QModelConnectorParam (get_called_class(), 'HtmlEntities', 'Whether to apply HTML entities on the label', QType::Boolean),
313:                 new QModelConnectorParam (get_called_class(), 'CssClass', 'The css class(es) to apply to the checkbox and label together', QType::String)
314:             ));
315:         }
316: 
317: 
318:     }
API documentation generated by ApiGen