本文整理汇总了C++中PegRect类的典型用法代码示例。如果您正苦于以下问题:C++ PegRect类的具体用法?C++ PegRect怎么用?C++ PegRect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PegRect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
}
示例2:
/*--------------------------------------------------------------------------*/
PegScreen *CreatePegScreen(void)
{
PegRect Rect;
Rect.Set(0, 0, PEG_VIRTUAL_XSIZE - 1, PEG_VIRTUAL_YSIZE - 1);
PegScreen *pScreen = new Permedia2Screen(Rect);
return pScreen;
}
示例3:
PegScreen *CreatePegScreen(CELTHPEG_InitParams_t celInitParam)
{
PegRect Rect;
Rect.Set(0, 0, PEG_VIRTUAL_XSIZE - 1, PEG_VIRTUAL_YSIZE - 1);
PegScreen *pScreen = new L8BrcmScreen(Rect,celInitParam);
return pScreen;
}
示例4: defaultToolBarRect
PegRect MyMainFrame::defaultToolBarRect()
{
PegRect r = { 0,0,159,16 };
if(m_titleBar) { r.MoveTo(0,m_titleBar->mReal.wBottom+1); }
if(m_menuBar) { r.MoveTo(0,m_menuBar->mReal.wBottom+1); }
return r;
}
示例5:
PegScreen *CreatePegScreen(void)
{
PegRect Rect;
Rect.Set(0, 0, PEG_VIRTUAL_XSIZE - 1, PEG_VIRTUAL_YSIZE - 1);
PegScreen *pScreen = new SED1375Screen8(Rect);
return pScreen;
}
示例6: PegDecoratedWindow
/*--------------------------------------------------------------------------*/
LightWindow::LightWindow(const PegRect& Rect) :
PegDecoratedWindow(Rect)
{
Add(new PegTitle("PegBitmapLight Demo Window"));
muColors[PCI_NORMAL] = GREEN;
mpLight1 = new PegBitmapLight(mClient.wLeft + 20, mClient.wTop + 20, 3);
mpLight1->SetStateBitmap(2, &gbredltBitmap);
mpLight1->SetStateBitmap(1, &gbyellowltBitmap);
mpLight1->SetStateBitmap(0, &gbgreenltBitmap);
Add(mpLight1);
PegRect tRect;
tRect.Set(mClient.wLeft + 200, mClient.wTop + 40,
mClient.wLeft + 300, mClient.wTop + 80);
mpStart = new PegTextButton(tRect, "Start the Light", IDB_START);
Add(mpStart);
tRect.Shift(0, 50);
mpStop = new PegTextButton(tRect, "Stop the Light", IDB_STOP);
Add(mpStop);
}
示例7: PegAppInitialize
/*--------------------------------------------------------------------------*/
void PegAppInitialize(PegPresentationManager *pPresent)
{
PegRect WinRect;
WinRect.Set(0, 0, 400, 300);
TabWindow *pTab = new TabWindow(WinRect);
// pPresent->Center(pTab);
pPresent->Add(pTab);
}
示例8: placeInClient
void MyMainFrame::placeInClient(MyWindow* win, int x, int y, bool redrawClient)
{
PegRect r = win->mReal;
r.MoveTo(m_client->mClient.wLeft + x, m_client->mClient.wTop + y);
win->Resize(r);
win->setPosCorrected(true);
if(redrawClient) m_client->Redraw();
}
示例9: PegAppInitialize
/*--------------------------------------------------------------------------*/
void PegAppInitialize(PegPresentationManager* pPresentation)
{
PegRect Rect;
Rect.Set(20, 20, 400, 240);
LightWindow* pWindow = new LightWindow(Rect);
pPresentation->Add(pWindow);
}
示例10: Draw
/*--------------------------------------------------------------------------*/
void PegBitmapWindow::Draw()
{
PegPoint tPutBitmap;
PegRect CaptureRect;
if (!mbCaptured)
{
// Capture the four bitmaps on my corners
CaptureRect.wLeft = mReal.wLeft;
CaptureRect.wTop = mReal.wTop;
CaptureRect.wRight = CaptureRect.wLeft + CORNER_RADIUS;
CaptureRect.wBottom = CaptureRect.wTop + CORNER_RADIUS;
Screen()->Capture(&mCaptures[TOP_LEFT], CaptureRect);
CaptureRect.Shift(mReal.Width() - CORNER_RADIUS, 0);
Screen()->Capture(&mCaptures[TOP_RIGHT], CaptureRect);
CaptureRect.Shift(0, mReal.Height() - CORNER_RADIUS);
Screen()->Capture(&mCaptures[BOTTOM_RIGHT], CaptureRect);
CaptureRect.Shift(-(mReal.Width() - CORNER_RADIUS), 0);
Screen()->Capture(&mCaptures[BOTTOM_LEFT], CaptureRect);
mbCaptured = TRUE;
}
BeginDraw();
muColors[PCI_NORMAL] = mFillColor; /* set default value with given color */
if (mpBitmap == NULL)
{ /* no bitmap given, so fill frame with given color */
DrawFrame();
}
else
{
Screen()->Restore(this, &mCaptures[TOP_LEFT]);
Screen()->Restore(this, &mCaptures[TOP_RIGHT]);
Screen()->Restore(this, &mCaptures[BOTTOM_RIGHT]);
Screen()->Restore(this, &mCaptures[BOTTOM_LEFT]);
if (mBitmapStyle == kCenterBitmap)
{ /* center bitmap in window */
tPutBitmap.x = mReal.wLeft + ((mReal.wRight - mReal.wLeft) - mpBitmap->wWidth)/2;
tPutBitmap.y = mReal.wTop + ((mReal.wBottom - mReal.wTop) - mpBitmap->wHeight)/2;
}
else
{
tPutBitmap.x = mReal.wLeft;
tPutBitmap.y = mReal.wTop;
}
Bitmap(tPutBitmap, mpBitmap); /* set bitmap */
}
DrawChildren(); /* draw buttons */
EndDraw();
}
示例11: PegAppInitialize
void PegAppInitialize(PegPresentationManager *pPresentation)
{
PegRect Rect;
Rect.Set(MAINFRAME_LEFT-1, MAINFRAME_TOP-1, MAINFRAME_RIGHT+1, MAINFRAME_BOTTOM+1);
myWindow *mw = new myWindow(Rect);
pPresentation->Add(mw);
}
示例12: PegAppInitialize
/*--------------------------------------------------------------------------*/
void PegAppInitialize(PegPresentationManager *pPresentation)
{
// create the dialog and add it to PegPresentationManager:
PegRect Rect;
Rect.Set(0, 0, 240, 140);
DialogWin *pWin = new DialogWin(Rect);
pPresentation->Center(pWin);
pPresentation->Add(pWin);
}
示例13: DrawTextLine
/*--------------------------------------------------------------------------*/
void PegTextBox::DrawTextLine(SIGNED iLine, PegPoint Put, BOOL bFill)
{
SIGNED iLineLength;
PegRect FillRect;
PEGCHAR *pGet = GetLineStart(iLine, &iLineLength);
PegColor Color(muColors[PCI_NTEXT], muColors[PCI_NORMAL], CF_FILL);
CheckBufLen(iLineLength);
if (iLine == miMarkLine)
{
Color.Set(muColors[PCI_STEXT], muColors[PCI_SELECTED], CF_FILL);
bFill = TRUE;
}
if (bFill)
{
FillRect.Set(mClient.wLeft + TB_WHITESPACE, Put.y, mClient.wRight - TB_WHITESPACE,
Put.y + miLineHeight - 1);
Rectangle(FillRect, Color, 0);
}
if (!pGet)
{
return;
}
Color.uFlags = CF_NONE;
if (iLineLength > 0)
{
strncpy(mpBuf, pGet, iLineLength);
mpBuf[iLineLength] = '\0';
switch(Style() & TJ_MASK)
{
case TJ_RIGHT:
iLineLength = TextWidth(mpBuf, mpFont);
Put.x = mClient.wRight - iLineLength - TB_WHITESPACE;
break;
case TJ_CENTER:
iLineLength = TextWidth(mpBuf, mpFont);
Put.x = (mClient.Width() - iLineLength) / 2;
Put.x += mClient.wLeft;
break;
case TJ_LEFT:
default:
break;
}
DrawText(Put, mpBuf, Color, mpFont, -1);
}
}
示例14: 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;
}
}
}
示例15: PegWindow
/*--------------------------------------------------------------------------*/
AGCMessageClass::AGCMessageClass(SIGNED iLeft, SIGNED iTop) :
PegWindow(FF_THIN)
{
PegRect ChildRect;
mReal.Set(iLeft, iTop, iLeft + 393, iTop + 39);
InitClient();
SetColor(PCI_NORMAL, 223);
RemoveStatus(PSF_MOVEABLE|PSF_SIZEABLE|PSF_ACCEPTS_FOCUS);
ChildRect.Set(iLeft + 30, iTop + 10, iLeft + 374, iTop + 29);
pAGCMessage = new PegPrompt(ChildRect, LSA(SID_AGCMessage), AGCMessageID, FF_NONE|AF_TRANSPARENT|TJ_CENTER);
pAGCMessage->SetColor(PCI_NTEXT, RED);
Add(pAGCMessage);
/* WB End Construction */
Id(GENAGC_MESSAGE_ID);
}