Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix WGroupBox / WTabWidget layout behaviour

  • Loading branch information...
commit 41bb9bbc2cad241f4abf3a5cf27266eeae802bfb 1 parent 73332fe
Koen Deforche authored
15 src/Wt/Mail/Client
@@ -28,14 +28,17 @@ class Message;
28 28 * The SMTP client can send one or more mail messages to an SMTP host.
29 29 *
30 30 * \code
  31 + * #include <Wt/Mail/Client>
  32 + * #include <Wt/Mail/Message>
  33 + *
31 34 * Mail::Message message;
32   - * message.setFrom(Mail::Mailbox("kudos@corp.org", "Kudos Dukos"));
33   - * message.addRecipient(Mail::To, Mail::Mailbox("koen@emweb.be", "Koen Deforche"));
  35 + * message.setFrom(Mail::Mailbox("kudos@corp.org", "Kudos Dukos");
  36 + * message.addRecipient(Mail::To, Mail::Mailbox("koen@emweb.be", "Koen Deforche");
34 37 * message.setSubject("Hey there, koen!");
35   - * message.setBody("That mail client seems to be working."));
36   - * message.addHtmlBody("<p>"
37   - * "<a href="http://www.webtoolkit.eu/wt">That mail client</a>"
38   - * " seems to be working just great!</p>"));
  38 + * message.setBody("That mail client seems to be working.");
  39 + * message.addHtmlBody ("<p>"
  40 + * "<a href=\"http://www.webtoolkit.eu/wt\">That mail client</a>"
  41 + * " seems to be working just great!</p>");
39 42 *
40 43 * Mail::Client client;
41 44 * client.connect("localhost");
24 src/Wt/StdWidgetItemImpl.C
@@ -39,6 +39,30 @@ const char *StdWidgetItemImpl::childrenResizeJS()
39 39 return WT_CLASS ".ChildrenResize";
40 40 }
41 41
  42 +const char *StdWidgetItemImpl::childrenGetPSJS()
  43 +{
  44 + WApplication *app = WApplication::instance();
  45 + LOAD_JAVASCRIPT(app, "js/WtResize.js", "ChildrenGetPS", wtjs11);
  46 +
  47 + return WT_CLASS ".ChildrenGetPS";
  48 +}
  49 +
  50 +const char *StdWidgetItemImpl::secondResizeJS()
  51 +{
  52 + WApplication *app = WApplication::instance();
  53 + LOAD_JAVASCRIPT(app, "js/WtResize.js", "SecondResize", wtjs12);
  54 +
  55 + return WT_CLASS ".SecondResize";
  56 +}
  57 +
  58 +const char *StdWidgetItemImpl::secondGetPSJS()
  59 +{
  60 + WApplication *app = WApplication::instance();
  61 + LOAD_JAVASCRIPT(app, "js/WtResize.js", "SecondGetPS", wtjs13);
  62 +
  63 + return WT_CLASS ".SecondGetPS";
  64 +}
  65 +
42 66 WLayoutItem *StdWidgetItemImpl::layoutItem() const
43 67 {
44 68 return item_;
5 src/Wt/StdWidgetItemImpl.h
@@ -19,7 +19,10 @@ class StdWidgetItemImpl : public StdLayoutItemImpl
19 19 StdWidgetItemImpl(WWidgetItem *item);
20 20 virtual ~StdWidgetItemImpl();
21 21
22   - static const char* childrenResizeJS();
  22 + static const char *childrenResizeJS();
  23 + static const char *childrenGetPSJS();
  24 + static const char *secondResizeJS();
  25 + static const char *secondGetPSJS();
23 26
24 27 virtual const std::string id() const;
25 28 virtual int minimumHeight() const;
2  src/Wt/WApplication.C
@@ -1644,7 +1644,7 @@ void WApplication::streamJavaScriptPreamble(std::ostream& out, bool all)
1644 1644 = preamble.scope == ApplicationScope ? javaScriptClass() : WT_CLASS;
1645 1645
1646 1646 if (preamble.type == JavaScriptFunction) {
1647   - out << scope << '.' << preamble.name << " = function() { ("
  1647 + out << scope << '.' << preamble.name << " = function() { return ("
1648 1648 << preamble.src << ").apply(" << scope << ", arguments) };";
1649 1649 } else {
1650 1650 out << scope << '.' << preamble.name << " = " << preamble.src
11 src/Wt/WGroupBox
@@ -103,11 +103,6 @@ public:
103 103
104 104 virtual void refresh();
105 105
106   -private:
107   - WString title_;
108   -
109   - bool titleChanged_;
110   -
111 106 protected:
112 107 virtual DomElementType domElementType() const;
113 108
@@ -115,6 +110,12 @@ protected:
115 110 virtual void propagateSetEnabled(bool enabled);
116 111 virtual void propagateRenderOk(bool deep);
117 112 virtual int firstChildIndex() const;
  113 +
  114 +private:
  115 + WString title_;
  116 + bool titleChanged_;
  117 +
  118 + void init();
118 119 };
119 120
120 121 }
14 src/Wt/WGroupBox.C
@@ -6,19 +6,29 @@
6 6 #include "Wt/WGroupBox"
7 7
8 8 #include "DomElement.h"
  9 +#include "StdWidgetItemImpl.h"
9 10
10 11 namespace Wt {
11 12
12 13 WGroupBox::WGroupBox(WContainerWidget *parent)
13 14 : WContainerWidget(parent),
14 15 titleChanged_(false)
15   -{ }
  16 +{
  17 + init();
  18 +}
16 19
17 20 WGroupBox::WGroupBox(const WString& title, WContainerWidget *parent)
18 21 : WContainerWidget(parent),
19 22 title_(title),
20 23 titleChanged_(false)
21   -{ }
  24 +{
  25 + init();
  26 +}
  27 +
  28 +void WGroupBox::init()
  29 +{
  30 + setJavaScriptMember(WT_GETPS_JS, StdWidgetItemImpl::secondGetPSJS());
  31 +}
22 32
23 33 void WGroupBox::setTitle(const WString& title)
24 34 {
2  src/Wt/WStackedWidget.C
@@ -20,7 +20,9 @@ WStackedWidget::WStackedWidget(WContainerWidget *parent)
20 20 currentIndex_(-1)
21 21 {
22 22 WT_DEBUG( setObjectName("WStackedWidget") );
  23 +
23 24 setJavaScriptMember(WT_RESIZE_JS, StdWidgetItemImpl::childrenResizeJS());
  25 + setJavaScriptMember(WT_GETPS_JS, StdWidgetItemImpl::childrenGetPSJS());
24 26
25 27 addStyleClass("Wt-stack");
26 28 }
14 src/Wt/WTabWidget.C
@@ -14,6 +14,7 @@
14 14 #include "Wt/WStackedWidget"
15 15
16 16 #include "WebUtils.h"
  17 +#include "StdWidgetItemImpl.h"
17 18
18 19 namespace Wt {
19 20
@@ -103,17 +104,8 @@ void WTabWidget::create(WFlags<AlignmentFlag> layoutAlignment)
103 104 layout_->addWidget(menuDiv);
104 105 layout_->addWidget(menu_->contentsStack());
105 106
106   - setJavaScriptMember
107   - (WT_RESIZE_JS, std::string() +
108   - "function(self, w, h) {"
109   - """self.style.height= h + 'px';"
110   - """var c = self.firstChild;"
111   - """var t = self.lastChild;"
112   - """h -= c.offsetHeight + " WT_CLASS ".px(c, 'marginTop') "
113   - "" "+ " WT_CLASS ".px(c, 'marginBottom');"
114   - """if (h > 0)"
115   - "" "t." + WT_RESIZE_JS + "(t, w, h);"
116   - "};");
  107 + setJavaScriptMember(WT_RESIZE_JS, StdWidgetItemImpl::secondResizeJS());
  108 + setJavaScriptMember(WT_GETPS_JS, StdWidgetItemImpl::secondGetPSJS());
117 109
118 110 menu_->itemSelected().connect(this, &WTabWidget::onItemSelected);
119 111 menu_->itemClosed().connect(this, &WTabWidget::onItemClosed);
2  src/Wt/WWidget
@@ -930,7 +930,7 @@ public:
930 930 static void setTabOrder(WWidget *first, WWidget *second);
931 931
932 932 protected:
933   - static const char *WT_RESIZE_JS;
  933 + static const char *WT_RESIZE_JS, *WT_GETPS_JS;
934 934
935 935 /*! \brief Sets the widget to be aware of its size set by a layout manager.
936 936 *
1  src/Wt/WWidget.C
@@ -20,6 +20,7 @@
20 20 namespace Wt {
21 21
22 22 const char *WWidget::WT_RESIZE_JS = "wtResize";
  23 +const char *WWidget::WT_GETPS_JS = "wtGetPS";
23 24
24 25 WWidget::WWidget(WContainerWidget* parent)
25 26 : WObject(0)
56 src/js/StdGridLayoutImpl2.js
@@ -50,7 +50,7 @@ WT_DECLARE_WT_MEMBER
50 50 be remeasured */
51 51 var layoutDirty = true; /* all items dirty need to be remeasured */
52 52 var topLevel = false, parent = null, parentItemWidget = null,
53   - parentInitialized = false, parentMargin = [], parentMinPW = 0;
  53 + parentInitialized = false, parentMargin = [], parentWithWtPS = false;
54 54
55 55 var rtl = $(document.body).hasClass('Wt-rtl');
56 56
@@ -388,7 +388,7 @@ WT_DECLARE_WT_MEMBER
388 388 * set size as the preferred size, instead we revert
389 389 * to a previous preferred size.
390 390 */
391   - var sizeSet = item.set[dir] &&
  391 + var sizeSet = item.set[dir] &&
392 392 (calculated === item.psize[dir]);
393 393
394 394 /*
@@ -400,7 +400,7 @@ WT_DECLARE_WT_MEMBER
400 400 var stretching = (typeof item.ps[dir] !== 'undefined')
401 401 && (DC.config[di][STRETCH] > 0)
402 402 && item.set[dir];
403   -
  403 +
404 404 if (sizeSet || stretching)
405 405 wPreferred = Math.max(wPreferred, item.ps[dir]);
406 406 else
@@ -498,10 +498,26 @@ WT_DECLARE_WT_MEMBER
498 498 != DC.measures[TOTAL_PREFERRED_SIZE]) {
499 499 var totalPs = DC.measures[TOTAL_PREFERRED_SIZE];
500 500
501   - if (dir == HORIZONTAL)
502   - totalPs = Math.max(totalPs, parentMinPW);
  501 + if (parentWithWtPS) {
  502 + /*
  503 + * Go back up and apply wtGetPS() to totalPs
  504 + */
  505 + var c = widget, p = c.parentNode;
  506 +
  507 + for (;;) {
  508 + if (p.wtGetPS)
  509 + totalPs = p.wtGetPS(p, c, dir, totalPs);
  510 +
  511 + totalPs += boxMargin(p, dir);
503 512
504   - totalPs += parentMargin[dir];
  513 + if (p == parentItemWidget)
  514 + break;
  515 +
  516 + c = p;
  517 + p = c.parentNode;
  518 + }
  519 + } else
  520 + totalPs += parentMargin[dir];
505 521
506 522 parent.setChildSize(parentItemWidget, dir, totalPs);
507 523 }
@@ -648,11 +664,9 @@ WT_DECLARE_WT_MEMBER
648 664 }
649 665
650 666 var otherPadding = 0;
651   - if (container
652   - && dir == VERTICAL
653   - && WT.hasTag(container, 'FIELDSET')
654   - && container.children.length == 2) {
655   - otherPadding = container.firstChild.offsetHeight;
  667 +
  668 + if (container && container.wtGetPS && dir == VERTICAL) {
  669 + otherPadding = container.wtGetPS(container, widget, dir, 0);
656 670 }
657 671
658 672 var totalPreferredSize = measures[TOTAL_PREFERRED_SIZE];
@@ -1119,8 +1133,9 @@ WT_DECLARE_WT_MEMBER
1119 1133 parentMargin[VERTICAL] = boxMargin(parentItemWidget, VERTICAL);
1120 1134 } else {
1121 1135 /*
1122   - * While we are a single child in a parent, we can go further
1123   - * up looking for an ancestor layout
  1136 + * While we are a single child in a parent, or if we have a
  1137 + * wtGetPS() function on that parent, we can go further up
  1138 + * looking for an ancestor layout
1124 1139 */
1125 1140 var c = widget, p = c.parentNode;
1126 1141
@@ -1129,16 +1144,8 @@ WT_DECLARE_WT_MEMBER
1129 1144 parentMargin[HORIZONTAL] += boxMargin(p, HORIZONTAL);
1130 1145 parentMargin[VERTICAL] += boxMargin(p, VERTICAL);
1131 1146
1132   - if (p.childNodes.length > 1) {
1133   - var i, il;
1134   - for (i = 0, il = p.childNodes.length; i < il; ++i) {
1135   - if (p.childNodes[i] != c) {
1136   - parentMargin[VERTICAL] += p.childNodes[i].offsetHeight;
1137   - parentMinPW
1138   - = Math.max(p.childNodes[i].offsetWidth, parentMinPW);
1139   - }
1140   - }
1141   - }
  1147 + if (p.wtGetPS)
  1148 + parentWithWtPS = true;
1142 1149
1143 1150 var l = jQuery.data(p.parentNode, 'layout');
1144 1151 if (l) {
@@ -1149,7 +1156,8 @@ WT_DECLARE_WT_MEMBER
1149 1156
1150 1157 c = p;
1151 1158 p = c.parentNode;
1152   - if (p.childNodes.length != 1)
  1159 +
  1160 + if (p.childNodes.length != 1 && !p.wtGetPS)
1153 1161 break;
1154 1162 }
1155 1163 }
48 src/js/StdGridLayoutImpl2.min.js
... ... @@ -1,24 +1,24 @@
1   -WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"StdLayout2",function(G,A,K,N,O,t,H,D,B,v,z){function u(a,b){var c=s[b],g=b?a.scrollHeight:a.scrollWidth,h=b?a.clientHeight:a.clientWidth;b=b?a.offsetHeight:a.offsetWidth;if(h>=1E6){h-=1E6;if(g>=1E6)g-=1E6}if(g===0)g=e.pxself(a,c.size);if(e.isIE&&(e.hasTag(a,"BUTTON")||e.hasTag(a,"TEXTAREA")||e.hasTag(a,"INPUT")||e.hasTag(a,"SELECT")))g=h;if(!e.isOpera&&!e.isGecko)g+=e.px(a,"border"+c.Left+"Width")+e.px(a,"border"+c.Right+"Width");g+=e.px(a,"margin"+c.Left)+
2   -e.px(a,"margin"+c.Right);if(!e.boxSizing(a)&&!e.isIE)g+=e.px(a,"padding"+c.Left)+e.px(a,"padding"+c.Right);if(e.isWebKit&&g>b){c=0;for(h=a.childNodes.length;c<h;++c){var j=a.childNodes[c];if(j.nodeType==1)if(j.style.zIndex>0){g=0;break}}}if(g<b)g=b;return g}function I(a,b){b=s[b];if(a.style.display=="none")return 0;else if(a["layoutMin"+b.Size])return a["layoutMin"+b.Size];else{var c=e.px(a,"min"+b.Size);e.boxSizing(a)||(c+=e.px(a,"padding"+b.Left)+e.px(a,"padding"+b.Right));return c}}function E(a,
3   -b){b=s[b];var c=e.px(a,"margin"+b.Left)+e.px(a,"margin"+b.Right);if(!e.boxSizing(a)&&!(e.isIE&&!e.isIElt9&&e.hasTag(a,"BUTTON")))c+=e.px(a,"border"+b.Left+"Width")+e.px(a,"border"+b.Right+"Width")+e.px(a,"padding"+b.Left)+e.px(a,"padding"+b.Right);return c}function Y(a,b){b=s[b];return e.px(a,"padding"+b.Left)+e.px(a,"padding"+b.Right)}function S(a,b){if(e.boxSizing(a)){b=s[b];return e.px(a,"border"+b.Left+"Width")+e.px(a,"border"+b.Right+"Width")+e.px(a,"padding"+b.Left)+e.px(a,"padding"+b.Right)}else return 0}
4   -function T(a,b){b=s[b];return e.px(a,"border"+b.Left+"Width")+e.px(a,"border"+b.Right+"Width")+e.px(a,"margin"+b.Left)+e.px(a,"margin"+b.Right)+e.px(a,"padding"+b.Left)+e.px(a,"padding"+b.Right)}function P(a,b){L=a.dirty=true;b&&G.layouts2.scheduleAdjust()}function y(a,b,c){if(a.style[b]!==c){a.style[b]=c;return true}else return false}function aa(a,b,c){b=s[a];var g=s[a^1],h=b.measures,j=b.config.length,o=g.config.length;if(L||M){if(c&&typeof b.minSize=="undefined"){b.minSize=e.px(c,"min"+b.Size);
5   -if(b.minSize>0)b.minSize-=S(c,a)}h=h.slice();if(h.length==5){h[0]=h[0].slice();h[1]=h[1].slice()}var w=[],i=[],m=0,k=0,d,p;for(d=0;d<j;++d){var l=0,r=b.config[d][2],n=true;for(p=0;p<o;++p){var f=b.getItem(d,p);if(f){if(!f.w||a==0&&f.dirty){var x=$("#"+f.id),q=x.get(0);if(q!=f.w){f.w=q;(function(){x.find("img").load(function(){P(f)})})();f.w.style[b.left]=f.w.style[g.left]="-1000000px"}}if(!t&&f.w.style.position!="absolute"){f.w.style.position="absolute";f.w.style.visibility="hidden";if(!f.w.wtResize){f.w.style.boxSizing=
6   -"border-box";if(q=e.cssPrefix("BoxSizing"))f.w.style[q+"BoxSizing"]="border-box"}}if(!f.ps)f.ps=[];if(!f.ms)f.ms=[];if(!f.size)f.size=[];if(!f.psize)f.psize=[];if(!f.fs)f.fs=[];if(!f.set)f.set=[false,false];if(f.w){if(e.isIE)f.w.style.visibility="";if(f.dirty||M){q=I(f.w,a);if(q>r)r=q;f.ms[a]=q;if(!f.set[a])if(a==0){var F=e.pxself(f.w,b.size);f.fs[a]=F?F+E(f.w,a):0}else{F=e.px(f.w,b.size);f.fs[a]=F>Math.max(S(f.w,a),q)?F+E(f.w,a):0}q=f.fs[a];if(f.layout)q=Math.max(q,f.ps[a]);else{F=u(f.w,a);var ba=
7   -typeof f.ps[a]!=="undefined"&&b.config[d][0]>0&&f.set[a];q=f.set[a]&&F===f.psize[a]||ba?Math.max(q,f.ps[a]):Math.max(q,F)}f.ps[a]=q;if(!f.span||f.span[a]==1)if(q>l)l=q}else if(!f.span||f.span[a]==1){if(f.ps[a]>l)l=f.ps[a];if(f.ms[a]>r)r=f.ms[a]}if(f.w.style.display!=="none"||e.hasTag(f.w,"TEXTAREA")&&f.w.wtResize)n=false}}}if(n)r=l=-1;else if(r>l)l=r;w[d]=l;i[d]=r;if(r>-1){m+=l;k+=r}}g=0;o=true;p=false;for(d=0;d<j;++d)if(i[d]>-1){if(o){g+=b.margins[1];o=false}else{g+=b.margins[0];if(p)g+=4}p=b.config[d][1]!==
8   -0}o||(g+=b.margins[2]);m+=g;k+=g;b.measures=[w,i,m,k,g];if(U)if(h[2]!=b.measures[2]){j=b.measures[2];if(a==0)j=Math.max(j,W);j+=J[a];U.setChildSize(Q,a,j)}c&&b.minSize==0&&h[3]!=b.measures[3]&&c.parentNode.className!="Wt-domRoot"&&y(c,"min"+b.Size,b.measures[3]+"px")&&V.ancestor&&V.ancestor.setContentsDirty(c);c&&a==0&&c&&e.hasTag(c,"TD")&&y(c,b.size,b.measures[2]+"px")}}function ca(a,b,c){a=s[a];if(R)c=-c;if(a.config[b][0]>0&&a.config[b+1][0]==0){++b;c=-c}a.fixedSize[b]=a.sizes[b]+c;G.layouts2.scheduleAdjust()}
9   -function da(a,b,c){var g=b.di,h=s[a],j=s[a^1],o,w=e.getElement(A),i;for(i=g-1;i>=0;--i)if(h.sizes[i]>=0){o=-(h.sizes[i]-h.measures[1][i]);break}g=h.sizes[g]-h.measures[1][g];if(R){var m=o;o=-g;g=-m}new e.SizeHandle(e,h.resizeDir,e.pxself(b,h.size),e.pxself(b,j.size),o,g,h.resizerClass,function(k){ca(a,i,k)},b,w,c,0,0)}function ea(a,b){var c=s[a],g=s[a^1],h=c.measures,j=0,o=false,w=false,i=false,m=X?b.parentNode:null;if(c.maxSize===0)if(m){var k=e.css(m,"position");if(k==="absolute")j=e.pxself(m,c.size);
10   -if(j===0){if(!c.initialized)if(k!=="absolute"){j=a?m.clientHeight:m.clientWidth;o=true;if(a==0&&j==0&&e.isIElt9){j=m.offsetWidth;o=false}var d;if((e.hasTag(m,"TD")||e.hasTag(m,"TH"))&&!(e.isIE&&!e.isIElt9)){d=0;i=1}else{d=c.minSize?c.minSize:h[3];i=0}if(e.isIElt9&&j==i||j==d+Y(m,a))c.maxSize=999999}if(j===0&&c.maxSize===0){j=a?m.clientHeight:m.clientWidth;o=true}}}else{j=e.pxself(b,c.size);w=true}d=0;if(m&&a==1&&e.hasTag(m,"FIELDSET")&&m.children.length==2)d=m.firstChild.offsetHeight;i=h[2];if(i<
11   -c.minSize)i=c.minSize;if(c.maxSize)if(i+d<c.maxSize){y(m,c.size,i+d+S(m,a)+"px");j=i+d;i=w=true}else{j=c.maxSize;o=false}c.cSize=j;if(a==1&&m&&m.wtResize){i=g.cSize;var p=c.cSize;m.wtResize(m,Math.round(i),Math.round(p))}j-=d;if(!w){w=0;if(typeof c.cPadding==="undefined"){w=o?Y(m,a):S(m,a);c.cPadding=w}else w=c.cPadding;j-=w}c.initialized=true;if(!(m&&j<=0)){if(j<h[3]-d)j=h[3]-d;$(b).children("."+g.handleClass).css(c.size,j-c.margins[2]-c.margins[1]+"px");o=[];m=c.config.length;w=g.config.length;
12   -if(j>=h[3]-d){p=j-h[4];i=[];var l=[0,0],r=[0,0],n=0;for(d=0;d<m;++d)if(h[1][d]>-1){k=-1;if(typeof c.fixedSize[d]!=="undefined")k=c.fixedSize[d];else if(c.config[d][1]!==0&&c.config[d][1][0]>=0){k=c.config[d][1][0];if(c.config[d][1][1])k=(j-h[4])*k/100}if(k>=0){i[d]=-1;o[d]=k;p-=o[d]}else{if(c.config[d][0]>0){k=1;i[d]=c.config[d][0];n+=i[d]}else{k=0;i[d]=0}l[k]+=h[1][d];r[k]+=h[0][d];o[d]=h[0][d]}}else i[d]=-2;if(n==0){for(d=0;d<m;++d)if(i[d]==0){i[d]=1;++n}r[1]=r[0];l[1]=l[0];r[0]=0;l[0]=0}if(p>r[0]+
13   -l[1]){p-=r[0];if(p>r[1]){if(c.fitSize){p-=r[1];j=p/n;for(d=0;d<m;++d)if(i[d]>0)o[d]+=Math.round(i[d]*j)}}else{k=1;if(p<l[k])p=l[k];j=r[k]-l[k]>0?(p-l[k])/(r[k]-l[k]):0;for(d=0;d<m;++d)if(i[d]>0){p=h[0][d]-h[1][d];o[d]=h[1][d]+Math.round(p*j)}}}else{for(d=0;d<m;++d)if(i[d]>0)o[d]=h[1][d];p-=l[1];k=0;if(p<l[k])p=l[k];j=r[k]-l[k]>0?(p-l[k])/(r[k]-l[k]):0;for(d=0;d<m;++d)if(i[d]==0){p=h[0][d]-h[1][d];o[d]=h[1][d]+Math.round(p*j)}}}else o=h[1];c.sizes=o;h=0;j=true;l=false;for(d=0;d<m;++d)if(o[d]>-1){if(p=
14   -l){i=A+"-rs"+a+"-"+d;l=e.getElement(i);if(!l){l=document.createElement("div");l.setAttribute("id",i);l.di=d;l.style.position="absolute";l.style[g.left]=g.margins[1]+"px";l.style[c.size]=c.margins[0]+"px";l.className=c.handleClass;b.insertBefore(l,b.firstChild);l.onmousedown=l.ontouchstart=function(F){da(a,this,F||window.event)}}h+=2;y(l,c.left,h+"px");h+=2}l=c.config[d][1]!==0;if(j){h+=c.margins[1];j=false}else h+=c.margins[0];for(r=0;r<w;++r)if((n=c.getItem(d,r))&&n.w){i=n.w;k=o[d];if(n.span){var f,
15   -x=l;for(f=1;f<n.span[a];++f){if(x)k+=4;x=c.config[d+x][1]!==0;k+=c.margins[0];k+=o[d+f]}}var q;i.style.visibility="";x=n.align>>c.alignBits&15;f=n.ps[a];if(k<f)x=0;if(x){switch(x){case 1:q=h;break;case 4:q=h+(k-f)/2;break;case 2:q=h+(k-f);break}if(n.layout){y(i,c.size,f+"px")&&P(n);n.set[a]=true}else if(k>=f&&n.set[a]){y(i,c.size,f+"px")&&P(n);n.set[a]=false}n.size[a]=f;n.psize[a]=f}else{q=E(n.w,a);x=k;if(e.isIElt9||!e.hasTag(i,"BUTTON")&&!e.hasTag(i,"INPUT")&&!e.hasTag(i,"SELECT")&&!e.hasTag(i,"TEXTAREA"))x=
16   -Math.max(0,x-q);q=false;if(e.isIE&&e.hasTag(i,"BUTTON"))q=true;if(q||k!=f||n.layout){y(i,c.size,x+"px")&&P(n);n.set[a]=true}else if(n.fs[a])a==0&&y(i,c.size,n.fs[a]+"px");else{y(i,c.size,"")&&P(n);n.set[a]=false}q=h;n.size[a]=x;n.psize[a]=k}if(t)if(p){y(i,c.left,"4px");k=e.css(i,"position");if(k!=="absolute")i.style.position="relative"}else y(i,c.left,"0px");else y(i,c.left,q+"px");if(a==1){i.wtResize&&i.wtResize(i,Math.round(n.size[0]),Math.round(n.size[1]));n.dirty=false}}h+=o[d]}}}var e=G.WT;this.ancestor=
17   -null;this.descendants=[];var V=this,C=z,L=false,M=true,X=false,U=null,Q=null,Z=false,J=[],W=0,R=$(document.body).hasClass("Wt-rtl"),s=[{initialized:false,config:C.cols,margins:B,maxSize:H,measures:[],sizes:[],fixedSize:[],Left:R?"Right":"Left",left:R?"right":"left",Right:R?"Left":"Right",Size:"Width",size:"width",alignBits:0,getItem:function(a,b){return C.items[b*s[0].config.length+a]},handleClass:"Wt-vrh2",resizeDir:"h",resizerClass:"Wt-hsh2",fitSize:N},{initialized:false,config:C.rows,margins:v,
18   -maxSize:D,measures:[],sizes:[],fixedSize:[],Left:"Top",left:"top",Right:"Bottom",Size:"Height",size:"height",alignBits:4,getItem:function(a,b){return C.items[a*s[0].config.length+b]},handleClass:"Wt-hrh2",resizeDir:"v",resizerClass:"Wt-vsh2",fitSize:O}];jQuery.data(document.getElementById(A),"layout",this);this.setConfig=function(a){var b=C;C=a;s[0].config=C.cols;s[1].config=C.rows;var c;a=0;for(c=b.items.length;a<c;++a){var g=b.items[a];if(g){g.set[0]&&y(g.w,s[0].size,"");g.set[1]&&y(g.w,s[1].size,
19   -"");if(g.layout){V.setChildSize(g.w,0,g.ps[0]);V.setChildSize(g.w,1,g.ps[1])}}}M=true};this.getId=function(){return A};this.setItemsDirty=function(a){var b,c,g=s[0].config.length;b=0;for(c=a.length;b<c;++b)C.items[a[b][0]*g+a[b][1]].dirty=true;L=true};this.setDirty=function(){M=true};this.setChildSize=function(a,b,c){var g,h;g=0;for(h=C.items.length;g<h;++g){var j=C.items[g];if(j&&j.id==a.id){if(!j.ps)j.ps=[];j.ps[b]=c;j.layout=true;break}}L=true};this.measure=function(a){var b=e.getElement(A);if(b)if(!e.isHidden(b)){if(!Z){Z=
20   -true;if(X=K==null){var c=b,g=c.parentNode;for(J=[0,0];;){J[0]+=T(g,0);J[1]+=T(g,1);if(g.childNodes.length>1){var h,j;h=0;for(j=g.childNodes.length;h<j;++h)if(g.childNodes[h]!=c){J[1]+=g.childNodes[h].offsetHeight;W=Math.max(g.childNodes[h].offsetWidth,W)}}if(c=jQuery.data(g.parentNode,"layout")){U=c;Q=g;break}c=g;g=c.parentNode;if(g.childNodes.length!=1)break}}else{U=jQuery.data(document.getElementById(K),"layout");Q=b;J[0]=T(Q,0);J[1]=T(Q,1)}}if(L||M)aa(a,b,X?b.parentNode:null);if(a==1)L=M=false}};
21   -this.apply=function(a){var b=e.getElement(A);if(!b)return false;if(e.isHidden(b))return true;ea(a,b);return true};this.contains=function(a){var b=e.getElement(A);a=e.getElement(a.getId());return b&&a?e.contains(b,a):false}});WT_DECLARE_WT_MEMBER(2,JavaScriptPrototype,"StdLayout2.prototype.initResize",function(){this.resizeInitialized=true});
22   -WT_DECLARE_APP_MEMBER(1,JavaScriptObject,"layouts2",new (function(){var G=[],A=false,K=this,N=false;this.find=function(t){return jQuery.data(document.getElementById(t),"layout")};this.setDirty=function(t){(t=jQuery.data(t,"layout"))&&t.setDirty()};this.add=function(t){function H(D,B){var v,z;v=0;for(z=D.length;v<z;++v){var u=D[v];if(u.contains(B)){H(u.descendants,B);return}else if(B.contains(u)){B.descendants.push(u);D.splice(v,1);--v;--z}}D.push(B)}H(G,t)};var O=false;this.scheduleAdjust=function(){if(!O){O=
23   -true;setTimeout(function(){K.adjust()},0)}};this.adjust=function(t,H){function D(v,z){var u,I;u=0;for(I=v.length;u<I;++u){var E=v[u];D(E.descendants,z);z==1&&N&&E.setDirty();E.measure(z)}}function B(v,z){var u,I;u=0;for(I=v.length;u<I;++u){var E=v[u];if(E.apply(z))B(E.descendants,z);else{v.splice(u,1);--u;--I}}}if(t){(t=this.find(t))&&t.setItemsDirty(H);K.scheduleAdjust()}else{O=false;if(!A){A=true;D(G,0);B(G,0);D(G,1);B(G,1);N=A=false}}};this.updateConfig=function(t,H){(t=this.find(t))&&t.setConfig(H)};
24   -window.onresize=function(){N=true;K.scheduleAdjust()}}));
  1 +WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"StdLayout2",function(G,B,K,P,Q,t,H,E,C,x,A){function u(a,c){var b=r[c],f=c?a.scrollHeight:a.scrollWidth,i=c?a.clientHeight:a.clientWidth;c=c?a.offsetHeight:a.offsetWidth;if(i>=1E6){i-=1E6;if(f>=1E6)f-=1E6}if(f===0)f=e.pxself(a,b.size);if(e.isIE&&(e.hasTag(a,"BUTTON")||e.hasTag(a,"TEXTAREA")||e.hasTag(a,"INPUT")||e.hasTag(a,"SELECT")))f=i;if(!e.isOpera&&!e.isGecko)f+=e.px(a,"border"+b.Left+"Width")+e.px(a,"border"+b.Right+"Width");f+=e.px(a,"margin"+b.Left)+
  2 +e.px(a,"margin"+b.Right);if(!e.boxSizing(a)&&!e.isIE)f+=e.px(a,"padding"+b.Left)+e.px(a,"padding"+b.Right);if(e.isWebKit&&f>c){b=0;for(i=a.childNodes.length;b<i;++b){var j=a.childNodes[b];if(j.nodeType==1)if(j.style.zIndex>0){f=0;break}}}if(f<c)f=c;return f}function I(a,c){c=r[c];if(a.style.display=="none")return 0;else if(a["layoutMin"+c.Size])return a["layoutMin"+c.Size];else{var b=e.px(a,"min"+c.Size);e.boxSizing(a)||(b+=e.px(a,"padding"+c.Left)+e.px(a,"padding"+c.Right));return b}}function F(a,
  3 +c){c=r[c];var b=e.px(a,"margin"+c.Left)+e.px(a,"margin"+c.Right);if(!e.boxSizing(a)&&!(e.isIE&&!e.isIElt9&&e.hasTag(a,"BUTTON")))b+=e.px(a,"border"+c.Left+"Width")+e.px(a,"border"+c.Right+"Width")+e.px(a,"padding"+c.Left)+e.px(a,"padding"+c.Right);return b}function Y(a,c){c=r[c];return e.px(a,"padding"+c.Left)+e.px(a,"padding"+c.Right)}function U(a,c){if(e.boxSizing(a)){c=r[c];return e.px(a,"border"+c.Left+"Width")+e.px(a,"border"+c.Right+"Width")+e.px(a,"padding"+c.Left)+e.px(a,"padding"+c.Right)}else return 0}
  4 +function R(a,c){c=r[c];return e.px(a,"border"+c.Left+"Width")+e.px(a,"border"+c.Right+"Width")+e.px(a,"margin"+c.Left)+e.px(a,"margin"+c.Right)+e.px(a,"padding"+c.Left)+e.px(a,"padding"+c.Right)}function S(a,c){L=a.dirty=true;c&&G.layouts2.scheduleAdjust()}function y(a,c,b){if(a.style[c]!==b){a.style[c]=b;return true}else return false}function ba(a,c,b){var f=r[a],i=r[a^1],j=f.measures,p=f.config.length,v=i.config.length;if(L||M){if(b&&typeof f.minSize=="undefined"){f.minSize=e.px(b,"min"+f.Size);
  5 +if(f.minSize>0)f.minSize-=U(b,a)}j=j.slice();if(j.length==5){j[0]=j[0].slice();j[1]=j[1].slice()}var h=[],n=[],k=0,d=0,o,m;for(o=0;o<p;++o){var q=0,l=f.config[o][2],w=true;for(m=0;m<v;++m){var g=f.getItem(o,m);if(g){if(!g.w||a==0&&g.dirty){var z=$("#"+g.id),s=z.get(0);if(s!=g.w){g.w=s;(function(){z.find("img").load(function(){S(g)})})();g.w.style[f.left]=g.w.style[i.left]="-1000000px"}}if(!t&&g.w.style.position!="absolute"){g.w.style.position="absolute";g.w.style.visibility="hidden";if(!g.w.wtResize){g.w.style.boxSizing=
  6 +"border-box";if(s=e.cssPrefix("BoxSizing"))g.w.style[s+"BoxSizing"]="border-box"}}if(!g.ps)g.ps=[];if(!g.ms)g.ms=[];if(!g.size)g.size=[];if(!g.psize)g.psize=[];if(!g.fs)g.fs=[];if(!g.set)g.set=[false,false];if(g.w){if(e.isIE)g.w.style.visibility="";if(g.dirty||M){s=I(g.w,a);if(s>l)l=s;g.ms[a]=s;if(!g.set[a])if(a==0){var J=e.pxself(g.w,f.size);g.fs[a]=J?J+F(g.w,a):0}else{J=e.px(g.w,f.size);g.fs[a]=J>Math.max(U(g.w,a),s)?J+F(g.w,a):0}s=g.fs[a];if(g.layout)s=Math.max(s,g.ps[a]);else{J=u(g.w,a);var ca=
  7 +typeof g.ps[a]!=="undefined"&&f.config[o][0]>0&&g.set[a];s=g.set[a]&&J===g.psize[a]||ca?Math.max(s,g.ps[a]):Math.max(s,J)}g.ps[a]=s;if(!g.span||g.span[a]==1)if(s>q)q=s}else if(!g.span||g.span[a]==1){if(g.ps[a]>q)q=g.ps[a];if(g.ms[a]>l)l=g.ms[a]}if(g.w.style.display!=="none"||e.hasTag(g.w,"TEXTAREA")&&g.w.wtResize)w=false}}}if(w)l=q=-1;else if(l>q)q=l;h[o]=q;n[o]=l;if(l>-1){k+=q;d+=l}}i=0;v=true;m=false;for(o=0;o<p;++o)if(n[o]>-1){if(v){i+=f.margins[1];v=false}else{i+=f.margins[0];if(m)i+=4}m=f.config[o][1]!==
  8 +0}v||(i+=f.margins[2]);k+=i;d+=i;f.measures=[h,n,k,d,i];if(V)if(j[2]!=f.measures[2]){p=f.measures[2];if(Z){c=c;for(h=c.parentNode;;){if(h.wtGetPS)p=h.wtGetPS(h,c,a,p);p+=R(h,a);if(h==N)break;c=h;h=c.parentNode}}else p+=O[a];V.setChildSize(N,a,p)}b&&f.minSize==0&&j[3]!=f.measures[3]&&b.parentNode.className!="Wt-domRoot"&&y(b,"min"+f.Size,f.measures[3]+"px")&&W.ancestor&&W.ancestor.setContentsDirty(b);b&&a==0&&b&&e.hasTag(b,"TD")&&y(b,f.size,f.measures[2]+"px")}}function da(a,c,b){a=r[a];if(T)b=-b;
  9 +if(a.config[c][0]>0&&a.config[c+1][0]==0){++c;b=-b}a.fixedSize[c]=a.sizes[c]+b;G.layouts2.scheduleAdjust()}function ea(a,c,b){var f=c.di,i=r[a],j=r[a^1],p,v=e.getElement(B),h;for(h=f-1;h>=0;--h)if(i.sizes[h]>=0){p=-(i.sizes[h]-i.measures[1][h]);break}f=i.sizes[f]-i.measures[1][f];if(T){var n=p;p=-f;f=-n}new e.SizeHandle(e,i.resizeDir,e.pxself(c,i.size),e.pxself(c,j.size),p,f,i.resizerClass,function(k){da(a,h,k)},c,v,b,0,0)}function fa(a,c){var b=r[a],f=r[a^1],i=b.measures,j=0,p=false,v=false,h=false,
  10 +n=X?c.parentNode:null;if(b.maxSize===0)if(n){var k=e.css(n,"position");if(k==="absolute")j=e.pxself(n,b.size);if(j===0){if(!b.initialized)if(k!=="absolute"){j=a?n.clientHeight:n.clientWidth;p=true;if(a==0&&j==0&&e.isIElt9){j=n.offsetWidth;p=false}var d;if((e.hasTag(n,"TD")||e.hasTag(n,"TH"))&&!(e.isIE&&!e.isIElt9)){d=0;h=1}else{d=b.minSize?b.minSize:i[3];h=0}if(e.isIElt9&&j==h||j==d+Y(n,a))b.maxSize=999999}if(j===0&&b.maxSize===0){j=a?n.clientHeight:n.clientWidth;p=true}}}else{j=e.pxself(c,b.size);
  11 +v=true}d=0;if(n&&n.wtGetPS&&a==1)d=n.wtGetPS(n,c,a,0);h=i[2];if(h<b.minSize)h=b.minSize;if(b.maxSize)if(h+d<b.maxSize){y(n,b.size,h+d+U(n,a)+"px");j=h+d;h=v=true}else{j=b.maxSize;p=false}b.cSize=j;if(a==1&&n&&n.wtResize){h=f.cSize;var o=b.cSize;n.wtResize(n,Math.round(h),Math.round(o))}j-=d;if(!v){v=0;if(typeof b.cPadding==="undefined"){v=p?Y(n,a):U(n,a);b.cPadding=v}else v=b.cPadding;j-=v}b.initialized=true;if(!(n&&j<=0)){if(j<i[3]-d)j=i[3]-d;$(c).children("."+f.handleClass).css(b.size,j-b.margins[2]-
  12 +b.margins[1]+"px");p=[];n=b.config.length;v=f.config.length;if(j>=i[3]-d){o=j-i[4];h=[];var m=[0,0],q=[0,0],l=0;for(d=0;d<n;++d)if(i[1][d]>-1){k=-1;if(typeof b.fixedSize[d]!=="undefined")k=b.fixedSize[d];else if(b.config[d][1]!==0&&b.config[d][1][0]>=0){k=b.config[d][1][0];if(b.config[d][1][1])k=(j-i[4])*k/100}if(k>=0){h[d]=-1;p[d]=k;o-=p[d]}else{if(b.config[d][0]>0){k=1;h[d]=b.config[d][0];l+=h[d]}else{k=0;h[d]=0}m[k]+=i[1][d];q[k]+=i[0][d];p[d]=i[0][d]}}else h[d]=-2;if(l==0){for(d=0;d<n;++d)if(h[d]==
  13 +0){h[d]=1;++l}q[1]=q[0];m[1]=m[0];q[0]=0;m[0]=0}if(o>q[0]+m[1]){o-=q[0];if(o>q[1]){if(b.fitSize){o-=q[1];j=o/l;for(d=0;d<n;++d)if(h[d]>0)p[d]+=Math.round(h[d]*j)}}else{k=1;if(o<m[k])o=m[k];j=q[k]-m[k]>0?(o-m[k])/(q[k]-m[k]):0;for(d=0;d<n;++d)if(h[d]>0){o=i[0][d]-i[1][d];p[d]=i[1][d]+Math.round(o*j)}}}else{for(d=0;d<n;++d)if(h[d]>0)p[d]=i[1][d];o-=m[1];k=0;if(o<m[k])o=m[k];j=q[k]-m[k]>0?(o-m[k])/(q[k]-m[k]):0;for(d=0;d<n;++d)if(h[d]==0){o=i[0][d]-i[1][d];p[d]=i[1][d]+Math.round(o*j)}}}else p=i[1];
  14 +b.sizes=p;i=0;j=true;m=false;for(d=0;d<n;++d)if(p[d]>-1){if(o=m){h=B+"-rs"+a+"-"+d;m=e.getElement(h);if(!m){m=document.createElement("div");m.setAttribute("id",h);m.di=d;m.style.position="absolute";m.style[f.left]=f.margins[1]+"px";m.style[b.size]=b.margins[0]+"px";m.className=b.handleClass;c.insertBefore(m,c.firstChild);m.onmousedown=m.ontouchstart=function(s){ea(a,this,s||window.event)}}i+=2;y(m,b.left,i+"px");i+=2}m=b.config[d][1]!==0;if(j){i+=b.margins[1];j=false}else i+=b.margins[0];for(q=0;q<
  15 +v;++q)if((l=b.getItem(d,q))&&l.w){h=l.w;k=p[d];if(l.span){var w,g=m;for(w=1;w<l.span[a];++w){if(g)k+=4;g=b.config[d+g][1]!==0;k+=b.margins[0];k+=p[d+w]}}var z;h.style.visibility="";g=l.align>>b.alignBits&15;w=l.ps[a];if(k<w)g=0;if(g){switch(g){case 1:z=i;break;case 4:z=i+(k-w)/2;break;case 2:z=i+(k-w);break}if(l.layout){y(h,b.size,w+"px")&&S(l);l.set[a]=true}else if(k>=w&&l.set[a]){y(h,b.size,w+"px")&&S(l);l.set[a]=false}l.size[a]=w;l.psize[a]=w}else{z=F(l.w,a);g=k;if(e.isIElt9||!e.hasTag(h,"BUTTON")&&
  16 +!e.hasTag(h,"INPUT")&&!e.hasTag(h,"SELECT")&&!e.hasTag(h,"TEXTAREA"))g=Math.max(0,g-z);z=false;if(e.isIE&&e.hasTag(h,"BUTTON"))z=true;if(z||k!=w||l.layout){y(h,b.size,g+"px")&&S(l);l.set[a]=true}else if(l.fs[a])a==0&&y(h,b.size,l.fs[a]+"px");else{y(h,b.size,"")&&S(l);l.set[a]=false}z=i;l.size[a]=g;l.psize[a]=k}if(t)if(o){y(h,b.left,"4px");k=e.css(h,"position");if(k!=="absolute")h.style.position="relative"}else y(h,b.left,"0px");else y(h,b.left,z+"px");if(a==1){h.wtResize&&h.wtResize(h,Math.round(l.size[0]),
  17 +Math.round(l.size[1]));l.dirty=false}}i+=p[d]}}}var e=G.WT;this.ancestor=null;this.descendants=[];var W=this,D=A,L=false,M=true,X=false,V=null,N=null,aa=false,O=[],Z=false,T=$(document.body).hasClass("Wt-rtl"),r=[{initialized:false,config:D.cols,margins:C,maxSize:H,measures:[],sizes:[],fixedSize:[],Left:T?"Right":"Left",left:T?"right":"left",Right:T?"Left":"Right",Size:"Width",size:"width",alignBits:0,getItem:function(a,c){return D.items[c*r[0].config.length+a]},handleClass:"Wt-vrh2",resizeDir:"h",
  18 +resizerClass:"Wt-hsh2",fitSize:P},{initialized:false,config:D.rows,margins:x,maxSize:E,measures:[],sizes:[],fixedSize:[],Left:"Top",left:"top",Right:"Bottom",Size:"Height",size:"height",alignBits:4,getItem:function(a,c){return D.items[a*r[0].config.length+c]},handleClass:"Wt-hrh2",resizeDir:"v",resizerClass:"Wt-vsh2",fitSize:Q}];jQuery.data(document.getElementById(B),"layout",this);this.setConfig=function(a){var c=D;D=a;r[0].config=D.cols;r[1].config=D.rows;var b;a=0;for(b=c.items.length;a<b;++a){var f=
  19 +c.items[a];if(f){f.set[0]&&y(f.w,r[0].size,"");f.set[1]&&y(f.w,r[1].size,"");if(f.layout){W.setChildSize(f.w,0,f.ps[0]);W.setChildSize(f.w,1,f.ps[1])}}}M=true};this.getId=function(){return B};this.setItemsDirty=function(a){var c,b,f=r[0].config.length;c=0;for(b=a.length;c<b;++c)D.items[a[c][0]*f+a[c][1]].dirty=true;L=true};this.setDirty=function(){M=true};this.setChildSize=function(a,c,b){var f,i;f=0;for(i=D.items.length;f<i;++f){var j=D.items[f];if(j&&j.id==a.id){if(!j.ps)j.ps=[];j.ps[c]=b;j.layout=
  20 +true;break}}L=true};this.measure=function(a){var c=e.getElement(B);if(c)if(!e.isHidden(c)){if(!aa){aa=true;if(X=K==null){var b=c;b=b.parentNode;for(O=[0,0];;){O[0]+=R(b,0);O[1]+=R(b,1);if(b.wtGetPS)Z=true;var f=jQuery.data(b.parentNode,"layout");if(f){V=f;N=b;break}b=b;b=b.parentNode;if(b.childNodes.length!=1&&!b.wtGetPS)break}}else{V=jQuery.data(document.getElementById(K),"layout");N=c;O[0]=R(N,0);O[1]=R(N,1)}}if(L||M)ba(a,c,X?c.parentNode:null);if(a==1)L=M=false}};this.apply=function(a){var c=e.getElement(B);
  21 +if(!c)return false;if(e.isHidden(c))return true;fa(a,c);return true};this.contains=function(a){var c=e.getElement(B);a=e.getElement(a.getId());return c&&a?e.contains(c,a):false}});WT_DECLARE_WT_MEMBER(2,JavaScriptPrototype,"StdLayout2.prototype.initResize",function(){this.resizeInitialized=true});
  22 +WT_DECLARE_APP_MEMBER(1,JavaScriptObject,"layouts2",new (function(){var G=[],B=false,K=this,P=false;this.find=function(t){return jQuery.data(document.getElementById(t),"layout")};this.setDirty=function(t){(t=jQuery.data(t,"layout"))&&t.setDirty()};this.add=function(t){function H(E,C){var x,A;x=0;for(A=E.length;x<A;++x){var u=E[x];if(u.contains(C)){H(u.descendants,C);return}else if(C.contains(u)){C.descendants.push(u);E.splice(x,1);--x;--A}}E.push(C)}H(G,t)};var Q=false;this.scheduleAdjust=function(){if(!Q){Q=
  23 +true;setTimeout(function(){K.adjust()},0)}};this.adjust=function(t,H){function E(x,A){var u,I;u=0;for(I=x.length;u<I;++u){var F=x[u];E(F.descendants,A);A==1&&P&&F.setDirty();F.measure(A)}}function C(x,A){var u,I;u=0;for(I=x.length;u<I;++u){var F=x[u];if(F.apply(A))C(F.descendants,A);else{x.splice(u,1);--u;--I}}}if(t){(t=this.find(t))&&t.setItemsDirty(H);K.scheduleAdjust()}else{Q=false;if(!B){B=true;E(G,0);C(G,0);E(G,1);C(G,1);P=B=false}}};this.updateConfig=function(t,H){(t=this.find(t))&&t.setConfig(H)};
  24 +window.onresize=function(){P=true;K.scheduleAdjust()}}));
134 src/js/WtResize.js
@@ -8,55 +8,99 @@
8 8
9 9 WT_DECLARE_WT_MEMBER
10 10 (10, JavaScriptFunction, "ChildrenResize",
11   - function(self, w, h) {
12   - var j, jl, c, WT = this;
13   - self.style.height = h + 'px';
14   -
15   - if (WT.boxSizing(self)) {
16   - h -= WT.px(self, 'marginTop');
17   - h -= WT.px(self, 'marginBottom');
18   - h -= WT.px(self, 'borderTopWidth');
19   - h -= WT.px(self, 'borderBottomWidth');
20   - h -= WT.px(self, 'paddingTop');
21   - h -= WT.px(self, 'paddingBottom');
22   -
23   - w -= WT.px(self, 'marginLeft');
24   - w -= WT.px(self, 'marginRight');
25   - w -= WT.px(self, 'borderLeftWidth');
26   - w -= WT.px(self, 'borderRightWidth');
27   - w -= WT.px(self, 'paddingLeft');
28   - w -= WT.px(self, 'paddingRight');
29   - }
30 11
31   - function marginV(el) {
32   - var result = WT.px(el, 'marginTop');
33   - result += WT.px(el, 'marginBottom');
  12 + function(self, w, h) {
  13 + var j, jl, c, WT = this;
  14 + self.style.height = h + 'px';
34 15
35   - if (!WT.boxSizing(el)) {
36   - result += WT.px(el, 'borderTopWidth');
37   - result += WT.px(el, 'borderBottomWidth');
38   - result += WT.px(el, 'paddingTop');
39   - result += WT.px(el, 'paddingBottom');
40   - }
  16 + if (WT.boxSizing(self)) {
  17 + h -= WT.px(self, 'marginTop');
  18 + h -= WT.px(self, 'marginBottom');
  19 + h -= WT.px(self, 'borderTopWidth');
  20 + h -= WT.px(self, 'borderBottomWidth');
  21 + h -= WT.px(self, 'paddingTop');
  22 + h -= WT.px(self, 'paddingBottom');
41 23
42   - return result;
43   - }
  24 + w -= WT.px(self, 'marginLeft');
  25 + w -= WT.px(self, 'marginRight');
  26 + w -= WT.px(self, 'borderLeftWidth');
  27 + w -= WT.px(self, 'borderRightWidth');
  28 + w -= WT.px(self, 'paddingLeft');
  29 + w -= WT.px(self, 'paddingRight');
  30 + }
  31 +
  32 + function marginV(el) {
  33 + var result = WT.px(el, 'marginTop');
  34 + result += WT.px(el, 'marginBottom');
  35 +
  36 + if (!WT.boxSizing(el)) {
  37 + result += WT.px(el, 'borderTopWidth');
  38 + result += WT.px(el, 'borderBottomWidth');
  39 + result += WT.px(el, 'paddingTop');
  40 + result += WT.px(el, 'paddingBottom');
  41 + }
  42 +
  43 + return result;
  44 + }
  45 +
  46 + for (j=0, jl=self.childNodes.length; j < jl; ++j) {
  47 + c = self.childNodes[j];
  48 + if (c.nodeType == 1) {
  49 + var ch = h - marginV(c);
44 50
45   - for (j=0, jl=self.childNodes.length; j < jl; ++j) {
46   - c=self.childNodes[j];
47   - if (c.nodeType == 1) {
48   - var ch = h - marginV(c);
49   -
50   - if (ch > 0) {
51   - if (c.wtResize)
52   - c.wtResize(c, w, ch);
53   - else {
54   - var cheight = ch + 'px';
55   - if (c.style.height != cheight)
56   - c.style.height = cheight;
57   - }
58   - }
  51 + if (ch > 0) {
  52 + if (c.wtResize)
  53 + c.wtResize(c, w, ch);
  54 + else {
  55 + var cheight = ch + 'px';
  56 + if (c.style.height != cheight)
  57 + c.style.height = cheight;
59 58 }
60 59 }
61 60 }
62   - );
  61 + }
  62 + }
  63 + );
  64 +
  65 +WT_DECLARE_WT_MEMBER
  66 +(11, JavaScriptFunction, "ChildrenGetPS",
  67 + function(self, child, dir, size) {
  68 + return size;
  69 + }
  70 + );
  71 +
  72 +WT_DECLARE_WT_MEMBER
  73 +(12, JavaScriptFunction, "SecondResize",
  74 + function(self, w, h) {
  75 + var WT = this;
  76 + self.style.height= h + 'px';
  77 + var c = self.firstChild;
  78 + var t = self.lastChild;
  79 + h -= c.offsetHeight + WT.px(c, 'marginTop') + WT.px(c, 'marginBottom');
  80 + if (h > 0) {
  81 + if (t.wtResize)
  82 + t.wtResize(t, w, h);
  83 + else
  84 + t.style.height = h + 'px';
  85 + }
  86 + }
  87 + );
  88 +
  89 +WT_DECLARE_WT_MEMBER
  90 +(13, JavaScriptFunction, "SecondGetPS",
  91 + function(self, child, dir, size) {
  92 + var WT = this, i, il;
  93 + for (i = 0, il = self.childNodes.length; i < il; ++i) {
  94 + var c = self.childNodes[i];
  95 + if (c != child) {
  96 + if (dir === 0)
  97 + size = Math.max(size, c.offsetWidth);
  98 + else
  99 + size += c.offsetHeight + WT.px(c, 'marginTop')
  100 + + WT.px(c, 'marginBottom');
  101 + }
  102 + }
  103 +
  104 + return size;
  105 + }
  106 + );
6 src/js/WtResize.min.js
... ... @@ -1,2 +1,4 @@
1   -WT_DECLARE_WT_MEMBER(10,JavaScriptFunction,"ChildrenResize",function(b,e,c){function k(f){var g=a.px(f,"marginTop");g+=a.px(f,"marginBottom");if(!a.boxSizing(f)){g+=a.px(f,"borderTopWidth");g+=a.px(f,"borderBottomWidth");g+=a.px(f,"paddingTop");g+=a.px(f,"paddingBottom")}return g}var i,j,d,a=this;b.style.height=c+"px";if(a.boxSizing(b)){c-=a.px(b,"marginTop");c-=a.px(b,"marginBottom");c-=a.px(b,"borderTopWidth");c-=a.px(b,"borderBottomWidth");c-=a.px(b,"paddingTop");c-=a.px(b,"paddingBottom");e-=
2   -a.px(b,"marginLeft");e-=a.px(b,"marginRight");e-=a.px(b,"borderLeftWidth");e-=a.px(b,"borderRightWidth");e-=a.px(b,"paddingLeft");e-=a.px(b,"paddingRight")}i=0;for(j=b.childNodes.length;i<j;++i){d=b.childNodes[i];if(d.nodeType==1){var h=c-k(d);if(h>0)if(d.wtResize)d.wtResize(d,e,h);else{h=h+"px";if(d.style.height!=h)d.style.height=h}}}});
  1 +WT_DECLARE_WT_MEMBER(10,JavaScriptFunction,"ChildrenResize",function(a,d,c){function e(h){var j=b.px(h,"marginTop");j+=b.px(h,"marginBottom");if(!b.boxSizing(h)){j+=b.px(h,"borderTopWidth");j+=b.px(h,"borderBottomWidth");j+=b.px(h,"paddingTop");j+=b.px(h,"paddingBottom")}return j}var f,i,g,b=this;a.style.height=c+"px";if(b.boxSizing(a)){c-=b.px(a,"marginTop");c-=b.px(a,"marginBottom");c-=b.px(a,"borderTopWidth");c-=b.px(a,"borderBottomWidth");c-=b.px(a,"paddingTop");c-=b.px(a,"paddingBottom");d-=
  2 +b.px(a,"marginLeft");d-=b.px(a,"marginRight");d-=b.px(a,"borderLeftWidth");d-=b.px(a,"borderRightWidth");d-=b.px(a,"paddingLeft");d-=b.px(a,"paddingRight")}f=0;for(i=a.childNodes.length;f<i;++f){g=a.childNodes[f];if(g.nodeType==1){var k=c-e(g);if(k>0)if(g.wtResize)g.wtResize(g,d,k);else{k=k+"px";if(g.style.height!=k)g.style.height=k}}}});WT_DECLARE_WT_MEMBER(11,JavaScriptFunction,"ChildrenGetPS",function(a,d,c,e){return e});
  3 +WT_DECLARE_WT_MEMBER(12,JavaScriptFunction,"SecondResize",function(a,d,c){var e=this;a.style.height=c+"px";var f=a.firstChild;a=a.lastChild;c-=f.offsetHeight+e.px(f,"marginTop")+e.px(f,"marginBottom");if(c>0)if(a.wtResize)a.wtResize(a,d,c);else a.style.height=c+"px"});
  4 +WT_DECLARE_WT_MEMBER(13,JavaScriptFunction,"SecondGetPS",function(a,d,c,e){var f=this,i,g;i=0;for(g=a.childNodes.length;i<g;++i){var b=a.childNodes[i];if(b!=d)if(c===0)e=Math.max(e,b.offsetWidth);else e+=b.offsetHeight+f.px(b,"marginTop")+f.px(b,"marginBottom")}return e});
6 src/web/skeleton/Wt.js
@@ -16,7 +16,9 @@ window.WT_DECLARE_WT_MEMBER = function(i, type, name, fn)
16 16 _$_WT_CLASS_$_[name.substr(0, proto)]
17 17 .prototype[name.substr(proto + '.prototype.'.length)] = fn;
18 18 } else if (type == JavaScriptFunction) {
19   - _$_WT_CLASS_$_[name] = function() { fn.apply(_$_WT_CLASS_$_, arguments); };
  19 + _$_WT_CLASS_$_[name] = function() {
  20 + return fn.apply(_$_WT_CLASS_$_, arguments);
  21 + };
20 22 } else {
21 23 _$_WT_CLASS_$_[name] = fn;
22 24 }
@@ -30,7 +32,7 @@ window.WT_DECLARE_APP_MEMBER = function(i, type, name, fn)
30 32 app[name.substr(0, proto)]
31 33 .prototype[name.substr(proto + '.prototype.'.length)] = fn;
32 34 } else if (type == JavaScriptFunction) {
33   - app[name] = function() { fn.apply(app, arguments); };
  35 + app[name] = function() { return fn.apply(app, arguments); };
34 36 } else {
35 37 app[name] = fn;
36 38 }
4 src/web/skeleton/Wt.min.js
@@ -13,8 +13,8 @@
13 13 http://developer.yahoo.net/yui/license.txt
14 14 version: 2.5.2
15 15 */
16   -_$_$if_DYNAMIC_JS_$_();window.JavaScriptFunction=1;window.JavaScriptConstructor=2;window.JavaScriptObject=3;window.JavaScriptPrototype=4;window.WT_DECLARE_WT_MEMBER=function(M,N,F,K){if(N==JavaScriptPrototype){M=F.indexOf(".prototype");_$_WT_CLASS_$_[F.substr(0,M)].prototype[F.substr(M+11)]=K}else _$_WT_CLASS_$_[F]=N==JavaScriptFunction?function(){K.apply(_$_WT_CLASS_$_,arguments)}:K};
17   -window.WT_DECLARE_APP_MEMBER=function(M,N,F,K){var P=window.currentApp;if(N==JavaScriptPrototype){M=F.indexOf(".prototype");P[F.substr(0,M)].prototype[F.substr(M+11)]=K}else P[F]=N==JavaScriptFunction?function(){K.apply(P,arguments)}:K};_$_$endif_$_();
  16 +_$_$if_DYNAMIC_JS_$_();window.JavaScriptFunction=1;window.JavaScriptConstructor=2;window.JavaScriptObject=3;window.JavaScriptPrototype=4;window.WT_DECLARE_WT_MEMBER=function(M,N,F,K){if(N==JavaScriptPrototype){M=F.indexOf(".prototype");_$_WT_CLASS_$_[F.substr(0,M)].prototype[F.substr(M+11)]=K}else _$_WT_CLASS_$_[F]=N==JavaScriptFunction?function(){return K.apply(_$_WT_CLASS_$_,arguments)}:K};
  17 +window.WT_DECLARE_APP_MEMBER=function(M,N,F,K){var P=window.currentApp;if(N==JavaScriptPrototype){M=F.indexOf(".prototype");P[F.substr(0,M)].prototype[F.substr(M+11)]=K}else P[F]=N==JavaScriptFunction?function(){return K.apply(P,arguments)}:K};_$_$endif_$_();
18 18 if(!window._$_WT_CLASS_$_)window._$_WT_CLASS_$_=new (function(){function M(a){return a.split("/")[2]}function N(a,b,e){if(a=="auto"||a==null)return e;return(a=(a=b.exec(a))&&a.length==2?a[1]:null)?parseFloat(a):e}function F(a,b){return N(a,/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/i,b)}function K(a){if(L==null)return null;if(!a)a=window.event;if(a){for(var b=a=g.target(a);b&&b!=L;)b=b.parentNode;return b==L?g.isIElt9?a:null:L}else return L}function P(a){var b=K(a);if(b&&!X){if(!a)a=window.event;X=true;if(g.isIElt9){g.firedTarget=
19 19 a.srcElement||b;b.fireEvent("onmousemove",a);g.firedTarget=null}else g.condCall(b,"onmousemove",a);return X=false}else return true}function Y(a){var b=K(a);g.capture(null);if(b){if(!a)a=window.event;if(g.isIElt9){g.firedTarget=a.srcElement||b;b.fireEvent("onmouseup",a);g.firedTarget=null}else g.condCall(b,"onmouseup",a);g.cancelEvent(a,g.CancelPropagate);return false}else return true}function la(){if(!ea){ea=true;if(document.body.addEventListener){var a=document.body;a.addEventListener("mousemove",
20 20 P,true);a.addEventListener("mouseup",Y,true);g.isGecko&&window.addEventListener("mouseout",function(b){!b.relatedTarget&&g.hasTag(b.target,"HTML")&&Y(b)},true)}else{a=document.body;a.attachEvent("onmousemove",P);a.attachEvent("onmouseup",Y)}}}function fa(){if(!S){var a,b,e=document.styleSheets;a=0;for(b=e.length;a<b;++a){var i=e[a];if(g.hasTag(e[a].ownerNode,"STYLE")){S=i;break}}if(!S){i=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(i);S=i.sheet}}return S}function ga(a){return a.replace(/%/g,
10 test/dbo/DboTest.C
@@ -104,7 +104,9 @@ public:
104 104 Wt::WTime time;
105 105 Wt::WDateTime datetime;
106 106 Wt::WString wstring;
  107 + Wt::WString wstring2;
107 108 std::string string;
  109 + std::string string2;
108 110 boost::posix_time::ptime ptime;
109 111 boost::posix_time::time_duration pduration;
110 112 bool checked;
@@ -126,7 +128,9 @@ public:
126 128 && time == other.time
127 129 && datetime == other.datetime
128 130 && wstring == other.wstring
  131 + && wstring2 == other.wstring2
129 132 && string == other.string
  133 + && string2 == other.string2
130 134 && ptime == other.ptime
131 135 && pduration == pduration
132 136 && i == other.i
@@ -150,7 +154,9 @@ public:
150 154 dbo::field(a, binary, "binary");
151 155 dbo::field(a, datetime, "datetime");
152 156 dbo::field(a, wstring, "wstring");
153   - dbo::field(a, string, "string", 50);
  157 + dbo::field(a, wstring2, "wstring2", 30);
  158 + dbo::field(a, string, "string");
  159 + dbo::field(a, string2, "string2", 50);
154 160 dbo::field(a, ptime, "ptime");
155 161 dbo::field(a, pduration, "pduration");
156 162 dbo::field(a, i, "i");
@@ -361,7 +367,9 @@ BOOST_AUTO_TEST_CASE( dbo_test1 )
361 367 a1.date = Wt::WDate(1976, 6, 14);
362 368 a1.time = Wt::WTime(13, 14, 15, 102);
363 369 a1.wstring = "Hello";
  370 + a1.wstring2 = "Kitty";
364 371 a1.string = "There";
  372 + a1.string2 = "Big Owl";
365 373 a1.ptime = boost::posix_time::ptime
366 374 (boost::gregorian::date(2005,boost::gregorian::Jan,1),
367 375 boost::posix_time::time_duration(1,2,3));

0 comments on commit 41bb9bb

Please sign in to comment.
Something went wrong with that request. Please try again.