home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
volume_3.zip
/
WIN_IT.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-02
|
3KB
|
121 lines
#include <CONIO.H>
#include <STDIO.H>
#include <STDLIB.H>
#include <ALLOC.H>
#include <GRAPHICS.H>
#include <DOS.H>
#include <IOSTREAM.H>
#ifndef __MOUSE_H
#include "C:\TC\mouse.h"
#endif
#ifndef __GRAPHVGA_H
#include "C:\TC\graphvga.h"
#endif
//Constructor
Windw::Windw(int U_X,int U_Y,int L_X,int H_Y,int bor,int buf)
{
Upper_Left_X = U_X;
Upper_Left_Y = U_Y;
Length_X = L_X;
Height_Y = H_Y;
border = bor;
buffered = buf;
buffer = NULL;
}
int Windw::RemoveWindows(void)
{
if(buffer != NULL)
{
Hide_Mouse();
putimage(Upper_Left_X,Upper_Left_Y,buffer,COPY_PUT);
free(buffer);
Display_Mouse();
}
return TRUE;
}
int Windw::Store_BackGround(void)
{
int size;
Hide_Mouse();
// Save Windows screen area, if requested.
if (buffered)
{
if ((size = imagesize(Upper_Left_X, Upper_Left_Y, Upper_Left_X + Length_X, Upper_Left_Y + Height_Y)) < 0)
{
printf("Image too large to store.");
free(buffer);
Display_Mouse();
return FALSE;
}
else
{
if ((buffer = (int *)malloc(size)) == NULL)
{
printf("Not enough memory.");
free(buffer);
Display_Mouse();
return FALSE;
}
else
getimage(Upper_Left_X, Upper_Left_Y, Upper_Left_X+Length_X, Upper_Left_Y+Height_Y, buffer);
}
}
Display_Mouse();
return TRUE;
}
void Windw::DrawWindows (void)
{
Hide_Mouse();
//Draw basic 3D Windows.
setcolor(WHITE);
moveto(Upper_Left_X+Length_X, Upper_Left_Y);
lineto(Upper_Left_X, Upper_Left_Y);
lineto(Upper_Left_X, Upper_Left_Y+Height_Y);
moveto(Upper_Left_X+Length_X-1, Upper_Left_Y+1);
lineto(Upper_Left_X+1, Upper_Left_Y+1);
lineto(Upper_Left_X+1, Upper_Left_Y+Height_Y-1);
setcolor(DARKGRAY);
moveto(Upper_Left_X+1, Upper_Left_Y+Height_Y);
lineto(Upper_Left_X+Length_X, Upper_Left_Y+Height_Y);
lineto(Upper_Left_X+Length_X, Upper_Left_Y);
moveto(Upper_Left_X+2, Upper_Left_Y+Height_Y-1);
lineto(Upper_Left_X+Length_X-1, Upper_Left_Y+Height_Y-1);
lineto(Upper_Left_X+Length_X-1, Upper_Left_Y+1);
setfillstyle(SOLID_FILL, LIGHTGRAY);
bar(Upper_Left_X+2, Upper_Left_Y+2, Upper_Left_X+Length_X-2, Upper_Left_Y+Height_Y-2);
//Draw border, if requested.
if (border) {
setcolor(DARKGRAY);
moveto(Upper_Left_X+Length_X-10, Upper_Left_Y+10);
lineto(Upper_Left_X+10, Upper_Left_Y+10);
lineto(Upper_Left_X+10, Upper_Left_Y+Height_Y-10);
setcolor(WHITE);
lineto(Upper_Left_X+Length_X-10, Upper_Left_Y+Height_Y-10);
lineto(Upper_Left_X+Length_X-10, Upper_Left_Y+10);
}
Display_Mouse();
}