本文整理匯總了C++中GetActiveView函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetActiveView函數的具體用法?C++ GetActiveView怎麽用?C++ GetActiveView使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetActiveView函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: OnShowSensorNb
/**
* 響應上工具條按鈕;選擇檢波器Nb
* @param void
* @return void
*/
void CSensorGraphChildFrame::OnShowSensorNb(UINT nID)
{
CSensorGraphView* pView = (CSensorGraphView*)GetActiveView();
unsigned int uiIndex = 0;
uiIndex = nID - ID_BUTTON_MATRIX_SENSOR_GRAPH_NBSTART;
CToolbarGraphButton* pBNSensorNb = NULL;
pBNSensorNb = (CToolbarGraphButton*)m_oGraphViewTopToolBar.GetButton(uiIndex);
POSITION pos;
CSensorData oSensorData;
pos = m_pSiteData->m_oSensorList.m_olsSensor.FindIndex(uiIndex);
oSensorData = m_pSiteData->m_oSensorList.m_olsSensor.GetAt(pos);
if(1 == pBNSensorNb->m_iMode)
{
pBNSensorNb->m_iMode = 0;
m_oSensorNbMap.RemoveKey(oSensorData.m_uiNb);
}
else
{
m_oSensorNbMap.SetAt(oSensorData.m_uiNb, oSensorData.m_uiNb);
pBNSensorNb->m_iMode = 1;
}
m_oGraphViewTopToolBar.InvalidateButton(uiIndex);
pView->RedrawWindow();
}
示例2: OnSelectTestType
/**
* 響應上工具條按鈕;選擇測試類型
* @param void
* @return void
*/
void CSensorGraphChildFrame::OnSelectTestType()
{
CSensorGraphView* pView = (CSensorGraphView*)GetActiveView();
CBCGPToolbarComboBoxButton* pComboButton = NULL;
pComboButton = (CBCGPToolbarComboBoxButton*)m_oGraphViewTopToolBar.GetButton(9 + m_uiSensorNbCount);
m_strTestType = pComboButton->GetText();
m_uiTestType = m_pSiteData->GetTestTypeIDByString(m_strTestType);
if(40 != m_uiTestType)
{
// 得到檢波器TestType判據字符串
m_strTestType = m_pSiteData->GetSensorTestTypeLimitStringByID(m_uiTestType);
}
CToolbarGraph* pBNGraph = NULL;
pBNGraph = (CToolbarGraph*)m_oGraphViewTopToolBar.GetButton(2 + m_uiSensorNbCount);
pBNGraph->m_iMode = 1;
if(15 == m_uiTestType) // 檢波器電阻
{
pBNGraph->m_iMode = 2;
}
pBNGraph->m_strLabel = m_strTestType;
m_oGraphViewTopToolBar.InvalidateButton(2 + m_uiSensorNbCount);
pView->RedrawWindow();
}
示例3: GetActiveView
BOOL CMainFrame::OnQueryNewPalette()
{
CView* pView = GetActiveView();
if (pView != NULL)
return (BOOL) pView->SendMessage(WM_QUERYNEWPALETTE);
return FALSE;
}
示例4: return
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
BOOL tHandled;
CWnd* pView;
// First, try the default routing scheme.
tHandled = CFrameWnd::OnCmdMsg( nID, nCode, pExtra, pHandlerInfo );
if( tHandled )
{
return( TRUE );
}
// If nobody handled it, and the main view isn't active, try the main view.
pView = m_wndSplitter.GetPane( 0, 1 );
if( pView != GetActiveView() )
{
tHandled = pView->OnCmdMsg( nID, nCode, pExtra, pHandlerInfo );
if( tHandled )
{
return( TRUE );
}
}
return( FALSE );
}
示例5: GetActiveView
// All child frame's will have exactly one CHexEditView (unless in print preview?). This returns it.
CHexEditView *CChildFrame::GetHexEditView() const
{
CView *pv = GetActiveView();
if (pv != NULL) // May be NULL if print preview
{
if (pv->IsKindOf(RUNTIME_CLASS(CHexEditView)))
return (CHexEditView *)pv;
else if (pv->IsKindOf(RUNTIME_CLASS(CDataFormatView)))
return ((CDataFormatView *)pv)->phev_;
else if (pv->IsKindOf(RUNTIME_CLASS(CAerialView)))
return ((CAerialView *)pv)->phev_;
else if (pv->IsKindOf(RUNTIME_CLASS(CCompareView)))
return ((CCompareView *)pv)->phev_;
else if (pv->IsKindOf(RUNTIME_CLASS(CPrevwView)))
return ((CPrevwView *)pv)->phev_;
else if (pv->IsKindOf(RUNTIME_CLASS(CHexTabView)))
{
// Find the hex view (left-most tab)
CHexTabView *ptv = (CHexTabView *)pv;
ptv->SetActiveView(0); // hex view is always left-most (index 0)
ASSERT_KINDOF(CHexEditView, ptv->GetActiveView());
return (CHexEditView *)ptv->GetActiveView();
}
}
return NULL;
}
示例6: CRect
CXTPDockingPane* CMainFrame::CreatePane(int x, int y, CRuntimeClass* pNewViewClass, CString strFormat, XTPDockingPaneDirection direction, CXTPDockingPane* pNeighbour)
{
//做個標記
int nID = ++m_nCount;
CXTPDockingPane* pwndPane = m_paneManager.CreatePane(nID, CRect(0, 0,x, y), direction, pNeighbour);
CString strTitle;
strTitle.Format(strFormat, nID);
pwndPane->SetTitle(strTitle);
pwndPane->SetIconID(nID % 6 + 1);
CFrameWnd* pFrame = new CFrameWnd;
CCreateContext context;
context.m_pNewViewClass = pNewViewClass;
context.m_pCurrentDoc = GetActiveView()->GetDocument();
pFrame->Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), this, NULL, 0, &context);
pFrame->ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
m_mapPanes.SetAt(nID, pFrame);
return pwndPane;
}
示例7: OnActivate
void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
//DeadCode DAW 22Jun99 TRACE2("Activate %i ==> %08x\n",nState,::GetWindowThreadProcessId(pWndOther->m_hWnd, NULL) );
//DeadCode DAW 22Jun99 else
//DeadCode DAW 22Jun99 {
//DeadCode DAW 22Jun99 TRACE1("Activate %i xxx\n",nState);
//If in the 3D && state==0 then discard DD here
#ifdef NDEBUG
if (!pWndOther)
if (Inst3d::InThe3D())
{
if (!nState) Inst3d::ReleaseDirectX();
else
{
Inst3d::RestoreDirectX();
CMIGView* view=(CMIGView*)GetActiveView();
RFullPanelDial* dial=GetFullPanel(view);
dial->LaunchScreen(&RFullPanelDial::quickmissionflight);
}
}
#endif
//DeadCode DAW 22Jun99 }
CFrameWnd::OnActivate(nState, pWndOther, bMinimized);
// TODO: Add your message handler code here
}
示例8: GetActiveView
void CInPlaceFrame::RecalcLayout(BOOL bNotify)
{
if (m_wndResizeBar.m_hWnd != NULL)
m_wndResizeBar.BringWindowToTop();
COleIPFrameWndEx::RecalcLayout(bNotify);
CWnd* pWnd = GetActiveView();
if (pWnd != NULL)
pWnd->BringWindowToTop();
if (m_wndRulerBar.m_hWnd != NULL)
m_wndRulerBar.BringWindowToTop();
// at least 12 pt region plus ruler if it exists
CDisplayIC dc;
CSize size;
size.cy = MulDiv(12, dc.GetDeviceCaps(LOGPIXELSY), 72)+1;
size.cx = dc.GetDeviceCaps(LOGPIXELSX)/4; // 1/4"
size.cx += HORZ_TEXTOFFSET; //adjust for offset
size.cy += VERT_TEXTOFFSET;
if (m_wndRulerBar.m_hWnd != NULL && m_wndRulerBar.IsVisible())
{
CRect rect;
m_wndRulerBar.GetWindowRect(&rect);
size.cy += rect.Height();
}
m_wndResizeBar.SetMinSize(size);
}
示例9: OnEditPaste
void CChildFrame::OnEditPaste()
{
// TODO: Add your command handler code here
CMTXCalcView* pView = (CMTXCalcView*)GetActiveView();
pView->pGridCtrl->OnEditPaste();
pView->updateDocFromGrid();
}
示例10: MinMaxInfo
void CResizableFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
MinMaxInfo(lpMMI);
CView* pView = GetActiveView();
if (pView == NULL)
return;
// get the extra size from view to frame
CRect rectClient, rectWnd;
GetWindowRect(rectWnd);
RepositionBars(0, 0xFFFF, AFX_IDW_PANE_FIRST, reposQuery, rectClient);
CSize sizeExtra = rectWnd.Size() - rectClient.Size();
// ask the view for track size
MINMAXINFO mmiView = *lpMMI;
pView->SendMessage(WM_GETMINMAXINFO, 0, (LPARAM)&mmiView);
mmiView.ptMaxTrackSize = sizeExtra + mmiView.ptMaxTrackSize;
mmiView.ptMinTrackSize = sizeExtra + mmiView.ptMinTrackSize;
// min size is the largest
lpMMI->ptMinTrackSize.x = __max(lpMMI->ptMinTrackSize.x,
mmiView.ptMinTrackSize.x);
lpMMI->ptMinTrackSize.y = __max(lpMMI->ptMinTrackSize.y,
mmiView.ptMinTrackSize.y);
// max size is the shortest
lpMMI->ptMaxTrackSize.x = __min(lpMMI->ptMaxTrackSize.x,
mmiView.ptMaxTrackSize.x);
lpMMI->ptMaxTrackSize.y = __min(lpMMI->ptMaxTrackSize.y,
mmiView.ptMaxTrackSize.y);
}
示例11: OnShowInstrumentCollect
/**
* 響應上工具條按鈕;顯示采集站
* @param void
* @return void
*/
void CInstrumentGraphChildFrame::OnShowInstrumentCollect()
{
//是否顯示采集站
m_bShowInstrumentCollect = !m_bShowInstrumentCollect;
CInstrumentGraphView* pView = (CInstrumentGraphView*)GetActiveView();
pView->RedrawWindow();
}
示例12: OnShowInstrumentCross
/**
* 響應上工具條按鈕;顯示交叉站
* @param void
* @return void
*/
void CInstrumentGraphChildFrame::OnShowInstrumentCross()
{
//是否顯示交叉站
m_bShowInstrumentCross = !m_bShowInstrumentCross;
CInstrumentGraphView* pView = (CInstrumentGraphView*)GetActiveView();
pView->RedrawWindow();
}
示例13: OnShowInstrumentPower
/**
* 響應上工具條按鈕;顯示電源站
* @param void
* @return void
*/
void CInstrumentGraphChildFrame::OnShowInstrumentPower()
{
//是否顯示電源站
m_bShowInstrumentPower = !m_bShowInstrumentPower;
CInstrumentGraphView* pView = (CInstrumentGraphView*)GetActiveView();
pView->RedrawWindow();
}
示例14: ASSERT_VALID
BOOL CDrawItem::OnChangeItemPosition(const CRect& rectPos)
{
ASSERT_VALID(this);
CDrawView* pView = GetActiveView();
ASSERT_VALID(pView);
CRect rect = rectPos;
pView->ClientToDoc(rect);
if (rect != m_pDrawObj->m_position)
{
// invalidate old rectangle
m_pDrawObj->Invalidate();
// update to new rectangle
m_pDrawObj->m_position = rect;
GetExtent(&m_pDrawObj->m_extent);
// and invalidate new rectangle
m_pDrawObj->Invalidate();
// mark document as dirty
GetDocument()->SetModifiedFlag();
}
return COleClientItem::OnChangeItemPosition(rectPos);
}
示例15: OnShowLinkLine
/**
* 響應上工具條按鈕;顯示連接線
* @param void
* @return void
*/
void CInstrumentGraphChildFrame::OnShowLinkLine()
{
//是否顯示連接線
m_bShowLinkLine = !m_bShowLinkLine;
CInstrumentGraphView* pView = (CInstrumentGraphView*)GetActiveView();
pView->RedrawWindow();
}