当前位置: 首页>>代码示例>>C++>>正文


C++ PegRect类代码示例

本文整理汇总了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();
    }
}
开发者ID:garyqinyu,项目名称:abv,代码行数:26,代码来源:pmenu.cpp

示例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;
}
开发者ID:garyqinyu,项目名称:abv,代码行数:8,代码来源:permedia.cpp

示例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;
}
开发者ID:garyqinyu,项目名称:abv,代码行数:7,代码来源:l8brcmscrn.cpp

示例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;
}
开发者ID:Cartix,项目名称:BattleShip,代码行数:7,代码来源:MyMainFrame.cpp

示例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;
}
开发者ID:garyqinyu,项目名称:abv,代码行数:7,代码来源:1375scr8.cpp

示例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);


}
开发者ID:garyqinyu,项目名称:abv,代码行数:26,代码来源:main.cpp

示例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);
}
开发者ID:garyqinyu,项目名称:abv,代码行数:9,代码来源:notebook.cpp

示例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();
}
开发者ID:Cartix,项目名称:BattleShip,代码行数:8,代码来源:MyMainFrame.cpp

示例9: PegAppInitialize

/*--------------------------------------------------------------------------*/
void PegAppInitialize(PegPresentationManager* pPresentation)
{
    PegRect Rect;
    Rect.Set(20, 20, 400, 240);
    LightWindow* pWindow = new LightWindow(Rect);

    pPresentation->Add(pWindow);
}
开发者ID:garyqinyu,项目名称:abv,代码行数:9,代码来源:main.cpp

示例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();
}
开发者ID:garyqinyu,项目名称:abv,代码行数:58,代码来源:pbitmwin.cpp

示例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);
}
开发者ID:Cartix,项目名称:8Pool,代码行数:9,代码来源:main.cpp

示例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);
}
开发者ID:garyqinyu,项目名称:abv,代码行数:11,代码来源:dialog.cpp

示例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);
    }
}
开发者ID:garyqinyu,项目名称:abv,代码行数:54,代码来源:ptextbox.cpp

示例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;
        }
    }
}
开发者ID:garyqinyu,项目名称:abv,代码行数:52,代码来源:pwindow.cpp

示例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);	
}
开发者ID:garyqinyu,项目名称:abv,代码行数:20,代码来源:agcmsg.cpp


注:本文中的PegRect类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。