Author: dmacvicar
Date: Tue Nov 13 14:13:07 2007
New Revision: 42011
URL: http://svn.opensuse.org/viewcvs/yast?rev=42011&view=rev
Log:
label widget, not working yet
Added:
branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.cc
branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.h
Modified:
branches/tmp/sh/mod-ui/web-wt/src/YWebWidgetFactory.cc
Added: branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.cc?rev=42011&view=auto
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.cc (added)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.cc Tue Nov 13 14:13:07 2007
@@ -0,0 +1,63 @@
+
+#include <WString>
+#include <WContainerWidget>
+#include "YWebLabel.h"
+
+using namespace Wt;
+
+YWebLabel::YWebLabel( YWidget * parent,
+ const string & text,
+ bool isHeading,
+ bool isOutputField)
+ : WLabel( (WContainerWidget *) parent->widgetRep() )
+ , YLabel( parent, text, isHeading, isOutputField )
+{
+}
+
+YWebLabel::~YWebLabel()
+{
+}
+
+void YWebLabel::setText( const string & newText )
+{
+ YLabel::setText( newText );
+ WLabel::setText( WString::fromUTF8(newText) );
+}
+
+
+void YWebLabel::setUseBoldFont( bool useBold )
+{
+// setFont( useBold ?
+// YWebUI::ui()->boldFont() :
+// YWebUI::ui()->currentFont() );
+//
+// YLabel::setUseBoldFont( useBold );
+}
+
+
+void YWebLabel::setEnabled( bool enabled )
+{
+ ////QLabel::setEnabled( enabled );
+ YWidget::setEnabled( enabled );
+}
+
+
+int YWebLabel::preferredWidth()
+{
+ //return sizeHint().width();
+ return width().value();
+}
+
+
+int YWebLabel::preferredHeight()
+{
+ //return sizeHint().height();
+ return height().value();
+}
+
+
+void YWebLabel::setSize( int newWidth, int newHeight )
+{
+ //resize(WLength(newWidth), WLength(newHeight) );
+ resize(WLength(), WLength());
+}
Added: branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.h?rev=42011&view=auto
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.h (added)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebLabel.h Tue Nov 13 14:13:07 2007
@@ -0,0 +1,70 @@
+
+#ifndef WebLabel_h
+#define WebLabel_h
+
+#include "YLabel.h"
+
+#include <WLabel>
+
+class YWebLabel : public Wt::WLabel, public YLabel
+{
+public:
+
+ /**
+ * Constructor.
+ **/
+ YWebLabel( YWidget * parent,
+ const string & text,
+ bool isHeading = false,
+ bool isOutputField = false );
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YWebLabel();
+
+ /**
+ * Set the text the widget displays.
+ *
+ * Reimplemented from YLabel.
+ **/
+ virtual void setText( const string & newText );
+
+ /**
+ * Switch bold font on or off.
+ *
+ * Reimplemented from YLabel.
+ **/
+ virtual void setUseBoldFont( bool bold );
+
+ /**
+ * Set enabled / disabled state.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setEnabled( bool enabled );
+
+ /**
+ * 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.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
+};
+
+
+#endif // WebLabel_h
Modified: branches/tmp/sh/mod-ui/web-wt/src/YWebWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/web-wt/src/YWebWidgetFactory.cc?rev=42011&r1=42010&r2=42011&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/web-wt/src/YWebWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/web-wt/src/YWebWidgetFactory.cc Tue Nov 13 14:13:07 2007
@@ -20,7 +20,9 @@
#include
#include "YWebWidgetFactory.h"
+
#include "YWebPushButton.h"
+#include "YWebLabel.h"
#include <string>
@@ -72,17 +74,17 @@
// Dialogs
//
- YDialog * YWebWidgetFactory::createMainDialog() {}
- YDialog * YWebWidgetFactory::createPopupDialog() {}
+ YDialog * YWebWidgetFactory::createMainDialog() { return 0L; }
+ YDialog * YWebWidgetFactory::createPopupDialog() { return 0L; }
//
// Layout Boxes
//
- YLayoutBox * YWebWidgetFactory::createVBox ( YWidget * parent ){}
- YLayoutBox * YWebWidgetFactory::createHBox ( YWidget * parent ){}
- YLayoutBox * YWebWidgetFactory::createLayoutBox ( YWidget * parent, YUIDimension dimension ) {}
- YAlignment * YWebWidgetFactory::createAlignment ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment ) {}
+ YLayoutBox * YWebWidgetFactory::createVBox ( YWidget * parent ){ return 0L; }
+ YLayoutBox * YWebWidgetFactory::createHBox ( YWidget * parent ){ return 0L; }
+ YLayoutBox * YWebWidgetFactory::createLayoutBox ( YWidget * parent, YUIDimension dimension ) { return 0L; }
+ YAlignment * YWebWidgetFactory::createAlignment ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment ) { return 0L; }
//
// Common Leaf Widgets
//
@@ -93,54 +95,59 @@
return new YWebPushButton( parent, label );
}
- YLabel * YWebWidgetFactory::createLabel ( YWidget * parent, const string & text, bool isHeading, bool isOutputField ) {}
- YInputField * YWebWidgetFactory::createInputField ( YWidget * parent, const string & label, bool passwordMode ) {}
- YCheckBox * YWebWidgetFactory::createCheckBox ( YWidget * parent, const string & label, bool isChecked ) {}
- YRadioButton * YWebWidgetFactory::createRadioButton ( YWidget * parent, const string & label, bool isChecked ) {}
- YComboBox * YWebWidgetFactory::createComboBox ( YWidget * parent, const string & label, bool editable ) {}
- YSelectionBox * YWebWidgetFactory::createSelectionBox ( YWidget * parent, const string & label ) {}
- YTree * YWebWidgetFactory::createTree ( YWidget * parent, const string & label ) {}
- YTable * YWebWidgetFactory::createTable ( YWidget * parent, YTableHeader * header ) {}
- YProgressBar * YWebWidgetFactory::createProgressBar ( YWidget * parent, const string & label, int maxValue ) {}
- YRichText * YWebWidgetFactory::createRichText ( YWidget * parent, const string & text, bool plainTextMode ) {}
+YLabel * YWebWidgetFactory::createLabel( YWidget * parent, const string & text, bool isHeading, bool isOutputField )
+{
+ return new YWebLabel(parent, text);
+}
+
+
+ YInputField * YWebWidgetFactory::createInputField ( YWidget * parent, const string & label, bool passwordMode ) { return 0L; }
+ YCheckBox * YWebWidgetFactory::createCheckBox ( YWidget * parent, const string & label, bool isChecked ) { return 0L; }
+ YRadioButton * YWebWidgetFactory::createRadioButton ( YWidget * parent, const string & label, bool isChecked ) { return 0L; }
+ YComboBox * YWebWidgetFactory::createComboBox ( YWidget * parent, const string & label, bool editable ) { return 0L; }
+ YSelectionBox * YWebWidgetFactory::createSelectionBox ( YWidget * parent, const string & label ) { return 0L; }
+ YTree * YWebWidgetFactory::createTree ( YWidget * parent, const string & label ) { return 0L; }
+ YTable * YWebWidgetFactory::createTable ( YWidget * parent, YTableHeader * header ) { return 0L; }
+ YProgressBar * YWebWidgetFactory::createProgressBar ( YWidget * parent, const string & label, int maxValue ) { return 0L; }
+ YRichText * YWebWidgetFactory::createRichText ( YWidget * parent, const string & text, bool plainTextMode ) { return 0L; }
//
// Less Common Leaf Widgets
//
- YIntField * YWebWidgetFactory::createIntField ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal ) {}
+ YIntField * YWebWidgetFactory::createIntField ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal ) { return 0L; }
- YMenuButton * YWebWidgetFactory::createMenuButton ( YWidget * parent, const string & label ) {}
- YMultiLineEdit * YWebWidgetFactory::createMultiLineEdit ( YWidget * parent, const string & label ) {}
- YImage * YWebWidgetFactory::createImage ( YWidget * parent, const string & imageFileName, bool animated ) {}
- YLogView * YWebWidgetFactory::createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines ) {}
- YMultiSelectionBox *YWebWidgetFactory::createMultiSelectionBox ( YWidget * parent, const string & label ) {}
+ YMenuButton * YWebWidgetFactory::createMenuButton ( YWidget * parent, const string & label ) { return 0L; }
+ YMultiLineEdit * YWebWidgetFactory::createMultiLineEdit ( YWidget * parent, const string & label ) { return 0L; }
+ YImage * YWebWidgetFactory::createImage ( YWidget * parent, const string & imageFileName, bool animated ) { return 0L; }
+ YLogView * YWebWidgetFactory::createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines ) { return 0L; }
+ YMultiSelectionBox *YWebWidgetFactory::createMultiSelectionBox ( YWidget * parent, const string & label ) { return 0L; }
- YPackageSelector * YWebWidgetFactory::createPackageSelector( YWidget * parent, long ModeFlags ) {}
- YWidget * YWebWidgetFactory::createPkgSpecial ( YWidget * parent, const string & subwidgetName ) {} // NCurses only
+ YPackageSelector * YWebWidgetFactory::createPackageSelector( YWidget * parent, long ModeFlags ) { return 0L; }
+ YWidget * YWebWidgetFactory::createPkgSpecial ( YWidget * parent, const string & subwidgetName ) { return 0L; } // NCurses only
//
// Layout Helpers
//
- YSpacing * YWebWidgetFactory::createSpacing ( YWidget * parent, YUIDimension dim, bool stretchable, YLayoutSize_t size ) {}
- YEmpty * YWebWidgetFactory::createEmpty ( YWidget * parent ) {}
+ YSpacing * YWebWidgetFactory::createSpacing ( YWidget * parent, YUIDimension dim, bool stretchable, YLayoutSize_t size ) { return 0L; }
+ YEmpty * YWebWidgetFactory::createEmpty ( YWidget * parent ) { return 0L; }
- YSquash * YWebWidgetFactory::createSquash ( YWidget * parent, bool horSquash, bool vertSquash ) {}
+ YSquash * YWebWidgetFactory::createSquash ( YWidget * parent, bool horSquash, bool vertSquash ) { return 0L; }
//
// Visual Grouping
//
- YFrame * YWebWidgetFactory::createFrame ( YWidget * parent, const string & label ) {}
- YCheckBoxFrame * YWebWidgetFactory::createCheckBoxFrame ( YWidget * parent, const string & label, bool checked ) {}
+ YFrame * YWebWidgetFactory::createFrame ( YWidget * parent, const string & label ) { return 0L; }
+ YCheckBoxFrame * YWebWidgetFactory::createCheckBoxFrame ( YWidget * parent, const string & label, bool checked ) { return 0L; }
//
// Logical Grouping
//
- YRadioButtonGroup * YWebWidgetFactory::createRadioButtonGroup ( YWidget * parent ) {}
- YReplacePoint * YWebWidgetFactory::createReplacePoint ( YWidget * parent ) {}
+ YRadioButtonGroup * YWebWidgetFactory::createRadioButtonGroup ( YWidget * parent ) { return 0L; }
+ YReplacePoint * YWebWidgetFactory::createReplacePoint ( YWidget * parent ) { return 0L; }
/**
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org