From d412d9f203c936e7364ae3985f3ba03f6b38ce38 Mon Sep 17 00:00:00 2001 From: visnov Date: Tue, 13 Nov 2007 10:36:28 +0000 Subject: [PATCH] missing files git-svn-id: http://svn.opensuse.org/svn/yast/branches/tmp/sh/mod-ui/web-wt@42000 e0cc52ee-31ee-0310-8b87-e83c4596d67c --- src/YWebPushButton.cc | 57 +++++++++++++++++++++++++++ src/YWebPushButton.h | 84 ++++++++++++++++++++++++++++++++++++++++ src/YWebWidgetFactory.cc | 8 ++-- 3 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 src/YWebPushButton.cc create mode 100644 src/YWebPushButton.h diff --git a/src/YWebPushButton.cc b/src/YWebPushButton.cc new file mode 100644 index 0000000..7b59c2a --- /dev/null +++ b/src/YWebPushButton.cc @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (C) SuSE GmbH | +\----------------------------------------------------------------------/ + + File: YWebPushButton.cc + + Author: Stefan Hundhammer + +/-*/ + + +#define y2log_component "web-ui" +#include + +#include "YWebPushButton.h" + + +using std::string; + + +YWebPushButton::YWebPushButton( YWidget * parent, const string & label ) + : YPushButton( parent, label ) +{ +} + + +YWebPushButton::~YWebPushButton() +{ + // NOP +} + +int YWebPushButton::preferredWidth() +{ + // FIXME + return 1; +} + +int YWebPushButton::preferredHeight() +{ + // FIXME + return 1; +} + + +void YWebPushButton::setSize( int newWidth, int newHeight ) +{ + // FIXME +} + diff --git a/src/YWebPushButton.h b/src/YWebPushButton.h new file mode 100644 index 0000000..4195106 --- /dev/null +++ b/src/YWebPushButton.h @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (C) SuSE GmbH | +\----------------------------------------------------------------------/ + + File: YWebPushButton.h + + Author: Stefan Hundhammer + +/-*/ + +#ifndef YWebPushButton_h +#define YWebPushButton_h + +#include + + +using std::string; + + +class YWebPushButton : public YPushButton +{ +public: + /** + * Constructor. + **/ + YWebPushButton( YWidget * parent, const string & label ); + + /** + * Destructor. + **/ + ~YWebPushButton(); + + /** + * Return a descriptive name of this widget class for logging, + * debugging etc. + **/ + virtual const char * widgetClass() const { return "YWebPushButton"; } + + /** + * Preferred width of the widget. + * + * Reimplemented from YWidget + **/ + virtual int preferredWidth(); + + /** + * Preferred height of the widget. + * + * Reimplemented from YWidget + **/ + virtual int preferredHeight(); + + /** + * Set the new size of the widget. + * + * Layout manager widgets (like YLayoutBox) call this during geometry + * management after all widgets are queried about their preferred widths + * and heights. Depending on layout constraints, widgets might be resized + * beyond or below their preferred size. + * + * The sizes passed here are not meant to affect any future + * preferredWidth() or preferredHeight() calls; they are just the outcome + * of all kinds of compromises (too little screen space or too much) for + * the current geometry management calculation. + * + * Reimplemented from YWidget + **/ + virtual void setSize( int newWidth, int newHeight ); + +}; + + +typedef YWebPushButton YWebIconButton; + + +#endif // YWebPushButton_h diff --git a/src/YWebWidgetFactory.cc b/src/YWebWidgetFactory.cc index 2a4191e..fd3f8e9 100644 --- a/src/YWebWidgetFactory.cc +++ b/src/YWebWidgetFactory.cc @@ -16,13 +16,14 @@ /-*/ +#define y2log_component "web-ui" +#include + #include "YWebWidgetFactory.h" +#include "YWebPushButton.h" #include -#include "YTypes.h" - -#include "YWebPushButton.h" using std::string; @@ -88,6 +89,7 @@ class YTree; YPushButton * YWebWidgetFactory::createPushButton ( YWidget * parent, const string & label ) { + y2milestone( "Creating push button '%s'", label.c_str() ); return new YWebPushButton( parent, label ); } -- 2.39.2