本文整理汇总了C++中PegRect::Width方法的典型用法代码示例。如果您正苦于以下问题:C++ PegRect::Width方法的具体用法?C++ PegRect::Width怎么用?C++ PegRect::Width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PegRect
的用法示例。
在下文中一共展示了PegRect::Width方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PegScreen
/*--------------------------------------------------------------------------*/
SED1376Screen8::SED1376Screen8(PegRect &Rect) : PegScreen(Rect)
{
mdNumColors = 256;
mwHRes = Rect.Width();
mwVRes = Rect.Height();
mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
UCHAR PEGFAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = CurrentPtr;
CurrentPtr += mwHRes;
}
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
ConfigureController(); // set up controller registers
SetPalette(0, 232, DefPalette256);
#ifdef PEGWIN32
mwWinRectXOffset = 0;
mwWinRectYOffset = 0;
#endif
}
示例2: PegScreen
/*--------------------------------------------------------------------------*/
Dragon4Screen::Dragon4Screen(PegRect &Rect) : PegScreen(Rect)
{
mdNumColors = 16;
mwHRes = Rect.Width();
mwVRes = Rect.Height();
mpScanPointers = new UCHAR *[Rect.Height()];
UCHAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = CurrentPtr;
CurrentPtr += mwHRes >> 1;
}
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
ConfigureController(); // set up controller registers
SetPalette(0, 16, GrayPalette);
}
示例3: PegScreen
/*--------------------------------------------------------------------------*/
SED1355Screen::SED1355Screen(PegRect &Rect, BOOL bDual) : PegScreen(Rect)
{
mdNumColors = 256;
mbDualMode = bDual;
mwHRes = Rect.Width();
mwVRes = Rect.Height();
mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
UCHAR PEGFAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = CurrentPtr;
CurrentPtr += mwHRes;
}
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
ConfigureController(); // set up controller registers
SetPalette(0, 232, DefPalette256);
}
示例4: PegScreen
/*--------------------------------------------------------------------------*/
GenericSvgaScreen::GenericSvgaScreen(PegRect &Rect) : PegScreen(Rect)
{
mdNumColors = 256;
mwHRes = Rect.Width();
mwVRes = Rect.Height();
WORD wPitch = mwHRes;
ConfigureController(); // set up controller registers
SetPalette(0, 232, DefPalette256);
mpScanPointers = new UCHAR *[Rect.Height()];
UCHAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = CurrentPtr;
CurrentPtr += wPitch;
}
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
}
示例5: PegScreen
SED1353Screen::SED1353Screen(HWND hWnd, PegRect &Rect) : PegScreen(Rect)
#else
SED1353Screen::SED1353Screen(PegRect &Rect) : PegScreen(Rect)
#endif
{
mdNumColors = 16;
mwHRes = Rect.Width();
mwVRes = Rect.Height();
mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
UCHAR PEGFAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = CurrentPtr;
CurrentPtr += mwHRes >> 1;
}
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
ConfigureController(); // set up controller registers
#ifdef PEGWIN32
// Some setup stuff for the BitBlitting function:
mHWnd = hWnd;
mhPalette = NULL;
RECT lSize;
::GetClientRect(mHWnd, &lSize);
mwWinRectXOffset = (lSize.right - mwHRes) / 2;
mwWinRectYOffset = (lSize.bottom -mwVRes) / 2;
#endif
SetPalette(0, 16, DefPalette16);
}
/*--------------------------------------------------------------------------*/
// *** This function must be filled in by the developer ***
/*--------------------------------------------------------------------------*/
UCHAR PEGFAR *SED1353Screen::GetVideoAddress(void)
{
#ifdef PEGWIN32
DWORD dSize = mwHRes / 2 * mwVRes;
UCHAR *pMem = new UCHAR[dSize];
return pMem;
#else
return (UCHAR *) VID_MEM_BASE;
#endif
}
示例6: PositionButtons
/*--------------------------------------------------------------------------*/
void PegMenuBar::PositionButtons(void)
{
PegRect Put;
PegRect Current;
Put.wTop = mReal.wTop + 2;
Put.wLeft = mReal.wLeft + 2;
Put.wRight = Put.wLeft;
PegMessage NewMessage;
// I have to figure out where my children go!
PegMenuButton *pButton = (PegMenuButton *) First();
while(pButton)
{
Put.wLeft = Put.wRight + 4;
Current = pButton->GetMinSize(TYPE_MENU_BAR);
Put.wRight = Put.wLeft + Current.Width();
Put.wBottom = Put.wTop + Current.Height() - 1;
NewMessage.wType = PM_SIZE;
NewMessage.Rect = Put;
pButton->Message(NewMessage);
pButton = (PegMenuButton *) pButton->Next();
}
}
示例7: GetMinSize
/*--------------------------------------------------------------------------*/
PegRect PegMenu::GetMinSize(void)
{
PegRect SizeRect;
PegRect CurrentSize;
SizeRect.Set(0, 0, 0, 0);
PegMenuButton *pButton = (PegMenuButton *) First();
while(pButton)
{
CurrentSize = pButton->GetMinSize(TYPE_MENU);
if (CurrentSize.Width() > SizeRect.Width())
{
SizeRect.wRight += CurrentSize.Width() - SizeRect.Width();
}
SizeRect.wBottom += CurrentSize.Height();
pButton = (PegMenuButton *) pButton->Next();
}
SizeRect.wBottom += 6;
SizeRect.wRight += 6;
return SizeRect;
}
示例8: CheckResizeRect
/*--------------------------------------------------------------------------*/
void PegWindow::CheckResizeRect(PegRect &NewSize)
{
if (muMoveMode == PMM_MOVEALL)
{
return;
}
SIGNED iChange = mReal.Width() - NewSize.Width();
SIGNED iMin;
if (Type() == TYPE_WINDOW)
{
iMin = mClient.Width() - 4;
}
else
{
iMin = mReal.Width() - PEG_SCROLL_WIDTH * 5;
}
if (iChange > iMin)
{
switch(muMoveMode)
{
case PMM_MOVELEFT:
case PMM_MOVEUL:
case PMM_MOVELL:
NewSize.wLeft -= iChange - iMin;
break;
default:
NewSize.wRight += iChange - iMin;
}
}
iChange = mReal.Height() - NewSize.Height();
iMin = mClient.Height();
if (iChange > iMin)
{
switch(muMoveMode)
{
case PMM_MOVETOP:
case PMM_MOVEUL:
case PMM_MOVEUR:
NewSize.wTop -= iChange - iMin;
break;
default:
NewSize.wBottom += iChange - iMin;
}
}
}
示例9: PegScreen
/*--------------------------------------------------------------------------*/
Permedia2Screen::Permedia2Screen(PegRect &Rect) : PegScreen(Rect)
{
mdNumColors = 256;
mwHRes = Rect.Width();
mwVRes = Rect.Height();
mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
UCHAR PEGFAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = CurrentPtr;
CurrentPtr += mwHRes;
}
ConfigureController(); // set up controller registers
#ifdef USE_VID_MEM_MANAGER
UCHAR *pStart = CurrentPtr;
#ifdef HARDWARE_CURSOR
pStart += 4 * 1024; // leave 4K for mouse pointer bitmaps
#endif
UCHAR *pEnd = mpVidMemBase;
pEnd += VID_MEM_SIZE - 1;
InitVidMemManager(pStart, pEnd);
#endif
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
SetPalette(0, 232, DefPalette256);
}
示例10: PegScreen
SED1375Screen8::SED1375Screen8(HWND hWnd, PegRect &Rect) : PegScreen(Rect)
#else
SED1375Screen8::SED1375Screen8(PegRect &Rect) : PegScreen(Rect)
#endif
{
mdNumColors = 256;
#ifdef PEGWIN32
mhPalette = NULL;
#endif
mwHRes = Rect.Width();
mwVRes = Rect.Height();
mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
UCHAR PEGFAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = CurrentPtr;
CurrentPtr += mwHRes;
}
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
ConfigureController(); // set up controller registers
#ifdef PEGWIN32
// Some setup stuff for the BitBlitting function:
mHWnd = hWnd;
RECT lSize;
::GetClientRect(mHWnd, &lSize);
mwWinRectXOffset = (lSize.right - mwHRes) / 2;
mwWinRectYOffset = (lSize.bottom -mwVRes) / 2;
mhPalette = NULL;
#endif
SetPalette(0, 232, DefPalette256);
}
/*--------------------------------------------------------------------------*/
// *** This function must be filled in by the developer ***
/*--------------------------------------------------------------------------*/
UCHAR PEGFAR *SED1375Screen8::GetVideoAddress(void)
{
#ifdef PEGWIN32
DWORD dSize = mwHRes * mwVRes;
UCHAR *pMem = new UCHAR[dSize];
return pMem;
#else
// for an example, just allocate a buffer in dynamic memory:
#ifdef DOUBLE_BUFFER
DWORD dSize = mwHRes * mwVRes;
UCHAR PEGFAR *pMem = new UCHAR[dSize];
return pMem;
#else
return((UCHAR PEGFAR *) VID_MEM_BASE);
#endif
#endif
}
示例11: PegScreen
L24Screen::L24Screen(HWND hWnd, PegRect &Rect) : PegScreen(Rect)
#else
L24Screen::L24Screen(PegRect &Rect) : PegScreen(Rect)
#endif
{
mdNumColors = 256;
mwHRes = Rect.Width();
mwVRes = Rect.Height();
mpScanPointers = new COLORVAL PEGFAR *[Rect.Height()];
UCHAR PEGFAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = (COLORVAL *) CurrentPtr;
CurrentPtr += mwHRes * 3;
}
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
ConfigureController(); // set up controller registers
#ifdef PEGWIN32
// Some setup stuff for the BitBlitting function:
mHWnd = hWnd;
RECT lSize;
::GetClientRect(mHWnd, &lSize);
mwWinRectXOffset = (lSize.right - mwHRes) / 2;
mwWinRectYOffset = (lSize.bottom -mwVRes) / 2;
#endif
SetPalette(0, 232, DefPalette256);
}
/*--------------------------------------------------------------------------*/
// *** This function must be filled in by the developer ***
/*--------------------------------------------------------------------------*/
UCHAR PEGFAR *L24Screen::GetVideoAddress(void)
{
#ifdef PEGWIN32
DWORD dSize = mwHRes * mwVRes * 3;
UCHAR *pMem = new UCHAR[dSize];
return pMem;
#else
#ifdef STATIC_FRAME_BUFFER
// just return the address of the static array:
UCHAR PEGFAR *pMem = (UCHAR PEGFAR *) gbVMemory;
#else
#if 0
// for an example, just allocate a buffer in dynamic memory:
DWORD dSize = mwHRes * mwVRes * 3;
UCHAR *pMem = new UCHAR[dSize];
#else
UCHAR *pMem = (UCHAR *) 0x00800000L;
#endif
#endif
return pMem;
#endif
}
示例12: PegScreen
L8Screen::L8Screen(HWND hWnd, PegRect &Rect) : PegScreen(Rect)
#else
L8Screen::L8Screen(PegRect &Rect) : PegScreen(Rect)
#endif
{
mdNumColors = 256;
#ifdef PEGWIN32
mhPalette = NULL;
#endif
mwHRes = Rect.Width();
mwVRes = Rect.Height();
WORD wPitch = mwHRes;
#ifdef PEGWIN32
// Windows bitmaps must be modulo-4 byte in width:
wPitch += 3;
wPitch &= 0xfffc;
#endif
mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
UCHAR PEGFAR *CurrentPtr = GetVideoAddress();
for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
{
mpScanPointers[iLoop] = CurrentPtr;
CurrentPtr += wPitch;
}
mLastPointerPos.x = Rect.Width() / 2;
mLastPointerPos.y = Rect.Height() / 2;
mbPointerHidden = FALSE;
mwDrawNesting = 0;
ConfigureController(); // set up controller registers
#ifdef PEGWIN32
// Some setup stuff for the BitBlitting function:
mHWnd = hWnd;
RECT lSize;
::GetClientRect(mHWnd, &lSize);
mwWinRectXOffset = (lSize.right - mwHRes) / 2;
mwWinRectYOffset = (lSize.bottom -mwVRes) / 2;
mhPalette = NULL;
#endif
SetPalette(0, 232, DefPalette256);
}
/*--------------------------------------------------------------------------*/
// *** This function must be filled in by the developer ***
/*--------------------------------------------------------------------------*/
UCHAR PEGFAR *L8Screen::GetVideoAddress(void)
{
UCHAR PEGFAR *pMem;
#ifdef PEGWIN32
DWORD dSize = mwHRes;
dSize += 3;
dSize &= 0xfffffffc;
dSize *= mwVRes;
pMem = new UCHAR[dSize];
#else
#ifdef STATIC_FRAME_BUFFER
// simply return the address of the static array:
pMem = (UCHAR PEGFAR *) gbVMemory;
#else
// For an example, allocate a buffer in dynamic memory. This
// would normally be an address specific to your hardware.
DWORD dSize = mwHRes * mwVRes;
#ifdef DOUBLE_BUFFER
dSize *= 2;
#endif
pMem = new UCHAR[dSize];
#endif
#ifdef DOUBLE_BUFFER
pMem += (DWORD) mwHRes * (DWORD) mwVRes;
#endif
#endif
return pMem;
}