void FStringTable::LoadStrings (bool enuOnly)
{
	int lastlump, lump;
	int i, j;

	FreeNonDehackedStrings ();

	lastlump = 0;

	while ((lump = Wads.FindLump ("LANGUAGE", &lastlump)) != -1)
	{
		j = 0;
		if (!enuOnly)
		{
			LoadLanguage (lump, MAKE_ID('*',0,0,0), true, ++j);
			for (i = 0; i < 4; ++i)
			{
				LoadLanguage (lump, LanguageIDs[i], true, ++j);
				LoadLanguage (lump, LanguageIDs[i] & MAKE_ID(0xff,0xff,0,0), true, ++j);
				LoadLanguage (lump, LanguageIDs[i], false, ++j);
			}
		}

		// Fill in any missing strings with the default language
		LoadLanguage (lump, MAKE_ID('*','*',0,0), true, ++j);
	}
}
示例#2
0
/*-----------------------------------------------------------------*/
__fastcall TOverviewForm::TOverviewForm(TComponent* Owner, TDBWFRM* _frm)
    : TForm(Owner), frm(_frm)
{
    LoadLanguage();

    int ddx, ddy;

    // Zoom dynamisch anhand Range ermitteln...
    if (frm->kette.count()!=0) ddx = ClientWidth / frm->kette.count() + 1;
    else ddx = 0;
    if (frm->schuesse.count()!=0) ddy = (ClientHeight-Toolbar->Height) / frm->schuesse.count() + 1;
    else ddy = 0;

    if (ddx<=0) ddx = 1;
    if (ddy<=0) ddy = 1;
    if (ddx>10) ddx = 10;
    if (ddy>10) ddy = 10;

    zoom = min (ddx, ddy);

    if (zoom==1) {
        SBZoomIn->Enabled = true;
        SBZoomOut->Enabled = false;
    }

    if (zoom==10) {
        SBZoomIn->Enabled = false;
        SBZoomOut->Enabled = true;
    }

    grid = true;
    SBGrid->Down = grid;
}
示例#3
0
CString Language::GetString(UINT uiID, const CString& strKey)
{
	CString strValue = _T("");

	// 使用系统语言
	if (m_strFileName.IsEmpty())
	{
		LoadLanguage(GetUserDefaultLangID());
	}

	// 使用配置文件数据
	LANG_MAP::iterator iter = m_langMap.find(strKey);
	if(m_langMap.end() != iter)
	{
		strValue = iter->second;
	}

	if(strValue.IsEmpty())
	{
		// 使用默认配置
		TCHAR tchValue[LANGUAGE_MAX_LENGTH] = {0};
		(void)::LoadString(AfxGetInstanceHandle(), uiID, tchValue, /*sizeof(TCHAR)**/LANGUAGE_MAX_LENGTH);
		strValue = tchValue;
	}

	return strValue;
}
示例#4
0
void GuiLanguage::Set(const std::string & lang_id, std::ostream & error)
{
	if (m_lang_id != lang_id)
	{
		m_lang_id = lang_id;
		LoadLanguage(error);
	}
}
示例#5
0
BOOL LanguageManager::LoadLanguage(UINT idx)
{
	if (idx >= GetLanguageCount())
		return FALSE;
	if (IsLanguageLoaded(idx))
		return TRUE;
	return LoadLanguage(m_languages[idx].langPath.c_str());
}
示例#6
0
/*-----------------------------------------------------------------*/
__fastcall TCursorDirForm::TCursorDirForm(TComponent* Owner, CURSORDIRECTION _cd, int /*_dummy*/)
: TForm(Owner), cursordirection(_cd)
{
    LoadLanguage();
    if (_cd&CD_UP) cdUp->Down = true;
    if (_cd&CD_DOWN) cdDown->Down = true;
    if (_cd&CD_LEFT) cdLeft->Down = true;
    if (_cd&CD_RIGHT) cdRight->Down = true;
}
示例#7
0
bool nuiTranslator::LoadLanguage(const nglString& rLangID)
{
  LanguageFiles::const_iterator it = mFiles.find(rLangID);
  if (it == mFiles.end())
    return false;
  
  const nglPath& rPath(it->second);
  return LoadLanguage(rPath);
}
示例#8
0
/*
 * Loads the currently selected language
 */
static void select_language()
{
  TREENODE* lang = language_menu->children[language_index];
  if( lang->node_type == NODETYPE_LANG_DEFAULT )
  {
    wii_language[0] = '\0'; // update selected language 
    LoadLanguage( NULL );
  }
  else
  {
    // update selected language 
    Util_strlcpy( wii_language, lang->name, sizeof(wii_language) );

    char langfile[WII_MAX_PATH] = "";
    snprintf( langfile, WII_MAX_PATH, "%s%s.%s", 
      wii_get_lang_dir(), lang->name, WII_LANG_EXT );    
    LoadLanguage( langfile );    
  }
}
示例#9
0
BOOL LanguageManager::LoadLanguageByLANGID(LANGID lID)
{
	LPCTSTR langName = GetLangNameByLangID(lID);
	if (langName != NULL)
	{
		TCHAR path[MAX_PATH];
		_sntprintf(path, MAX_PATH, _T("%s%s.lng"), GetLanguageFolder(), langName);
		return LoadLanguage(path);
	}
	return FALSE;
}
示例#10
0
bool Wll0Intepreter::IntepretWll(const std::vector<Symbols>& input_symbols, std::vector<Symbols>& output_symbols)
{
	if( !input_symbols.empty() && input_symbols.front()==Symbols::REMARK_WLL0 )
	{
		return LoadLanguage(input_symbols, this->compiler->languages);
	}
	else
	{
		output_symbols = input_symbols;
		return true;
	}
}
示例#11
0
bool nuiTranslator::LoadLanguage(const nglPath& rLanguageFile)
{
  nglIStream* pStream = rLanguageFile.OpenRead();
  if (!pStream)
    return false;
  
  bool res = LoadLanguage(pStream);
  
  delete pStream;
  
  return res;
}
示例#12
0
/*-----------------------------------------------------------------*/
__fastcall TChoosePaletteForm::TChoosePaletteForm(TComponent* Owner)
: TForm(Owner)
{
    LoadLanguage();

    DRAWSIZE = pbColors->Width / 16;
    if (DRAWSIZE > pbColors->Height/16) DRAWSIZE = pbColors->Height/16;

    ClientWidth = pbColors->Width + 8 + DRAWSIZE;
    ClientHeight = bOk->Top + bOk->Height + 12;

    index = 0;
    ActiveControl = DummyEdit;
}
示例#13
0
long LoadResource(const char *FileName)
{
  long ResourceSize;

  /***************************************************************/
  /* Load the Graphical part of the Resource                     */
  /***************************************************************/
  Program->FileId=Open(FileName,READ);                             /* Opens the resource-file                                   */
  if(Program->FileId<0)                                            /* IF the resourcefile cannot be opened                      */
    return ERROR_NO_RESOURCE_FILE;                                 /* Return an error                                           */

  ResourceSize=FileSize(filename);                                 /* Get the size of the resourcefile                          */
  Program->Resource=(RHeader *)Alloc(ResourceSize+1);                 /* Allocate enough memory for the resource and the header    */
  if(Program->Resource==NULL)                                      /* If the needed memory could not be allocated               */
  {
    Close(Program->FileId);                                        /* close the resource-file                                   */
    return ERROR_NO_MEMORY_FOR_RESOURCE;                           /* and return an error                                       */
  }
  if(Read(FileId,Program->Resource,ResourceSize)!=ResourceSize)    /* Read the resourcefile contents into the allocated memory  */
  {                                                                /* If the file cannot be read, or less Data is read          */
    Close(Program->FileID);                                        /* Close the Resopurce file                                  */
    Free(Program->Resource);                                       /* Free the allocated memory                                 */
    return ERROR_READING_RESOURCE_FILE;                            /* Return an error                                           */
  }
  StringCopy(Program->ResourceName,FileName);                      /* Copy the resource-file-name to the program data buffert   */

  Close(Program->FileID);                                          /* Close the resource-file since it is not needed any more   */
  /***************************************************************/
  /* Load the Textual part of the resource                       */
  /***************************************************************/
  if(!LoadLanguage(0))                                             /* Load the default system language (what the user has set) */
  {                                                                /* If any language at all cannot be loaded                  */
    Free(Program->resource);                                       /* Free the allocated memory for the graphical part         */
    return ERROR_NO_LANGUAGE_FILE;                                 /* return an Error                                          */
  }

  /***************************************************************/
  /* Insert the Textual Part into the Graphical Part             */
  /***************************************************************/

  /***************************************************************/
  /* Fix objects and other parts that use pointers in memory     */
  /***************************************************************/

}
示例#14
0
BOOL CScadViewerApp::InitInstance()
{
	m_Settings.Initialize(_T(""));
	m_Settings.StartFileProc();
	AfxOleInit();

	// Standard initialization
/*
#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif
*/
	// Change the registry key under which our settings are stored.
	SetRegistryKey(_T("Scad Soft"));

	LoadStdProfileSettings(10);  // Load standard INI file options (including MRU)
	LoadLanguage(1049);

	// Register document templates

	CSingleDocTemplate* pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(CScadViewerDoc),
		RUNTIME_CLASS(CMainScadViewerFrame),       // main SDI frame window
		RUNTIME_CLASS(CScadViewerView));
	AddDocTemplate(pDocTemplate);

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);
	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;
	//m_pMainWnd->ShowWindow(SW_SHOW);
	//m_pMainWnd->UpdateWindow();

	return TRUE;
}
void LanguageTable::LoadTranslation(char *_filename)
{
    LoadLanguage( _filename, m_translation );

#ifdef _DEBUG
    DArray<char *> *keys = m_baseLanguage.ConvertIndexToDArray();

    for( int i = 0; i < keys->Size(); ++i )
    {
        if( keys->ValidIndex(i) )
        {
            char *key = keys->GetData(i);
			if( !m_translation.GetData( key ) )
			{
				AppDebugOut( "Warning : base language key '%s' with no translation in language file %s\n", key, _filename );
			}
        }
    }

    delete keys;
#endif
}
示例#16
0
/*-----------------------------------------------------------------*/
__fastcall TFixeinzugForm::TFixeinzugForm(TComponent* Owner, TDBWFRM* _frm, CrCursorHandler* _ch)
: TForm(Owner), frm(_frm)
{
    LoadLanguage();

    dbw3_assert(frm!=NULL);

    Width = frm->Width;
    Left = frm->Left;

    Top = frm->gewebe.pos.y0+30;

    cursorhandler = _ch;
    if (cursorhandler) cursordirection = cursorhandler->GetCursorDirection();

    // Daten kopieren
    try {
        einzug = new short[Data->MAXX1];
        memset (einzug, 0, sizeof(short)*Data->MAXX1);
        size = frm->fixsize;
        for (int i=0; i<=size; i++)
            einzug[i] = frm->fixeinzug[i];
        firstfree = frm->firstfree;
        changed = false;
    } catch (...) {
        dbw3_assert(false);
    }

    cx = cy = 0;
    scrollx = 0;
    scrolly = 0;

    RecalcDimensions();
    CalcRange();
    Invalidate();
}
void LanguageTable::LoadBaseLanguage(char *_filename)
{
    LoadLanguage( _filename, m_baseLanguage );
}
示例#18
0
dword My_IdleHandler(void)
{
	dword	currentTickTime = 0;
	static	byte	oldMin = 100, oldSec = 0;
	static	byte	schIdleHandlerSV = SCH_IDLE_HANDLER_INITIALISE;

	switch(schIdleHandlerSV)
	{
	/*--------------------------------------------------*/
	case SCH_IDLE_HANDLER_INITIALISE:

		FindTapDir();
		schMainDetermineChangeDirType();
		schFileCreateSettingsFolder();
		LoadConfiguration();
		LoadLanguage();
		CacheLogos();
		schMainInitLcnToSvcNumMap();
		schDispWindowInitialise();
		schEditWindowInitialise();
		initialiseMenu();
		InitialiseConfigRoutines();
		schShowWindowInitialise();
		logInitialise();
		schMainAlreadyRecordedInitialise();

		schMainApiMoveAvailable = FALSE;
		schMainDebugMoveAvailable = FALSE;

#ifndef WIN32
		if( FirmwareCallsEnabled == TRUE )
		{
			schMainApiMoveAvailable = fcCheckApiMoveAvailability();

			if(schMainApiMoveAvailable == FALSE)
			{
				StartTAPExtensions();

				schMainDebugMoveAvailable = fcCheckDebugMoveAvailability();
			}
		}
#else
		schMainApiMoveAvailable = TRUE;
#endif

		schIdleHandlerSV = SCH_IDLE_HANDLER_SERVICE;

		break;
	/*--------------------------------------------------*/
	case SCH_IDLE_HANDLER_SERVICE:

		currentTickTime = TAP_GetTick();				// only get the current tick time once
		if ( keyboardWindowShowing ) KeyboardCursorBlink( currentTickTime );

		schObtainCurrentTime();

		if
		(
			(creditsShowing == FALSE)
			&&
			(menuShowing == FALSE)
			&&
			(schEditWindowShowing == FALSE)
			&&
			(schDispWindowShowing == FALSE)
			&&
			(schShowWindowShowing == FALSE)
		)
		{
			schMainService();

			if
			(
				(FirmwareCallsEnabled == TRUE)
				&&
				(
					(schMainApiMoveAvailable == TRUE)
					||
					(schMainDebugMoveAvailable == TRUE)
				)
			)
			{
				schMoveService();

				schKeepService();
			}

			oldMin = 100;
		}
		else
		{
			if(schShowWindowShowing == TRUE)
			{
				schShowService();
			}

			if ( schTimeMin != oldMin )
			{
				oldMin = schTimeMin;

				if
				(
					( menuShowing == FALSE )
					&&
					( creditsShowing == FALSE )
				)
				{
					UpdateListClock();
				}
			}
		}

		if
		(
			( schTimeSec != oldSec )
			&&
			( schStartUpCounter < 0xFF )
		)
		{
			oldSec = schTimeSec;

			schStartUpCounter++;
		}

		break;
	/*--------------------------------------------------*/
	}
}
示例#19
0
int SetCurrentLanguage()
{
	int iRet = 0;
	wchar_t * cSettingFile = new wchar_t [1024];
	memset(cSettingFile,0,1024 * sizeof(wchar_t));
	//GetModuleFileName(NULL,cSettingFile,1024);
	GetCurrentDirectory(1024,cSettingFile);
	wcscat(cSettingFile,L"\\Language\\LangSetting.ini");
	HANDLE hSettingFile = CreateFileW(cSettingFile,GENERIC_READ|GENERIC_WRITE,
		FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
	


	if(hSettingFile == INVALID_HANDLE_VALUE)
	{
//		delete [] cSettingFile;
		if(WritePrivateProfileStringW(L"Setting",L"CurrentLanguage",L"English",cSettingFile) == 0)
		{
			OutputDebugString(L"Write Language Error.");
		}
		if(WritePrivateProfileStringW(L"Setting",L"CurrentLanguageID",L"First",cSettingFile) == 0)
		{
			OutputDebugString(L"Write Language Error.");
		}

		//return iRet;
	}
	else
	{
		CloseHandle(hSettingFile);
	}
	wchar_t szSection[20],*szValue = new wchar_t[1024],szKey[30];
	memset(szSection,0,20 * sizeof(wchar_t));
	memset(szKey,0,30 * sizeof(wchar_t));
	memset(szValue,0,1024 * sizeof(wchar_t));
	wcscpy(szSection,L"Setting");
	wcscpy(szKey,L"CurrentLanguage");


	if(GetPrivateProfileStringW(szSection,L"CurrentLanguageID",L"",szValue,1024,cSettingFile) != 0)
	{
		if(wcscmp(szValue,L"First") == 0)
		{
			int iRet = GetSysLangLoadLang();
			if(iRet == 1)
			{
				delete [] cSettingFile;
				delete [] szValue;

				return 1;
			}
		}
	}


	if(GetPrivateProfileStringW(szSection,szKey,L"",szValue,1024,cSettingFile) != 0)
	{
		wchar_t * cFilePath = new wchar_t[1024];
		memset(cFilePath,0,1024 * sizeof(wchar_t));
		iRet = LoadLanguage(szValue,cFilePath);
		delete [] cFilePath;
	}
	delete [] cSettingFile;
	delete [] szValue;
	
	return iRet;
}
示例#20
0
bool HTranslate::LoadLanguage(int ID)
{
	if (ID >= m_langs) return false;
	return LoadLanguage(m_lang[ID].c_str());
}
示例#21
0
bool CSettings::LoadLanguage(const char *path, int lang)
{
	bool ret = false;

	if (path && strlen(path) > 3)
	{
		ret = gettextLoadLanguage(path);
		if (ret)
		{
			strlcpy(language_path, path, sizeof(language_path));
			strlcpy(db_language, GetLangCode(language_path), sizeof(db_language));
		}
		else
			return LoadLanguage(NULL, CONSOLE_DEFAULT);
	}
	else if (lang >= 0)
	{
		char filepath[150];
		char langpath[150];
		strlcpy(langpath, languagefiles_path, sizeof(langpath));
		if (langpath[strlen(langpath) - 1] != '/')
		{
			char * ptr = strrchr(langpath, '/');
			if (ptr)
			{
				ptr++;
				ptr[0] = '\0';
			}
		}

		if (lang == CONSOLE_DEFAULT)
		{
			return LoadLanguage(NULL, CONF_GetLanguage());
		}
		else if (lang == JAPANESE)
		{
			snprintf(filepath, sizeof(filepath), "%s/japanese.lang", langpath);
		}
		else if (lang == ENGLISH)
		{
			snprintf(filepath, sizeof(filepath), "%s/english.lang", langpath);
		}
		else if (lang == GERMAN)
		{
			snprintf(filepath, sizeof(filepath), "%s/german.lang", langpath);
		}
		else if (lang == FRENCH)
		{
			snprintf(filepath, sizeof(filepath), "%s/french.lang", langpath);
		}
		else if (lang == SPANISH)
		{
			snprintf(filepath, sizeof(filepath), "%s/spanish.lang", langpath);
		}
		else if (lang == ITALIAN)
		{
			snprintf(filepath, sizeof(filepath), "%s/italian.lang", langpath);
		}
		else if (lang == DUTCH)
		{
			snprintf(filepath, sizeof(filepath), "%s/dutch.lang", langpath);
		}
		else if (lang == S_CHINESE)
		{
			snprintf(filepath, sizeof(filepath), "%s/schinese.lang", langpath);
		}
		else if (lang == T_CHINESE)
		{
			snprintf(filepath, sizeof(filepath), "%s/tchinese.lang", langpath);
		}
		else if (lang == KOREAN)
		{
			snprintf(filepath, sizeof(filepath), "%s/korean.lang", langpath);
		}

		strlcpy(db_language, GetLangCode(filepath), sizeof(db_language));
		ret = gettextLoadLanguage(filepath);
		if (ret)
			strlcpy(language_path, filepath, sizeof(language_path));
	}

	return ret;
}
/*-----------------------------------------------------------------*/
__fastcall TUserdefEnternameForm::TUserdefEnternameForm(TComponent* Owner)
: TForm(Owner)
{
    LoadLanguage();
}
示例#23
0
void FORUM3DVIEW_EXPORT __cdecl Forum3DView(SCHEMA *Prj,CString PathToFile,CWnd *p_hWnd)
{

	CWinApp &theApp = *AfxGetApp();
	p_hWnd->EnableWindow(FALSE);
	LPCTSTR pszOldRegistryKey = theApp.m_pszRegistryKey;
	LPCTSTR pszOldProfileName = theApp.m_pszProfileName;
	theApp.m_pszProfileName = _T("ForumViewDll");
	theApp.m_pszRegistryKey = _T("Scad Soft");
	CSettingManager sm;
	sm.SetKey(_T(""));
	sm.UpdateInt(true, _T("Language"), &nLangID, 1049);
	HINSTANCE hOldResInst = AfxGetResourceHandle();
	LoadLanguage(nLangID);

	CScadViewerFrame * p3DFrame = static_cast<CScadViewerFrame*>(RUNTIME_CLASS( CScadViewerFrame )->CreateObject());
	theApp.m_pMainWnd = p3DFrame;
	//CRect r( 0, 0, 10, 10 );
	//BOOL bCreateRes = p3DFrame->Create( NULL, PathToFile, WS_OVERLAPPEDWINDOW | WS_POPUPWINDOW, r, p_hWnd);
	//

	//if(!bCreateRes )
	//	return;


	CScadViewerDoc *pDoc = static_cast<CScadViewerDoc *>(RUNTIME_CLASS(CScadViewerDoc)->CreateObject());
	p3DFrame->LoadFrame(IDR_MAINFRAME);
	pDoc->AddView(p3DFrame->GetActiveView());
	//p3DFrame->SetWindowPos( NULL, 0, 0, 800, 600, SWP_NOOWNERZORDER);
	bool bFrameClosed = false;
	p3DFrame->SetCloseFlag(&bFrameClosed);

	pDoc->SetPathName(PathToFile, FALSE);
	p3DFrame->ActivateFrame();
	pDoc->LoadSchema(Prj);
	p3DFrame->GetActiveView()->OnInitialUpdate();
	BOOL bIdle = TRUE;
	LONG lIdleCount = 0;
	MSG msgCur;
	while (!bFrameClosed)
	{
		// phase1: check to see if we can do idle work
		while (bIdle &&
			!::PeekMessage(&msgCur, nullptr, NULL, NULL, PM_NOREMOVE))
		{
			// call OnIdle while in bIdle state
			if (!theApp.OnIdle(lIdleCount++))
				bIdle = FALSE; // assume "no idle" state
		}

		// phase2: pump messages while available
		do
		{
			// pump message, but quit on WM_QUIT
			if (!theApp.PumpMessage())
			{
				goto Exit;
			}

			// reset "no idle" state after pumping "normal" message
			if (theApp.IsIdleMessage(&msgCur))
			{
				bIdle = TRUE;
				lIdleCount = 0;
			}

		} while (::PeekMessage(&msgCur, nullptr, NULL, NULL, PM_NOREMOVE));
	}
Exit:
	sm.UpdateInt(false, _T("Language"), &nLangID, 1049);
	theApp.ExitInstance();
	theApp.m_pszProfileName = pszOldProfileName;
	theApp.m_pszRegistryKey = pszOldRegistryKey;
	AfxSetResourceHandle(hOldResInst);
	p_hWnd->EnableWindow(TRUE);
	::SetActiveWindow(p_hWnd->m_hWnd);
	
}
示例#24
0
void FORUM3DVIEW_EXPORT OglIso3D(SOglIsoParam *pParam)
{
	theFakeApp.Init();
	CWinApp &theApp = *AfxGetApp();
	CWnd wnd;
	wnd.Attach(pParam->hWndParent);
	//CWnd *p_hWnd = &wnd;
	CString PathToFile = pParam->pDMI->Caption;
	//p_hWnd->EnableWindow(FALSE);
//	LPCTSTR pszOldRegistryKey = theApp.m_pszRegistryKey;
//	LPCTSTR pszOldProfileName = theApp.m_pszProfileName;
	free(reinterpret_cast<void*>(const_cast<LPTSTR>(theApp.m_pszRegistryKey)));
	free(reinterpret_cast<void*>(const_cast<LPTSTR>(theApp.m_pszProfileName)));
	theApp.m_pszProfileName = _tcsdup(_T("ForumViewIso"));
	theApp.m_pszRegistryKey =  _tcsdup(_T("Scad Soft"));
	CSettingManager sm;
	sm.SetKey(_T(""));
	sm.UpdateInt(true, _T("Language"), &nLangID, 1049);
	//HINSTANCE hOldResInst = AfxGetResourceHandle();
	LoadLanguage(nLangID);

	CIsoViewerFrame * p3DFrame = static_cast<CIsoViewerFrame*>(RUNTIME_CLASS(CIsoViewerFrame)->CreateObject());

	AfxGetThread()->m_pMainWnd = p3DFrame;

	p3DFrame->m_hWndParent = pParam->hWndParent;

	CScadViewerDoc *pDoc = static_cast<CScadViewerDoc *>(RUNTIME_CLASS(CScadViewerDoc)->CreateObject());
	pDoc->m_bViewResults = TRUE;
	p3DFrame->LoadFrame(IDR_MAINFRAME);
	//p3DFrame->SetWindowPos( NULL, 0, 0, 800, 600, SWP_NOOWNERZORDER);
	bool bFrameClosed = false;
	p3DFrame->SetCloseFlag(&bFrameClosed);
	pDoc->AddView(p3DFrame->GetActiveView());
	pDoc->SetDocPathName(PathToFile);
	pDoc->SetTitle(PathToFile);
#ifdef SCAD21
	pDoc->m_pSchem = nullptr;//pParam->Res->SchemaData;
#else
	pDoc->m_pSchem = pParam->Res->SchemaData;
#endif
	p3DFrame->ActivateFrame();
	//AfxGetApp()->m_pMainWnd = NULL;
	CIsoViewGeometry *pIsoGeometry = new CIsoViewGeometry(p3DFrame,nullptr,nullptr);
	pIsoGeometry->SetParams(pParam);
	pIsoGeometry->LoadIso(pDoc->m_bShowProfiles, static_cast<CScadViewerView*>(p3DFrame->GetActiveView())->m_ViewOptions.bDrawOptimize);
	pDoc->m_pViewGeometry = pIsoGeometry;
	p3DFrame->GetActiveView()->OnInitialUpdate();
	pParam->hWndOgl = p3DFrame->m_hWnd;
	wnd.Detach();
	/*
		BOOL bIdle = TRUE;
		LONG lIdleCount = 0;
		MSG msgCur;
		while (!bFrameClosed)
		{
			// phase1: check to see if we can do idle work
			while (bIdle &&
				!::PeekMessage(&msgCur, NULL, NULL, NULL, PM_NOREMOVE))
			{
				// call OnIdle while in bIdle state
				if (!theApp.OnIdle(lIdleCount++))
					bIdle = FALSE; // assume "no idle" state
			}
	
			// phase2: pump messages while available
			do
			{
				// pump message, but quit on WM_QUIT
				if (!theApp.PumpMessage())
				{
					goto Exit;
				}
	
				// reset "no idle" state after pumping "normal" message
				if (theApp.IsIdleMessage(&msgCur))
				{
					bIdle = TRUE;
					lIdleCount = 0;
				}
	
			} while (::PeekMessage(&msgCur, NULL, NULL, NULL, PM_NOREMOVE));
		}
	Exit:
		sm.UpdateInt(false, _T("Language"), &nLangID, 1049);
		theApp.m_pszProfileName = pszOldProfileName;
		theApp.m_pszRegistryKey = pszOldRegistryKey;
		AfxSetResourceHandle(hOldResInst);
		p_hWnd->EnableWindow(TRUE);
		::SetActiveWindow(p_hWnd->m_hWnd);	wnd.Detach();
	
		pParam->hWndOgl = NULL;
	*/
}
示例#25
0
/*-----------------------------------------------------------------*/
__fastcall TAboutBox::TAboutBox(TComponent* AOwner)
: TForm(AOwner)
{
    LoadLanguage();
}
示例#26
0
void FStringTable::LoadStrings (int lump, int expectedSize, bool enuOnly)
{
	BYTE *strData = (BYTE *)W_CacheLumpNum (lump, PU_CACHE);
	int lumpLen = LELONG(((Header *)strData)->FileSize);
	int nameCount = LESHORT(((Header *)strData)->NameCount);
	int nameLen = LESHORT(((Header *)strData)->NameLen);

	int languageStart = sizeof(Header) + nameCount*4 + nameLen;
	languageStart += (4 - languageStart) & 3;

	if (expectedSize >= 0 && nameCount != expectedSize)
	{
		char name[9];

		W_GetLumpName (name, lump);
		name[8] = 0;
		I_FatalError ("%s had %d strings.\nThis version of ZDoom expects it to have %d.",
			name, nameCount, expectedSize);
	}

	FreeStandardStrings ();

	NumStrings = nameCount;
	LumpNum = lump;
	if (Strings == NULL)
	{
		Strings = new char *[nameCount];
		StringStatus = new BYTE[(nameCount+7)/8];
		memset (StringStatus, 0, (nameCount+7)/8);	// 0 means: from wad (standard)
		memset (Strings, 0, sizeof(char *)*nameCount);
	}

	BYTE *const start = strData + languageStart;
	BYTE *const end = strData + lumpLen;
	int loadedCount, i;

	for (loadedCount = i = 0; i < NumStrings; ++i)
	{
		if (Strings[i] != NULL)
		{
			++loadedCount;
		}
	}

	if (!enuOnly)
	{
		for (i = 0; i < 4 && loadedCount != nameCount; ++i)
		{
			loadedCount += LoadLanguage (LanguageIDs[i], true, start, end);
			loadedCount += LoadLanguage (LanguageIDs[i] & MAKE_ID(0xff,0xff,0,0), true, start, end);
			loadedCount += LoadLanguage (LanguageIDs[i], false, start, end);
		}
	}

	// Fill in any missing strings with the default language (enu)
	if (loadedCount != nameCount)
	{
		loadedCount += LoadLanguage (MAKE_ID('e','n','u',0), true, start, end);
	}

	DoneLoading (start, end);

	if (loadedCount != nameCount)
	{
		I_FatalError ("Loaded %d strings (expected %d)", loadedCount, nameCount);
	}
}