From 99ecc26ddd9c6f0233aff2770e82c9db80fd0b4c Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 31 Jan 2006 01:30:28 +0000 Subject: All events are now defined with public on-functions. This is to comply with the new change introduced since 5.1. --- framework/Web/UI/WebControls/TWizard.php | 128 +++++++++++++++---------------- 1 file changed, 64 insertions(+), 64 deletions(-) (limited to 'framework/Web/UI/WebControls/TWizard.php') diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php index fec48d1f..9bc6a1e0 100644 --- a/framework/Web/UI/WebControls/TWizard.php +++ b/framework/Web/UI/WebControls/TWizard.php @@ -1,11 +1,11 @@ next, TWizard fires OnNextCommand event. * - previous, TWizard fires OnPreviousCommand event. * - finish, TWizard fires OnFinishCommand event. - * - cancel, TWizard fires OnCancelCommand event. - * - jumpto, TWizard fires OnJumpToCommand event. + * - cancel, TWizard fires OnCancelCommand event. + * - jumpto, TWizard fires OnJumpToCommand event. * jumpto requires a parameter, the destination step. - * + * * E.g. anywhere within the TWizard, a button like the following * * when click will bubble to TWizard and in turn fires the OnJumpToCommand @@ -74,7 +74,7 @@ * Namespace: System.Web.UI.WebControls * * Properties - * - ActiveStep, TWizardStep, + * - ActiveStep, TWizardStep, *
Gets the current active step. * - ActiveStepIndex, integer, *
Gets or sets the active step specified by a zero-starting index. @@ -88,15 +88,15 @@ *
Gets or sets the string for the "Previous" button. * - CancelButtonText, string *
Gets or sets the string for the "Cancel" button. - * + * * Events * - OnStepChanged Occurs when the step is changed. * - OnCancelCommand Occurs when the "Cancel" button is pressed. * - OnFinishCommand Occurs when the "Finish" button is pressed. * - OnNextCommand Occurs when the "Next" button is pressed. * - OnPreviousCommand Occurs when the "Previous" button is pressed. - * - OnJumpToCommand Occurs when the "JumpTo" button is pressed. - * + * - OnJumpToCommand Occurs when the "JumpTo" button is pressed. + * * @author Xiang Wei Zhuo * @version v1.0, last update on Sat Dec 11 15:25:11 EST 2004 * @package System.Web.UI.WebControls @@ -105,43 +105,43 @@ class TWizard extends TPanel { /** * The command name for the OnNextCommand. - * @var string + * @var string */ const CMD_NEXT = 'next'; /** * The command name for the OnPreviousCommand. - * @var string + * @var string */ const CMD_PREVIOUS = 'previous'; /** * The command name for the OnFinishCommand. - * @var string + * @var string */ const CMD_FINISH = 'finish'; - + /** * The command name for the OnCancelCommand. - * @var string + * @var string */ const CMD_CANCEL = 'cancel'; /** * The command name for the OnJumpToCommand. - * @var string + * @var string */ const CMD_JUMP = 'jumpto'; /** * A list of steps. - * @var array + * @var array */ protected $steps=array(); - + /** * A list of navigation templates, including built-in defaults. - * @var array + * @var array */ protected $navigation = array(); @@ -162,7 +162,7 @@ class TWizard extends TPanel /** * Get the Finish button text. - * @return string button text. + * @return string button text. */ public function getFinishStepButtonText() { @@ -174,14 +174,14 @@ class TWizard extends TPanel * @param string button text */ public function setNextStepButtonText($value) - { + { $this->setViewState('NextStepButtonText', $value, 'Next >'); - + } /** * Get the Next button text. - * @return string button text. + * @return string button text. */ public function getNextStepButtonText() { @@ -191,7 +191,7 @@ class TWizard extends TPanel /** * Set the Previous button text. * @param string button text - */ + */ public function setPreviousStepButtonText($value) { $this->setViewState('PreviousStepButtonText',$value, '< Back'); @@ -199,8 +199,8 @@ class TWizard extends TPanel /** * Get the Previous button text. - * @return string button text. - */ + * @return string button text. + */ public function getPreviousStepButtonText() { return $this->getViewState('PreviousStepButtonText', '< Back'); @@ -217,8 +217,8 @@ class TWizard extends TPanel /** * Get the Cancel button text. - * @return string button text. - */ + * @return string button text. + */ public function getCancelButtonText() { return $this->getViewState('CancelButtonText', 'Cancel'); @@ -235,7 +235,7 @@ class TWizard extends TPanel /** * Determine if the side bar's visibility. - * @return boolean true if visible, false otherwise. + * @return boolean true if visible, false otherwise. */ public function isSideBarVisible() { @@ -244,7 +244,7 @@ class TWizard extends TPanel /** * Get the current step. null if the ActiveStepIndex is not valid. - * @return TWizardStep + * @return TWizardStep */ public function getActiveStep() { @@ -252,7 +252,7 @@ class TWizard extends TPanel if(isset($this->steps[$index])) return $this->steps[$index]; } - + /** * Set the active step index. This determines which step to show. * @param int the current step to show. @@ -264,7 +264,7 @@ class TWizard extends TPanel /** * Get the current step index. - * @return int current step index. + * @return int current step index. */ public function getActiveStepIndex() { @@ -272,9 +272,9 @@ class TWizard extends TPanel } /** - * Override the parent implementation. + * Override the parent implementation. * It adds any components that are instance of TWizardStep or TWizardTemplate - * as a child and body of the TWizard. Other components are handled by the parent. + * as a child and body of the TWizard. Other components are handled by the parent. * By adding components as child of TWizard, these component's parent * is the TWizard. * @param object a component object. @@ -305,21 +305,21 @@ class TWizard extends TPanel * if required. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onLoad($param) + public function onLoad($param) { parent::onLoad($param); - + $this->addNavigationButtons(); if($this->isSideBarVisible()) - $this->addNavigationSideBar(); + $this->addNavigationSideBar(); } /** * Determins which wizard step to show and appropriate navigation elements. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onPreRender($param) + public function onPreRender($param) { parent::onPreRender($param); @@ -329,7 +329,7 @@ class TWizard extends TPanel //show the current step for($i = 0; $i < $totalSteps; $i++) $this->steps[$i]->setVisible($i == $index); - + //determine which link is active for($i = 0; $i < count($this->sidebarLinks); $i++) $this->sidebarLinks[$i]->CssClass= ($i == $index)?'active':''; @@ -342,13 +342,13 @@ class TWizard extends TPanel } $final = $this->steps[$index]->Type == TWizardStep::TYPE_FINAL; - + //if it is not the final step - if(!$final && $this->isSideBarVisible()) + if(!$final && $this->isSideBarVisible()) $this->showNavigation(TWizardTemplate::ID_SIDEBAR); - + $finishStep = $index == $totalSteps-1; - $finishStep = $finishStep || (isset($this->steps[$index+1]) && + $finishStep = $finishStep || (isset($this->steps[$index+1]) && $this->steps[$index+1]->Type == TWizardStep::TYPE_FINAL); //now show the appropriate navigation elements. @@ -371,7 +371,7 @@ class TWizard extends TPanel foreach($this->navigation[$index] as $nav) { $nav->setVisible(true); - $nav->dataBind(); + $nav->dataBind(); } } @@ -381,17 +381,17 @@ class TWizard extends TPanel * particular navigation type is not customized. */ private function addNavigationButtons() - { - //create the 3 navigation components + { + //create the 3 navigation components $start = $this->createComponent('TPanel',TWizardTemplate::ID_START); $start->CssClass = 'navigation'; - + $step = $this->createComponent('TPanel',TWizardTemplate::ID_STEP); $step->CssClass = 'navigation'; $finish = $this->createComponent('TPanel',TWizardTemplate::ID_FINISH); $finish->CssClass = 'navigation'; - + $previousButton = $this->createComponent('TButton'); $previousButton->setText($this->getPreviousStepButtonText()); $previousButton->setCommandName(self::CMD_PREVIOUS); @@ -400,7 +400,7 @@ class TWizard extends TPanel $finishButton = $this->createComponent('TButton'); $finishButton->setText($this->getFinishStepButtonText()); $finishButton->setCommandName(self::CMD_FINISH); - + $nextButton = $this->createComponent('TButton'); $nextButton->setText($this->getNextStepButtonText()); $nextButton->setCommandName(self::CMD_NEXT); @@ -414,18 +414,18 @@ class TWizard extends TPanel $cancelButton->setCommandName(self::CMD_CANCEL); $cancelButton->CssClass='Cancel'; $cancelButton->setCausesValidation(false); - + if(!isset($this->navigation[TWizardTemplate::ID_START])) { $start->addBody($nextButton); - $start->addBody($cancelButton); + $start->addBody($cancelButton); $this->addBody($start); $this->navigation[TWizardTemplate::ID_START][] = $start; } if(!isset($this->navigation[TWizardTemplate::ID_STEP])) { - + $step->addBody($hiddenButton); $step->addBody($previousButton); $step->addBody($nextButton); @@ -433,7 +433,7 @@ class TWizard extends TPanel $this->addBody($step); $this->navigation[TWizardTemplate::ID_STEP][] = $step; } - + if(!isset($this->navigation[TWizardTemplate::ID_FINISH])) { $finish->addBody($previousButton); @@ -460,7 +460,7 @@ class TWizard extends TPanel $sidebar = $this->createComponent('TPanel',TWizardTemplate::ID_SIDEBAR); $sidebar->CssClass = 'sidebar'; - + if($total > 0) $sidebar->addBody("\n"); - + $this->addBody($sidebar); $this->navigation[TWizardTemplate::ID_SIDEBAR][] = $sidebar; } @@ -489,16 +489,16 @@ class TWizard extends TPanel * is set to true. * @param TComponent sender of the event * @param TEventParameter event parameters - */ - protected function onBubbleEvent($sender,$param) + */ + public function onBubbleEvent($sender,$param) { //if false on validation, do nothing. - if (!$this->Page->isValid()) return; + if (!$this->Page->isValid()) return; $event = new TWizardCommandEventParameter(); $event->currentStepIndex = $this->getActiveStepIndex(); $event->nextStepIndex = $event->currentStepIndex; - + switch($param->name) { case self::CMD_NEXT: @@ -521,7 +521,7 @@ class TWizard extends TPanel break; case self::CMD_FINISH: if(isset($this->steps[$event->nextStepIndex+1])) - $event->nextStepIndex++; + $event->nextStepIndex++; $this->raiseEvent('OnFinishCommand',$this,$event); if(!$event->cancel) { @@ -547,8 +547,8 @@ class TWizard extends TPanel } /** - * TWizard command event parameter. - * + * TWizard command event parameter. + * * This is passed as the parameter to all event orginating from TWizard. * If the event was a particular OnXXXXCommand, the variable $cancel * determine if the step will be changed. e.g in handling the "next" command -- cgit v1.2.3