Kent Olsson schrieb:
As no one even reacted, I send it again....

I have attached a suggested class called QxStatusBar, which has been
attached. Additionally, I have broken out the status bar in QxWindow.
This has been done to be able to manipulate the object in a regular and
logical way. I attached all changes. I let the QxCommonViewPane be the
superclass. Is that the best choice?

I hope someone likes it. Could it be committed to the cvs?

Hi Ken,

thank you for your patch. Good idea but with some problems in it:

* A statusbar should IMHO directly inherits from QxHorizontalBoxLayout. I have no idea why you came up with the idea to use QxCommonViewPane.

* This would also reduce your code from the additional horizontalBoxLayout which you, just to mention it, have created in the from place: "applyInitialStyle" is to apply initial styles, like the name says - not for creating additional sub-widgets. These should be created inside the constructor whereever possible.

* Other things like the disposer integration looks good.

By the way, I am not sure if this statusbar has some real effort. I would like it better to create a more complex one. Like the ones in typical applications, which consists of multiple text blocks and divider between them.

Regards,

Sebastian



Kent

Here comes the code...

QxStatusBar.js
--------------
/* ****************************************************************************

   qooxdoo - the new era of web interface development

   Version:
     $Id: QxStatusBar.js,v 1.1.2.2 2005/11/22 23:50:35 kols Exp $

   Copyright:
     (C) 2004-2005 by Schlund + Partner AG, Germany
         All rights reserved

   License:
     LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/

   Internet:
     * http://qooxdoo.oss.schlund.de

   Authors:
     * Kent Olsson (kols)
       <kent dot olsson at chello dot se>

**************************************************************************** */

/* ****************************************************************************

#package(statusbar)

**************************************************************************** */

function QxStatusBar(statustext) {
  QxCommonViewPane.call(this);

  if (statustext.isValidString()) {
    var statusL = this._statusText = new QxLabel(statustext);

    statusL.setPadding(1, 4);
    statusL.setSelectable(false);
    statusL.setCursor(QxConst.CORE_DEFAULT);

    layout.add(statusL);
  };
};

QxStatusBar.extend(QxCommonViewPane, "QxStatusBar");



/*
------------------------------------------------------------------------------------
  STYLES & BEHAVIOR
------------------------------------------------------------------------------------
*/

proto._applyInitialStyle = function(statustext)
{
  this.setBorder(1, QxConst.BORDER_STYLE_INSET, "windowtext");
  this.setBackgroundColor("threedface");

  var layout = new QxHorizontalBoxLayout;
  this.add(layout);
};

/*
------------------------------------------------------------------------------------
  UTILITIES
------------------------------------------------------------------------------------
*/

proto.getStatusText = function() {
  return this._statusText;
};

/*
------------------------------------------------------------------------------------
  DISPOSER
------------------------------------------------------------------------------------
*/

proto.dispose = function()
{
  if (this._statusText)
  {
    this._statusText.dispose();
    this._statusText = null;
  };
};

-------------------
Changed QxWindow.js
-------------------
the section where it is created:

  // ***********************************************************************
  //   STATUSBAR
  // ***********************************************************************

  this._statusBar = new QxStatusBar("Ready");

another change...

proto._modifyStatus = function(propValue, propOldValue, propData)
{
  this._statusBar.getStatusText().setHtml(propValue);

  return true;
};

removed the following in the dispose() method...

  if (this._statusText)
  {
    this._statusText.dispose();
    this._statusText = null;
  };





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to