本文整理汇总了C++中STATIC_DOWNCAST函数的典型用法代码示例。如果您正苦于以下问题:C++ STATIC_DOWNCAST函数的具体用法?C++ STATIC_DOWNCAST怎么用?C++ STATIC_DOWNCAST使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了STATIC_DOWNCAST函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: STATIC_DOWNCAST
void CStylePage::OnStyleClicked(UINT /*nCmdID*/)
{
// The CStylePage property page is used for both the
// CModalShapePropSheet and the CModelessShapePropSheet.
// Both these versions of the property sheet share a common
// feature that they immediately update a shape. In the
// case of CModalShapePropSheet, the shape is in the preview
// window. In the case of CModelessShapePropSheet, the shape
// is the currently selected shape in the view.
CPropertySheet* pSheet = STATIC_DOWNCAST(CPropertySheet, GetParent());
CModalShapePropSheet* pModalSheet =
DYNAMIC_DOWNCAST(CModalShapePropSheet, pSheet);
if (pModalSheet != NULL)
{
UpdateData();
pModalSheet->UpdateShapePreview();
SetModified(); // enable Apply Now button
}
CModelessShapePropSheet* pModelessSheet =
DYNAMIC_DOWNCAST(CModelessShapePropSheet, pSheet);
if (pModelessSheet != NULL)
{
UpdateData();
CFrameWnd* pFrameWnd = STATIC_DOWNCAST(CFrameWnd, AfxGetMainWnd());
CView* pView = pFrameWnd->GetActiveFrame()->GetActiveView();
pView->SendMessage(WM_USER_CHANGE_OBJECT_PROPERTIES, 0, 0);
}
}
示例2: ASSERT_VALID
// OnEndPrintPreview is here for swap tuning reasons
// (see viewprev.cpp for complete preview mode implementation)
void CView::OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo,
POINT, CPreviewView* pView)
{
ASSERT_VALID(pDC);
ASSERT_VALID(pView);
if (pView->m_pPrintView != NULL)
pView->m_pPrintView->OnEndPrinting(pDC, pInfo);
CFrameWnd* pParent = STATIC_DOWNCAST(CFrameWnd, AfxGetMainWnd());
ASSERT_VALID(pParent);
// restore the old main window
pParent->OnSetPreviewMode(FALSE, pView->m_pPreviewState);
// Force active view back to old one
pParent->SetActiveView(pView->m_pPreviewState->pViewActiveOld);
if (pParent != GetParentFrame())
OnActivateView(TRUE, this, this); // re-activate view in real frame
pView->DestroyWindow(); // destroy preview view
// C++ object will be deleted in PostNcDestroy
// restore main frame layout and idle message
pParent->RecalcLayout();
pParent->SendMessage(WM_SETMESSAGESTRING, (WPARAM)AFX_IDS_IDLEMESSAGE, 0L);
pParent->UpdateWindow();
}
示例3: STATIC_DOWNCAST
CXTPChartRectF CXTPChartStackedBarSeriesPointView::GetScreenRect() const
{
CXTPChartStackedBarSeriesView* pSeriesView = (CXTPChartStackedBarSeriesView*)GetSeriesView();
CXTPChartStackedBarSeriesStyle* pSeriesStyle = STATIC_DOWNCAST(CXTPChartStackedBarSeriesStyle, GetSeriesView()->GetStyle());
CXTPChartAxisView* pAxisXView = pSeriesView->GetAxisViewX();
if (pSeriesView->m_nBarIndex != -1)
{
int nCount = pSeriesView->m_nBarCount;
int nIndex = pSeriesView->m_nBarIndex;
double dOffset = 3 / pAxisXView->GetScale();
double dBarWidth = (pSeriesStyle->GetBarWidth() - dOffset * (nCount - 1)) / nCount;
CXTPChartPointF ptTopLeft(pSeriesView->GetScreenPoint(m_pPoint->GetInternalArgumentValue() -
pSeriesStyle->GetBarWidth() / 2 + dBarWidth * nIndex + dOffset * nIndex, m_dValueTo));
CXTPChartPointF ptBottomRight(pSeriesView->GetScreenPoint(m_pPoint->GetInternalArgumentValue() -
pSeriesStyle->GetBarWidth() / 2 + dBarWidth * nIndex + dOffset * nIndex + dBarWidth, m_dValueFrom));
CXTPChartRectF rc(ptTopLeft, ptBottomRight);
rc.Width++;
rc.Height++;
return rc;
}
return CXTPChartRectF(0, 0, 0, 0);
}
示例4: UpdateData
void CCalcUnary::OnInverse()
{
// TODO: Add your control notification handler code here
UpdateData();
xpMatrix mtx;
CWaitCursor wait;
//invert the matrix
try
{
CAllPages * pParent = STATIC_DOWNCAST(CAllPages, GetParent());
if (getMatrix(mtx) == TRUE)
{
wait.Restore( );
m_mtxResult = mtx.getInverse();
}
pParent->m_pMtx->pDoc->m_mtx = &m_mtxResult;
pParent->SetActivePage(0);
pParent->m_calcResults.pGridCtrl->Refresh();
}
catch (xpException * e)
{
CString errMess;
e->getErrorMessage(errMess);
MessageBox(errMess, "Matrix Calculation Error", MB_OK);
e->Delete();
}
}
示例5: RUNTIME_CLASS
int CPrintFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
{
return -1;
}
CCreateContext context;
context.m_pNewViewClass = RUNTIME_CLASS(CPrintView);
context.m_pCurrentFrame = this;
context.m_pCurrentDoc = NULL;
context.m_pLastView = NULL;
m_pView = STATIC_DOWNCAST(CPrintView, CreateView(&context));
if(m_pView != NULL)
{
m_pView->ShowWindow(SW_SHOW);
SetActiveView(m_pView);
}
SetIcon(m_pOldWnd->GetIcon(FALSE),FALSE);
SetIcon(m_pOldWnd->GetIcon(TRUE),TRUE);
ShowWindow(SW_MAXIMIZE);
CWinApp* pApp=AfxGetApp();
m_pOldFram = pApp->m_pMainWnd;
pApp->m_pMainWnd=this;
m_pView->OnFilePrintPreview();
//m_pView->SendMessage(WM_COMMAND, ID_FILE_PRINT);//直接打印
m_pOldWnd->ShowWindow(SW_HIDE);
return 0;
}
示例6: ASSERT
CObject* CListCtrlItemWalk::GetNextSelectableItem()
{
ASSERT( m_pListCtrl != NULL );
if (m_pListCtrl == NULL)
return NULL;
int iItemCount = m_pListCtrl->GetItemCount();
if (iItemCount >= 2)
{
POSITION pos = m_pListCtrl->GetFirstSelectedItemPosition();
if (pos)
{
int iItem = m_pListCtrl->GetNextSelectedItem(pos);
if (iItem+1 < iItemCount)
{
m_pListCtrl->SetItemState(iItem, 0, LVIS_SELECTED | LVIS_FOCUSED);
iItem++;
m_pListCtrl->SetItemState(iItem, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
m_pListCtrl->SetSelectionMark(iItem);
m_pListCtrl->EnsureVisible(iItem, FALSE);
return STATIC_DOWNCAST(CObject, (CObject*)m_pListCtrl->GetItemData(iItem));
}
}
}
return NULL;
}
示例7: UNREFERENCED_PARAMETER
CXTPChartDeviceCommand* CXTPChartPyramidSeriesPointView::CreateDeviceCommand(CXTPChartDeviceContext* pDC)
{
UNREFERENCED_PARAMETER(pDC);
CXTPChartColor color1 = GetColor();
CXTPChartColor color2 = GetColor2();
CXTPChartColor clrBorder = GetBorderActualColor();
CXTPChartDeviceCommand* pCommand = new CXTPChartHitTestElementCommand(m_pPoint);
CXTPChartPyramidSeriesStyle* pStyle = STATIC_DOWNCAST(CXTPChartPyramidSeriesStyle, GetSeriesView()->GetStyle());
CXTPChartPoints arrPoints;
arrPoints.Add(CXTPChartPointF(m_rc.GetLeft() + int((m_rc.Width - m_rc.Width * m_dFrom) / 2), m_rc.GetTop()));
arrPoints.Add(CXTPChartPointF(m_rc.GetLeft() + int((m_rc.Width + m_rc.Width * m_dFrom) / 2), m_rc.GetTop()));
arrPoints.Add(CXTPChartPointF(m_rc.GetLeft() + int((m_rc.Width + m_rc.Width * m_dTo) / 2), m_rc.GetBottom()));
arrPoints.Add(CXTPChartPointF(m_rc.GetLeft() + int((m_rc.Width - m_rc.Width * m_dTo) / 2), m_rc.GetBottom()));
pCommand->AddChildCommand(pStyle->GetFillStyle()->CreateDeviceCommand(arrPoints, color1, color2));
if (pStyle->GetBorder()->IsVisible())
pCommand->AddChildCommand(new CXTPChartBoundedPolygonDeviceCommand(arrPoints, clrBorder, pStyle->GetBorder()->GetThickness()));
return pCommand;
}
示例8: STATIC_DOWNCAST
int CChannelRulerCtrl::GetRulerIndex() const
{
CChannelBar *Bar = STATIC_DOWNCAST(CChannelBar, GetParent());
int iChan = Bar->FindRuler(this);
ASSERT(iChan >= 0);
return(iChan);
}
示例9: SetWindowText
void CFileDetailDialog::UpdateTitle()
{
if (m_aItems.GetSize() == 1)
SetWindowText(GetResString(IDS_DETAILS) + _T(": ") + STATIC_DOWNCAST(CAbstractFile, m_aItems[0])->GetFileName());
else
SetWindowText(GetResString(IDS_DETAILS));
}
示例10: STATIC_DOWNCAST
CExtGridCellHyperLinkEx* PropertiesBar::GetHyperLink(CExtPropertyItem* pItem)
{
CExtGridCellHyperLinkEx* pLink = STATIC_DOWNCAST(CExtGridCellHyperLinkEx,
pItem->ValueDefaultGetByRTC(RUNTIME_CLASS(CExtGridCellHyperLinkEx)));
pLink->TextColorSet(CExtGridCellHyperLink::__ECS_NORMAL, RGB(0,0,255));
pLink->TextColorSet(CExtGridCellHyperLink::__ECS_SELECTED, RGB(255,0,0));
pLink->TextColorSet(CExtGridCellHyperLink::__ECS_HOVERED, RGB(128,128,255));
pLink->SetAllowVisitedState(1);
pLink->SetTextColorVisited(RGB(0,0,255));
pLink->FontUnderlineSet();
// I hate this workaround, but it is the only damn thing that works.
HyperLinkClickInfo hci;
hci.pGrid = m_pGrid;
hci.pItem = pItem;
hyperLinks.push_back(hci);
pLink->LParamSet((LPARAM)&(hyperLinks.back()));
pLink->SetCursor(LoadCursor(NULL, IDC_HAND));
// Set the cell pointer
m_pGrid->propValueMgrs[pItem]->pCell = pLink;
return pLink;
}
示例11: PropertyStoreSet
LRESULT CProfStudioPropertyGridCtrl::WindowProc( UINT message, WPARAM wParam, LPARAM lParam)
{
LRESULT lResult =
CExtPropertyGridCtrl::WindowProc( message, wParam, lParam );
if( message == WM_CREATE )
{
PropertyStoreSet( &m_PS );
CTypedPtrArray < CPtrArray, CExtPropertyGridWnd * > arrGrids;
OnPgcQueryGrids( arrGrids );
INT nGridIdx = 0;
for( ; nGridIdx < arrGrids.GetSize(); nGridIdx ++ )
{
CExtPropertyGridWnd * pGrid = arrGrids[ nGridIdx ];
ASSERT_VALID( pGrid );
g_PaintManager->LoadWinXpTreeBox(
pGrid->m_iconTreeBoxExpanded,
true
);
g_PaintManager->LoadWinXpTreeBox(
pGrid->m_iconTreeBoxCollapsed,
false
);
} // for( ; nGridIdx < arrGrids.GetSize(); nGridIdx ++ )
CExtPropertyGridComboBoxBar * pCBB =
STATIC_DOWNCAST(
CExtPropertyGridComboBoxBar,
GetChildByRTC(
RUNTIME_CLASS(CExtPropertyGridComboBoxBar)
)
);
pCBB->PropertyStoreInsert( &m_PS );
} // if( message == WM_CREATE )
return lResult;
}
示例12: STATIC_DOWNCAST
CSeriousSkaStudioView* CSeriousSkaStudioApp::GetActiveView(void)
{
CSeriousSkaStudioView *res;
CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
res = DYNAMIC_DOWNCAST(CSeriousSkaStudioView, pMainFrame->GetActiveFrame()->GetActiveView());
return res;
}
示例13: UNREFERENCED_PARAMETER
CXTPChartDeviceCommand* CXTPChartAreaSeriesView::CreateLegendDeviceCommand(CXTPChartDeviceContext* pDC, CRect rcBounds)
{
UNREFERENCED_PARAMETER(pDC);
rcBounds.DeflateRect(1, 1);
CXTPChartDeviceCommand* pCommand = new CXTPChartPolygonAntialiasingDeviceCommand();
CXTPChartAreaSeriesStyle* pStyle = STATIC_DOWNCAST(CXTPChartAreaSeriesStyle, m_pSeries->GetStyle());
CXTPChartPointF ptCenter(rcBounds.CenterPoint().x, rcBounds.top + 4) ;
int nSize = 8;
CXTPChartPoints arrPoints;
arrPoints.Add(CXTPChartPointF(rcBounds.left, rcBounds.bottom + 1));
arrPoints.Add(CXTPChartPointF(ptCenter.X, float(rcBounds.top + 4)));
arrPoints.Add(CXTPChartPointF(rcBounds.right, rcBounds.bottom + 1));
pCommand->AddChildCommand(pStyle->GetFillStyle()->CreateDeviceCommand(arrPoints, GetActualColor(), GetActualColor2()));
CXTPChartColor clrBorder = GetBorderActualColor();
pCommand->AddChildCommand(new CXTPChartSolidLineDeviceCommand(arrPoints[0], arrPoints[1], clrBorder, 1));
pCommand->AddChildCommand(new CXTPChartSolidLineDeviceCommand(arrPoints[1], arrPoints[2], clrBorder, 1));
pCommand->AddChildCommand(pStyle->GetMarker()->CreateDeviceCommand(pDC, ptCenter, nSize, GetColor(), GetColor2(), GetColor().GetDarkColor()));
return pCommand;
}
示例14: STATIC_DOWNCAST
BOOL CModelerDoc::CreateModelFromScriptFile( CTFileName fnScrFileName, char *strError)
{
CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
try
{
CWaitCursor StartWaitCursor;
CRect rectMainFrameSize;
CRect rectProgress, rectProgressNew;
pMainFrame->GetWindowRect( &rectMainFrameSize);
pMainFrame->m_NewProgress.Create( IDD_NEW_PROGRESS, pMainFrame);
pMainFrame->m_NewProgress.GetWindowRect( &rectProgress);
rectProgressNew.left = rectMainFrameSize.Width()/2 - rectProgress.Width()/2;
rectProgressNew.top = rectMainFrameSize.Height()/2 - rectProgress.Height()/2;
rectProgressNew.right = rectProgressNew.left + rectProgress.Width();
rectProgressNew.bottom = rectProgressNew.top + rectProgress.Height();
pMainFrame->m_NewProgress.MoveWindow( rectProgressNew);
pMainFrame->m_NewProgress.ShowWindow(SW_SHOW);
m_emEditModel.LoadFromScript_t( fnScrFileName);
}
catch( char *err_str)
{
strcpy( strError, err_str);
pMainFrame->m_NewProgress.DestroyWindow();
return FALSE;
}
pMainFrame->m_NewProgress.DestroyWindow();
m_bDocLoadedOk = TRUE;
return TRUE;
}
示例15: GetDocument
void CScriptView::OnScriptUpdateMipmodels()
{
// find document with same name
CModelerDoc *pDoc = (CModelerDoc *) GetDocument();
CTFileName fnScriptName = CTString(pDoc->GetPathName());
CTFileName fnModelName = fnScriptName.FileDir() + fnScriptName.FileName() + ".mdl";
POSITION pos = theApp.m_pdtModelDocTemplate->GetFirstDocPosition();
while (pos!=NULL)
{
CModelerDoc *pmdCurrent = (CModelerDoc *)theApp.m_pdtModelDocTemplate->GetNextDoc(pos);
if( CTFileName( CTString(pmdCurrent->GetPathName())) == fnModelName)
{
POSITION pos = pmdCurrent->GetFirstViewPosition();
CView *pView = pmdCurrent->GetNextView( pos);
if( DYNAMIC_DOWNCAST(CModelerView, pView) != NULL)
{
CModelerView* pModelerView = (CModelerView *) pView;
if(pModelerView != NULL)
{
pModelerView->OnScriptUpdateMipmodels();
pModelerView->SetActiveWindow();
pModelerView->SetFocus();
CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
pMainFrame->MDIActivate(pModelerView->GetParentFrame());
}
}
break;
}
}
}