这篇教程C++ GetApp函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetApp函数的典型用法代码示例。如果您正苦于以下问题:C++ GetApp函数的具体用法?C++ GetApp怎么用?C++ GetApp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetApp函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AFX_MANAGE_STATEIComparison* Comparisons::Open(LPCTSTR wdfDocId){ AFX_MANAGE_STATE(AfxGetAppModuleState()); AutomationInteractionSuppressor ais; CMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, AfxGetMainWnd()); GetApp()->RealFileNew();// TODO - can we get the frame in a better way CChildFrame *pFrame = DYNAMIC_DOWNCAST( CChildFrame, pMainFrame->MDIGetActive() ); if (pFrame) { // TODO - do we need this GetDVController(pFrame)->CloseDocument(true); GetDVController(pFrame)->CloseDocument(false); GetDVController(pFrame)->CloseCompositeDocument(); GetDVController(pFrame)->GetComparisonDocController().CloseComparisonDocument(); if( pFrame->GetCompositeBar() ) pFrame->GetCompositeBar()->OnInitialUpdate(); pFrame->ShowWindow(SW_SHOW); pFrame->BringWindowToTop(); if (!GetDVController(pFrame)->LoadWDF(wdfDocId)) { AfxThrowOleDispatchException(1102, L"File not found : " + CString(wdfDocId)); } pFrame->GetDocument()->UpdateAllViews(NULL); UpdateOpenList(); return FindComObject(pFrame->GetDocument()); } AfxThrowOleDispatchException(1101, L"Internal Error"); return NULL;}
开发者ID:killbug2004,项目名称:WSProf,代码行数:39,
示例2: GetRotateMatrixvoid CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, FX_DWORD dwStatus, int32_t iRotate) { if (!IsMatchVisibleStatus(dwStatus)) { return; } CFX_Matrix mtRotate; GetRotateMatrix(mtRotate); if (pMatrix) { mtRotate.Concat(*pMatrix); } CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); RenderHighlightCaption(pGS, &mtRotate); CFX_RectF rtWidget; GetRectWithoutRotate(rtWidget); CFX_Matrix mt; mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); mt.Concat(mtRotate); GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), pGS, &mt);}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:22,
示例3: AFX_MANAGE_STATEvoid DVControllerTests::TestGetSaveFormatAsDVCode(){ AFX_MANAGE_STATE(AfxGetAppModuleState()); short nStoreOption = Workshare::OptionApi::GetInt(L"DocFormat"); CMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, AfxGetMainWnd()); CChildFrame *pFrame = DYNAMIC_DOWNCAST( CChildFrame, pMainFrame->MDIGetActive() ); assertTest( pFrame ); Workshare::OptionApi::SetInt(L"DocFormat", -1); long lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode(); assertTest(lRetVal == WSCONVERTERLib::dvFormatWDF); Workshare::OptionApi::SetInt(L"DocFormat", 6); lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode(); assertTest(lRetVal == WSCONVERTERLib::dvFormatRTF); Workshare::OptionApi::SetInt(L"DocFormat", 0); lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode(); assertTest(lRetVal == WSCONVERTERLib::dvFormatDocument); Workshare::OptionApi::SetInt(L"DocFormat", 12); lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode(); assertTest(lRetVal == WSCONVERTERLib::dvFormatXMLDocument); Workshare::OptionApi::SetInt(L"DocFormat", 2); lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode(); assertTest(lRetVal == WSCONVERTERLib::dvFormatText); Workshare::OptionApi::SetInt(L"DocFormat", -7); lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode(); assertTest(lRetVal == WSCONVERTERLib::dvFormatPDF); //check for default Workshare::OptionApi::SetInt(L"DocFormat", 50); lRetVal = GetApp()->GetDVController(pFrame)->GetComparisonDocController().GetSaveFormatAsDVCode(); assertTest(lRetVal == WSCONVERTERLib::dvFormatWDF); Workshare::OptionApi::SetInt(L"DocFormat", nStoreOption);}
开发者ID:killbug2004,项目名称:WSProf,代码行数:41,
示例4: GetAppBOOL COptFont::OnInitDialog(){ u32 i; GF_BaseInterface *ifce; CDialog::OnInitDialog(); COsmo4 *gpac = GetApp(); TCHAR wTmp[500]; const char *sOpt; /*video drivers enum*/ while (m_Fonts.GetCount()) m_Fonts.DeleteString(0); sOpt = gf_cfg_get_key(gpac->m_user.config, "FontEngine", "DriverName"); s32 to_sel = 0; s32 select = 0; u32 count = gf_modules_get_count(gpac->m_user.modules); for (i=0; i<count; i++) { ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_FONT_READER_INTERFACE); if (!ifce) continue; if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel; CE_CharToWide((char *) ifce->module_name, (u16 *)wTmp); m_Fonts.AddString(wTmp); gf_modules_close_interface(ifce); to_sel++; } m_Fonts.SetCurSel(select); sOpt = gf_cfg_get_key(gpac->m_user.config, "FontEngine", "FontDirectory"); CE_CharToWide((char *)sOpt, (u16 *)wTmp); if (sOpt) m_BrowseFont.SetWindowText(wTmp); sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "TextureTextMode"); m_UseTexture.SetCheck( (!sOpt || stricmp(sOpt, "Never")) ? 1 : 0); return TRUE;}
开发者ID:erelh,项目名称:gpac,代码行数:38,
示例5: LOWORDBOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam){ int ID = LOWORD(wParam); WinGPAC *app = GetApp(); if ( (ID>=ID_VP_0) && (ID<=ID_VP_0+nb_viewpoints)) { ID -= ID_VP_0; M4T_SetViewpoint(app->m_term, ID+1, NULL); return TRUE; } if ( (ID>=ID_NAV_PREV_0) && (ID<=ID_NAV_PREV_9)) { ID -= ID_NAV_PREV_0; s32 prev = m_pPlayList->m_cur_entry - ID; if (prev>=0) { m_pPlayList->m_cur_entry = prev; m_pPlayList->PlayPrev(); } return TRUE; } if ( (ID>=ID_NAV_NEXT_0) && (ID<=ID_NAV_NEXT_9)) { ID -= ID_NAV_NEXT_0; u32 next = m_pPlayList->m_cur_entry + ID; if (next < ChainGetCount(m_pPlayList->m_entries) ) { m_pPlayList->m_cur_entry = next; m_pPlayList->PlayNext(); } return TRUE; } if ( (ID>=ID_SELOBJ_0) && (ID<=ID_SELOBJ_9)) { ID -= ID_SELOBJ_0; LPODMANAGER root_od = M4T_GetRootOD(app->m_term); if (!root_od) return TRUE; LPODMANAGER odm = M4T_GetODManager(app->m_term, root_od, ID); M4T_SelectOD(app->m_term, odm); return TRUE; } return CFrameWnd::OnCommand(wParam, lParam);}
开发者ID:DmitrySigaev,项目名称:DSMedia,代码行数:38,
示例6: GetAppbool COptionsDlgSelector::ValidateFileFormats(const CStdString& sResolvedDocID1, const int nIndex, const CStdString& sResolvedDocID2){ // If neither of the docs are PDF then they'll valid // (for the purposes of this method) HRESULT hr = FileTypeHelper::IsPDF(sResolvedDocID1); if (FAILED(hr)) // test DMS connection good first return false; HRESULT hr2 = FileTypeHelper::IsPDF(sResolvedDocID2); if (FAILED(hr2)) return false; if( S_OK != hr && S_OK == hr2 ) return true; if(!Workshare::OptionApi::GetBool(L"EnablePDFCompare")) { GetApp()->ShowMessageEx(AfxGetMainWnd()->m_hWnd, L"Your system administrator has disabled PDF comparisons.", WsOK, WsDefault, WsInfoIcon, L"", functionality_not_available, LOG_LOCATION); return false; } return true;}
开发者ID:killbug2004,项目名称:WSProf,代码行数:23,
示例7: GetAppvoid CEditProjectMgr::UpdateBUTFile(){ //get the resource directory for the currently open project, and add on //our filename to get the BUT file CString sBUTFile = m_BaseProjectDir + "//ClassHlp.but"; //now create a but manager to load this CButeMgr* pNewMgr = new CButeMgr; //bail if memory failed if(pNewMgr == NULL) return; if (!pNewMgr->Parse(sBUTFile)) { //failed to find a new but file, no worries, just bail delete pNewMgr; return; } //this worked, we want to override the old but file with this one GetApp()->SetClassHelpButeAgg(pNewMgr); }
开发者ID:Joincheng,项目名称:lithtech,代码行数:24,
示例8: gf_list_getvoid Playlist::RefreshList(){ u32 i, top_idx; char szPath[GF_MAX_PATH]; top_idx = m_FileList.GetTopIndex(); m_FileList.DeleteAllItems(); for (i=0; i<gf_list_count(m_entries); i++) { PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i); m_FileList.InsertItem(i, ""); m_FileList.SetItemData(i, (u32) ple); UpdateEntry(i); /*in case of sorting*/ if (ple->m_bIsPlaying) m_cur_entry = i; if (ple->m_bIsSelected) { m_FileList.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED); ple->m_bIsSelected = GF_FALSE; } } if (m_cur_entry >= (s32)gf_list_count(m_entries)) m_cur_entry = gf_list_count(m_entries); else { s32 last_idx = top_idx + m_FileList.GetCountPerPage(); m_FileList.EnsureVisible(top_idx, 0); if (gf_list_count(m_entries)<(u32) last_idx) last_idx = gf_list_count(m_entries); m_FileList.EnsureVisible(last_idx, 1); } strcpy((char *) szPath, GetApp()->szUserPath); strcat(szPath, "gpac_pl.m3u"); Save(szPath, GF_TRUE);}
开发者ID:Bevara,项目名称:Access,代码行数:36,
示例9: GetRotateMatrixvoid CXFA_FFField::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) { return; } CFX_Matrix mtRotate; GetRotateMatrix(mtRotate); if (pMatrix) { mtRotate.Concat(*pMatrix); } CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); RenderCaption(pGS, &mtRotate); DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); CFX_RectF rtWidget; m_pNormalWidget->GetWidgetRect(rtWidget); CFX_Matrix mt; mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); mt.Concat(mtRotate); GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), pGS, &mt);}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:24,
示例10: GetDlgItemBOOL COrderFailedDialog::OnInitDialog(){ CBaseDialog::OnInitDialog(); CMlsPropertyControl::SubclassPropertyControls(this); // If there is no help number, get rid of the reference. CWnd* pHelp = GetDlgItem(IDC_HELP_INFO); if (pHelp != NULL) { CInternationalData* pInternationalData = GetApp()->GetInternationalData(); if (pInternationalData != NULL) { if (!pInternationalData->m_InstantSales.m_Help.Exists()) { pHelp->ShowWindow(SW_HIDE); } } } CenterWindow(); return TRUE; // return TRUE unless you set the focus to a control}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:24,
示例11: OnTimervoid CDocSelector::OnTimer(UINT nIDEvent) { for ( int i = 0; i < m_Buttons.GetSize(); i++ ) { CSwitcherButton* wndButton = (CSwitcherButton *) m_Buttons.GetAt( i ); // May be the user has destroyed the view... if ( wndButton->m_AttachedView ) { // Modified by Bender to fix akward problem with CFormView and GetFocus() // MFC works in misterious ways ;) if(GetApp()->GetMainFrame()->MDIGetActive() == wndButton->m_AttachedView->GetParentFrame()) //if ( GetFocus() == wndButton->m_AttachedView) { if ( wndButton->m_nState != SWITCHBUTTON_SELECTED ) { wndButton->Select(); m_iSelectedButton = i; } } else { if ( wndButton->m_nState == SWITCHBUTTON_SELECTED ) wndButton->Unselect(); } } // Yes, he has, critical condition..., break... else break; } CControlBar::OnTimer(nIDEvent);}
开发者ID:MXControl,项目名称:RoboMX,代码行数:36,
示例12: GetAppvoid CommandSystem::Draw() { if (!mCommandMode) return; int nHeight = GetApp()->getHeight() * 0.7f; GetApp()->text_->SetInsertionPos(50, nHeight); GetApp()->text_->SetForegroundColor(D3DXCOLOR(0.0f, 0.0f, 0.0f, 1.0f)); GetApp()->text_->DrawFormattedTextLine(mStatusLine.c_str()); idStr displayString = "edit"; GetApp()->text_->SetInsertionPos(50, nHeight+10); displayString += "> "; displayString += mCommand.c_str(); if (timeGetTime() & 0x200) { displayString += "_"; } GetApp()->text_->DrawFormattedTextLine(displayString.c_str());}
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:21,
示例13: Initialize status_t Initialize() { try { //os::RegistrarManager* pcRegManager = os::RegistrarManager::Get(); /* Register remote calls */ pcPlayEvent = os::Event::Register( "media/Coldfish/Play","Play",GetApp(),CF_GUI_PLAY); pcStopEvent = os::Event::Register( "media/Coldfish/Stop","Stop",GetApp(),CF_GUI_STOP); pcPauseEvent = os::Event::Register( "media/Coldfish/Pause","Pause",GetApp(),CF_GUI_PAUSE); pcNextEvent = os::Event::Register( "media/Coldfish/Next","Next",GetApp(),CF_PLAY_NEXT); pcPrevEvent = os::Event::Register( "media/Coldfish/Previous","Previous",GetApp(),CF_PLAY_PREVIOUS); pcGetSongEvent = os::Event::Register( "media/Coldfish/GetSong", "Gets the current song",GetApp(), CF_GET_SONG); pcGetPlayStateEvent = os::Event::Register( "media/Coldfish/GetPlayState", "Gets the current playstate",GetApp(), CF_GET_PLAYSTATE); pcAddFileEvent = os::Event::Register( "media/Coldfish/AddFile", "Calls the file requester to add a file to ColdFish",GetApp(), CF_GUI_ADD_FILE); pcAboutEvent = os::Event::Register( "media/Coldfish/About", "Calls the about box",GetApp(), CF_GUI_ABOUT); } catch( ... ) { return( -1 ); } return( 0 ); }
开发者ID:PyroOS,项目名称:Pyro,代码行数:21,
示例14: RenderToBackBuffer//--------------------------------------------------------------------------------------// Render the scene using the D3D11 device//--------------------------------------------------------------------------------------void RenderToBackBuffer(Renderer* renderer, double fTime, float fElapsedTime, void* pUserContext){ ID3D11DeviceContext* pContext = GetApp()->GetContext(); // Something's wrong in the shader and the tri size is out by a factor of 2. Why?!? g_pTriSizeVar->SetInt(2 * g_tessellatedTriWidth); const bool debugDrawPatches = false; g_DebugShowPatchesVar->SetBool(debugDrawPatches); const bool debugDrawTiles = false; g_DebugShowTilesVar->SetBool(debugDrawTiles); const float wireAlpha = 0.01f * (float)80; // Below 1.0, we fade the lines out with blending; above 1, we increase line thickness. if (wireAlpha < 1) { g_WireAlphaVar->SetFloat(wireAlpha); g_WireWidthVar->SetFloat(1); } else { g_WireAlphaVar->SetFloat(1); g_WireWidthVar->SetFloat(wireAlpha); } g_DetailNoiseVar->SetFloat(0.001f * (float)g_DetailNoiseScale); float samplesapcing = WORLD_SCALE * g_pTileRings[g_nRings-1]->outerWidth() / (float) COARSE_HEIGHT_MAP_SIZE; g_SampleSpacingVar->SetFloat(samplesapcing); // If the settings dialog is being shown, then render it instead of rendering the app's scene BaseCamera* pCam = GetApp()->ActiveCam_; D3DXMATRIX mProj; D3DXMATRIX mView; const unsigned int size16 = sizeof(float) * 16; memcpy(&mView, pCam->getViewMatrix(), size16); memcpy(&mProj, pCam->getProjectionMatrix(), size16); SetViewport(pContext, g_BackBufferVP); D3DXMATRIX mViewCopy = mView; mViewCopy._41 = mViewCopy._42 = mViewCopy._43 = 0; D3DXMATRIX mWVP = StarWorldMatrix() * mViewCopy * mProj; if (!g_CheckForCracks) g_Skybox.D3D11Render(&mWVP, pContext); RenderStars(pContext, mViewCopy, mProj, g_ScreenSize); int vec[3] = { g_RidgeOctaves, g_fBmOctaves, g_TexTwistOctaves }; g_pFractalOctavesTVar->SetIntVector(vec); // I'm still trying to figure out if the detail scale can be derived from any combo of ridge + twist. // I don't think this works well (nor does ridge+twist+fBm). By contrast the relationship with fBm is // straightforward. The -4 is a fudge factor that accounts for the frequency of the coarsest ocatve // in the pre-rendered detail map. const float DETAIL_UV_SCALE = powf(2.0f, std::max(g_RidgeOctaves, g_TexTwistOctaves) + g_fBmOctaves - 4.0f); g_DetailUVVar->SetFloatVector(D3DXVECTOR2(DETAIL_UV_SCALE, 1.0f/DETAIL_UV_SCALE)); SetUVOffset(g_pUVOffsetTVar); /*ID3D11Query* pFreeQuery = FindFreeQuery(); if (pFreeQuery) pContext->Begin(pFreeQuery);*/ RenderTerrain(pContext, mProj, g_BackBufferVP); //if (pFreeQuery) // pContext->End(pFreeQuery); //for (int i=0; i!=N_QUERIES; ++i) //{ // if (!g_FreePipelineQueries[i] && g_PipelineQueries[i]) // in use & exists // { // D3D11_QUERY_DATA_PIPELINE_STATISTICS stats; // if (S_OK == pContext->GetData(g_PipelineQueries[i], &stats, sizeof(stats), D3D11_ASYNC_GETDATA_DONOTFLUSH)) // { // g_PrimitivesRendered = stats.CInvocations; // g_FreePipelineQueries[i] = g_PipelineQueries[i]; // Put back on free list. // } // } //} }
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:90,
示例15: GetAppvoid CWorldsDlg::OnFileNewWorld(){ GetApp()->OnFileNewWorld();}
开发者ID:Joincheng,项目名称:lithtech,代码行数:4,
示例16: switchbool PlayerManager::Entry( DNID dnidClient, LINKSTATUS enumStatus, void *data, size_t size ){ //这里收到玩家启动客户端的消息,发送服务器状态 SMessage *pMsg = (SMessage *)data; if ( pMsg == NULL ) { return true; } //给客户端发送服务器状态数据 if ( pMsg->_protocol == pMsg->EPRO_Center_MESSAGE ) { SCenterBaseMsg* _pMsg = static_cast< SCenterBaseMsg* >( pMsg ); switch (_pMsg->_protocol) { case SCenterBaseMsg::EPRO_RequestClientVersionInfo: //返回当前游戏资源更新信息 { SARequestAssetUpdateInfo _msg; CDAppMain& appMain = GetApp(); _msg.streamLength = appMain.m_iAssetBundleInfoLength; memcpy(_msg.streamData, appMain.m_AssetbundleVersionInfo, appMain.m_iAssetBundleInfoLength); SendToClient(dnidClient, &_msg, sizeof(SARequestAssetUpdateInfo) - (MAX_ASSET_SIZE - appMain.m_iAssetBundleInfoLength)); //rfalse(2, 1, ""); } break; case SCenterBaseMsg::EPRO_RequestServerState: { //接受请求数据 SARequestServerState _msg; bool b = GetApp().m_ServerManager[GAMESERVER_FLAG].GetGameServerList(&_msg); if (b) { SendToClient(dnidClient, &_msg, _msg.MySize()); m_dPlayerConnectNum++; char string[100] = {}; sprintf_s(string, "/nPlayeConnectCenterServer: %d ", m_dPlayerConnectNum); GetApp().SaveConnectNumString(string); } } break; case SCenterBaseMsg::EPRO_RequestServerDetailInfo: { SQRequestServeDetailInfoMsg *psrcMsg = static_cast<SQRequestServeDetailInfoMsg*>(pMsg); if (NULL == psrcMsg) break; ServerData *pServerData = NULL; GameServer *pGameServer = NULL; if (GetApp().m_ServerManager[GAMESERVER_FLAG].FindGameServerByIndex(psrcMsg->dwIndex, &pGameServer)) { if (NULL != pGameServer) { pServerData = pGameServer->GetServerData(); } } if (NULL != pServerData) { SARequestServeDetailInfoMsg msg; msg.dwIndex = pServerData->m_dwIndex; lite::Serializer sl(msg.streamData, sizeof(msg.streamData)); sl(pServerData->m_dwIP)(pServerData->m_dwPort); SendToClient(dnidClient, &msg, sizeof(msg) - sl.EndEdition()); } } break; default: break; } } else if (pMsg->_protocol == SMessage::EPRO_SYSTEM_MESSAGE) { SQLoginMsg* _pMsg = static_cast<SQLoginMsg*>(pMsg); } return true;}
开发者ID:luw630,项目名称:Server,代码行数:78,
示例17: GetAppBOOL COrderFormInformationDialog::PrintOrderForm(){ COrderForm OrderForm; CString csFormat; CString csOfferCode; Util::SafeLoadString(IDS_OFFER_CODE, csFormat); csOfferCode.Format(csFormat, GetApp()->Offer()->OfferCode()); OrderForm.AddStringMapping("~RCODE", csOfferCode); CString csFaxNumber = GetApp()->GetFaxNumber(); OrderForm.AddStringMapping("~LFAXNUMBER", csFaxNumber); int nIndex = 1; CString csValue; wsprintf(csValue.GetBuffer(128), "%s %s", (LPCSTR)m_csFirstName, (LPCSTR)m_csLastName); csValue.ReleaseBuffer(); OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, csValue); if (!m_csCompany.IsEmpty()) { OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csCompany); } if (!m_csAddress1.IsEmpty()) { OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csAddress1); } if (!m_csAddress2.IsEmpty()) { OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csAddress2); } wsprintf(csValue.GetBuffer(128), "%s, %s %s", (LPCSTR)m_csCity, (LPCSTR)m_csState, (LPCSTR)m_csZip); csValue.ReleaseBuffer(); OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, csValue); if (m_wCountryId != COUNTRY_UnitedStatesOfAmerica) { OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csCountry); } if (!m_csPhone.IsEmpty()) { OrderForm.AddIndexedStringMapping("~LSHIPADDRESS", nIndex++, m_csPhone); } nIndex = 1; CString csPaymentMethod; Util::SafeLoadString(PaymentMethodNames[m_nPaymentMethod], csPaymentMethod); OrderForm.AddIndexedStringMapping("~LPAYMENTMETHOD", nIndex++, csPaymentMethod); if ((m_nPaymentMethod >= CCreditCard::VISA) && (m_nPaymentMethod <= CCreditCard::DISCOVER)) { csValue = m_csCardNumber; CCreditCard::PrettyCreditCardNumber(m_nPaymentMethod, csValue); OrderForm.AddIndexedStringMapping("~LPAYMENTMETHOD", nIndex++, csValue); Util::SafeLoadString(IDS_EXPIRES, csFormat); csValue.Format(csFormat, m_csExpirationDate); OrderForm.AddIndexedStringMapping("~LPAYMENTMETHOD", nIndex++, csValue); } CInternationalData* pInternationalData = GetApp()->GetInternationalData(); if (pInternationalData != NULL) { CNameList MailList(pInternationalData->m_InstantSales.m_Mail.m_szAddress); for (nIndex = 1; nIndex <= MailList.GetSize(); nIndex++) { csValue = MailList.ElementAt(nIndex-1); PerformIniKeySubstitution(csValue); OrderForm.AddIndexedStringMapping("~LMAILADDRESS", nIndex, csValue); } } Util::SafeLoadString(IDS_PRINTED, csFormat); CString csDate;#ifdef WIN32 SYSTEMTIME SystemTime; GetLocalTime(&SystemTime); csDate.Format( csFormat, (int)SystemTime.wMonth, (int)SystemTime.wDay, (int)(SystemTime.wYear % 100), (int)SystemTime.wHour, (int)SystemTime.wMinute, (int)SystemTime.wSecond);#else time_t BinaryTime; time(&BinaryTime); CTime Time(BinaryTime);//.........这里部分代码省略.........
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:101,
示例18: GameOnSelectvoid GameOnSelect( VariantList* pVList ){ Entity *pEntClicked = pVList->m_variant[1].GetEntity(); Tetris* tetris = Tetris::GetInstance(); Config* config = Config::GetInstance(); if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_MENU_BUTTON ) { GetApp()->buttonClickSound(); if( tetris->isEndGame() ) { SlideScreen( pEntClicked->GetParent(), false ); GetMessageManager()->CallEntityFunction( pEntClicked->GetParent(), 500, "OnDelete", NULL ); GetApp()->setGame( false ); GetApp()->setContinueBtn( false ); if( tetris->getScoreInt() > config->getMinScore() ) { GameState::SetState( new GS_Menu() ); InputBestScoreCreate( pEntClicked->GetParent()->GetParent() ); } else { tetris->ResetEndGame(); GameState::SetState( new GS_Menu() ); MainMenuCreate( pEntClicked->GetParent()->GetParent() ); } tetris->FreeInstance(); config->FreeInstance(); return; } GameState::SetState( new GS_Menu() ); if( config->getMusic() ) { GetAudioManager()->StopMusic(); } GetApp()->setGame( false ); SlideScreen( pEntClicked->GetParent(), false ); GetMessageManager()->CallEntityFunction( pEntClicked->GetParent(), 500, "OnDelete", NULL ); MainMenuCreate( pEntClicked->GetParent()->GetParent() ); } if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_DOWN && !tetris->isEndGame() ) { if( config->getSoundEffects() ) { GetAudioManager()->Play( GetApp()->getResourceInstance()->getItem(GetApp()->getResolutionType(), RES_TYPE_AUDIO, RES_ID_AUDIO_FIGURE_DOWN ) ); } tetris->ClickForceDown(); } if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_LEFT && !tetris->isEndGame() ) { buttonMoveSound(); tetris->ClickLeft(); } if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_RIGHT && !tetris->isEndGame() ) { buttonMoveSound(); tetris->ClickRight(); } if( pEntClicked->GetName() == GUI_IMAGEBUTTON_GAMEPLAY_ROTATE && !tetris->isEndGame() ) { buttonMoveSound(); tetris->ClickRotate(); } tetris->FreeInstance(); config->FreeInstance();}
开发者ID:maximbilan,项目名称:tblock,代码行数:81,
示例19: HtmlHelpAHWND CWnd::HtmlHelp(UINT uCommand,DWORD_PTR dwData,LPCSTR szHelpFile){ if (szHelpFile!=NULL) { if (FirstCharIndex(szHelpFile,'//')!=-1) return HtmlHelpA(m_hWnd,szHelpFile,uCommand,dwData); // Insert path#ifdef DEF_WCHAR if (IsUnicodeSystem()) { CStringW sExeName=GetApp()->GetExeNameW(); return HtmlHelpW(*this,sExeName.Left(sExeName.FindLast(L'//')+1)+szHelpFile, uCommand,dwData); }#endif CString sExeName=GetApp()->GetExeName(); return HtmlHelpA(*this,sExeName.Left(sExeName.FindLast(L'//')+1)+szHelpFile, uCommand,dwData); } #ifdef DEF_WCHAR LPCWSTR szwHelpFile=GetApp()->m_szHelpFile; if (szwHelpFile!=NULL) { if (FirstCharIndex(szwHelpFile,L'//')!=-1) { if (IsUnicodeSystem()) return HtmlHelpW(m_hWnd,szwHelpFile,uCommand,dwData); else return HtmlHelpA(m_hWnd,W2A(szwHelpFile),uCommand,dwData); } // Insert path if (IsUnicodeSystem()) { CStringW sExeName=GetApp()->GetExeNameW(); return HtmlHelpW(*this,sExeName.Left(sExeName.FindLast(L'//')+1)+szwHelpFile, uCommand,dwData); } CString sExeName=GetApp()->GetExeName(); return HtmlHelpA(*this,sExeName.Left(sExeName.FindLast(L'//')+1)+szwHelpFile, uCommand,dwData); } if (IsUnicodeSystem()) { CStringW sExeName=GetApp()->GetExeNameW(); return HtmlHelpW(*this,sExeName.Left(sExeName.FindLast(L'.')+1)+L"chm", uCommand,dwData); }#endif CString sExeName=GetApp()->GetExeName(); return HtmlHelpA(*this,sExeName.Left(sExeName.FindLast(L'.')+1)+"chm", uCommand,dwData);}
开发者ID:eladkarako,项目名称:locate32,代码行数:61,
示例20: removebool remove( dp::sg::core::ObjectSharedPtr const& parent, dp::sg::core::ObjectSharedPtr const& child ){ switch( parent->getObjectCode() ) { case dp::sg::core::OC_GEONODE : if ( child.isPtrTo<dp::sg::core::EffectData>() ) { parent.staticCast<dp::sg::core::GeoNode>()->setMaterialEffect( dp::sg::core::EffectDataSharedPtr() ); } else { DP_ASSERT( child.isPtrTo<dp::sg::core::Primitive>() ); parent.staticCast<dp::sg::core::GeoNode>()->setPrimitive( dp::sg::core::PrimitiveSharedPtr() ); } break; case dp::sg::core::OC_GROUP : case dp::sg::core::OC_LOD : case dp::sg::core::OC_SWITCH : case dp::sg::core::OC_TRANSFORM : case dp::sg::core::OC_BILLBOARD : if ( child.isPtrTo<dp::sg::core::Node>() ) { parent.staticCast<dp::sg::core::Group>()->removeChild( child.staticCast<dp::sg::core::Node>() ); } else { DP_ASSERT( child.isPtrTo<dp::sg::core::ClipPlane>() ); parent.staticCast<dp::sg::core::Group>()->removeClipPlane( child.staticCast<dp::sg::core::ClipPlane>() ); } break; case dp::sg::core::OC_PRIMITIVE : if ( child.isPtrTo<dp::sg::core::IndexSet>() ) { parent.staticCast<dp::sg::core::Primitive>()->setIndexSet( dp::sg::core::IndexSetSharedPtr() ); } else { DP_ASSERT( child.isPtrTo<dp::sg::core::VertexAttributeSet>() ); parent.staticCast<dp::sg::core::Primitive>()->setVertexAttributeSet( dp::sg::core::VertexAttributeSetSharedPtr() ); } break; case dp::sg::core::OC_EFFECT_DATA : DP_ASSERT( child.isPtrTo<dp::sg::core::ParameterGroupData>() ); { dp::sg::core::ParameterGroupDataSharedPtr const& pgd = child.staticCast<dp::sg::core::ParameterGroupData>(); dp::sg::core::EffectDataSharedPtr const& ed = parent.staticCast<dp::sg::core::EffectData>(); dp::fx::SmartEffectSpec const & es = ed->getEffectSpec(); DP_ASSERT( es->findParameterGroupSpec( pgd->getParameterGroupSpec() ) != es->endParameterGroupSpecs() ); parent.staticCast<dp::sg::core::EffectData>()->setParameterGroupData( es->findParameterGroupSpec( pgd->getParameterGroupSpec() ), dp::sg::core::ParameterGroupDataSharedPtr() ); } break; case dp::sg::core::OC_PARAMETER_GROUP_DATA : DP_ASSERT( child->getObjectCode() == dp::sg::core::OC_SAMPLER ); { dp::sg::core::ParameterGroupDataSharedPtr const& pgd = parent.staticCast<dp::sg::core::ParameterGroupData>(); const dp::fx::SmartParameterGroupSpec & pgs = pgd->getParameterGroupSpec(); dp::fx::ParameterGroupSpec::iterator it = pgs->findParameterSpec( child.staticCast<dp::sg::core::Sampler>()->getName() ); DP_ASSERT( it != pgs->endParameterSpecs() ); pgd->setParameter( it, dp::sg::core::SamplerSharedPtr() ); } break; case dp::sg::core::OC_PARALLELCAMERA : case dp::sg::core::OC_PERSPECTIVECAMERA : case dp::sg::core::OC_MATRIXCAMERA : DP_ASSERT( child->getObjectCode() == dp::sg::core::OC_LIGHT_SOURCE ); parent.staticCast<dp::sg::core::Camera>()->removeHeadLight( child.staticCast<dp::sg::core::LightSource>() ); break; case dp::sg::core::OC_SCENE : if ( child.isPtrTo<dp::sg::core::Camera>() ) { DP_VERIFY( parent.staticCast<dp::sg::core::Scene>()->removeCamera( child.staticCast<dp::sg::core::Camera>() ) ); } else { DP_ASSERT( child.isPtrTo<dp::sg::core::Node>() ); parent.staticCast<dp::sg::core::Scene>()->setRootNode( dp::sg::core::NodeSharedPtr() ); } break; default : DP_ASSERT( false ); break; } GetApp()->outputStatistics(); return true;}
开发者ID:getov,项目名称:pipeline,代码行数:87,
示例21: UpdateDatavoid CAxialAnalysisOptionsDlg::OnOK(){ UpdateData(TRUE); if (m_radius.IsEmpty() || m_radius.FindOneOf(_T("nN123456789")) == -1) { AfxMessageBox(_T("The radius must either be numeric or 'n'/n") _T("Alternatively, for multiple radii, type a list of comma separated numeric radii (you can include 'n')")); m_radius = _T("n"); UpdateData(FALSE); m_radius_ctrl.SetFocus(); return; } // now parse radius list: GetApp()->m_options.radius_list.clear(); CString curr_radius; int curr_comma = -1, last_comma = 0; bool add_rn = false; do { curr_comma = m_radius.Find(',',last_comma); if (curr_comma != -1) { curr_radius = m_radius.Mid(last_comma, curr_comma-last_comma); last_comma = curr_comma + 1; } else { curr_radius = m_radius.Mid(last_comma); } curr_radius.TrimLeft(' '); curr_radius.TrimRight(' '); if (!curr_radius.IsEmpty()) { if (curr_radius == "n" || curr_radius == "N") { add_rn = true; } else { int radius = _wtoi(curr_radius); if (radius <= 0) { AfxMessageBox(_T("Each radius in the list must either be 'n' or a number in the range 1-99")); m_radius_ctrl.SetFocus(); return; } GetApp()->m_options.radius_list.add((double) radius); } } } while (curr_comma != -1); if (GetApp()->m_options.radius_list.size() == 0 || add_rn) { GetApp()->m_options.radius_list.push_back(-1); } GetApp()->m_options.choice = m_choice; GetApp()->m_options.local = m_local; GetApp()->m_options.fulloutput = m_rra; // attributes: if (!m_weighted) { GetApp()->m_options.weighted_measure_col = -1; } else { GetApp()->m_options.weighted_measure_col = m_attribute; } CDialog::OnOK();}
开发者ID:jpinelo,项目名称:Depthmap,代码行数:63,
示例22: DoAutoScroll//.........这里部分代码省略......... // Cancel the movement along the y and z axis moveOffset.x=(-1)*m_vTotalMoveOffset.x; moveOffset.z=(-1)*m_vTotalMoveOffset.z; m_vMoveSnapAxis=CVector(0.0f, 1.0f, 0.0f); } // Check to see if we should snap to the z axis if (vAbsolute.z > vAbsolute.x && vAbsolute.z > vAbsolute.y) { // Cancel the movement along the y and z axis moveOffset.x=(-1)*m_vTotalMoveOffset.x; moveOffset.y=(-1)*m_vTotalMoveOffset.y; m_vMoveSnapAxis=CVector(0.0f, 0.0f, 1.0f); } } } else { m_vMoveSnapAxis=CVector(1.0f, 1.0f, 1.0f); } // Update the total move offset. This is used to snap the nodes when the shift key is pressed. m_vTotalMoveOffset+=moveOffset; // Go through all the selected nodes and move them... for( i=0; i < m_pView->GetRegion()->m_Selections; i++ ) { pNode = m_pView->GetRegion()->m_Selections[i]; // Handle movement for Brush nodes... if(pNode->GetType() == Node_Brush) { // Get the brush pointer... pBrush = pNode->AsBrush(); // Check for perpendicular movement... if(m_bPerp) { translateAmount = -(m_pView->EditGrid().Forward() * (CReal)(m_cCurPt.y - m_cLastPt.y)); } // planar movement... else { translateAmount = moveOffset; } for( j=0; j < pBrush->m_Points; j++ ) pBrush->m_Points[j] += translateAmount; // Update the texture space on the polies that are stuck. for(j=0; j < pBrush->m_Polies; j++) { pPoly = pBrush->m_Polies[j]; for(uint32 nCurrTex = 0; nCurrTex < CEditPoly::NUM_TEXTURES; nCurrTex++) { CTexturedPlane& Texture = pPoly->GetTexture(nCurrTex); pPoly->SetTextureSpace(nCurrTex, Texture.GetO() + translateAmount, Texture.GetP(), Texture.GetQ()); } } m_pView->GetRegion()->UpdateBrush(pBrush); } // Handle movement for object nodes... else if((pNode->GetType() == Node_Object) || (pNode->GetType() == Node_PrefabRef)) { // Check if perpendicular movement... if(m_bPerp) { LTVector vCurPos = pNode->GetPos(); vCurPos -= m_pView->EditGrid().Forward() * (CReal)(m_cCurPt.y - m_cLastPt.y); pNode->SetPos(vCurPos); } // planar movement... else { pNode->SetPos(pNode->GetPos() + moveOffset); } } } // Update starting vertex for next pass... m_vStartVec = newVert; } // If user wants all the views updated, then do it... if( GetApp()->m_bFullUpdate ) { m_pView->GetDocument()->UpdateAllViews(m_pView); m_pView->DrawRect(); } m_cLastPt = m_cCurPt; return TRUE;}
开发者ID:Joincheng,项目名称:lithtech,代码行数:101,
示例23: sizeofbool Mesh_D3D11::CreateBuffers(void){ // Define the input layout D3D11_INPUT_ELEMENT_DESC layout[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 }, }; unsigned int iElements = sizeof(layout)/sizeof(layout[0]); // create shaders if not created yet if(g_pTechniqueShadows == NULL) { if(!CreateShaders()) return false; } // Create the input layout HRESULT hr; D3DX11_PASS_DESC PassDesc; hr = g_pTechniqueShadows->GetPassByIndex(0)->GetDesc(&PassDesc); if(FAILED(hr)) { MessageBox(NULL, TEXT("Getting technique pass description failed!"), TEXT("Error!"), MB_OK); return false; } hr = GetApp()->GetDevice()->CreateInputLayout(layout, iElements, PassDesc.pIAInputSignature, PassDesc.IAInputSignatureSize, &m_pVertexLayout); if(FAILED(hr)) { MessageBox(NULL, TEXT("Creating input layout failed!"), TEXT("Error!"), MB_OK); return false; } // Create vertex buffer D3D11_BUFFER_DESC bd; bd.Usage = D3D11_USAGE_DEFAULT; bd.ByteWidth = m_iVertexSize * m_iNumVertices; bd.BindFlags = D3D11_BIND_VERTEX_BUFFER; bd.CPUAccessFlags = 0; bd.MiscFlags = 0; D3D11_SUBRESOURCE_DATA InitData; InitData.pSysMem = m_pVertices; hr = GetApp()->GetDevice()->CreateBuffer( &bd, &InitData, &m_pVertexBuffer ); if(FAILED(hr)) { MessageBox(NULL, TEXT("Creating vertex buffer failed!"), TEXT("Error!"), MB_OK); return false; } // Create index buffer bd.Usage = D3D11_USAGE_DEFAULT; bd.ByteWidth = sizeof(unsigned short) * m_iNumTris * 3; bd.BindFlags = D3D11_BIND_INDEX_BUFFER; bd.CPUAccessFlags = 0; bd.MiscFlags = 0; InitData.pSysMem = m_pIndices; hr = GetApp()->GetDevice()->CreateBuffer( &bd, &InitData, &m_pIndexBuffer ); if(FAILED(hr)) { MessageBox(NULL, TEXT("Creating index buffer failed!"), TEXT("Error!"), MB_OK); return false; } return true;}
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:66,
示例24: GetAppvoid CFileProps::SetGeneralInfo(){ char info[10000]; char buf[1000]; GF_MediaInfo odi; GF_ObjectManager *odm; u32 h, m, s, i, j; Osmo4 *gpac = GetApp(); odm = current_odm; strcpy(info, ""); if (!odm || gf_term_get_object_info(gpac->m_term, odm, &odi) != GF_OK) return; if (!odi.od) { strcat(info, odi.service_url); m_ODInfo.SetWindowText(info); return; } sprintf(buf, "%sObject Descriptor ID %d/r/n", (odi.has_profiles) ? "Initial " : "", odi.od->objectDescriptorID); strcat(info, buf); if (odi.duration) { h = (u32) (odi.duration / 3600); m = (u32) (odi.duration / 60) - h*60; s = (u32) (odi.duration) - h*3600 - m*60; sprintf(buf, "Duration %02d:%02d:%02d/r/n", h, m, s); strcat(info, buf); } else { strcat(info, "Unknown duration/r/n"); } if (odi.owns_service) { strcat(info, "Service Handler: "); strcat(info, odi.service_handler); strcat(info, "/r/n"); strcat(info, "Service URL: "); strcat(info, odi.service_url); strcat(info, "/r/n"); } if (odi.od->URLString) { strcat(info, "Remote OD - URL: "); strcat(info, odi.od->URLString); strcat(info, "/r/n"); } /*get OD content info*/ if (odi.codec_name) { switch (odi.od_type) { case GF_STREAM_VISUAL: sprintf(buf, "Video Object: Width %d - Height %d/r/n", odi.width, odi.height); strcat(info, buf); strcat(info, "Media Codec "); strcat(info, odi.codec_name); strcat(info, "/r/n"); if (odi.par) { sprintf(buf, "Pixel Aspect Ratio: %d:%d/r/n", (odi.par>>16)&0xFF, (odi.par)&0xFF); strcat(info, buf); } break; case GF_STREAM_AUDIO: sprintf(buf, "Audio Object: Sample Rate %d - %d channels/r/n", odi.sample_rate, odi.num_channels); strcat(info, buf); strcat(info, "Media Codec "); strcat(info, odi.codec_name); strcat(info, "/r/n"); break; case GF_STREAM_PRIVATE_SCENE: case GF_STREAM_SCENE: if (odi.width && odi.height) { sprintf(buf, "Scene Description: Width %d - Height %d/r/n", odi.width, odi.height); } else { sprintf(buf, "Scene Description: No size specified/r/n"); } strcat(info, buf); strcat(info, "Scene Codec "); strcat(info, odi.codec_name); strcat(info, "/r/n"); break; case GF_STREAM_TEXT: if (odi.width && odi.height) { sprintf(buf, "Text Object: Width %d - Height %d/r/n", odi.width, odi.height); } else { sprintf(buf, "Text Object: No size specified/r/n"); } strcat(info, buf); strcat(info, "Text Codec "); strcat(info, odi.codec_name); strcat(info, "/r/n"); break; } }
开发者ID:bigbensk,项目名称:gpac,代码行数:90,
示例25: GetStringconst char* GetString(enumSTRING eString) { return c_pszText[GetApp()->GetLanguage()][eString]; }
开发者ID:arron-h,项目名称:gravity-wars-redux,代码行数:4,
示例26: OnDestroyvoid CFileProps::OnDestroy() { CDialog::OnDestroy(); delete this; ((CMainFrame *)GetApp()->m_pMainWnd)->m_pProps = NULL;}
开发者ID:bigbensk,项目名称:gpac,代码行数:6,
注:本文中的GetApp函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetAppClass函数代码示例 C++ GetAngle函数代码示例 |