home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
vos2-121.zip
/
v
/
contrib
/
pstest.tar
/
testcnv.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-08-28
|
3KB
|
120 lines
//=======================================================================
//@V@:Note: This file generated by vgen V1.00 (14:12:12 23 Aug 1996).
// testcnv.cpp: Source for testCanvasPane class
//=======================================================================
#include "testcnv.h"
#include <v/vfont.h>
#include <v/vdc.h>
#include <v/vcolor.h>
#include <v/vbrush.h>
//===================>>> testCanvasPane::testCanvasPane <<<====================
testCanvasPane::testCanvasPane()
{
}
//===================>>> testCanvasPane::~testCanvasPane <<<====================
testCanvasPane::~testCanvasPane()
{
}
//======================>>> testCanvasPane::HPage <<<========================
void testCanvasPane::HPage(int shown, int top)
{
vCanvasPane::HPage(shown, top);
}
//======================>>> testCanvasPane::VPage <<<========================
void testCanvasPane::VPage(int shown, int top)
{
vCanvasPane::VPage(shown, top);
}
//=======================>>> testCanvasPane::HScroll <<<======================
void testCanvasPane::HScroll(int step)
{
vCanvasPane::HScroll(step);
}
//======================>>> testCanvasPane::VScroll <<<======================
void testCanvasPane::VScroll(int step)
{
vCanvasPane::VScroll(step);
}
//======================>>> testCanvasPane::MouseDown <<<======================
void testCanvasPane::MouseDown(int X, int Y, int button)
{
vCanvasPane::MouseDown(X,Y,button);
}
//========================>>> testCanvasPane::MouseUp <<<======================
void testCanvasPane::MouseUp(int X, int Y, int button)
{
vCanvasPane::MouseUp(X,Y,button);
}
//======================>>> testCanvasPane::MouseMove <<<======================
void testCanvasPane::MouseMove(int x, int y, int button)
{
vCanvasPane::MouseMove(x,y,button);
}
//=========================>>> testCanvasPane::Redraw <<<======================
void testCanvasPane::Redraw(int x, int y, int w, int h)
{
draw (GetDC());
}
//======================>>> testCanvasPane::Resize <<<======================
void testCanvasPane::Resize(int w, int h)
{
vCanvasPane::Resize(w,h);
}
void testCanvasPane::draw(vDC* dc)
{
vBrush brush;
vPen pen;
int x = 0;
int y = 0;
int w = GetWidth();
int h = GetHeight();
dc->SetPen(pen);
brush.SetColor (vStdColors[vC_Red]);
dc->SetBrush (brush);
dc->DrawRectangle(x, y, w/2, h/2);
brush.SetColor (vStdColors[vC_Blue]);
dc->SetBrush (brush);
dc->DrawRectangle(x+w/2, y, w/2, h/2);
brush.SetColor (vStdColors[vC_Green]);
dc->SetBrush (brush);
dc->DrawRectangle(x, y+h/2, w/2, h/2);
brush.SetColor (vStdColors[vC_Yellow]);
dc->SetBrush (brush);
dc->DrawRectangle(x+w/2, y+h/2, w/2, h/2);
vFont font (vfSansSerif, 24, vfNormal, vfBold, 0);
dc->SetFont (font);
int ascend, descend, height;
height = dc->TextHeight (ascend, descend);
int width = dc->TextWidth ("Hello");
dc->DrawAttrText (x+w/2-width/2, y+h/2+height/2, "Hello",
ChReverse);
pen.SetStyle(vTransparent);
dc->SetPen(pen);
dc->DrawAttrText (x+w/2-width/2, y+h/2+height/2+height, "World",
ChNormal);
}