Update of /cvsroot/qooxdoo/qooxdoo/source/script/widgets
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19026/source/script/widgets
Modified Files:
Tag: renderer
QxCommonViewButton.js QxListViewHeader.js
QxListViewHeaderCell.js QxListViewPane.js QxMenuCheckBox.js
QxSpinner.js QxTree.js QxTreeElement.js QxWindow.js
Log Message:
Reimplemented QxSpinner using appearance and box layouts, optimized state handling in many classes (use constants, instead of deep object access)
Index: QxListViewHeader.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/Attic/QxListViewHeader.js,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -C2 -d -r1.1.2.14 -r1.1.2.15
*** QxListViewHeader.js 13 Jan 2006 10:50:26 -0000 1.1.2.14
--- QxListViewHeader.js 16 Jan 2006 15:17:02 -0000 1.1.2.15
***************
*** 240,244 ****
// Remove hover effect
! this._resizeTarget.setMouseState(QxWidget.states.mouse[0]);
// Hide resize line
--- 240,244 ----
// Remove hover effect
! this._resizeTarget.setMouseState(QxConst.STATE_OUT);
// Hide resize line
Index: QxListViewPane.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/Attic/QxListViewPane.js,v
retrieving revision 1.1.2.32
retrieving revision 1.1.2.33
diff -C2 -d -r1.1.2.32 -r1.1.2.33
*** QxListViewPane.js 13 Jan 2006 10:50:26 -0000 1.1.2.32
--- QxListViewPane.js 16 Jan 2006 15:17:02 -0000 1.1.2.33
***************
*** 228,232 ****
if (vChild)
{
! vChild.setSelectedState(QxWidget.states.selected[vEntry && vEntry._selected ? 1 : 0]);
vChild.set(vEntry ? vEntry[vCol] : vColumns[vCol].empty || vColumns[vCol].contentClass.empty);
};
--- 228,232 ----
if (vChild)
{
! vChild.setSelectedState(vEntry && vEntry._selected ? QxConst.STATE_SELECTED : QxConst.STATE_NOTSELECTED);
vChild.set(vEntry ? vEntry[vCol] : vColumns[vCol].empty || vColumns[vCol].contentClass.empty);
};
Index: QxSpinner.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/QxSpinner.js,v
retrieving revision 1.9.2.23
retrieving revision 1.9.2.24
diff -C2 -d -r1.9.2.23 -r1.9.2.24
*** QxSpinner.js 19 Dec 2005 12:34:59 -0000 1.9.2.23
--- QxSpinner.js 16 Jan 2006 15:17:02 -0000 1.9.2.24
***************
*** 36,50 ****
function QxSpinner(vMin, vValue, vMax)
{
! QxCanvasLayout.call(this);
! this.setWidth(60);
! this.setHeight(22);
! this.setBorder(QxBorderObject.presets.inset);
this.setTabIndex(-1);
- this.setBackgroundColor("white");
// ***********************************************************************
! // RANGE MANAGER
// ***********************************************************************
this._manager = new QxRangeManager();
--- 36,49 ----
function QxSpinner(vMin, vValue, vMax)
{
! QxHorizontalBoxLayout.call(this);
! // ***********************************************************************
! // BEHAVIOR
! // ***********************************************************************
this.setTabIndex(-1);
// ***********************************************************************
! // MANAGER
// ***********************************************************************
this._manager = new QxRangeManager();
***************
*** 55,61 ****
// ***********************************************************************
this._textfield = new QxTextField;
! this._textfield.set({ left: 0, right: 16, bottom: 0, top: 0, value : String(this._manager.getValue()), border : QxBorder.presets.none });
this.add(this._textfield);
--- 54,69 ----
// ***********************************************************************
this._textfield = new QxTextField;
! this._textfield.setAppearance("spinner-field");
! this._textfield.setValue(String(this._manager.getValue()));
this.add(this._textfield);
+
+
+ // ***********************************************************************
+ // BUTTON LAYOUT
+ // ***********************************************************************
+ this._buttonlayout = new QxVerticalBoxLayout;
+ this._buttonlayout.setWidth(QxConst.CORE_AUTO);
+ this.add(this._buttonlayout);
***************
*** 64,71 ****
// ***********************************************************************
this._upbutton = new QxImage("widgets/arrows/up_small.gif");
! this._upbutton.set({ top : 0, height: 9, width: 16, right : 0, border: QxBorderObject.presets.outset, paddingLeft : 3, backgroundColor: new QxColorObject("threedface") });
!
! this.add(this._upbutton);
! this._upbuttonimage = this._upbutton;
--- 72,77 ----
// ***********************************************************************
this._upbutton = new QxImage("widgets/arrows/up_small.gif");
! this._upbutton.setAppearance("spinner-button-up");
! this._buttonlayout.add(this._upbutton);
***************
*** 74,81 ****
// ***********************************************************************
this._downbutton = new QxImage("widgets/arrows/down_small.gif");
! this._downbutton.set({ bottom : 0, height: 9, width: 16, right : 0, border: QxBorderObject.presets.outset, paddingLeft : 3, paddingTop: 1, backgroundColor: new QxColorObject("threedface") });
!
! this.add(this._downbutton);
! this._downbuttonimage = this._downbutton;
--- 80,85 ----
// ***********************************************************************
this._downbutton = new QxImage("widgets/arrows/down_small.gif");
! this._downbutton.setAppearance("spinner-button-down");
! this._buttonlayout.add(this._downbutton);
***************
*** 118,122 ****
};
! QxSpinner.extend(QxCanvasLayout, "QxSpinner");
--- 122,126 ----
};
! QxSpinner.extend(QxHorizontalBoxLayout, "QxSpinner");
***************
*** 128,131 ****
--- 132,137 ----
*/
+ QxSpinner.changeProperty({ name : "appearance", type : QxConst.TYPEOF_STRING, defaultValue : "spinner" });
+
/*!
The amount to increment on each event (keypress or mousedown).
***************
*** 320,324 ****
var vButton = e.getCurrentTarget();
! vButton.setBorder(QxBorderObject.presets.inset);
vButton.addEventListener(QxConst.EVENT_TYPE_MOUSEUP, this._onmouseup, this);
--- 326,330 ----
var vButton = e.getCurrentTarget();
! vButton.setButtonState(QxConst.STATE_PRESSED);
vButton.addEventListener(QxConst.EVENT_TYPE_MOUSEUP, this._onmouseup, this);
***************
*** 339,343 ****
var vButton = e.getCurrentTarget();
! vButton.setBorder(QxBorderObject.presets.outset);
vButton.removeEventListener(QxConst.EVENT_TYPE_MOUSEUP, this._onmouseup, this);
--- 345,349 ----
var vButton = e.getCurrentTarget();
! vButton.setButtonState(QxConst.STATE_NOTPRESSED);
vButton.removeEventListener(QxConst.EVENT_TYPE_MOUSEUP, this._onmouseup, this);
***************
*** 378,384 ****
if (vValue == this.getMin())
{
! this._downbutton.setBorder(QxBorderObject.presets.outset);
this._downbutton.setEnabled(false);
- this._downbuttonimage.setEnabled(false);
this._timer.stop();
}
--- 384,389 ----
if (vValue == this.getMin())
{
! this._downbutton.setButtonState(QxConst.STATE_NOTPRESSED);
this._downbutton.setEnabled(false);
this._timer.stop();
}
***************
*** 386,397 ****
{
this._downbutton.setEnabled(true);
- this._downbuttonimage.setEnabled(true);
};
if (vValue == this.getMax())
{
! this._upbutton.setBorder(QxBorderObject.presets.outset);
this._upbutton.setEnabled(false);
- this._upbuttonimage.setEnabled(false);
this._timer.stop();
}
--- 391,400 ----
{
this._downbutton.setEnabled(true);
};
if (vValue == this.getMax())
{
! this._upbutton.setButtonState(QxConst.STATE_NOTPRESSED);
this._upbutton.setEnabled(false);
this._timer.stop();
}
***************
*** 399,403 ****
{
this._upbutton.setEnabled(true);
- this._upbuttonimage.setEnabled(true);
};
--- 402,405 ----
***************
*** 673,676 ****
};
! return QxCanvasLayout.prototype.dispose.call(this);
};
\ No newline at end of file
--- 675,678 ----
};
! return QxHorizontalBoxLayout.prototype.dispose.call(this);
};
\ No newline at end of file
Index: QxTree.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/QxTree.js,v
retrieving revision 1.2.2.32
retrieving revision 1.2.2.33
diff -C2 -d -r1.2.2.32 -r1.2.2.33
*** QxTree.js 13 Jan 2006 10:50:26 -0000 1.2.2.32
--- QxTree.js 16 Jan 2006 15:17:02 -0000 1.2.2.33
***************
*** 321,330 ****
if (this._fastUpdate)
{
- var vStates = QxWidget.states.selected;
var vOldItem = this._oldItem;
var vNewItem = this.getManager().getSelectedItem();
! //vOldItem.getIconObject().setSelectedState(vStates[0]);
! vNewItem.getIconObject().setSelectedState(vStates[1]);
delete this._fastUpdate;
--- 321,328 ----
if (this._fastUpdate)
{
var vOldItem = this._oldItem;
var vNewItem = this.getManager().getSelectedItem();
! vNewItem.getIconObject().setSelectedState(QxConst.STATE_SELECTED);
delete this._fastUpdate;
Index: QxTreeElement.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/QxTreeElement.js,v
retrieving revision 1.3.2.44
retrieving revision 1.3.2.45
diff -C2 -d -r1.3.2.44 -r1.3.2.45
*** QxTreeElement.js 13 Jan 2006 10:50:26 -0000 1.3.2.44
--- QxTreeElement.js 16 Jan 2006 15:17:02 -0000 1.3.2.45
***************
*** 123,127 ****
proto._modifySelected = function(propValue, propOldValue, propData)
{
! var vState = QxWidget.states.selected[propValue ? 1 : 0];
this.setSelectedState(vState);
--- 123,127 ----
proto._modifySelected = function(propValue, propOldValue, propData)
{
! var vState = propValue ? QxConst.STATE_SELECTED : QxConst.NOT_SELECTED;
this.setSelectedState(vState);
Index: QxWindow.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/QxWindow.js,v
retrieving revision 1.25.2.60
retrieving revision 1.25.2.61
diff -C2 -d -r1.25.2.60 -r1.25.2.61
*** QxWindow.js 13 Jan 2006 10:50:26 -0000 1.25.2.60
--- QxWindow.js 16 Jan 2006 15:17:02 -0000 1.25.2.61
***************
*** 736,740 ****
// update state
! this.setWindowState(QxWidget.states.window[0]);
// toggle button
--- 736,740 ----
// update state
! this.setWindowState(QxConst.STATE_RESTORED);
// toggle button
***************
*** 777,781 ****
// update state
! this.setWindowState(QxWidget.states.window[1]);
// toggle button
--- 777,781 ----
// update state
! this.setWindowState(QxConst.STATE_MAXIMIZED);
// toggle button
Index: QxMenuCheckBox.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/QxMenuCheckBox.js,v
retrieving revision 1.7.2.15
retrieving revision 1.7.2.16
diff -C2 -d -r1.7.2.15 -r1.7.2.16
*** QxMenuCheckBox.js 13 Jan 2006 10:50:26 -0000 1.7.2.15
--- QxMenuCheckBox.js 16 Jan 2006 15:17:02 -0000 1.7.2.16
***************
*** 71,75 ****
proto._modifyChecked = function(propValue, propOldValue, propData)
{
! var vState = QxWidget.states.checked[propValue ? 1 : 0];
this.setCheckedState(vState);
--- 71,75 ----
proto._modifyChecked = function(propValue, propOldValue, propData)
{
! var vState = propValue ? QxConst.STATE_CHECKED : QxConst.STATE_NOTCHECKED;
this.setCheckedState(vState);
Index: QxCommonViewButton.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/Attic/QxCommonViewButton.js,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** QxCommonViewButton.js 13 Jan 2006 10:50:26 -0000 1.1.2.3
--- QxCommonViewButton.js 16 Jan 2006 15:17:02 -0000 1.1.2.4
***************
*** 159,163 ****
};
! this.setCheckedState(QxWidget.states.checked[propValue ? 1 : 0]);
var vPage = this.getPage();
--- 159,163 ----
};
! this.setCheckedState(propValue ? QxConst.STATE_CHECKED : QxConst.STATE_NOTCHECKED);
var vPage = this.getPage();
Index: QxListViewHeaderCell.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/widgets/Attic/QxListViewHeaderCell.js,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -C2 -d -r1.1.2.15 -r1.1.2.16
*** QxListViewHeaderCell.js 13 Jan 2006 10:50:26 -0000 1.1.2.15
--- QxListViewHeaderCell.js 16 Jan 2006 15:17:02 -0000 1.1.2.16
***************
*** 199,207 ****
proto._onmouseover = function(e) {
! this.setMouseState(QxWidget.states.mouse[1]);
};
proto._onmouseout = function(e) {
! this.setMouseState(QxWidget.states.mouse[0]);
};
--- 199,207 ----
proto._onmouseover = function(e) {
! this.setMouseState(QxConst.STATE_OVER);
};
proto._onmouseout = function(e) {
! this.setMouseState(QxConst.STATE_OUT);
};
|