bool CSequence::DoProperties()
{
	bool dirty = false;

	if (IsGLA())
	{
		InfoBox("You can't edit the properties of a GLA file");
	}
	else
	{
		CPropertySheet* propSheet = new CPropertySheet(m_name);

 		CSequencePropPage* propPage = new CSequencePropPage();
		propPage->m_sequence = this;
		propPage->m_soilFlag = &dirty;
		propSheet->AddPage(propPage);

		propSheet->DoModal();

		delete propPage;
		delete propSheet;
	}

	return dirty;
}
Exemple #2
0
void CTestMenu::testShowActuellEPG()
{
	CEPGData epgData;
	event_id_t epgid = 0;
			
	if(sectionsd_getActualEPGServiceKey(live_channel_id&0xFFFFFFFFFFFFULL, &epgData))
		epgid = epgData.eventID;

	if(epgid != 0) 
	{
		CShortEPGData epgdata;
				
		if(sectionsd_getEPGidShort(epgid, &epgdata)) 
		{
			//InfoBox
			std::string title;
			title = g_Zapit->getChannelName(live_channel_id);
			title += ":";
			title += epgdata.title;
			std::string buffer;
			buffer = epgdata.info1;
			buffer += "\n";
			buffer += epgdata.info2;
			
			InfoBox(title.c_str(), buffer.c_str(), CInfoBox::mbrBack, CInfoBox::mbBack);	// UTF-8
			
		}
	}
	else
		MessageBox(LOCALE_MESSAGEBOX_ERROR, "No EPG found!", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR);
}
Exemple #3
0
void CWebTV::showFileInfoWebTV(int pos)
{
	if(pos > -1)
	{
		InfoBox(channels[pos]->title.c_str(), channels[pos]->description.c_str(), CInfoBox::mbrBack, CInfoBox::mbBack);
		/*
		int mode =  CInfoBox::SCROLL | CInfoBox::TITLE | CInfoBox::FOOT | CInfoBox::BORDER;// | //CInfoBox::NO_AUTO_LINEBREAK | //CInfoBox::CENTER | //CInfoBox::AUTO_WIDTH | //CInfoBox::AUTO_HIGH;
		CBox position(g_settings.screen_StartX + 50, g_settings.screen_StartY + 50, g_settings.screen_EndX - g_settings.screen_StartX - 100, g_settings.screen_EndY - g_settings.screen_StartY - 100); 
					
		CInfoBox * infoBox = new CInfoBox(channels[pos]->title.c_str(), g_Font[SNeutrinoSettings::FONT_TYPE_MENU], mode, &position, channels[pos]->title.c_str(), g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], NULL);
		infoBox->setText(&channels[pos]->description);
		infoBox->exec();
		delete infoBox;
		*/
	}
}
int WINAPI WinMain(HINSTANCE inst, 
                   HINSTANCE prevInstance, 
                   LPSTR lpszCmdLine,
                   int nShowCmd)
{
	char* lpszAppName = "HelloWorld";
	HWND wnd;
	WNDCLASSEX wndclass;
	int retCode;

    {	//  Needed to scope all nsCOMPtr within XPCOM Init and Shutdown
      nsresult rv;
      nsCOMPtr<nsIServiceManager> servMan;
      rv = NS_InitXPCOM2(getter_AddRefs(servMan), nsnull, nsnull);
      if(NS_FAILED(rv))
      {
        ErrorBox("Failed to initialize xpcom.");
        return -1;
      }
      
      nsCOMPtr<nsIComponentRegistrar> registrar = do_QueryInterface(servMan);
      NS_ASSERTION(registrar, "Null nsIComponentRegistrar");
      registrar->AutoRegister(nsnull);
      
      nsCOMPtr<nsINativeApp> nativeAppService(do_GetService(kNativeAppCID, &rv));

      if(NS_FAILED(rv))
      {
        ErrorBox("Failed to get nativeAppService");
        return -1;
      }
      wndclass.cbSize        = sizeof(wndclass);
      wndclass.style         = CS_HREDRAW | CS_VREDRAW;
      wndclass.lpfnWndProc   = WndProc;
      wndclass.cbClsExtra    = 0;
      wndclass.cbWndExtra    = 0;
      wndclass.hInstance     = inst;
      wndclass.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
      wndclass.hCursor       = LoadCursor(NULL, IDC_ARROW);
      wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
      wndclass.lpszMenuName  = NULL;
      wndclass.lpszClassName = lpszAppName;
      wndclass.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

      RegisterClassEx(&wndclass) ;
      
      wnd = CreateWindow(lpszAppName, "The Hello World",
                         WS_OVERLAPPEDWINDOW,
                         CW_USEDEFAULT, CW_USEDEFAULT,
                         CW_USEDEFAULT, CW_USEDEFAULT,
                         NULL, NULL, inst, NULL);		     
      
      ShowWindow(wnd, nShowCmd);
      UpdateWindow(wnd);
      
      nsCOMPtr<nsIEventLoop> eventLoop;
      
      if(NS_FAILED(nativeAppService->CreateEventLoop(L"_MainLoop", 
                                                     nsEventLoopTypes::MainAppLoop, getter_AddRefs(eventLoop))))
        {
          ErrorBox("Failed to create event Loop");
          return 0;
        } 
      
      eventLoop->Run(nsnull, nsnull, nsnull, &retCode);
      eventLoop = nsnull; // Clear out before Shutting down XPCOM
      
      InfoBox("Hello World app is out of loop");
    }
	NS_ShutdownXPCOM(nsnull);
	InfoBox("Hello World app is exiting");
	return retCode;
}
Exemple #5
0
/*
Returns the number of frames loaded
*/
int XSI_LoadFile(const char *filename)
{
	char *filebin=0;
	TxtNode *root;

	FILE *fp=fopen(filename,"ra");
	if (!fp){
		InfoBox(va("File not found: \"%s\"",filename));
		return 0;
	}
	fseek(fp,0,SEEK_END);
	int len=ftell(fp);
	filebin=new char[len];
	fseek(fp,0,SEEK_SET);
	if (fread(filebin,1,len,fp)!=(size_t)len)
	{	
		fclose(fp);
		InfoBox(va("Bad XSI file\n",filename));
		delete(filebin);
		return 0;
	}
	fclose(fp);
	
	char *at=filebin;
	char *end=filebin+len;
	root=new TxtNode;
	TxtNode **last=&root->child;
	char *retat;
	while (1)
	{
		TxtNode *t=ReadANode(at,end,&retat);
		if (!t)
		{
			at=end;
			break;
		}
		at=retat;
		*last=t;
		last=&t->sibling;
	}
	if (!root->child)
	{
		printf("Bad XSI file\n");
		delete(filebin);
		delete root;
		return 0;
	}
#if PDEB
	root->Print(0);
#endif

	nsNodes=0;
	maxframe=-10000;
	minframe=10000;
	startframe=10000;
	endframe=-10000;
	CacheName[0]=0;
	int fn=FindNodes(0,root);
	if (!fn)
	{
		fn=FindAnims(root);
	}

	delete(filebin);
	delete root;

	if (fn==2000)
	{
		printf("XSI import failed, Missing Keys\n",fn);
		return 0;
	}
	if (fn)
	{
		printf("XSI import failed, code = %d",fn);
		return 0;
	}
	return maxframe+1;
}
Exemple #6
0
void CMainFrame::OnViewGlinfo() 
{
	InfoBox(va("%s",GL_GetInfo()));
}
Exemple #7
0
bool Skins_Validate( ModelContainer_t *pContainer, int iSkinNumber )
{
	bool bReturn = true;	
	bool bPREV_bReportImageLoadErrors = g_bReportImageLoadErrors;
										g_bReportImageLoadErrors = false;

	bool bCheckMissingMaterials = true;//GetYesNo("Check for materials referenced by model but missing in skinfile(s)?\n\n( Note: This can give false alarms for skins which don't use (eg) \"scarf\" )");

	// first, build up a list of all model materials...
	//	
	StringSet_t MaterialsPresentInModel;
	for (int iSurface = 0; iSurface < pContainer->iNumSurfaces; iSurface++)
	{
		bool bOnOff = GLMModel_SurfaceIsON(pContainer->hModel, iSurface);

		if (bOnOff)
		{
			LPCSTR psMaterial = GLMModel_GetSurfaceShaderName( pContainer->hModel, iSurface);

			MaterialsPresentInModel.insert(MaterialsPresentInModel.end(),psMaterial);
		}
	}

	// build up a list of shaders used...
	//	
	StringSet_t UniqueSkinShaders;	
	SkinFileMaterialsMissing_t SkinFileMaterialsMissing;
	int iThisSkinIndex = 0;
	for (SkinSets_t::iterator itSkins = pContainer->SkinSets.begin(); itSkins != pContainer->SkinSets.end(); ++itSkins, iThisSkinIndex++)
	{
		if (iSkinNumber == iThisSkinIndex || iSkinNumber == -1)
		{
			SkinSet_Validate_BuildList(UniqueSkinShaders, itSkins, MaterialsPresentInModel, SkinFileMaterialsMissing);
		}
	}

	// now process the unique list we've just built...
	//
	CWaitCursor wait;
	string strFoundList;
	string strNotFoundList;
	int iUniqueIndex = 0;
	for (StringSet_t::iterator it = UniqueSkinShaders.begin(); it != UniqueSkinShaders.end(); ++it, iUniqueIndex++)
	{			
		string strShader(*it);

		StatusMessage(va("Processing shader %d/%d: \"%s\"\n",iUniqueIndex,UniqueSkinShaders.size(),strShader.c_str()));

		OutputDebugString(va("Unique: \"%s\"... ",strShader.c_str()));

		int iTextureHandle = Texture_Load(strShader.c_str(), true);	// bInhibitStatus

		GLuint uiGLBind = Texture_GetGLBind( iTextureHandle );

		if (uiGLBind == 0)
		{
			OutputDebugString("NOT FOUND\n");
			
			strNotFoundList += strShader;
			strNotFoundList += "\n";
		}
		else
		{
			OutputDebugString("found\n");

			strFoundList += strShader;
			strFoundList += "\n";
		}
	}

	StatusMessage(NULL);

	
	// see if we were missing any model materials in these skins...
	//
	CString strModelMaterialsMissing;
	if (SkinFileMaterialsMissing.size())
	{
		for (SkinFileMaterialsMissing_t::iterator itSkinFileMaterialsMissing = SkinFileMaterialsMissing.begin(); itSkinFileMaterialsMissing != SkinFileMaterialsMissing.end(); ++itSkinFileMaterialsMissing)
		{
			string strSkinFileName((*itSkinFileMaterialsMissing).first);

			if (iSkinNumber == -1)
			{
				strModelMaterialsMissing += va("\nSkin \"%s\":\n",strSkinFileName.c_str());
			}
																					 
			for (EthnicMaterials_t::iterator itSkinFile = (*itSkinFileMaterialsMissing).second.begin(); itSkinFile != (*itSkinFileMaterialsMissing).second.end(); ++itSkinFile)
			{
				string strEthnicFileName((*itSkinFile).first);

				strModelMaterialsMissing += va("Ethnic \"%s\":   ",strEthnicFileName.c_str());

				StringVector_t& MaterialStrings = (*itSkinFile).second;

				for (int iMaterial = 0; iMaterial != MaterialStrings.size(); ++iMaterial)
				{
					string strMaterial(MaterialStrings[iMaterial]);

					strModelMaterialsMissing += va("%s\"%s\"",(iMaterial==0)?"":", ",strMaterial.c_str());
				}
				strModelMaterialsMissing += "\n";
			}
		}
	}
	if (!strModelMaterialsMissing.IsEmpty())
	{
		if (iSkinNumber == -1)
		{
			strModelMaterialsMissing.Insert(0, "One or more skin files are missing some material definitions referenced by this model's currently-active surfaces.\nList follows...\n\n");
		}
		else
		{
			strModelMaterialsMissing.Insert(0, "This skin file is missing one or more material definitions referenced by this model's currently-active surfaces.\nList follows...\n\n");
		}
	}

	
	if (!strModelMaterialsMissing.IsEmpty())
	{
		if (bCheckMissingMaterials)
		{
			WarningBox(va("Summary Part 1: Missing materials\n\n%s",(LPCSTR)strModelMaterialsMissing));
		}
	}


	// Now output results...

	// If too many lines to fit on screen (which is now happening), send 'em to notepad instead...
	//
	// ( tacky way of counting lines...)
	CString strTackyCount(strNotFoundList.c_str());
			strTackyCount += strFoundList.c_str();

	int iLines = strTackyCount.Replace('\n','?');	// :-)

	#define MAX_BOX_LINES_HERE 50

	if (strNotFoundList.empty())
	{
		if (iLines > MAX_BOX_LINES_HERE)
		{
			if (GetYesNo(va("All shaders found...    :-)\n\nList has > %d entries, send to Notepad?",MAX_BOX_LINES_HERE)))
			{
				SendStringToNotepad(va("All shaders found...    :-)\n\nList follows:\n\n%s",strFoundList.c_str()),"found_shaders.txt");
			}
		}
		else
		{
			InfoBox(va("All shaders found...    :-)\n\nList follows:\n\n%s",strFoundList.c_str()));
		}
	}
	else
	{
		if (iLines > MAX_BOX_LINES_HERE)
		{
			if (GetYesNo(va("Some missing shader, some found, but list is > %d entries, send to Notepad?",MAX_BOX_LINES_HERE)))
			{
				SendStringToNotepad(va("Missing shaders:\n\n%s\n\nFound shaders:\n\n%s",strNotFoundList.c_str(),strFoundList.c_str()),"found_shaders.txt");
			}
		}
		else
		{
			WarningBox(va("Missing shaders:\n\n%s\n\nFound shaders:\n\n%s",strNotFoundList.c_str(),strFoundList.c_str()));
		}
		bReturn = false;
	}


	g_bReportImageLoadErrors = bPREV_bReportImageLoadErrors;
	return bReturn;
}
// every case here must either do CommArea_CommandAck(...) or CommArea_CommandError(...),
//	failure to do this is amazingly bad!!!
// 
static void HandleCommands(LPCSTR psString, byte *pbCommandData, int iCommandDataSize)
{
/*
#define IF_ARG(string)	if (!strncmp(psArg,string,strlen(string)))
#define NEXT_ARG		SkipWhitespace(FindWhitespace(psArg))

	LPCSTR psArg = psString;
		
	IF_ARG("model_loadprimary")
	{
		psArg = NEXT_ARG;

		if (Document_ModelLoadPrimary( psArg ))
		{
			CommArea_CommandAck();
		}
		else
		{
			CommArea_CommandError(va("ModView: Failed command: \"model_loadprimary %s\"\"", psArg));
		}
	}
	else				
	IF_ARG("modeltree_getrootsurface")
	{
		// for this command, just send back whatever the answer is without validating...
		//
		HTREEITEM hTreeItem = ModelTree_GetRootSurface(Model_GetPrimaryHandle());
		
		CommArea_CommandAck(va("%d",hTreeItem));
	}
	else				
	IF_ARG("modeltree_getrootbone")
	{
		// for this command, just send back whatever the answer is without validating...
		//
		HTREEITEM hTreeItem = ModelTree_GetRootBone(Model_GetPrimaryHandle());

		CommArea_CommandAck(va("%d",hTreeItem));
	}
	else
	// this version MUST be the first of the two, or the shorter one will early-match even a long command
	IF_ARG("modeltree_getitemtextpure")	// "...pure" will skip stuff like "////" for disabled surfaces
	{
		psArg = NEXT_ARG;

		HTREEITEM	hTreeItem	= (HTREEITEM) atoi(psArg);
		LPCSTR		psText		= ModelTree_GetItemText(hTreeItem,true);

		CommArea_CommandAck(psText);
	}
	else
	IF_ARG("modeltree_getitemtext")
	{
		psArg = NEXT_ARG;

		HTREEITEM	hTreeItem	= (HTREEITEM) atoi(psArg);
		LPCSTR		psText		= ModelTree_GetItemText(hTreeItem);

		CommArea_CommandAck(psText);
	}
	else
	IF_ARG("modeltree_getchilditem")
	{
		psArg = NEXT_ARG;

		HTREEITEM	hTreeItem = (HTREEITEM) atoi(psArg);
					hTreeItem = ModelTree_GetChildItem(hTreeItem);

		CommArea_CommandAck(va("%d",hTreeItem));
	}
	else
	IF_ARG("modeltree_getnextsiblingitem")
	{
		psArg = NEXT_ARG;

		HTREEITEM	hTreeItem = (HTREEITEM) atoi(psArg);
					hTreeItem = ModelTree_GetNextSiblingItem(hTreeItem);

		CommArea_CommandAck(va("%d",hTreeItem));
	}
	else
	{
		// unknown command...
		//		
		CommArea_CommandError(va("ModView: Unknown command \"%s\"", psString));
	}
*/

	InfoBox(va("CommsTest: Command recieved: \"%s\"",psString));

	if (GetYesNo("CommsTest: Report as error? ('NO' will report success)"))
	{
		CommArea_CommandError(va("CommsTest: Failed to complete task '%s'", psString));
	}
	else
	{					
		CommArea_CommandAck();
	}
}
Exemple #9
0
void CTestMenu::testCInfoBoxShowMsg()
{
	InfoBox("InfoBox", "infobox.cpp", CInfoBox::mbrBack, CInfoBox::mbBack);	// UTF-8
}