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


C++ CGuiLayout::Process方法代码示例

本文整理汇总了C++中CGuiLayout::Process方法的典型用法代码示例。如果您正苦于以下问题:C++ CGuiLayout::Process方法的具体用法?C++ CGuiLayout::Process怎么用?C++ CGuiLayout::Process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGuiLayout的用法示例。


在下文中一共展示了CGuiLayout::Process方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Menu_Net_NETShowServer

///////////////////
// Show a server's details
void Menu_Net_NETShowServer(const std::string& szAddress)
{
    CGuiLayout  cDetails;

    // Create the buffer
    DrawImage(tMenu->bmpBuffer.get(),tMenu->bmpMainBack_common,0,0);
    Menu_DrawBox(tMenu->bmpBuffer.get(), 15,130, 625, 465);
	Menu_DrawSubTitle(tMenu->bmpBuffer.get(),SUB_NETWORK);
	cInternet.Draw(tMenu->bmpBuffer.get());

	//for(ushort i=1;i<4;i++)
	//	cNetButtons[i].Draw(tMenu->bmpBuffer.get());

	Menu_RedrawMouse(true);

	int center = VideoPostProcessor::videoSurface()->w/2;
	int y = VideoPostProcessor::videoSurface()->h/2 - INFO_H/2;
	
    cDetails.Initialize();
	cDetails.Add( new CButton(BUT_REFRESH, tMenu->bmpButtons),  nd_Refresh,	center - 105, y+INFO_H-20, 85,15);
    cDetails.Add( new CButton(BUT_JOIN, tMenu->bmpButtons),	    nd_Join,    center, y+INFO_H-20, 40,45);
	cDetails.Add( new CButton(BUT_OK, tMenu->bmpButtons),	    nd_Ok,      center + 60, y+INFO_H-20, 40,15);
	((CButton *)cDetails.getWidget(nd_Refresh))->setRedrawMenu(false);
	((CButton *)cDetails.getWidget(nd_Ok))->setRedrawMenu(false);
	((CButton *)cDetails.getWidget(nd_Join))->setRedrawMenu(false);

	bGotDetails = false;
	bOldLxBug = false;
	nTries = 0;
	fStart = AbsTime();

    while(!WasKeyboardEventHappening(SDLK_ESCAPE,false) && tMenu->bMenuRunning) {
		tLX->currentTime = GetTime();

		Menu_RedrawMouse(true);
		ProcessEvents();
		//DrawImageAdv(VideoPostProcessor::videoSurface(),tMenu->bmpBuffer, 200,220, 200,220, 240, 240);

		Menu_SvrList_DrawInfo(szAddress, INFO_W, INFO_H);

        cDetails.Draw(VideoPostProcessor::videoSurface());
        gui_event_t *ev = NULL;

		ev = cDetails.Process();
        if(ev) {

			// Ok
            if(ev->iControlID == nd_Ok && ev->iEventMsg == BTN_CLICKED) {
                break;
			// Refresh
            } else if (ev->iControlID == nd_Refresh && ev->iEventMsg == BTN_CLICKED)  {
				fStart = AbsTime();
				bGotDetails = false;
				bOldLxBug = false;
				nTries = 0;
			} else if (ev->iControlID == nd_Join && ev->iEventMsg == BTN_CLICKED)  {
                // Save the list
                SvrList_Save();

				lv_subitem_t *sub = ((CListview *)cInternet.getWidget(mi_ServerList))->getCurSubitem(1);

				// Join
				if (sub)
					Menu_Net_NETJoinServer(szAddress, sub->sText);

				break;
			}
        }

        DrawCursor(VideoPostProcessor::videoSurface());
		doVideoFrameInMainThread();
		CapFPS();
    }

	cDetails.Shutdown();


    // Redraw the background
	DrawImage(tMenu->bmpBuffer.get(),tMenu->bmpMainBack_common,0,0);
	if (tMenu->tFrontendInfo.bPageBoxes)
		Menu_DrawBox(tMenu->bmpBuffer.get(), 15,130, 625, 465);
	Menu_DrawSubTitle(tMenu->bmpBuffer.get(),SUB_NETWORK);
	Menu_RedrawMouse(true);
}
开发者ID:iamnilay3,项目名称:openlierox,代码行数:86,代码来源:Menu_Net_Internet.cpp

示例2: Menu_Net_NETAddServer

void Menu_Net_NETAddServer()
{
	CGuiLayout	cAddSvr;
	gui_event_t *ev = NULL;
	bool		addServerMsg = true;


	// Create the background
	cInternet.Draw( tMenu->bmpBuffer.get() );
	Menu_DrawBox(tMenu->bmpBuffer.get(), 200, 220, 440, 340);
	//DrawImageAdv(tMenu->bmpBuffer, tMenu->bmpMainBack, 202,222, 202,222, 237,117);
    DrawRectFill(tMenu->bmpBuffer.get(), 202,222,439,339,tLX->clDialogBackground);
	for(int i=0;i<6;i++)
		cNetButtons[i].Draw(tMenu->bmpBuffer.get());
	Menu_RedrawMouse(true);


	cAddSvr.Initialize();
	cAddSvr.Add( new CButton(BUT_ADD, tMenu->bmpButtons),	na_Add, 220, 320, 40,15);
	cAddSvr.Add( new CButton(BUT_CANCEL, tMenu->bmpButtons),na_Cancel, 350, 320, 70,15);
	cAddSvr.Add( new CLabel("Add a server", tLX->clNormalLabel),		-1,275, 225, 0, 0);
	cAddSvr.Add( new CLabel("Address", tLX->clNormalLabel),				-1,215, 267, 0, 0);
	cAddSvr.Add( new CTextbox(),							na_Address, 280, 265, 140, tLX->cFont.GetHeight());

	ProcessEvents();
	while(!WasKeyboardEventHappening(SDLK_ESCAPE,false) && addServerMsg && tMenu->bMenuRunning) {
		Menu_RedrawMouse(true);
		DrawImageAdv(VideoPostProcessor::videoSurface(),tMenu->bmpBuffer, 200,220, 200,220, 240, 240);

		ProcessEvents();

		// Process the server list
		if( SvrList_Process() ) {
			// Add the servers to the listview
			Menu_Net_NET_ServerList_Refresher();
		}

		cAddSvr.Draw( VideoPostProcessor::videoSurface() );
		ev = cAddSvr.Process();

		// Process any events
		if(ev) {

			switch(ev->iControlID) {

				// Add
				case na_Add:
					if(ev->iEventMsg == BTN_CLICKED) {

						std::string addr;
						cAddSvr.SendMessage(na_Address, TXS_GETTEXT, &addr, 0);

						SvrList_AddServer(addr, true);
						Menu_Net_NET_ServerList_Refresher();

						// Click!
						PlaySoundSample(sfxGeneral.smpClick);

						addServerMsg = false;
					}
					break;

				// Cancel
				case na_Cancel:
					if(ev->iEventMsg == BTN_CLICKED) {
						// Click!
						PlaySoundSample(sfxGeneral.smpClick);

						addServerMsg = false;
					}
					break;
			}
		}


		DrawCursor(VideoPostProcessor::videoSurface());
		doVideoFrameInMainThread();
		CapFPS();
	}


	cAddSvr.Shutdown();

	// Re-draw the background
	DrawImage(tMenu->bmpBuffer.get(),tMenu->bmpMainBack_common,0,0);
	Menu_DrawSubTitle(tMenu->bmpBuffer.get(),SUB_NETWORK);
	if (tMenu->tFrontendInfo.bPageBoxes)
		Menu_DrawBox(tMenu->bmpBuffer.get(), 15,130, 625, 465);
	Menu_RedrawMouse(true);
}
开发者ID:iamnilay3,项目名称:openlierox,代码行数:90,代码来源:Menu_Net_Internet.cpp

示例3: Menu_Net_NETFrame

///////////////////
// Net Internet frame
void Menu_Net_NETFrame(int mouse)
{
	gui_event_t *ev = NULL;
	std::string	addr;


	// Process & Draw the gui
	ev = cInternet.Process();
	cInternet.Draw( VideoPostProcessor::videoSurface() );


	// Process the server list
	static bool wasLoadedBefore = false;
	if( SvrList_Process() || (tIpToCountryDB->Loaded() && !wasLoadedBefore) ) {
		// Add the servers to the listview
		Menu_Net_NET_ServerList_Refresher();
		wasLoadedBefore = tIpToCountryDB->Loaded();
	}



	// Process any events
	if(ev) {

		switch(ev->iControlID) {

			// Add Server
			case mi_AddServer:
				if(ev->iEventMsg == BTN_CLICKED) {
					// Click!
					PlaySoundSample(sfxGeneral.smpClick);

					Menu_Net_NETAddServer();
				}
				break;

			// Back
			case mi_Back:
				if(ev->iEventMsg == BTN_CLICKED) {

					// Shutdown
					Menu_Net_NETShutdown();

					// Click!
					PlaySoundSample(sfxGeneral.smpClick);

					// Back to main menu
					Menu_MainInitialize();
				}
				break;

			// Refresh
			case mi_Refresh:
				if(ev->iEventMsg == BTN_CLICKED) {

					// Click!
					PlaySoundSample(sfxGeneral.smpClick);

					// Refresh the currently visible servers
					SvrList_RefreshList();
					Menu_Net_NET_ServerList_Refresher();
				}
				break;

			// Join
			case mi_Join:
                if(ev->iEventMsg == BTN_CLICKED) {

					addr = "";
					int result = cInternet.SendMessage(mi_ServerList, LVS_GETCURSINDEX, &addr, 0);
					if(result != -1 && addr != "") {

                        // Save the list
                        SvrList_Save();

						// Click!
						PlaySoundSample(sfxGeneral.smpClick);

						lv_subitem_t *sub = ((CListview *)cInternet.getWidget(mi_ServerList))->getCurSubitem(1);

						// Join
						if (sub)
							Menu_Net_NETJoinServer(addr,sub->sText);
						return;
					}
				}
				break;

			// Serverlist
			case mi_ServerList:

                // Double click
				if(ev->iEventMsg == LV_DOUBLECLK) {

					/*
					  Now.... Should a double click refresh the server (like tribes)?
					  Or should it join the server like other games???
					*/
//.........这里部分代码省略.........
开发者ID:iamnilay3,项目名称:openlierox,代码行数:101,代码来源:Menu_Net_Internet.cpp

示例4: Dnr_ProcessGUI

///////////////////
// Process the gui
void Dnr_ProcessGUI(void)
{
    gui_event_t *ev;

    // Process the bottom gui
    ev = cDinerLayout2.Process();
    if(ev) {
        // Leave button
        if(ev->iControlID == 0 && ev->iEventMsg == BUT_CLICKED) {
            psDiner->bProcessDiner = false;
            psDiner->bRacing = false;
            return;
        }
    }


    // Process the racing gui
    if(psDiner->bOppClicked) {
        ev = cDinerLayout.Process();
        if(!ev)
            return;

        switch(ev->iControlID) {

            // Cancel
            case dng_cancel:
                // Chicken
                if(ev->iEventMsg == BUT_CLICKED) {
                    // Leave
                    psDiner->bOppClicked = false;
                    psDiner->nOppState = opp_rollingout;

                    Dnr_InitSpeechBubble("Chicken");
                }
                break;

            // Drag race
            case dng_drag:
                if(ev->iEventMsg == BUT_CLICKED) {
                    sRaceInfo.nType = rc_drag;

                    // Show tracks
                    Dnr_ChallengeOpponent(1, 0);
                    return;
                }
                break;

            // Drag : track selection
            case dng_dragtrk1:      // Fall through
            case dng_dragtrk2:
            case dng_dragtrk3:
            case dng_dragtrk4:
            case dng_dragtrk5:
            case dng_dragtrk6:
            case dng_dragtrk7:
            case dng_dragtrk8:
            case dng_dragtrk9:
                if(ev->iEventMsg == BUT_CLICKED) {
                    int l = ev->iControlID - dng_dragtrk1;
                    sr_strncpy(sRaceInfo.szTrackDir, psDiner->sDragTracks[l].szDir, 127);

                    // Show bets
                    Dnr_ChallengeOpponent(2, 0);
                    return;
                }
                break;

            // Drag : Back
            case dng_dragback:
                if(ev->iEventMsg == BUT_CLICKED) {
                    // Show tracks
                    Dnr_ChallengeOpponent(1, 0);
                    return;
                }
                break;


            //
            // Drag : Bet
            //
            case dng_dragkicks:
                if(ev->iEventMsg == BUT_CLICKED) {
                    // Make an offer
                    Dnr_MakeOffer(rcb_kicks, 0);
                }
                break;

            case dng_drag10:
                if(ev->iEventMsg == BUT_CLICKED) {
                    // Make an offer
                    Dnr_MakeOffer(rcb_money, 10);
                }
                break;

            case dng_drag50:
                if(ev->iEventMsg == BUT_CLICKED) {
                    // Make an offer
                    Dnr_MakeOffer(rcb_money, 50);
//.........这里部分代码省略.........
开发者ID:tecan,项目名称:StreetRod3,代码行数:101,代码来源:Diner.cpp

示例5: Menu_Net_ChatFrame

///////////////////
// The net news menu frame
void Menu_Net_ChatFrame(int mouse)
{
	gui_event_t *ev = NULL;


	// Process & Draw the gui
	ev = cChat.Process();
	cChat.Draw( VideoPostProcessor::videoSurface() );


	// Process any events
	if(ev) {

		switch(ev->iControlID) {

			// Back
			case nc_Back:
				if(ev->iEventMsg == BTN_CLICKED) {

					// Click!
					PlaySoundSample(sfxGeneral.smpClick);

					// Shutdown
					Menu_Net_ChatShutdown();

					// Back to main menu
					Menu_MainInitialize();
				}
				break;


			case nc_EnableChat:
				if(ev->iEventMsg == CHK_CHANGED) {
					
					PlaySoundSample(sfxGeneral.smpClick);
					tLXOptions->bEnableChat = cChat.SendMessage(nc_EnableChat, CKM_GETCHECK, 1, 1) != 0;
					if (!tLXOptions->bEnableChat)
					{
						((CChatWidget *)cChat.getWidget(nc_Chat))->DisableChat();
						ShutdownIRC();
					}
					else
					{
						InitializeIRC();
						((CChatWidget *)cChat.getWidget(nc_Chat))->EnableChat();
					}
				}
				break;

			case nc_EnableMiniChat:
				if(ev->iEventMsg == CHK_CHANGED) {
					PlaySoundSample(sfxGeneral.smpClick);
					tLXOptions->bEnableMiniChat = cChat.SendMessage(nc_EnableMiniChat, CKM_GETCHECK, 1, 1) != 0;
				}
				break;
		}

	}


	// Draw the mouse
	DrawCursor(VideoPostProcessor::videoSurface());
}
开发者ID:iamnilay3,项目名称:openlierox,代码行数:65,代码来源:Menu_Net_Chat.cpp

示例6: Gar_ChangePart

///////////////////
// Change a part
void Gar_ChangePart(void)
{
	mouse_t *mouse = System_GetMouse();


    // Process an escape
    /*if( System_GetKeyboard()->KeyUp[SDLK_ESCAPE] ) {
        // Go up a level
		if(tGarage->iState == GAR_ENGINEPART) {
			Gar_Part2Engine();
		}
		if(tGarage->iState == GAR_RUNGPART) {
			tGarage->iState = GAR_RUNNINGG;
			Gar_Part2RunningG();
		}
        return;
    }*/

    // Draw the part information
    cGarLocation->drawPartInfo(tPartChange.cPart, 1);


    // Process the change part dialog box
    cPartDlg.Draw();
    gui_event_t *ev = cPartDlg.Process();
    if( ev ) {
        switch(ev->iControlID) {

            // Add all / Remove all
            case 1:
                if( ev->iEventMsg == BUT_CLICKED ) {

                    if( tPartChange.iNutsGoingon ) {
                        // Put all the nuts on
                        tPartChange.cPart->putNutsOn();
                        Gar_FinishAddPart();
                    } else {

                        // Remove all the nuts
                        Gar_RemovePart();
                    }

                    cPartDlg.Shutdown();
                    return;

                }
                break;

            // Repair
            case 2:
                if( ev->iEventMsg == BUT_CLICKED ) {

                    // Parts with more then 50% damage cannot be repaired
                    if( tPartChange.cPart->getDamage() >= 50 ) {
                        Gar_InitSpeechBubble("The part is too damaged to be repaired");
                        return;
                    }

                    // Can we afford to repair the part?
                    if( !cMainGuy->canBuy( tPartChange.cPart->repairCost() ) ) {
                        Gar_InitSpeechBubble("You ain't got enough cash buddy");
                        return;
                    }

                    // Repair the part
                    int cost = tPartChange.cPart->repair();
                    cMainGuy->makePurchase(cost);
                }
                break;

            // Forget it
            case 3:
                if( ev->iEventMsg == BUT_CLICKED ) {

                    // If this part is coming off but was cancelled; put all the nuts back on
                    if( !tPartChange.iNutsGoingon )
                        tPartChange.cPart->putNutsOn();
                    else {
                        // Remove the part
                        Gar_RemovePart();
                    }


                    // Go up a level
		            if(tGarage->iState == GAR_ENGINEPART) {
			            Gar_Part2Engine();
		            }
		            if(tGarage->iState == GAR_RUNGPART) {
			            tGarage->iState = GAR_RUNNINGG;
			            Gar_Part2RunningG();
		            }

                    cPartDlg.Shutdown();
                    return;
                }
                break;
        }

//.........这里部分代码省略.........
开发者ID:tecan,项目名称:StreetRod3,代码行数:101,代码来源:Gar_Parts.cpp


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