summaryrefslogtreecommitdiffstats
path: root/kugar/lib/mpagedisplay.cpp
blob: 4f4b1869ca93411a5103abdbe4dcae96766b9c34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/***************************************************************************
             mpagedisplay.cpp  -  Kugar page display widget
             -------------------
   begin     : Sun Aug 15 1999
   copyright : (C) 1999 by Mutiny Bay Software
   email     : info@mutinybaysoftware.com
***************************************************************************/

#include "mpagedisplay.h"

namespace Kugar
{

/** Constructor */
MPageDisplay::MPageDisplay( TQWidget *parent, const char *name ) : TQWidget( parent, name )
{
    buffer.resize( 1, 1 );
}

/** Destructor */
MPageDisplay::~MPageDisplay()
{}

/** Sets the report page image */
void MPageDisplay::setPage( TQPicture* image )
{
    buffer.fill( white );
    TQPainter p( &buffer );
    image->play( &p );
}

/** Display object's paint event */
void MPageDisplay::paintEvent( TQPaintEvent* event )
{
    bitBlt( this, 0, 0, &buffer );
}

/** Sets the page display dimensions */
void MPageDisplay::setPageDimensions( TQSize size )
{
    buffer.resize( size );
    resize( size );
}


// Return the preferred size of the display.

TQSize MPageDisplay::sizeHint() const
{
    return buffer.size();
}


// Return the size policy.

TQSizePolicy MPageDisplay::sizePolicy() const
{
    return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
}

}

#include "mpagedisplay.moc"