]> icculus.org git repositories - duncan/yast2-web-wt.git/blob - src/YWebPushButton.cc
(no commit message)
[duncan/yast2-web-wt.git] / src / YWebPushButton.cc
1
2 #define y2log_component "web-ui"
3 #include <ycp/y2log.h>
4
5 #include <sys/types.h>
6 #include "YWebPushButton.h"
7
8 #include <WContainerWidget>
9 #include <WPushButton>
10 #include <WApplication>
11
12 using std::string;
13 using namespace Wt;
14 using Wt::Ext::Button;
15
16
17 #include <unistd.h>
18 #include <sys/syscall.h>
19 #include <sys/types.h>
20
21 pid_t gettid()
22 {
23     pid_t tid;
24     tid = syscall(SYS_gettid);
25     return tid;
26 }
27
28
29 // HACK
30 extern WApplication* _wApp;
31
32 YWebPushButton::YWebPushButton( YWidget * parent, const string & label )
33     : YPushButton( parent, label ), Button( label, (WContainerWidget *) parent->widgetRep() )
34 {
35   setWidgetRep( this );
36   if( ! widgetRep() )
37   {
38     y2security( "Using application %p, tid %d",  _wApp, gettid());
39     setWidgetRep( new WPushButton(label,  _wApp->root() ) );
40   }
41   y2milestone( "Pushbutton %s created", label.c_str());
42 }
43
44
45 YWebPushButton::~YWebPushButton()
46 {
47     // NOP
48 }
49
50 int YWebPushButton::preferredWidth()
51 {
52     // FIXME
53     return 1;
54 }
55
56 int YWebPushButton::preferredHeight()
57 {
58     // FIXME
59     return 1;
60 }
61
62
63 void YWebPushButton::setSize( int newWidth, int newHeight )
64 {
65     // FIXME
66 }
67