]> icculus.org git repositories - duncan/yast2-web-wt.git/blob - src/YWebLabel.cc
examples
[duncan/yast2-web-wt.git] / src / YWebLabel.cc
1
2 #include <WString>
3 #include <WContainerWidget>
4 #include "YWebLabel.h"
5
6 using namespace Wt;
7
8 YWebLabel::YWebLabel( YWidget *    parent,
9                     const string & text,
10                     bool     isHeading,
11                     bool     isOutputField)
12   : WLabel( (WContainerWidget *) parent->widgetRep() )
13   , YLabel( parent, text, isHeading, isOutputField )
14 {
15 }
16
17 YWebLabel::~YWebLabel()
18 {
19 }
20
21 void YWebLabel::setText( const string & newText )
22 {
23     YLabel::setText( newText );
24     WLabel::setText( WString::fromUTF8(newText) );
25 }
26
27
28 void YWebLabel::setUseBoldFont( bool useBold )
29 {
30 //     setFont( useBold ?
31 //        YWebUI::ui()->boldFont() :
32 //        YWebUI::ui()->currentFont() );
33 //     
34 //     YLabel::setUseBoldFont( useBold );
35 }
36
37
38 void YWebLabel::setEnabled( bool enabled )
39 {
40     ////QLabel::setEnabled( enabled );
41     YWidget::setEnabled( enabled );
42 }
43
44
45 int YWebLabel::preferredWidth()
46 {
47     //return sizeHint().width();
48     return width().value();
49 }
50
51
52 int YWebLabel::preferredHeight()
53 {
54     //return sizeHint().height();
55     return height().value();
56 }
57
58
59 void YWebLabel::setSize( int newWidth, int newHeight )
60 {
61   //resize(WLength(newWidth), WLength(newHeight) );
62   resize(WLength(), WLength());
63 }