home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Direkt: Spezial 1
/
CDD_SPIELE_.ISO
/
wingames
/
pyramid
/
cdialog.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-18
|
2KB
|
71 lines
//-------------------------------------------------------------------
// PROGRAM: CDIALOG.CPP
//
// DESCRIPTION: Multi-purpose dialog
//
// Written by Carlos Yu
//
// NOTE: The program design is kinda hacked because
// this is my first attempt at creating a
// fully functional Windows program using
// OWL and C++.
//
// Any suggestions on making the program better,
// specially the DealCards module which is
// painfully slow, would be greatly appreciated.
//
// Compuserve ID 72672,1567
//-------------------------------------------------------------------
#include "cdialog.h"
void CDialog::SetupWindow()
{
TDialog::SetupWindow();
int dlgHeight,
dlgWidth,
winHeight,
winWidth;
RECT parentWin,
dialogWin;
GetWindowRect(HWindow, &dialogWin);
GetWindowRect(parentHandle, &parentWin);
xPos = parentWin.left;
yPos = parentWin.top;
dlgHeight = (dialogWin.bottom - dialogWin.top) / 2;
dlgWidth = (dialogWin.right - dialogWin.left) / 2;
winHeight = (parentWin.bottom - parentWin.top) / 2;
winWidth = (parentWin.right - parentWin.left) / 2;
//----------------------------
// Center dialog in parent
// window
//----------------------------
SetWindowPos(HWindow, 0, (winWidth - dlgWidth) + xPos,
(winHeight - dlgHeight) + yPos, dlgWidth * 2,
dlgHeight * 2, SWP_NOSIZE);
}
void CDialog::InfoChosen(RTMessage)
{
GetApplication()->ExecDialog(new CDialog(this, INFODIALOG));
}
void CDialog::YesChosen(RTMessage)
{
CloseWindow(1);
}
void CDialog::NoChosen(RTMessage)
{
CloseWindow(0);
}