From c2981557f2112fbf93267058ad7f9c361bf2f180 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 11 Jan 2006 05:35:34 +0000 Subject: Fixed many issues with DataBoundControls. Added Prado Composer Demo (not done yet). --- demos/composer/index.php | 15 +++ demos/composer/protected/pages/Home.page | 75 +++++++++++ demos/composer/protected/pages/Home.php | 120 ++++++++++++++++++ demos/composer/protected/pages/Layout.php | 15 +++ demos/composer/protected/pages/Layout.tpl | 24 ++++ demos/composer/themes/Simple/style.css | 204 ++++++++++++++++++++++++++++++ 6 files changed, 453 insertions(+) create mode 100644 demos/composer/index.php create mode 100644 demos/composer/protected/pages/Home.page create mode 100644 demos/composer/protected/pages/Home.php create mode 100644 demos/composer/protected/pages/Layout.php create mode 100644 demos/composer/protected/pages/Layout.tpl create mode 100644 demos/composer/themes/Simple/style.css (limited to 'demos') diff --git a/demos/composer/index.php b/demos/composer/index.php new file mode 100644 index 00000000..04695b16 --- /dev/null +++ b/demos/composer/index.php @@ -0,0 +1,15 @@ +run(); + +?> \ No newline at end of file diff --git a/demos/composer/protected/pages/Home.page b/demos/composer/protected/pages/Home.page new file mode 100644 index 00000000..648bec21 --- /dev/null +++ b/demos/composer/protected/pages/Home.page @@ -0,0 +1,75 @@ +<%@ MasterClass="Application.pages.Layout" Theme="Simple" %> + + + +class +extends +implements +
+Author Name: +Author Email: +
+Comments: +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
AccessibilityNameTypeDefault ValueStorage ModeCommentsActions
+ Parent->DataItem->IsProtected %> /> + Parent->DataItem->ReadOnly %> /> + + Parent->DataItem->Name %> CssClass="slTextBox"/> + + Parent->DataItem->Type %> > + + + + + + + + Parent->DataItem->DefaultValue %> CssClass="slTextBox"/> + + Parent->DataItem->Storage %> > + + + + + + Parent->DataItem->Comments %> CssClass="slTextBox"/> + + + +
+
+ +Event Definitions: + + +
+
+
+ +
diff --git a/demos/composer/protected/pages/Home.php b/demos/composer/protected/pages/Home.php new file mode 100644 index 00000000..a2281828 --- /dev/null +++ b/demos/composer/protected/pages/Home.php @@ -0,0 +1,120 @@ +IsPostBack) + { + $this->Repeater->setDataSource($this->getInitialProperties()); + $this->Repeater->dataBind(); + } + else + $this->Repeater->ensureChildControls(); + } + + protected function getInitialProperties() + { + return array( + new PropertyDefinition, + new PropertyDefinition, + new PropertyDefinition, + new PropertyDefinition, + ); + } + + public function generateCode($sender,$param) + { + $code="ClassName->Text." extends ".$this->ParentClass->Text."implements ".$this->Interfaces->Text; + $code.="\n"; + $code.="{\n"; + $code.="}\n"; + $code.="?>"; + $this->SourceCode->Text=htmlentities($code); + } +} + +class PropertyDefinition extends TComponent +{ + private $_name=''; + private $_type='string'; + private $_default=''; + private $_readOnly=false; + private $_protected=false; + private $_storage='ViewState'; + private $_comments=''; + + public function getName() + { + return $this->_name; + } + + public function setName($value) + { + $this->_name=$value; + } + + public function getType() + { + return $this->_type; + } + + public function setType($value) + { + $this->_type=$value; + } + + public function getDefaultValue() + { + return $this->_default; + } + + public function setDefaultValue($value) + { + $this->_default=$value; + } + + public function getReadOnly() + { + return $this->_readOnly; + } + + public function setReadOnly($value) + { + $this->_readOnly=TPropertyValue::ensureBoolean($value); + } + + public function getIsProtected() + { + return $this->_protected; + } + + public function setIsProtected($value) + { + $this->_protected=TPropertyValue::ensureBoolean($value); + } + + public function getStorage() + { + return $this->_storage; + } + + public function setStorage($value) + { + $this->_storage=$value; + } + + public function getComments() + { + return $this->_comments; + } + + public function setComments($value) + { + $this->_comments=$value; + } +} + +?> \ No newline at end of file diff --git a/demos/composer/protected/pages/Layout.php b/demos/composer/protected/pages/Layout.php new file mode 100644 index 00000000..a82d2fff --- /dev/null +++ b/demos/composer/protected/pages/Layout.php @@ -0,0 +1,15 @@ +TopicPanel->Visible=!$this->TopicPanel->Visible; + if($this->TopicPanel->Visible) + $sender->Text="Hide TOC"; + else + $sender->Text="Show TOC"; + } +} + +?> \ No newline at end of file diff --git a/demos/composer/protected/pages/Layout.tpl b/demos/composer/protected/pages/Layout.tpl new file mode 100644 index 00000000..b72e8959 --- /dev/null +++ b/demos/composer/protected/pages/Layout.tpl @@ -0,0 +1,24 @@ + + + + + + + + + + + +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/demos/composer/themes/Simple/style.css b/demos/composer/themes/Simple/style.css new file mode 100644 index 00000000..b036d56d --- /dev/null +++ b/demos/composer/themes/Simple/style.css @@ -0,0 +1,204 @@ +body { + font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Helvetica, Arial, sans-serif; + font-weight:normal; + font-size:10pt; + color:black; + margin:0px 0px 0px 0px; + padding:0px; +} + +h1 { + font-size:13pt; +} + +h2 { + font-size:12pt; +} + +h3 { + font-size:10pt; + font-weight:bold; +} + +.slTextBox { + border: 0px; + border-bottom: 1px solid silver; + text-align:center; +} + +#header { + font-size:13pt; + font-weight:bold; + background:#fff; + height:40px; + padding:5px; +} + +#menu { + padding:3px; + padding-right:10px; + background:#00487D; + color:white; + text-align:right; +} + +#menu a { + color:#BFE4FF; + text-decoration:none; +} + +#menu a:hover { + color:white; +} + +#toc { + background:#BFE4FF; + width:200px; + padding:5px; +} + +#content { + background:#fff; + padding:10px; +} + +#footer { + clear:both; + color: gray; + font-size:8pt; + text-align:center; + margin-top:25px; + padding:10px; +} + +.topic { + font-size: 10pt; + padding: 0px 0px 10px 0px; +} + +.topic span { + font-size: 11pt; + font-weight:bold; + color:#00487D; +} + +.topic a { + color:#00487D; + padding-left:10px; +} + +.topic a:hover { + color:red; +} + +.source { + padding: 0.5em; + border-style:dotted; + border-width:1px; + border-color:#cccccc; + background-color:#ffffee; + font-family: "Courier New", Courier, mono; + margin-top: 0.2em; + margin-bottom: 0.5em; +} + +.source pre { + font-family: "Courier New", Courier, mono; + margin: 0; +} + +.runbar a:link, .runbar a:visited { + background-color:#BFE4FF; + font-size: 12px; + font-weight: bold; + padding: 3px; + padding-left: 6px; + padding-right: 6px; + border-top: 1px solid white; + border-left: 1px solid white; + border-bottom: 1px solid #aaaaaa; + border-right: 1px solid #aaaaaa; + text-decoration: none; +} + +.runbar a:link.active, .runbar a:visited.active, .runbar a:hover { + background-color:#BFE4FF; + font-size: 12px; + font-weight: bold; + padding: 3px; + padding-left: 6px; + padding-right: 6px; + border-top: 1px solid #aaaaaa; + border-left: 1px solid #aaaaaa; + border-bottom: 1px solid white; + border-right: 1px solid white; +} + +#sourceList { + background-color:#BFE4FF; + margin:10px 10px 0px 10px; + padding:10px; + border:1px solid silver; +} + +#sourceView { + font-family: "Courier New", Courier, mono; + background-color:#ffffee; + margin:5px 10px 10px 10px; + border:1px solid silver; + padding:10px; +} + +code { + font-family: "Courier New", Courier, mono; +} + +tt { + font-family: "Courier New", Courier, mono; + border-bottom: 1px dotted silver; +} + +.sampleheader { + background:#00487D; + color:white; + padding:3px; +} + +.sampleheader a { + color:white; +} + +.samplepanel { + margin: 0px; + border: 1px solid silver; + padding: 10px; + margin-bottom:10px; +} + +.sampletitle { + width: 100%; + border-bottom:1px solid silver; + font-weight:bold; + margin-bottom:5px; +} + +.sampletable { + width: 100%; + border-collapse: collapse; +} + +td.samplenote { + width: 300px; + text-align: right; + background: #BFE4FF; + border: 1px solid silver; + padding: 5px; + vertical-align: top; +} + +td.sampleaction { + background: #ffffee; + border: 1px solid silver; + padding: 5px; + vertical-align: top; +} -- cgit v1.2.3