⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (1005 Bytes)
Bug #1803
» png-drawRect.cpp
Example. Comment out setPen to reproduce the bug. -
Boris Nagaev
, 04/01/2013 02:45 PM
#include
<Wt/WGlobal>
#include
<Wt/WApplication>
#include
<Wt/WPaintedWidget>
#include
<Wt/WPainter>
using
namespace
Wt
;
class
SomePaintedWidget
:
public
WPaintedWidget
{
public:
SomePaintedWidget
(
WContainerWidget
*
p
=
0
)
:
WPaintedWidget
(
p
)
{
resize
(
600
,
600
);
setPreferredMethod
(
WPaintedWidget
::
PngImage
);
}
protected:
void
paintEvent
(
Wt
::
WPaintDevice
*
device
)
{
WPainter
painter
(
device
);
// comment out this to reproduce bug
WPen
pen
=
painter
.
pen
();
pen
.
setWidth
(
10
);
painter
.
setPen
(
pen
);
//
painter
.
drawRect
(
10
,
10
,
400
,
200
);
}
};
class
MyApp
:
public
WApplication
{
public:
MyApp
(
const
WEnvironment
&
env
)
:
WApplication
(
env
)
{
SomePaintedWidget
*
spw
=
new
SomePaintedWidget
(
root
());
}
};
WApplication
*
createApplication
(
const
WEnvironment
&
env
)
{
return
new
MyApp
(
env
);
}
int
main
(
int
argc
,
char
**
argv
)
{
return
WRun
(
argc
,
argv
,
&
createApplication
);
}
« Previous
1
2
Next »
(1-1/2)
Loading...