本文整理匯總了C++中GetApp函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetApp函數的具體用法?C++ GetApp怎麽用?C++ GetApp使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetApp函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AFX_MANAGE_STATE
IComparison* 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;
}
示例2: GetRotateMatrix
void 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);
}
示例3: AFX_MANAGE_STATE
void 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);
}
示例4: GetApp
BOOL 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;
}
示例5: LOWORD
BOOL 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);
}
示例6: GetApp
bool 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;
}
示例7: GetApp
void 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);
}
示例8: gf_list_get
void 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);
}
示例9: GetRotateMatrix
void 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);
}
示例10: GetDlgItem
BOOL 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
}
示例11: OnTimer
void 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);
}
示例12: GetApp
void 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());
}
示例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 );
}
示例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.
// }
// }
//}
}
示例15: GetApp
void CWorldsDlg::OnFileNewWorld()
{
GetApp()->OnFileNewWorld();
}