|
|
|
@ -4487,7 +4487,41 @@ Demo.BorderLayout = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.border", Demo.BorderLayout);Demo.CenterAdapt = BI.inherit(BI.Widget, { |
|
|
|
|
BI.shortcut("demo.border", Demo.BorderLayout);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.CenterLayout = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-center" |
|
|
|
|
}, |
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.center", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局", |
|
|
|
|
cls: "layout-bg1", |
|
|
|
|
whiteSpace: "normal" |
|
|
|
|
},{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal", |
|
|
|
|
cls: "layout-bg2", |
|
|
|
|
whiteSpace: "normal" |
|
|
|
|
},{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: "Center 3", |
|
|
|
|
cls: "layout-bg3" |
|
|
|
|
},{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: "Center 4", |
|
|
|
|
cls: "layout-bg5" |
|
|
|
|
}], |
|
|
|
|
hgap: 20, |
|
|
|
|
vgap: 20 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.center_layout", Demo.CenterLayout);Demo.CenterAdapt = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-absolute" |
|
|
|
|
}, |
|
|
|
@ -4570,40 +4604,6 @@ BI.shortcut("demo.border", Demo.BorderLayout);Demo.CenterAdapt = BI.inherit(BI.W
|
|
|
|
|
BI.shortcut("demo.center_adapt", Demo.CenterAdapt);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.CenterLayout = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-center" |
|
|
|
|
}, |
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.center", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局", |
|
|
|
|
cls: "layout-bg1", |
|
|
|
|
whiteSpace: "normal" |
|
|
|
|
},{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal", |
|
|
|
|
cls: "layout-bg2", |
|
|
|
|
whiteSpace: "normal" |
|
|
|
|
},{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: "Center 3", |
|
|
|
|
cls: "layout-bg3" |
|
|
|
|
},{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: "Center 4", |
|
|
|
|
cls: "layout-bg5" |
|
|
|
|
}], |
|
|
|
|
hgap: 20, |
|
|
|
|
vgap: 20 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.center_layout", Demo.CenterLayout);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.FloatCenterLayout = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-float-center" |
|
|
|
@ -4848,6 +4848,55 @@ Demo.GridLayout = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.grid", Demo.GridLayout);/** |
|
|
|
|
* Created by User on 2017/3/21. |
|
|
|
|
*/ |
|
|
|
|
Demo.Horizontal = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-horizontal" |
|
|
|
|
}, |
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.vertical", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.horizontal", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.text_button", |
|
|
|
|
cls: "layout-bg1", |
|
|
|
|
text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)", |
|
|
|
|
height: 30 |
|
|
|
|
}, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0 |
|
|
|
|
}], |
|
|
|
|
width: 100, |
|
|
|
|
height: 30 |
|
|
|
|
}, { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.text_button", |
|
|
|
|
cls: "layout-bg2", |
|
|
|
|
text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)", |
|
|
|
|
height: 30 |
|
|
|
|
}, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0 |
|
|
|
|
}], |
|
|
|
|
width: 200, |
|
|
|
|
height: 30 |
|
|
|
|
}] |
|
|
|
|
}], |
|
|
|
|
lgap: 20, |
|
|
|
|
rgap: 80, |
|
|
|
|
tgap: 80, |
|
|
|
|
bgap: 50 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.horizontal", Demo.Horizontal);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.HorizontalAdapt = BI.inherit(BI.Widget, { |
|
|
|
@ -4964,55 +5013,6 @@ Demo.HorizontalFloat = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.horizontal_float", Demo.HorizontalFloat);/** |
|
|
|
|
* Created by User on 2017/3/21. |
|
|
|
|
*/ |
|
|
|
|
Demo.Horizontal = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-horizontal" |
|
|
|
|
}, |
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.vertical", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.horizontal", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.text_button", |
|
|
|
|
cls: "layout-bg1", |
|
|
|
|
text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)", |
|
|
|
|
height: 30 |
|
|
|
|
}, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0 |
|
|
|
|
}], |
|
|
|
|
width: 100, |
|
|
|
|
height: 30 |
|
|
|
|
}, { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.text_button", |
|
|
|
|
cls: "layout-bg2", |
|
|
|
|
text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)", |
|
|
|
|
height: 30 |
|
|
|
|
}, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0 |
|
|
|
|
}], |
|
|
|
|
width: 200, |
|
|
|
|
height: 30 |
|
|
|
|
}] |
|
|
|
|
}], |
|
|
|
|
lgap: 20, |
|
|
|
|
rgap: 80, |
|
|
|
|
tgap: 80, |
|
|
|
|
bgap: 50 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.horizontal", Demo.Horizontal);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.HtapeLayout = BI.inherit(BI.Widget, { |
|
|
|
@ -5358,6 +5358,30 @@ Demo.TdLayout = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.td", Demo.TdLayout);/** |
|
|
|
|
* Created by User on 2017/3/21. |
|
|
|
|
*/ |
|
|
|
|
Demo.VerticalLayout = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-vertical" |
|
|
|
|
}, |
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.vertical", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
cls: "layout-bg1", |
|
|
|
|
text: "这里设置了hgap(水平间距),vgap(垂直间距)", |
|
|
|
|
height: 30 |
|
|
|
|
}, { |
|
|
|
|
type: "bi.label", |
|
|
|
|
cls: "layout-bg2", |
|
|
|
|
text: "这里设置了hgap(水平间距),vgap(垂直间距)", |
|
|
|
|
height: 30 |
|
|
|
|
}] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.vertical", Demo.VerticalLayout);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, { |
|
|
|
@ -5399,30 +5423,6 @@ Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.vertical_adapt", Demo.VerticalAdaptLayout);/** |
|
|
|
|
* Created by User on 2017/3/21. |
|
|
|
|
*/ |
|
|
|
|
Demo.VerticalLayout = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-vertical" |
|
|
|
|
}, |
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.vertical", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.label", |
|
|
|
|
cls: "layout-bg1", |
|
|
|
|
text: "这里设置了hgap(水平间距),vgap(垂直间距)", |
|
|
|
|
height: 30 |
|
|
|
|
}, { |
|
|
|
|
type: "bi.label", |
|
|
|
|
cls: "layout-bg2", |
|
|
|
|
text: "这里设置了hgap(水平间距),vgap(垂直间距)", |
|
|
|
|
height: 30 |
|
|
|
|
}] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.vertical", Demo.VerticalLayout);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.VtapeLayout = BI.inherit(BI.Widget, { |
|
|
|
@ -8445,32 +8445,67 @@ Demo.Slider = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
_init: function () { |
|
|
|
|
Demo.Slider.superclass._init.apply(this, arguments); |
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
|
|
var slider = BI.createWidget({ |
|
|
|
|
type: "bi.slider", |
|
|
|
|
min: 16, |
|
|
|
|
max: 50, |
|
|
|
|
width: 100, |
|
|
|
|
height: 50 |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
slider.setValue("30"); |
|
|
|
|
|
|
|
|
|
slider.on(BI.SliderNormal.EVENT_CHANGE, function () { |
|
|
|
|
console.log(this.getValue()); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var singleSlider = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider", |
|
|
|
|
min: 16, |
|
|
|
|
max: 50 |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
singleSlider.populate(); |
|
|
|
|
|
|
|
|
|
var normalSingleSlider = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider_normal", |
|
|
|
|
min: 16, |
|
|
|
|
max: 50 |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
normalSingleSlider.populate(); |
|
|
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
|
type: "bi.vertical_adapt", |
|
|
|
|
type: "bi.vtape", |
|
|
|
|
element: this, |
|
|
|
|
width: 100, |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.htape", |
|
|
|
|
el: { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: slider |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
height: 200 |
|
|
|
|
}, { |
|
|
|
|
el: { |
|
|
|
|
type: "bi.slider", |
|
|
|
|
min: 16, |
|
|
|
|
max: 50, |
|
|
|
|
ref: function (_ref) { |
|
|
|
|
self.slider = _ref; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}], |
|
|
|
|
height: 30, |
|
|
|
|
width: 100 |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: singleSlider |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
height: 200 |
|
|
|
|
}, { |
|
|
|
|
el: { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: normalSingleSlider |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
height: 200 |
|
|
|
|
}], |
|
|
|
|
hgap: 20 |
|
|
|
|
}); |
|
|
|
|
this.slider.setValue("30"); |
|
|
|
|
|
|
|
|
|
this.slider.on(BI.SliderNormal.EVENT_CHANGE, function () { |
|
|
|
|
console.log(this.getValue()); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.slider", Demo.Slider);/** |
|
|
|
|