Пример #1
0
Application::Application(GHOST_ISystem* system)
    : m_system(system), m_mainWindow(0), m_secondaryWindow(0), m_fullScreenWindow(0),
      m_gearsTimer(0), m_testTimer(0), m_cursor(GHOST_kStandardCursorFirstCursor),
      m_exitRequested(false), stereo(false)
{
    fApp = this;

    // Create the main window
    STR_String title1 ("gears - main window");
    m_mainWindow = system->createWindow(title1, 10, 64, 320, 200, GHOST_kWindowStateNormal,
                                        GHOST_kDrawingContextTypeOpenGL, false, false);

    if (!m_mainWindow) {
        std::cout << "could not create main window\n";
        exit(-1);
    }

    // Create a secondary window
    STR_String title2 ("gears - secondary window");
    m_secondaryWindow = system->createWindow(title2, 340, 64, 320, 200, GHOST_kWindowStateNormal,
                        GHOST_kDrawingContextTypeOpenGL, false, false);
    if (!m_secondaryWindow) {
        cout << "could not create secondary window\n";
        exit(-1);
    }

    // Install a timer to have the gears running
    m_gearsTimer = system->installTimer(0 /*delay*/, 20/*interval*/, gearsTimerProc, m_mainWindow);
}
void MpFetcherTestAppView::viewSongCaged()
{
    if(mReq){
        delete mReq;
        mReq = 0;
    }
    XQSharableFile sf;
    // Open the file for sharing from own private  directory
    // If you have handle available, just set it by "setHandle()" function
    if (!sf.open(mResultEdit->text()))
    {
        // Failed to open sharable file
        return;
    }

    // Create request for the sharable file
    mReq = mAppMgr.create(sf);
    if (!mReq)
   {
         // No viewer app found for the file
         // As we opened the handle, we need to close it !
         sf.close(); 
         return;  
   }
    // By default operation is "view(XQSharableFile)"

    // Set function parameters
    // Not only one sharable handle supported,  otherwise upon send EArgumentError error occurs
    QList<QVariant> args;
    args << qVariantFromValue(sf);  
    mReq->setArguments(args);
    QString title("WindowTitle");
   QVariant title2(QString("<app_name>Caged"));
   XQRequestInfo info;
   info.setInfo(title, title2);
   mReq->setInfo(info);
   // Send the request
   bool res = mReq->send();
   if  (!res) 
   {
       // Request failed. 
      int error = mReq->lastError();
      // Handle error
   }

    // As we opened the handle, we need to close it !
    sf.close(); 

   // If making multiple requests to same service, you can save the mReq as member variable
   // In this example all done.


}
void MpFetcherTestAppView::fetchSong()
{
    qDebug() <<  "MpFetcherTestAppView::fetchSong START";

    mResultEdit->setText("");
    mErrorEdit->setText("");
    mErrorCodeEdit->setText("");
    if(mReq){
        delete mReq;
        mReq = 0;
    }
    
    if (!mReq)
    {
        mReq = mAppMgr.create("com.nokia.symbian.IMusicFetch", "fetch()", true);

        qDebug() <<  "MpFetcherTestAppView::fetchSong: mReq=" << mReq;

        if (!mReq)
        {
            mErrorEdit->setText("Failed to create REQ");
            return;
        }
        else
        {
            connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&)));
            connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&)));
        }
    }

    // Set arguments for request (application title)
//    QList<QVariant> args;
//    args << QVariant(QString("<app_name>"));
//    mReq->setArguments(args);
    QString title("WindowTitle");
    QVariant title2(QString("app_name"));
    XQRequestInfo info;
    info.setInfo(title, title2);
    mReq->setInfo(info);
    // Make the request
    if (!mReq->send())
    {   
        mErrorEdit->setText("Failed to send REQ");
        qDebug() <<  "MpFetcherTestAppView::fetchSong: XQAiwRequest::send returned false";
    }

    qDebug() <<  "MpFetcherTestAppView::fetchSong END";
}
void Ut_MApplicationPage::testUpdatingWindowTitleWithChangingPageTitle()
{
    QString title("Test title");
    QString title2("Another test title");
    QString title3("Multiple length variants title\0x9cMult. length var. title");
    QString title3_longest("Multiple length variants title");
    QString title4;

    m_subject->appear(appWin);

    m_subject->setTitle(title);
    QCOMPARE(appWin->windowTitle(), title);
    m_subject->setTitle(title2);
    QCOMPARE(appWin->windowTitle(), title2);
    m_subject->setTitle(title3);
    QCOMPARE(appWin->windowTitle(), title3_longest);
    m_subject->setTitle(title4);
    QCOMPARE(appWin->windowTitle(), title4);
}
void MpFetcherTestAppView::viewSong()
{
    
    if(mReq){
        delete mReq;
        mReq = 0;
    }
    QFile file(mResultEdit->text());

    mReq = mAppMgr.create(file);
    if (mReq == NULL)
    {
           // No handlers for the URI
           return;
     }
    // By default operation is "view(QString)"

    // Set function parameters
   QList<QVariant> args;
   args << file.fileName();
   mReq->setArguments(args);
   QString title("WindowTitle");
   QVariant title2(QString("<app_name>View"));
   XQRequestInfo info;
   info.setInfo(title, title2);
   mReq->setInfo(info);
   // Send the request
   bool res = mReq->send();
   if  (!res) 
   {
       // Request failed. 
      int error = mReq->lastError();

      // Handle error
   }
 
   // If making multiple requests to same service, you can save the request as member variable
   // In this example all done.


}
Пример #6
0
char *complete_title(P_CHAR pc) // generates the ENTIRE title plus criminal stuff
{
	VALIDATEPCR(pc, 0);
	char tempstr[1024];
 	char temp[TEMP_STR_SIZE]; //xan -> this overrides the global temp var

	if (pc->account==0 && pc->IsGM()) // Ripper..special titles for admins :)
	{
		sprintf(tempstr, "%s %s", pc->getCurrentNameC(), pc->title.c_str());
	}
	else
	if (pc->IsGM() && pc->account!=0)
	{//GM.
		sprintf(tempstr, "%s %s", pc->getCurrentNameC(), pc->title.c_str());
	}
	// ripper ..rep stuff
	else if ((pc->IsCriminal()) && (!(pc->dead) && (pc->kills<4)))
	{
		sprintf(tempstr, "%s %s", title[0].other, pc->getCurrentNameC());
		if ( pc->title != "" )
			sprintf(tempstr, "%s, %s,", tempstr, pc->title.c_str());
		else
			sprintf(tempstr, "%s, %s %s,", tempstr, title1(pc), title2(pc));
	}
	else if ((pc->kills>=5) && (!(pc->dead) && (pc->kills<10)))
	{
		sprintf(tempstr, "%s %s", title[1].other, pc->getCurrentNameC());
		if ( pc->title != "" )
			sprintf(tempstr, "%s, %s,", tempstr, pc->title.c_str());
		else
			sprintf(tempstr, "%s, %s %s,", tempstr, title1(pc), title2(pc));
	}
	else if ((pc->kills>=10) && (!(pc->dead) && (pc->kills<20)))
	{
		sprintf(tempstr, "%s %s", title[2].other, pc->getCurrentNameC());
		if ( pc->title != "" )
			sprintf(tempstr, "%s, %s,", tempstr, pc->title.c_str());
		else
			sprintf(tempstr, "%s, %s %s,", tempstr, title1(pc), title2(pc));
	}
	else if ((pc->kills>=20) && (!(pc->dead) && (pc->kills<50)))
	{
		sprintf(tempstr, "%s %s", title[3].other, pc->getCurrentNameC());
		if ( pc->title != "" )
			sprintf(tempstr, "%s, %s,", tempstr, pc->title.c_str());
		else
			sprintf(tempstr, "%s, %s %s,", tempstr, title1(pc), title2(pc));
	}
	else if ((pc->kills>=50) && (!(pc->dead) && (pc->kills<100)))
	{
		sprintf(tempstr, "%s %s", title[4].other, pc->getCurrentNameC());
		if ( pc->title != "" )
			sprintf(tempstr, "%s, %s,", tempstr, pc->title.c_str());
		else
			sprintf(tempstr, "%s, %s %s,", tempstr, title1(pc), title2(pc));
	}
	else if ((pc->kills>=100) && (!(pc->dead)))
	{
		sprintf(tempstr, "%s %s", title[5].other, pc->getCurrentNameC());
		if ( pc->title != "" )
			sprintf(tempstr, "%s, %s,", tempstr, pc->title.c_str());
		else
			sprintf(tempstr, "%s, %s %s,", tempstr, title1(pc), title2(pc));
	} // end of rep stuff
	else
	{//Player.
		sprintf(tempstr, "%s%s", title3(pc), pc->getCurrentNameC());		//Repuation + Name
		{//NoTownTitle
			strcpy(temp,tempstr);
			if ( pc->title != "" )
				sprintf(tempstr, "%s, %s,", tempstr, pc->title.c_str());
			else
				sprintf(tempstr, "%s, %s %s,", tempstr, title1(pc), title2(pc));
		}
	}

	strcpy(completetitle, tempstr);
	return completetitle;

}
Пример #7
0
WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar,
                             WXWidget parent,
                             wxMenu * topMenu,
                             size_t menuIndex,
                             const wxString& title,
                             bool pullDown)
{
    Widget menu = (Widget) 0;
    Widget buttonWidget = (Widget) 0;
    Display* dpy = XtDisplay((Widget)parent);
    Arg args[5];
    XtSetArg (args[0], XmNnumColumns, m_numColumns);
    XtSetArg (args[1], XmNpacking, (m_numColumns > 1) ? XmPACK_COLUMN : XmPACK_TIGHT);

    if ( !m_font.IsOk() )
    {
        if ( menuBar )
            m_font = menuBar->GetFont();
        else if ( GetInvokingWindow() )
            m_font = GetInvokingWindow()->GetFont();
    }

    XtSetArg (args[2], (String)wxFont::GetFontTag(), m_font.GetFontTypeC(dpy) );

    if (!pullDown)
    {
        menu = XmCreatePopupMenu ((Widget) parent, wxMOTIF_STR("popup"), args, 3);
#if 0
        XtAddCallback(menu,
                      XmNunmapCallback,
                      (XtCallbackProc)wxMenuPopdownCallback,
                      (XtPointer)this);
#endif
    }
    else
    {
        char mnem = wxFindMnemonic (title);
        menu = XmCreatePulldownMenu ((Widget) parent, wxMOTIF_STR("pulldown"), args, 3);

        wxString title2(wxStripMenuCodes(title));
        wxXmString label_str(title2);
        buttonWidget = XtVaCreateManagedWidget(title2,
#if wxUSE_GADGETS
                                               xmCascadeButtonGadgetClass, (Widget) parent,
#else
                                               xmCascadeButtonWidgetClass, (Widget) parent,
#endif
                                               XmNlabelString, label_str(),
                                               XmNsubMenuId, menu,
                                               (String)wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
                                               XmNpositionIndex, menuIndex,
                                               NULL);

        if (mnem != 0)
            XtVaSetValues (buttonWidget, XmNmnemonic, mnem, NULL);
    }

    m_menuWidget = (WXWidget) menu;

    m_topLevelMenu = topMenu;

    size_t i = 0;
    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
            node;
            node = node->GetNext(), ++i )
    {
        wxMenuItem *item = node->GetData();

        item->CreateItem(menu, menuBar, topMenu, i);
    }

    ChangeFont();

    return buttonWidget;
}
Пример #8
0
int main() {
	AppEnv env(3000, 2048, false, true);

	//ゲームの素材(主人公)
	Texture anb_top("res/anb1.png");//正面
	Texture anb_side("res/anb2.png");//横
	Texture anb_back("res/anb3.png");//後ろ
	
	//素材その他
	Texture title("res/title_top.png");
	Texture title2("res/title2.png");
	Texture owari("res/owari.png");
	Texture door("res/door.png");
	Texture door2("res/door2.png");
	Texture titledoorhan("res/titledoorhan.png");
	Texture akari("res/akari.png");
	Texture hp("res/heart.png");
	Texture open("res/open.png");
	Texture closed("res/closed.png");
	Texture end("res/endcard.png");
	//音源
	Media nock("res/nock.wav");
	Media keyclose("res/keyclose.wav");
	//キャラの移動x,y
	int x = -1500;
	int y = -1024;

	
	//
	int stage_count = 0;
	
	int life = 3;
	int stage_clear=0;
	int block_x = 200;
	int block_y = 200;
	int akari_count = 0;
	int atari_count = 0;
	
	//stage_clear = 1;
	//**************************************おおもと**************************************
	while (true){

		env.begin();

		
		

		//::::::::::::::::::::::タイトル画面::::::::::::::::::::::::
		while (env.isOpen()) {
			env.begin();

			drawTextureBox(-1500, -1024, 3000, 2048, 0, 0, 4096, 2048, title);
			drawTextureBox(-1050, -600, 200, 200, 0, 0, 512, 512, open);
			drawTextureBox(100, -600, 200, 200, 0, 0, 512, 512, closed);

			if (!(-330 < x || -830 > x + 300 || -174 < y || -1024 > y + 600)){
				drawTextureBox(-828, -1010, 510, 840, 0, 0, 512, 512, titledoorhan);
				if (env.isPressKey(GLFW_KEY_SPACE)){
					x = -40;
					y = -1024;
					nock.play();
					
					break;
				}
			}



			//右ドア
			if (stage_clear == 1){
				drawTextureBox(100, -600, 200, 200, 0, 0, 512, 512, open);
				if (!(835 < x || 325 > x + 300 || -184 < y || -1024 > y + 600)){
					drawTextureBox(320, -1010, 510, 840, 0, 0, 512, 512, titledoorhan);
					
						if (env.isPressKey(GLFW_KEY_SPACE)){
							x = -40;
							y = -1024;
							nock.play();
							stage_count = 11;
							break;
							
					}

				}

			}
			else {
				
					if (env.isPushKey(GLFW_KEY_SPACE)){
						if (!(835 < x || 325 > x + 300 || -184 < y || -1024 > y + 600)){
						keyclose.play();
					}
				}
			}



			if (env.isPressKey(GLFW_KEY_LEFT)){
				x -= 5;
				drawTextureBox(x, y, 300, 600, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1));
				if (x <-1500){
					
					x = -1500;
				}

			}
			

				else if (env.isPressKey(GLFW_KEY_RIGHT)){
				x += 5;
				drawTextureBox(x, y, 300, 600, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1));
				if (x > 1200){
					x = 1200;
				}
			}
				else {
				drawTextureBox(x, y, 300, 600, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
			}

			//if(!( □+x<x || □x >x+300 || □+y <y || □y > y+600))

			
			



			env.end();
		}


		//:::::::::::::::::::::::ゲーム本編:::::::::::::::::::::::::::

		while (env.isOpen()) {

			Vec2f pos = env.mousePosition();

			env.begin();
		
			//--------------------チュートリアル---------------------

			//背景
			
			if (stage_count == 0){
				drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1));


			//ドア
				drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door);
				if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){
					drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2);
					if (env.isPressKey(GLFW_KEY_SPACE)){
						stage_count++;
						x = -40;
						y = -1024;
						nock.play();
					}
				}



				//drawTextureBox(-40, 30, 80, 160, 0, 0, 256, 512, door2);


				// キャラの移動&移動制限

				if (env.isPressKey(GLFW_KEY_UP)){
					y += 5;
					drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1));
					if (y > 864.0f){
						y = 864.0f;

					}
				}

				else if (env.isPressKey(GLFW_KEY_LEFT)){
					x -= 5;
					drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1));
					
				}
				else if (env.isPressKey(GLFW_KEY_DOWN)){
					y -= 5;
					drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
					if(y< -1024.0f){
						y = -1024.0f;

					}
				}
				else if (env.isPressKey(GLFW_KEY_RIGHT)){
					x += 5;
					drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1));
					
				}
				else {
					drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
				}


				

				//マップ&当たり判定
				//if(!( □+x<x || □x >x+80 || □+y <y || □y > y+160))


				drawFillBox(500, -1024, 600, 2048, Color(0, 0, 0, 1));

				if (!(1100 < x || 500 > x + 80 || 1024 < y || -1024 > y + 100)){
					x = -40;
					y = -1024;
					
				}
				drawFillBox(-1100, -1024, 600, 2048, Color(0,0,0, 1));//0.02
				if (!(-500 < x || -1100 > x + 80 || 1024 < y || -1024 > y + 160)){
					x = -40;
					y = -1024;
				}
				drawFillBox(-300, 0, 500, 200, Color(0,0,0,1));
				if (!(200 < x || -300 > x + 80 || 200 < y || 0 > y + 160)){
					x = -40;
					y = -1024;
				}

				

			}






		//----------------------ステージ1--------------------------------------------------------------

			
				if (stage_count == 1){
					drawFillBox(-1024, -1024, 2048, 2048, Color(40 / 255, 34 / 255, 42 / 255, 1));

					drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door);
					if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){
						drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2);
						if (env.isPressKey(GLFW_KEY_SPACE)){
							stage_count++;
							x = -40;
							y = -1024;
							nock.play();
						}

					}


					// キャラの移動&移動制限

					if (env.isPressKey(GLFW_KEY_UP)){
						y += 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 0.4));
						if (y > 864.0f){
							y = 864.0f;

						}
					}

					else if (env.isPressKey(GLFW_KEY_LEFT)){
						x -= 5;
						drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 0.4));
						if (x < -1024.0f){
							x = -1024.0f;

						}
					}
					else if (env.isPressKey(GLFW_KEY_DOWN)){
						y -= 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 0.4));
						if (y < -1024.0f){
							y = -1024.0f;

						}
					}
					else if (env.isPressKey(GLFW_KEY_RIGHT)){
						x += 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 0.4));
						if (x > 1024.0f){
							x = 1024.0f;
						}
					}
					else {
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 0.4));
					}

					//マップ&当たり判定
					//if(!( <x || >x+80 || <y ||> y+160))

					//if(!(ax2 < bx1 || ax1 > bx2 || ay1< by2 || ay2 >by1))

					drawFillBox(500, -1024, 100, 2048, Color(1, 1, 1, 0.02));

					if (!(600 < x || 500 > x + 80 || 1024 < y || -1024 > y + 100)){
						x = -40;
						y = -1024;

					}
					drawFillBox(-500, -1024, 100, 2048, Color(1, 1, 1, 0.02));//0.02
					if (!(-400 < x || -500 > x + 80 || 1024 < y || -1024 > y + 160)){
						x = -40;
						y = -1024;
					}
					drawFillBox(-400, 0, 500, 200, Color(1, 1, 1, 0.02));
					if (!(100 < x || -400 > x + 80 || 200 < y || 0 > y + 160)){
						x = -40;
						y = -1024;
					}

					drawFillBox(0, -500, 500, 200, Color(1, 1, 1, 0.02));
					if (!(500 < x || 0 > x + 80 || -300 < y || -500 > y + 160)){
						x = -40;
						y = -1024;
					}

					drawFillBox(-150, 500, 400, 200, Color(1, 1, 1, 0.02));
					if (!(250 < x || -150 > x + 80 || 700 < y || 500 > y + 160)){
						x = -40;
						y = -1024;
					}
					//キャラの明かり
					drawFillCircle(x + 40, y + 80, 130, 130, 100, Color(1, 1, 1, 0.13));

				}


				//--------------------2ステージ------------------------------------------------------------
				if (stage_count == 2){

					drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1));

					drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door);
					if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){
						drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2);
						if (env.isPressKey(GLFW_KEY_SPACE)){
							stage_count++;

							x = -40;
							y = -1024;
							nock.play();
						}

					}


					// キャラの移動&移動制限

					if (env.isPressKey(GLFW_KEY_UP)){
						y += 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1));
						if (y > 864.0f){
							y = 864.0f;

						}
					}

					else if (env.isPressKey(GLFW_KEY_LEFT)){
						x -= 5;
						drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1));
						if (x < -1024.0f){
							x = -1024.0f;

						}
					}
					else if (env.isPressKey(GLFW_KEY_DOWN)){
						y -= 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
						if (y < -1024.0f){
							y = -1024.0f;

						}
					}
					else if (env.isPressKey(GLFW_KEY_RIGHT)){
						x += 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1));
						if (x > 1024.0f){
							x = 1024.0f;
						}
					}
					else {
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
					}

					//明かり的な?
					drawFillCircle(x + 40, y + 80, 130, 130, 100, Color(0, 0, 0, 0.1));
					//マップ&当たり判定
					//if(!( <x || >x+80 || <y ||> y+160))

					//if(!(ax2 < bx1 || ax1 > bx2 || ay1< by2 || ay2 >by1))





					drawFillBox(500, -1024, 100, 2048, Color(1, 1, 1));
					if (!(600 < x || 500 > x + 80 || 1024 < y || -1024 > y + 100)){
						x = -40;
						y = -1024;

					}
					drawFillBox(-500, -1024, 100, 2048, Color(1, 1, 1));//0.02
					if (!(-400 < x || -500 > x + 80 || 1024 < y || -1024 > y + 160)){
						x = -40;
						y = -1024;
					}
					drawFillBox(-400, 0, 500, 200, Color(1, 1, 1));
					if (!(100 < x || -400 > x + 80 || 200 < y || 0 > y + 160)){
						x = -40;
						y = -1024;
					}

					drawFillBox(0, -500, 500, 200, Color(1, 1, 1));
					if (!(500 < x || 0 > x + 80 || -300 < y || -500 > y + 160)){
						x = -40;
						y = -1024;
					}

					drawFillBox(-150, 500, 400, 200, Color(1, 1, 1));
					if (!(250 < x || -150 > x + 80 || 700 < y || 500 > y + 160)){
						x = -40;
						y = -1024;
					}



				}


				//---------------------ステージ3-------------------------------------------------------------------------
				if (stage_count == 3){

					drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1));

					drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door);
					if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){
						drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2);
						if (env.isPressKey(GLFW_KEY_SPACE)){
							x = -1500;
							y = -1024;
							stage_count = 0;
							stage_clear = 1;
							nock.play();
							break;


						}

					}

					if (env.isPressKey(GLFW_KEY_UP)){
						y += 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1));
						if (y > 864.0f){
							y = 864.0f;

						}
					}

					else if (env.isPressKey(GLFW_KEY_LEFT)){
						x -= 5;
						drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1));
						if (x < -1024.0f){
							x = -40;
							y = -1024;

						}
					}
					else if (env.isPressKey(GLFW_KEY_DOWN)){
						y -= 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
						if (y < -1024.0f){
							y = -1024.0f;

						}
					}
					else if (env.isPressKey(GLFW_KEY_RIGHT)){
						x += 5;
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1));
						if (x > 944.0f){
							x = -40;
							y = -1024;
						}
					}
					else {
						drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
					}





					drawFillBox(block_x, block_y, 200, 200, Color::black);


					if (!(block_x + 200 < x || block_x > x + 80 || block_y + 200 < y || block_y > y + 160)){
						x = -40;
						y = -1024;

					}
					if (!(200 < x || 0 > x + 80 || 400 < y || 200 > y + 160)){
						block_x = 0;

					}

				}
			
				//--------------------------------------------すてーじ1--------------------------------------------
				
				if (stage_count == 11){
					if (life == 3){
						drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
						drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp);
						drawTextureBox(1376, -1024, 128, 128, 0, 0, 128, 128, hp);
					}
					else if (life == 2){
						drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
						drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp);
					}
					else if (life == 1){
						drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
					}
					else {
						stage_count = 0;
						life = 3;
						x = -1500;
						y = -1024;
						break;

					}
						drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1));

						drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door);
						if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){
							drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2);
							if (env.isPressKey(GLFW_KEY_SPACE)){
								x = -40;
								y = -1024;
								stage_count++;

								nock.play();



							}

						}

						if (env.isPressKey(GLFW_KEY_UP)){
							y += 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1,1,1, 1));
							if (y > 864.0f){
								y = 864.0f;

							}
						}

						else if (env.isPressKey(GLFW_KEY_LEFT)){
							x -= 5;
							drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1));
							if (x < -1024.0f){
								x = -40;
								y = -1024;

							}
						}
						else if (env.isPressKey(GLFW_KEY_DOWN)){
							y -= 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
							if (y < -1024.0f){
								y = -1024.0f;

							}
						}
						else if (env.isPressKey(GLFW_KEY_RIGHT)){
							x += 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1));
							if (x > 944.0f){
								x = -40;
								y = -1024;
							}
						}
						else {
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
						}


						drawFillCircle(x + 40, y + 80, 130, 130, 100, Color(0, 0, 0, 0.1));
						drawFillBox(100, -1024, 300, 500, Color::white);
						if (!(400 < x || 100 > x + 80 || -524 < y || -1024 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(-1024, -1024, 800, 400, Color::white);
						if (!(-224 < x || -1024 > x + 80 || -624 < y || -1024 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(-600, -224, 1000, 300, Color::white);
						if (!(400 < x || -600 > x + 80 || -124 < y || -224 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(400, 70, 600, 300, Color::white);
						if (!(1100 < x || 400 > x + 80 || 370 < y || 70 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(-600, 24, 300, 300, Color::white);
						if (!(-300 < x || -600 > x + 80 || 324 < y || 300 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(-600, 524, 300, 200, Color::white);
						if (!(-300 < x || -600 > x + 80 || 724 < y || 524 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(-300, 524, 300, 100, Color::white);
						if (!(0 < x || -300 > x + 80 || 624 < y || 524 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(0, 350, 400, 276, Color::white);
						if (!(400 < x || 0 > x + 80 || 626 < y || 350 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
					}

					//-------------------------------------すてーじ2----------------------------------------
					if (stage_count == 12){
						if (life == 3){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1376, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else if (life == 2){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else if (life == 1){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else {
							stage_count = 0;
							life = 3;
							x = -1500;
							y = -1024;
							akari_count = 0;
							break;

						}
						drawFillBox(-1024, -1024, 2048, 2048, Color(0, 0, 0, 1));
						drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door);
						if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){
							drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2);
							if (env.isPressKey(GLFW_KEY_SPACE)){
								x = -40;
								y = -1024;
								stage_count++;
								akari_count = 0;
								nock.play();



							}

						}

						if (env.isPressKey(GLFW_KEY_UP)){
							y += 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1));
							if (y > 864.0f){
								y = 864.0f;

							}
						}

						else if (env.isPressKey(GLFW_KEY_LEFT)){
							x -= 5;
							drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1));
							if (x < -1024.0f){
								x = -40;
								y = -1024;

							}
						}
						else if (env.isPressKey(GLFW_KEY_DOWN)){
							y -= 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
							if (y < -1024.0f){
								y = -1024.0f;

							}
						}
						else if (env.isPressKey(GLFW_KEY_RIGHT)){
							x += 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1));
							if (x > 944.0f){
								x = -40;
								y = -1024;
							}
						}
						else {
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));

						}


						drawFillBox(-1024, -1024, 800, 600, Color::black);
						if (!(-224<x ||-1024 >x + 80 ||-424 <y ||-1024 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(200, -1024, 500, 800, Color::black); 
							if (!(700<x ||200 >x + 80 ||-224 <y || -1024> y + 160)){
								x = -40;
								y = -1024;
								life--;
						}
						drawFillBox(-724, -250, 2000, 300, Color::black); 
							if (!(1276<x || -724 >x + 80 || 50<y || -250> y + 160)){
								x = -40;
								y = -1024;
								life--;
						}
						drawFillBox(-1024, 300, 1748, 200, Color::black); 
							if (!(724<x ||-1024 >x + 80 ||500 <y ||300 > y + 160)){
								x = -40;
								y = -1024;
								life--;
						}
						drawFillBox(60, 700, 1000, 424, Color::black); 
							if (!(1060<x ||60 >x + 80 || 1124<y ||700 > y + 160)){
								x = -40;
								y = -1024;
								life--;
						}


							
						akari_count++;
						if (akari_count < 90){
							drawTextureBox(-50, -350, 64, 64, 0, 0, 64, 64, akari);
						}
						if (akari_count > 90 && akari_count < 180){
							drawTextureBox(-900, -350, 64, 64, 0, 0, 64, 64, akari);
						}
						if (akari_count>180 && akari_count < 270){
							drawTextureBox(-900, 150, 64, 64, 0, 0, 64, 64, akari);
						}
						if (akari_count>270 && akari_count < 360){
							drawTextureBox(850, 150, 64, 64, 0, 0, 64, 64, akari);
						}
						if (akari_count>360 && akari_count < 450){
							drawTextureBox(850, 550, 64, 64, 0, 0, 64, 64, akari);
						}
						if (akari_count>450 && akari_count < 540){
							drawTextureBox(-40, 600, 64, 64, 0, 0, 64, 64, akari);
						}
						if (akari_count > 630){
							akari_count = 0;
						}



					}
					//------------------------------------------すてーじ3----------------------------
					if (stage_count == 13){
						if (life == 3){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1376, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else if (life == 2){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else if (life == 1){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else {
							stage_count = 0;
							life = 3;
							x = -40;
							y = -1024;
							akari_count = 0;
							break;

						}

						atari_count++;
						drawFillBox(-1024, -1024, 2048, 2048, Color(0, 0, 0, 1));
						if (atari_count == 600){
							if (!(1024 < x || -1024 > x + 80 || 1024 < y || -1024 > y + 160)){
								x = -40;
								y = -1024;
								life--;
							}
						}
						if(atari_count > 600){
							atari_count = 0;
						}

						drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door);
						if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){
							drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2);
							if (env.isPressKey(GLFW_KEY_SPACE)){
								x = -40;
								y = -1024;
								stage_count++;
								akari_count = 0;
								nock.play();



							}

						}

						if (env.isPressKey(GLFW_KEY_UP)){
							y += 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1));
							if (y > 864.0f){
								y = 864.0f;

							}
						}

						else if (env.isPressKey(GLFW_KEY_LEFT)){
							x -= 5;
							drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1));
							if (x < -1024.0f){
								x = -40;
								y = -1024;

							}
						}
						else if (env.isPressKey(GLFW_KEY_DOWN)){
							y -= 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
							if (y < -1024.0f){
								y = -1024.0f;

							}
						}
						else if (env.isPressKey(GLFW_KEY_RIGHT)){
							x += 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1));
							if (x > 944.0f){
								x = -40;
								y = -1024;
							}
						}
						else {
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));

						}


				//----------------------------------------すてーじ14-------------------------------
					}
					if (stage_count == 14){
						if (life == 3){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1376, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else if (life == 2){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
							drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else if (life == 1){
							drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp);
						}
						else {
							stage_count = 0;
							life = 3;
							x = -1500;
							y = -1024;
							akari_count = 0;
							break;

						}
						drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1));
						drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door);
						if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){
							drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2);
							if (env.isPressKey(GLFW_KEY_SPACE)){
								x = -40;
								y = -1024;
								stage_count++;
								akari_count = 0;
								nock.play();



							}

						}
						drawFillBox(-200, -300, 100, 100, Color::white);
						if (!(-100<x || -300 >x + 80 || -200 <y || -300 > y + 160)){
							x = 100;
							y = -700;
						}
						drawFillBox(100, 0, 100, 100, Color::white);
						if (!(200<x || 100>x + 80 || 100<y || 0> y + 160)){
							x = 300;
							y = -50;
						}
						drawFillBox(-500, -300, 100, 100, Color::white);
						if (!(-400<x || -500>x + 80 || -400 <y || -300 > y + 160)){
							x = 200;
							y = -100;
						}
						drawFillBox(-700, -400, 100, 100, Color::white);
						if (!(-600<x || -700>x + 80 || -300<y || -400> y + 160)){
							x = 700;
							y = -200;
						}
						drawFillBox(-500, -300, 100, 100, Color::white);
						if (!(-400<x || -500 >x + 80 || -400 <y || -300 > y + 160)){
							x = 400;
							y = 500;
						}
						drawFillBox(300, 0, 100, 100, Color::white);
						if (!(400<x || 300>x + 80 || 100 <y || 0 > y + 160)){
							x = -200;
							y = -900;
						}
						drawFillBox(-800, -300, 100, 100, Color::white);
						if (!(-700<x || -800 >x + 80 || -200 <y || -300> y + 160)){
							x = -600;
							y = 300;
						}
						drawFillBox(-300, -400, 100, 100, Color::white);
						if (!(-200<x || -300 >x + 80 || -300 <y || -400> y + 160)){
							x = -500;
							y = 800;
						}
						drawFillBox(300, 300, 100, 100, Color::white);
						if (!(400<x || 300>x + 80 || 400 <y || 300> y + 160)){
							x = 900;
							y = -300;
						}
						drawFillBox(0, 600, 100, 100, Color::white);
						if (!(100<x || 0>x + 80 || 700 <y || 600> y + 160)){
							x = 800;
							y = 700;
						}
						drawFillBox(700, 0, 100, 100, Color::white);
						if (!(800<x || 700 >x + 80 || 100 <y || 0> y + 160)){
							x = -700;
							y = 800;
						}
						drawFillBox(500, -200, 100, 100, Color::white);
						if (!(600<x || 500 >x + 80 || -100 <y || -200 > y + 160)){
							x = -400;
							y = 400;
						}
						drawFillBox(900, -400, 100, 100, Color::white);
						if (!(1000<x || 900 >x + 80 || 900<y || -400 > y + 160)){
							x = -1000;
							y = 800;
						}
						drawFillBox(400, -600, 100, 100, Color::white);
						if (!(500<x || 400 >x + 80 || -500 <y || -600> y + 160)){
							x = -200;
							y = -800;
						}
						drawFillBox(300, -800, 100, 100, Color::white);

						drawFillBox(500, -900, 100, 100, Color::white);
						if (!(600<x || 500 >x + 80 || -800 <y || -900> y + 160)){
							x = 300;
							y = -50;
						}

						if (env.isPressKey(GLFW_KEY_UP)){
							y += 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1));
							if (y > 864.0f){
								y = 864.0f;

							}
						}

						else if (env.isPressKey(GLFW_KEY_LEFT)){
							x -= 5;
							drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1));
							if (x < -1024.0f){
								x = -40;
								y = -1024;

							}
						}
						else if (env.isPressKey(GLFW_KEY_DOWN)){
							y -= 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));
							if (y < -1024.0f){
								y = -1024.0f;

							}
						}
						else if (env.isPressKey(GLFW_KEY_RIGHT)){
							x += 5;
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1));
							if (x > 944.0f){
								x = -40;
								y = -1024;
							}
						}
						else {
							drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1));

						}
						
						

						drawFillBox(-400, 400, 200, 824, Color::black);
						if (!(-200<x ||-400 >x + 80 ||600 <y ||400 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(200, 400, 200, 824, Color::black);
						if (!(400<x || 200>x + 80 ||1224 <y ||400 > y + 160)){
							x = -40;
							y = -1024;
							life--;
						}
						drawFillBox(-100, 0, 200, 200, Color::black);
						if (!(100 < x || -100 > x + 80 || 200 < y || 0 > y + 160))
						{
							x = -40;
							y = -1024;
							life--;
						}





						


						


					}
				
			//-------------------------------エンド画面------------------------------------------
			if (stage_count == 15){
				drawTextureBox(-1500, -1024, 3000, 2048, 0, 0, 4096, 2048, end);
				if (env.isPushButton(Mouse::LEFT)){
					x = -1500;
					y = -1024;
					break;
				}

			}
			if (env.isPushKey(GLFW_KEY_CAPS_LOCK)){
				stage_count++;

			}
		
				env.end();
			
		}
		//ここまでが本編while


		
		
		if (!env.isOpen()){
			return 0;

		}
		
































































































































































































		env.end();
	}
//*********************************************ここまで**************************************
}
Пример #9
0
WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar,
                             WXWidget parent,
                             wxMenu * topMenu,
                             size_t WXUNUSED(index),
                             const wxString& title,
                             bool pullDown)
{
    Widget menu = (Widget) 0;
    Widget buttonWidget = (Widget) 0;
    Arg args[5];
    XtSetArg (args[0], XmNnumColumns, m_numColumns);
    XtSetArg (args[1], XmNpacking, (m_numColumns > 1) ? XmPACK_COLUMN : XmPACK_TIGHT);

    if (!pullDown)
    {
        menu = XmCreatePopupMenu ((Widget) parent, wxMOTIF_STR("popup"), args, 2);
#if 0
        XtAddCallback(menu,
            XmNunmapCallback,
            (XtCallbackProc)wxMenuPopdownCallback,
            (XtPointer)this);
#endif
    }
    else
    {
        char mnem = wxFindMnemonic (title);
        menu = XmCreatePulldownMenu ((Widget) parent, wxMOTIF_STR("pulldown"), args, 2);

        wxString title2(wxStripMenuCodes(title));
        wxXmString label_str(title2);
        buttonWidget = XtVaCreateManagedWidget(title2,
#if wxUSE_GADGETS
            xmCascadeButtonGadgetClass, (Widget) parent,
#else
            xmCascadeButtonWidgetClass, (Widget) parent,
#endif
            XmNlabelString, label_str(),
            XmNsubMenuId, menu,
            NULL);

        if (mnem != 0)
            XtVaSetValues (buttonWidget, XmNmnemonic, mnem, NULL);
    }

    m_menuWidget = (WXWidget) menu;

    m_topLevelMenu = topMenu;

    size_t i = 0;
    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
          node;
          node = node->GetNext(), ++i )
    {
        wxMenuItem *item = node->GetData();

        item->CreateItem(menu, menuBar, topMenu, i);
    }

    SetBackgroundColour(m_backgroundColour);
    SetForegroundColour(m_foregroundColour);
    SetFont(m_font);

    return buttonWidget;
}
Пример #10
0
void CDataQuotaView::HandleCommandL(TInt aCommand)
	{
	switch (aCommand)
		{
		// case EAknSoftkeyBack:
			// AppUi()->ProcessCommandL(EAknCmdExit);
			// break;

		case EAknCmdExit:
			{
			TApaTask task(iEikonEnv->WsSession());
			task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
			task.SendToBackground();
			AppUi()->HandleCommandL(EAknCmdExit);
			}
			break;

		case EDataQuotaRefresh:
			{
			iContainer->UpdateValuesL();
			iContainer->DrawNow();
#ifdef __OVI_SIGNED__
			// UninstallSelfSignedVersionL();
#endif
			}
			break;

		case EDataQuotaEditQuota:
			{
			const TInt KMaxQuota(999999);
			TInt number(iContainer->DataQuota());
			CAknNumberQueryDialog* dlg(CAknNumberQueryDialog::NewL(number));
			dlg->PrepareLC(R_AVKON_DIALOG_QUERY_VALUE_NUMBER);
			dlg->SetMinimumAndMaximum(1, KMaxQuota);
			if (dlg->RunLD())
				{
				iContainer->SetDataQuotaL(number);
				HandleCommandL(EDataQuotaRefresh);
				}
			}
			break;

		case EDataQuotaEditBillingDay:
			{
			const TInt KMinBillingDay(1);
			const TInt KMaxBillingDay(31);
			TInt number(iContainer->BillingDay() + 1);
			CAknNumberQueryDialog* dlg(CAknNumberQueryDialog::NewL(number));
			dlg->PrepareLC(R_AVKON_DIALOG_QUERY_VALUE_NUMBER);
			dlg->SetMinimumAndMaximum(KMinBillingDay, KMaxBillingDay);
			if (dlg->RunLD())
				{
				iContainer->SetBillingDayL(number - 1);
				HandleCommandL(EDataQuotaRefresh);
				}
			}
			break;

		case EDataQuotaEditDailyQuota:
			iContainer->SetQuotaTypeL(CDataQuotaContainer::EDaily);
			HandleCommandL(EDataQuotaRefresh);
			break;

		case EDataQuotaEditMonthlyQuota:
			iContainer->SetQuotaTypeL(CDataQuotaContainer::EMonthly);
			HandleCommandL(EDataQuotaRefresh);
			break;

/*		case EDataQuotaEditBillingPeriod:
			{
			TInt number(iContainer->BillingDay() + 1);
			TBool numberValid(EFalse);
			while (!numberValid)
				{
				CAknNumberQueryDialog* dlg(CAknNumberQueryDialog::NewL(number));
				dlg->PrepareLC(R_AVKON_DIALOG_QUERY_VALUE_NUMBER);
				if (dlg->RunLD())
					{
					if (number > 0 && number < 32)
						{
						iContainer->SetBillingDay(number - 1);
						numberValid = ETrue;
						}
					}
				else
					{
					numberValid = ETrue;
					}
				}
			}
			break;
*/
		case EDataQuotaResetQuota:
			{
			CAknQueryDialog* dlg(CAknQueryDialog::NewL());
			HBufC* text(iEikonEnv->AllocReadResourceLC(
				R_DATAQUOTA_RESET_QUOTA_CONFIRMATION));
			if (dlg->ExecuteLD(R_DATAQUOTA_YES_NO_QUERY_DIALOG, *text))
				{
				iContainer->ResetQuota();
				HandleCommandL(EDataQuotaRefresh);
				}
			CleanupStack::PopAndDestroy(text);
			}
			break;

		case EDataQuotaHelp:
			{
			// Create the header text
			HBufC* title(iEikonEnv->AllocReadResourceLC(R_DATAQUOTA_HELP));
			HBufC* help(iEikonEnv->AllocReadResourceLC(R_DATAQUOTA_HELP_TEXT));
			
			CAknMessageQueryDialog* dlg(new(ELeave) CAknMessageQueryDialog());
			
			// Initialise the dialog
			dlg->PrepareLC(R_DATAQUOTA_ABOUT_BOX);
			dlg->QueryHeading()->SetTextL(*title);
			dlg->SetMessageTextL(*help);
			
			dlg->RunLD();
			
			CleanupStack::PopAndDestroy(2, title); // title, help
			}
			break;

		case EDataQuotaAbout:
			{
			// Create the header text
			HBufC* title1(iEikonEnv->AllocReadResourceLC(R_DATAQUOTA_ABOUT_TEXT));
			HBufC* title2(KVersion().AllocLC());
			
			HBufC* title(HBufC::NewLC(title1->Length() + title2->Length()));
			title->Des().Append(*title1);
			title->Des().Append(*title2);
			
			CAknMessageQueryDialog* dlg(new(ELeave) CAknMessageQueryDialog());
			
			// Initialise the dialog
			dlg->PrepareLC(R_DATAQUOTA_ABOUT_BOX);
			dlg->QueryHeading()->SetTextL(*title);
			_LIT(KMessage, "(C) 2008-2012 Hugo van Kemenade\ncode.google.com/p/dataquota\ntwitter.com/DataQuota");
			dlg->SetMessageTextL(KMessage);
			
			dlg->RunLD();
			
			CleanupStack::PopAndDestroy(3, title1); // title1, title2, title
			}
			break;

		case EDataQuotaMoreAppsPodOClock:	// intentional fall-through
		case EDataQuotaMoreAppsMobbler:		// intentional fall-through
		case EDataQuotaMoreAppsSugarSync:	// intentional fall-through
			{
			TBuf<256> url;
			TBool forceNativeBrowser(EFalse);
			switch (aCommand)
				{
				case EDataQuotaMoreAppsPodOClock:
					{
#ifdef __OVI_SIGNED__
					_LIT(KUrl, "http://store.ovi.mobi/content/180798/");
					forceNativeBrowser = ETrue;
#else
					_LIT(KUrl, "http://code.google.com/p/podoclock/");
#endif
					url.Copy(KUrl);
					}
					break;
				case EDataQuotaMoreAppsMobbler:
					{
#ifdef __OVI_SIGNED__
					_LIT(KUrl, "http://store.ovi.mobi/content/75692");
					forceNativeBrowser = ETrue;
#else
					_LIT(KUrl, "http://code.google.com/p/mobbler/");
#endif
					url.Copy(KUrl);
					}
					break;
				case EDataQuotaMoreAppsSugarSync:
					{
					_LIT(KUrl, "https://www.sugarsync.com/referral?rf=eoovtb627jrd7");
					url.Copy(KUrl);
					}
					break;
				default:
					break;
				}
			
			OpenWebBrowserL(url, forceNativeBrowser);
			}
			break;
		
		default:
			break;
		}
	}