示例#1
0
文件: pmenu.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
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
0
/*--------------------------------------------------------------------------*/
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
0
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
0
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
0
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
0
文件: main.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
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
0
/*--------------------------------------------------------------------------*/
void PegAppInitialize(PegPresentationManager *pPresent)
{
    PegRect WinRect;
    WinRect.Set(0, 0, 400, 300);
    TabWindow *pTab = new TabWindow(WinRect);
//    pPresent->Center(pTab);
    pPresent->Add(pTab);
}
示例#8
0
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
0
文件: main.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
void PegAppInitialize(PegPresentationManager* pPresentation)
{
    PegRect Rect;
    Rect.Set(20, 20, 400, 240);
    LightWindow* pWindow = new LightWindow(Rect);

    pPresentation->Add(pWindow);
}
示例#10
0
文件: main.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
void PegAppInitialize(PegPresentationManager* pPresentation)
{    
    PegRect Rect;
    Rect.Set(20, 20, 350, 350);
    ScaleWindow* pWindow = new ScaleWindow(Rect);
    pPresentation->Center(pWindow);
    pPresentation->Add(pWindow);
}
示例#11
0
/*--------------------------------------------------------------------------*/
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();
}
示例#12
0
文件: main.cpp 项目: garyqinyu/abv
void PegAppInitialize(PegPresentationManager* pPresentation)
{
    //pPresentation->SetWallpaper(&gbAbFluidBitmap);

    PegRect Rect;
    Rect.Set(20, 20, 550, 280);
    DialWindow* pWindow = new DialWindow(Rect);
    pPresentation->Add(pWindow);
}
示例#13
0
文件: main.cpp 项目: Cartix/8Pool
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);
}
示例#14
0
文件: dialog.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
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);
}
示例#15
0
/*--------------------------------------------------------------------------*/
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);
    }
}
示例#16
0
文件: pwindow.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
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;
        }
    }
}
示例#17
0
文件: main.cpp 项目: garyqinyu/abv
DialWindow::DialWindow(const PegRect& Rect) :
    PegDecoratedWindow(Rect)
{
    Add(new PegTitle(gsWindowTitle));

    miDial1Dir = 1;
    miDial2Dir = 1;
    miDial1Val = 0;
    miDial2Val = 0;

    PegRect WinRect;

    WinRect.Set(50, 50, 199, 199);
    mpDial1 = new PegFiniteBitmapDial(WinRect, 180, 0, 0, 100,
                                      &gbdialbkg2Bitmap);

    WinRect.Shift(160, 0);
    mpDial2 = new PegFiniteBitmapDial(WinRect, 225, 315, -25, 125,
                                      &gbdialbkg3Bitmap,
                                      &gbDialAnchor1Bitmap);
    mpDial2->Style((mpDial2->Style() | DS_POLYNEEDLE) & ~DS_THINNEEDLE);
    mpDial2->SetNeedleColor(BLUE);

    Add(mpDial1);
    Add(new PegPrompt(105, 210, 40, gsZero, 101, FF_RECESSED | TJ_RIGHT |
                      TT_COPY));
    Add(mpDial2);
    Add(new PegPrompt(265, 210, 40, gsZero, 102, FF_RECESSED | TJ_RIGHT |
                      TT_COPY));

    WinRect.Shift(160, 0);
    mpDial3 = new PegFiniteBitmapDial(WinRect, 180, 90, 0, 100,
                                      &gbdialbkg4Bitmap, NULL,
                                      0);
    mpDial3->Style(FF_NONE | AF_TRANSPARENT | DS_THICKNEEDLE | DS_USERCOR |
                   DS_CLOCKWISE);
    mpDial3->SetCOR(123, 123);
    mpDial3->SetNeedleLength(65);
    mpDial3->SetColor(PCI_NORMAL, BLUE);
    Add(mpDial3);

    SetColor(PCI_NORMAL, GREEN);

    Add(new PegPrompt(425, 210, 40, gsZero, 101, FF_RECESSED | TJ_RIGHT |
                      TT_COPY));

    WinRect.Set(245, 240, 330, 270);
    Add(new PegTextButton(WinRect, gsChangeColor, IDB_CHANGECOLOR));
}
示例#18
0
文件: agcmsg.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
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);	
}
示例#19
0
文件: main.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
ScaleWindow::ScaleWindow(const PegRect& Rect) :
    PegDecoratedWindow(Rect)
{
    Id(100);

    Add(new PegTitle("PegLinearScale Example"));

    PegRect WinRect;    
    WinRect.Set(50, 50, 100, 200);
    mpScale1 = new PegLinearScale(WinRect, 0, 100, 10, AF_TRANSPARENT | SS_STANDARDSTYLE);
    mlScale1Val = 0;
    miScale1Dir = -1;

    WinRect.Set(110, 50, 200, 200);
    mpScale2 = new PegLinearScale(WinRect, 0, 100, 10, FF_THIN | SS_STANDARDSTYLE);
    mpScale2->Style(mpScale2->Style() & ~SS_FACELEFT);

   #if PEG_NUM_COLORS >= 16
    mpScale2->SetNeedleColor(BLUE);
   #endif

    WinRect.Set(210, 50, 280, 300);
    mpScale3 = new PegLinearScale(WinRect, 0, 100, 10, FF_THIN | SS_STANDARDSTYLE);
    mpScale3->SetNeedleColor(CYAN);
    mpScale3->Style(mpScale3->Style() & ~SS_BOTTOMTOTOP);
    
    WinRect.Set(290, 50, 320, 310);
    mpScale4 = new PegLinearScale(WinRect, -100, 100, 10);
    mpScale4->Style(mpScale4->Style() & ~SS_FACELEFT);
    mpScale4->SetValue(0);
   #if PEG_NUM_COLORS >= 16
    mpScale4->SetNeedleColor(YELLOW);
   #endif

    WinRect.Set(50, 210, 200, 260);
    mpScale5 = new PegLinearScale(WinRect, 0, 100, 10);
    mpScale5->Style(mpScale5->Style() & ~SS_ORIENTVERT);
   #if PEG_NUM_COLORS >= 16
    mpScale5->SetNeedleColor(GREEN);
   #endif
    
    WinRect.Set(50, 270, 200, 320);
    mpScale6 = new PegLinearScale(WinRect, 0, 100, 5, FF_THIN | SS_STANDARDSTYLE);
    mpScale6->Style(mpScale6->Style() & ~SS_ORIENTVERT);
    mpScale6->Style(mpScale6->Style() & ~SS_FACELEFT);
    mpScale6->Style(mpScale6->Style() & ~SS_BOTTOMTOTOP);
   #if PEG_NUM_COLORS >= 16
    mpScale6->SetNeedleColor(MAGENTA);
   #endif

    Add(mpScale1);
    Add(mpScale2);
    Add(mpScale3);
    Add(mpScale4);
    Add(mpScale5);
    Add(mpScale6);
}
示例#20
0
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
}
示例#21
0
文件: dragon4.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
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);
}
示例#22
0
/*--------------------------------------------------------------------------*/
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);
}
示例#23
0
/*--------------------------------------------------------------------------*/
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
}
示例#24
0
/*--------------------------------------------------------------------------*/
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;
}
示例#25
0
文件: dospeg.cpp 项目: garyqinyu/abv
int main(int, char **)
{
    // create the screen interface object:
    PegScreen *pScreen = CreatePegScreen();
    PegThing::SetScreenPtr(pScreen);
    
    // create the PEG message Queue:
    
    PegMessageQueue *pMsgQueue = new PegMessageQueue();
    PegThing::SetMessageQueuePtr(pMsgQueue);
    
    // create the screen manager:
    
    PegRect Rect;
    Rect.Set(0, 0, pScreen->GetXRes() - 1, pScreen->GetYRes() - 1);
    PegPresentationManager *pPresentation = new PegPresentationManager(Rect);
    PegThing::SetPresentationManagerPtr(pPresentation);
    pScreen->GenerateViewportList(pPresentation);

    PegAppInitialize(pPresentation);    
    pPresentation->Execute();

    // restore the timer interrupt:

    /*
    outp(0x43, 0x36);
    outp(0x40,0xff);
    outp(0x40,0xff);
    */

    delete pPresentation;
    delete pMsgQueue;
    delete pScreen;

    return 0;
}
示例#26
0
/*--------------------------------------------------------------------------*/
PictureMenu::PictureMenu(SIGNED iLeft, SIGNED iTop) : 
    PegWindow(FF_NONE)
{
    PegRect ChildRect;

	mReal.Set(iLeft, iTop, iLeft + 49, iTop + 299);
    InitClient();
    AddStatus(PSF_MOVEABLE|PSF_SIZEABLE);

    ChildRect.Set(iLeft + 0, iTop + 250, iLeft + 49, iTop + 299);
    m_pPictureMenuButtonColorTemp = new TVBitmapButton(ChildRect, &gbcolortempBitmap, ID_PictureMenu_Button_ColorTemp);
    Add(m_pPictureMenuButtonColorTemp);

    ChildRect.Set(iLeft + 0, iTop + 200, iLeft + 49, iTop + 249);
    m_pPictureMenuButtonColor = new TVBitmapButton(ChildRect, &gbreducenoiseBitmap, ID_PictureMenu_Button_Color);
    Add(m_pPictureMenuButtonColor);

    ChildRect.Set(iLeft + 0, iTop + 150, iLeft + 49, iTop + 199);
    m_pPictureMenuButtonSharp = new TVBitmapButton(ChildRect, &gbsharpnessBitmap, ID_PictureMenu_Button_Sharp);
    Add(m_pPictureMenuButtonSharp);

    ChildRect.Set(iLeft + 0, iTop + 100, iLeft + 49, iTop + 149);
    m_pPictureMenuButtonTint = new TVBitmapButton(ChildRect, &gbcolorBitmap, ID_PictureMenu_Button_Tint);
    Add(m_pPictureMenuButtonTint);

    ChildRect.Set(iLeft + 0, iTop + 50, iLeft + 49, iTop + 99);
    m_pPictureMenuButtonContrast = new TVBitmapButton(ChildRect, &gbcontrastBitmap, ID_PictureMenu_Button_Contrast);
    Add(m_pPictureMenuButtonContrast);

    ChildRect.Set(iLeft + 0, iTop + 0, iLeft + 49, iTop + 49);
    m_pPictuerMenuButtonBright = new TVBitmapButton(ChildRect, &gbbrightnessBitmap, ID_PictureMenu_Button_Brightness);
    Add(m_pPictuerMenuButtonBright);

    /* WB End Construction */
	m_pPictureMenuButtonColorTemp->SetTipString(LS(SID_PictureMenu_Prompt_ColorTemp));
	m_pPictureMenuButtonColor->SetTipString(LS(SID_PictureMenu_Prompt_Color));
    m_pPictureMenuButtonSharp->SetTipString(LS(SID_PictureMenu_Prompt_Sharpness)); 
	m_pPictureMenuButtonTint->SetTipString(LS(SID_PictureMenu_Prompt_Tint));
	m_pPictureMenuButtonContrast->SetTipString(LS(SID_PictureMenu_Prompt_Contrast));
	m_pPictuerMenuButtonBright->SetTipString(LS(SID_PictureMenu_Prompt_Brightness));
	m_pToolTip = NULL;
	m_nCurrentSubWndID = ID_PictureMenu_Button_Brightness;
	Id(PICTURE_MENU_ID);

}
示例#27
0
文件: pmenu.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
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;
}
示例#28
0
/*--------------------------------------------------------------------------*/
MainMenu::MainMenu(SIGNED iLeft, SIGNED iTop) : 
    PegWindow(FF_NONE)
{
    PegRect ChildRect;

	mReal.Set(iLeft, iTop, iLeft + 49, iTop + 249);
    InitClient();
    AddStatus(PSF_MOVEABLE|PSF_SIZEABLE);

    ChildRect.Set(iLeft + 0, iTop + 200, iLeft + 49, iTop + 249);
	m_pMainMenuButton_SupFunction = new TVBitmapButton(ChildRect, &gbsuperfunctionBitmap, ID_MainMenu_Button_SupFunction);
    Add(m_pMainMenuButton_SupFunction);

	ChildRect.Set(iLeft + 0, iTop + 150, iLeft + 49, iTop + 199);
	m_pMainMenuButtonSupSetting = new TVBitmapButton(ChildRect, &gbsupersettingBitmap, ID_MainMenu_Button_SupSetting);
    Add(m_pMainMenuButtonSupSetting);

    ChildRect.Set(iLeft + 0, iTop + 100, iLeft + 49, iTop + 149);
	m_pMainMenuButtonSound = new TVBitmapButton(ChildRect, &gbsoundBitmap, ID_MainMenu_Button_Sound);
    Add(m_pMainMenuButtonSound);

    ChildRect.Set(iLeft + 0, iTop + 50, iLeft + 49, iTop + 99);
    m_pMainMenuButtonPicture = new TVBitmapButton(ChildRect, &gbpictureBitmap, ID_MainMenu_Buttion_Picture);
    Add(m_pMainMenuButtonPicture);

    ChildRect.Set(iLeft + 0, iTop + 0, iLeft + 49, iTop + 49);
	m_pMainMenuButtonFactorySetting = new TVBitmapButton(ChildRect, &gbfactoryBitmap, ID_MainMenu_Button_FactorySetting);
    Add(m_pMainMenuButtonFactorySetting);

    /* WB End Construction */
	m_pMainMenuButtonFactorySetting->SetTipString(LS(SID_MainMenu_Prompt_Factory));
	m_pMainMenuButton_SupFunction->SetTipString(LS(SID_MainMenu_Prompt_SuperFunction));
	m_pMainMenuButtonSupSetting->SetTipString(LS(SID_MainMenu_Prompt_SuperSetting));

	m_pMainMenuButtonSound->SetTipString(LS(SID_MainMenu_Prompt_Sound));
	m_pMainMenuButtonPicture->SetTipString(LS(SID_MainMenu_Prompt_Picture));

	m_pToolTip = NULL;
	m_pTVHelpWnd = NULL;
	m_nCurrentSubWndID = ID_MainMenu_Button_FactorySetting;


	Id(MAIN_MENU_ID);
}
示例#29
0
/*--------------------------------------------------------------------------*/
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);
}
示例#30
0
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
}