/**
  * Adds an event to the calendar
  * It overrides the base method to make sure click events are not accepted
  *
  * @param QEvent  $objEvent
  * @param QAction $objAction
  *
  * @throws QCallerException
  */
 public function AddAction($objEvent, $objAction)
 {
     if ($objEvent instanceof QClickEvent) {
         throw new QCallerException('QCalendar does not support click events');
     }
     parent::AddAction($objEvent, $objAction);
 }
Esempio n. 2
0
 public function __get($strName)
 {
     switch ($strName) {
         // MISC
         case "Maximum":
             return $this->dttMaximum;
         case "Minimum":
             return $this->dttMinimum;
         case 'DateTime':
             return QDateTimeTextBox::ParseForDateTimeValue($this->strText);
         case 'LabelForInvalid':
             return $this->strLabelForInvalid;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
 public function __set($strName, $mixValue)
 {
     $this->blnModified = true;
     switch ($strName) {
         // MISC
         case 'Maximum':
             try {
                 if ($mixValue == QDateTime::Now) {
                     $this->dttMaximum = QDateTime::Now;
                 } else {
                     $this->dttMaximum = QType::Cast($mixValue, QType::DateTime);
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Minimum':
             try {
                 if ($mixValue == QDateTime::Now) {
                     $this->dttMinimum = QDateTime::Now;
                 } else {
                     $this->dttMinimum = QType::Cast($mixValue, QType::DateTime);
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'DateTimeFormat':
             try {
                 $this->strDateTimeFormat = QType::Cast($mixValue, QType::String);
                 // trigger an update to reformat the text with the new format
                 $this->DateTime = $this->dttDateTime;
                 return $this->strDateTimeFormat;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'DateTime':
             try {
                 $this->dttDateTime = QType::Cast($mixValue, QType::DateTime);
                 if (!$this->dttDateTime || !$this->strDateTimeFormat) {
                     parent::__set('Text', '');
                 } else {
                     parent::__set('Text', $this->dttDateTime->qFormat($this->strDateTimeFormat));
                 }
                 return $this->dttDateTime;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Text':
             $this->dttDateTime = QDateTimeTextBox::ParseForDateTimeValue($this->strText);
             return parent::__set('Text', $mixValue);
         case 'LabelForInvalid':
             try {
                 return $this->strLabelForInvalid = QType::Cast($mixValue, QType::String);
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         default:
             try {
                 parent::__set($strName, $mixValue);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
     }
 }