Esempio n. 1
0
void ctp2_Button::MouseLDropInside(aui_MouseEvent *mouseData)
{

	RenderDown(false);

	aui_Button::MouseLDropInside(mouseData);
}
Esempio n. 2
0
void ctp2_Button::MouseLGrabInside(aui_MouseEvent *mouseData)
{

	RenderDown();

	aui_Button::MouseLGrabInside(mouseData);
}
Esempio n. 3
0
void ctp2_Button::MouseLDragAway(aui_MouseEvent *mouseData)
{

	if(GetMouseOwnership() == this) {

		RenderDown(false);
	}

	aui_Button::MouseLDragAway(mouseData);
}
Esempio n. 4
0
void ctp2_Button::MouseLDragOver(aui_MouseEvent *mouseData)
{

	if(GetMouseOwnership() == this) {

		RenderDown();
	}

	aui_Button::MouseLDragOver(mouseData);
}
Esempio n. 5
0
void ctp2_Button::SetToggleState(bool state)
{
	m_toggleState = state;
	RenderDown(GetMouseOwnership() == this);
}
void MyFrame::OnTecla(wxKeyEvent& event)
{
 int ascii = event.GetKeyCode();
	/*wxBitmap adrixdown("/opt/extras.ubuntu.com/azpazeta/media/Adrix.png", wxBITMAP_TYPE_PNG);
	wxBitmap adrixup("/opt/extras.ubuntu.com/azpazeta/media/AdrixUp.png", wxBITMAP_TYPE_PNG);
	wxBitmap adrixleft("/opt/extras.ubuntu.com/azpazeta/media/AdrixLeft.png", wxBITMAP_TYPE_PNG);
	wxBitmap adrixright("/opt/extras.ubuntu.com/azpazeta/media/AdrixRight.png", wxBITMAP_TYPE_PNG);*/
wxClientDC dc(dcpanel);
switch(city){
	case 1:{
	switch(ascii)
	{	
	//El primer edificio está a 26 pix-------333pix y 27 piy--------------330 piy
		
		case WXK_LEFT: //Left
		if(adry< 390 && adrx<330){}else{
		adrx-=5;
		RenderLeft(dc);
		if(adrx<=1 && mision>=6){Stage2();}
		}
		break;
		case WXK_UP: //UP
		if(adry< 390 && adrx<330){}else{
		adry-=5;
		RenderUp(dc);}
		break;
		case WXK_RIGHT: //Right
		//if(){}else{
		adrx+=5;
		RenderRight(dc);
		break;
		case WXK_DOWN: //Down
		//if(/*adry< 330 && adrx<334*/){}else{
		adry+=5;
		RenderDown(dc);
		break;
		case WXK_RETURN:
		if(adry<=400 && adrx<180)
		{if(adrx>=140){
		switch(mision){
		case 0:{
		RenderUp(dc);
		dc.DrawText("Quien eres?\nNo te conozco.\nEres el nuevo?\nPresiona ENTER", wxPoint(625, 470));
		mision++;
		break;}
		case 1:
		RenderUp(dc);
		dc.DrawText("Bueno, me presento\nSoy Alfredo\nEl alcalde de Azpazeta\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 2:{
		RenderUp(dc);
		wxString completo=wxT("Como te llamas?\n")+newname+wxT("\nBonito nombre\nPresiona ENTER");
		dc.DrawText(completo,wxPoint(625,470));
		mision++;
		break;}
		case 3:
		RenderUp(dc);
		dc.DrawText("Te has perdido?\nSupongo que querras casa\nPero no va ser gratis\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 4:
		RenderUp(dc);
		dc.DrawText("Necesitaras un trabajo\nNo se de que\nEso lo dejo a tu eleccion\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 5:
		RenderUp(dc);
		dc.DrawText("[Objetivo anadido:\nEncontrar trabajo]\nPista: El pueblo esta a la izquierda",wxPoint(625,470));
		mision++;
		break;
		}}}
		break;
		case WXK_ESCAPE:
		if(aux==1){SaveDialog* savedlg;savedlg=new SaveDialog();savedlg->ShowModal();savedlg->Destroy();Adrix->Destroy();Load();}
		break;
		case WXK_TAB:
		wxMessageBox(wxT("TAB"));
		break;
		case WXK_SHIFT:{
		wxString cheat=wxGetTextFromUser(wxT("Introduce el Cheat Code"), wxT("Debug Mode"),wxT(""));
		if(cheat==wxT("2")){Stage1();Stage2();}}
		break;
		case WXK_ALT:
		SetMenuBar(menuBar);
		break;
	}break;}
	case 2:
	switch(ascii)
	{	
	//El primer edificio está a 26 pix-------333pix y 27 piy--------------330 piy
		case WXK_LEFT:
		if(adry< 470){}else{
		adrx-=5;
		RenderLeft(dc);
		if(adrx<=1 && mision==15){Stage3();}
		}
		break;
		case WXK_UP:
		if(adry< 470){}else{
		adry-=5;
		RenderUp(dc);}
		break;
		case WXK_RIGHT:
		//if(){}else{
		adrx+=5;
		RenderRight(dc);//}
		break;
		case WXK_DOWN:
		//if(/*adry< 330 && adrx<334*/){}else{
		adry+=5;
		RenderDown(dc);
		//}
		break;
		case WXK_RETURN:
		if(adry<=480)
		{if(adrx>=108 && adrx<=170){
		switch(mision){
		case 6:
		RenderUp(dc);
		dc.DrawText("\"El INEM\nSeguro que aqui habra trabajo\nVoy a ver\"\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 7:
		RenderUp(dc);
		dc.DrawText("Siguiente...\n-Venia a por trabajo\n-Tenemos en la panificadora\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 8:
		RenderUp(dc);
		dc.DrawText("-Creo que me valdra\n-Siguiente...\n\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 9:
		RenderUp(dc);
		dc.DrawText("[Objetivo anadido:\nIr a la panificadora]",wxPoint(625,470));
		mision++;
		break;
		default:
		RenderUp(dc);
		dc.DrawText("Otra vez tu\nAnda vete para fuera\n",wxPoint(625,470));
		}}
		if(adrx>=474 && adrx<=542){
		switch(mision){
		case 10:
		RenderUp(dc);
		dc.DrawText("(Ruidos)\nPUES SI, IMPORTA\nAnda, vete a...\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 11:
		RenderUp(dc);
		dc.DrawText("-Y tu quien eres?\n-Vengo por el puesto\n-Ah, sí.\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 12:
		RenderUp(dc);
		dc.DrawText("Trabajaras de comerciante\nambulante.\nIras por los pueblos\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 13:
		RenderUp(dc);
		dc.DrawText("Vamos a ver como lo haces\nVe a la plaza de Gorguez\nLleva estos panes\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		case 14:
		RenderUp(dc);
		dc.DrawText("[Objetivo anadido:\nVender los panes en Gorguez]\nPista: La estacion de tren\ntiene trenes locales",wxPoint(625,470));
		mision++;
		break; 
		default:
		RenderUp(dc);
		dc.DrawText("(Esta cerrado)",wxPoint(625,470));
		break;
		}}}

		break;
		case WXK_ESCAPE:
		if(aux==1){SaveDialog* savedlg;savedlg=new SaveDialog();savedlg->ShowModal();savedlg->Destroy();Load();}
		break;
		case WXK_TAB:
		SetMenuBar(menuBar);
		break;
		case WXK_SHIFT:{
		wxString cheat=wxGetTextFromUser(wxT("Introduce el Cheat Code"), wxT("Debug Mode"),wxT(""));
		if(cheat==wxT("2")){Stage1();Stage2();}}
		break;
		case WXK_ALT:
		SetMenuBar(menuBar);
		break;
		}break;
	case 3:
	switch(ascii)
	{	
	//El primer edificio está a 26 pix-------333pix y 27 piy--------------330 piy
		case WXK_LEFT:
		if((adry<156 && adrx<307) || ((adry<383 && adry>200) && adrx<307) || (adry<383 && adrx>503)){if(adrx==504){adrx--; RenderLeft(dc); }}else{
		if(adrx<=1){Stage4();}else{
		GOLEFT}
		//if(adrx==1 && mision>=6){Stage2();}
		}
		break;
		case WXK_UP:
		if((adry<156 && adrx<307) || ((adry<383 && adry>200) && adrx<307) || (adry<383 && adrx>503)){printf("Valor X=%d Y=%d",adrx, adry);if(adry==199){adry--; RenderUp(dc);}}else{
		if(adry<=5){Stage7();}
GOUP}
		break;
		case WXK_RIGHT:
		if((adry<156 && adrx<307) || ((adry<383 && adry>200) && adrx<307) || (adry<383 && adrx>503)){if(adrx==306){adrx++; RenderRight(dc); }}else{
		if(adrx>=746){Stage2();}
GORIGHT}
		break;
		case WXK_DOWN:
		if((adry<156 && adrx<307) || ((adry<383 && adry>200) && adrx<307) || (adry<383 && adrx>503)){if(adry==382 || adry==155){adry++; RenderDown(dc);}}else{
GODOWN}
		break;
		case WXK_RETURN:
                //Trenes
		if(adry<=427 && (adrx>=633 && adrx<=670)){
		switch(mision){
		case 15:
		RenderUp(dc);
		dc.DrawText("-Supongo que es la estacion\nVamos a ver como es\nGorguez\nPresiona ENTER",wxPoint(625,470));
		mision++;
		break;
		default:
		wxPrintf("Cargando...");
		TrenDialog* trendlg=new TrenDialog();
		wxPrintf("Mostrando...");
		trendlg->ShowModal();
		trendlg->Destroy();
		Load();
		break;
		}}
                //Piso franco
                if(adry<=196 && (adrx>=156 && adrx<=182)){
		SaveDialog* savedlg;
                savedlg=new SaveDialog();
                savedlg->ShowModal();
                savedlg->Destroy();
		Load();
                }
		break;
		case WXK_ESCAPE:
		if(aux==1){SaveDialog* savedlg;savedlg=new SaveDialog();savedlg->ShowModal();savedlg->Destroy();Load();}
		break;
		case WXK_TAB:
		wxMessageBox(wxT("TAB"));
		break;
		case WXK_SHIFT:
		break;
		case WXK_ALT:
		SetMenuBar(menuBar);
		break;
		}break;
	case 4:
	switch(ascii)
	{	
	//366-222
		case WXK_LEFT:
			if(adrx<=283){}else{
			GOLEFT}
		break;
		case WXK_UP:
			if(adry<=204 && adrx>=474){}else{
			if(adry<=10){Stage5();}
GOUP}
		break;
		case WXK_RIGHT:
			if((adry<=204 && adrx>=475) || (adry>=366 && adrx>=474)){}else{
			if(adrx>=746){Stage3();}
	GORIGHT}
		break;
		case WXK_DOWN:
			if(adry>=366 && adrx>=474){}else{
			GODOWN}
		break;
		case WXK_RETURN:
		if((adrx>=616 || adrx<=688) && adry>=360){
		DivelKey* keydlg=new DivelKey();
		keydlg->ShowModal();
		keydlg->Destroy();}
		break;
		case WXK_ESCAPE:
		if(aux==1){SaveDialog* savedlg;savedlg=new SaveDialog();savedlg->ShowModal();savedlg->Destroy();Load();}
		break;
		case WXK_TAB:
		
		break;
		case WXK_SHIFT:
		
		break;
		case WXK_ALT:
		SetMenuBar(menuBar);
		break;
		}break;
	case 5:
	switch(ascii)
	{	
	//366-222
		case WXK_LEFT:
		if(adrx<=362 && (adry<=226 || adry>=399)){}else{
		GOLEFT

		}
		break;
		case WXK_UP:
		if(adrx<=362 && adry<=226){}else{
		if(adry<=5){Stage6();}
		GOUP
		}		//226-362
		break;
		case WXK_RIGHT:
		if(adrx>=545){}else{
		GORIGHT
		}
		break;
		case WXK_DOWN:
		if(adrx<=362 && adry>=399){}else{
		if(adry>=540){Stage4();}
		GODOWN
		}//399-362
		break;
		case WXK_RETURN:
		if((adrx>=154 && adrx<=222) && adry<=230){
		switch(mision){
		default: Police* poldlg=new Police();
		poldlg->ShowModal();
		poldlg->Destroy();
			}		
			}
		break;
		case WXK_ESCAPE:
		if(aux==1){SaveDialog* savedlg;savedlg=new SaveDialog();savedlg->ShowModal();savedlg->Destroy();Load();}
		break;
		case WXK_TAB:
		
		break;
		case WXK_SHIFT:
		
		break;
		case WXK_ALT:
		SetMenuBar(menuBar);
		break;
		}break;
	case 6:
	switch(ascii)
	{	
	//366-222
		case WXK_LEFT:
		GOLEFT
		break;
		case WXK_UP:
		if(adry<=300){}else{
		GOUP
		}
		break;
		case WXK_RIGHT:
		GORIGHT
		break;
		case WXK_DOWN:
		if(adry>=540){ Stage5();}
		GODOWN
		break;
		case WXK_RETURN:
		//Entrar en Hipermercado
		if(adry<=320 && (adrx>=407 && adrx<=470)){Hiper* hiperdlg; hiperdlg=new Hiper(); hiperdlg->ShowModal();hiperdlg->Destroy();}
		break;
		case WXK_ESCAPE:
		if(aux==1){SaveDialog* savedlg;savedlg=new SaveDialog();savedlg->ShowModal();savedlg->Destroy();Load();}
		break;
		case WXK_TAB:
		
		break;
		case WXK_SHIFT:
		
		break;
		case WXK_ALT:
		SetMenuBar(menuBar);
		break;
		}break;
	case 7:
	switch(ascii)
	{	
	//366-222
		case WXK_LEFT:
		GOLEFT
		break;
		case WXK_UP:
		if(adry<=300){}else{
		GOUP
		}
		break;
		case WXK_RIGHT:
		GORIGHT
		break;
		case WXK_DOWN:
		if(adry>=540){Stage3();}
		GODOWN
		break;
		case WXK_RETURN:
		if(adry<=302 && (adrx>=382 && adrx<=440)){Golf* golfdlg; golfdlg=new Golf();golfdlg->ShowModal();golfdlg->Destroy();}
		break;
		case WXK_ESCAPE:
		if(aux==1){SaveDialog* savedlg;savedlg=new SaveDialog();savedlg->ShowModal();savedlg->Destroy();Load();}
		break;
		case WXK_TAB:
		
		break;
		case WXK_SHIFT:
		
		break;
		case WXK_ALT:
		SetMenuBar(menuBar);
		break;
		}break;
	case 11:
	switch(ascii)
	{	
	//366-222
		case WXK_LEFT:
		if((adrx<=405 && adry>=405) || (adrx<=150 && adry<=130)){}else{
		GOLEFT
		}
		break;
		case WXK_UP:
		if((adrx<=150 && adry<=130) || (adrx>=555 && adry<=340)){}else{
		GOUP
		}
		break;
		case WXK_RIGHT:
		if(adrx>=555 && (adry<=340 || adry>=505)){}else{
		GORIGHT
		}
		break;
		case WXK_DOWN:
		if((adrx<=405 && adry>=405) || (adrx>=555 && adry>=505)){}else{
		GODOWN
		}
		break;
		case WXK_RETURN:
		//Bread&Pan
		if(adrx<=102 && adry<=152){
		DialogBox* dlgbox;
		dlgbox=new DialogBox();
		dlgbox->ShowModal();
		dlgbox->Destroy();
		}
		//Mercado
		if((adrx>=665 && adrx<=732) && adry<=358){
		Mercado* merdlg;
		merdlg=new Mercado();
		merdlg->ShowModal();
		merdlg->Destroy();
		}
		//Estacion de Tren
		if((adrx>=665 && adrx<=732) && adry>=498){
		int iraazpazeta=wxMessageBox("Deseas ir a Azpazeta por 50 $?","Train Station",wxYES_NO|wxICON_QUESTION);
		if(iraazpazeta==wxYES){
		money-=50;
		city=3;
		Load();
		}
		}
		break;
		case WXK_ESCAPE:
		if(aux==1){SaveDialog* savedlg;savedlg=new SaveDialog();savedlg->ShowModal();savedlg->Destroy();Load();}
		break;
		case WXK_TAB:
		
		break;
		case WXK_SHIFT:
		
		break;
		case WXK_ALT:
		SetMenuBar(menuBar);
		break;
		}break;

}
}
void MyFrame::Paint()
{
	wxClientDC dc(dcpanel);
    RenderDown(dc);
}