?? maindlg.h
字號:
* terminate the application
*
* \param wID
* \return 0
*
*/
//------------------------------------------------------------------------------
LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: Add validation code
CloseDialog(wID);
return 0;
}
// step 5 Add Message handler OnUpdate
//------------------------------------------------------------------------------
// LRESULT OnUpdate(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* let the BcamTopologyViewCtl update itself
*
* \return 0
*
*/
//------------------------------------------------------------------------------
LRESULT OnUpdate(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// let the control update the device tree
if (m_ptrToplogyView != NULL) m_ptrToplogyView->Update();
return 0;
}
//------------------------------------------------------------------------------
// void CloseDialog(int nVal)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* Closes the dialog and quits the application
*
* \param nVal
* \return 0
*
*/
//------------------------------------------------------------------------------
void CloseDialog(int nVal)
{
DestroyWindow();
::PostQuitMessage(nVal);
}
//------------------------------------------------------------------------------
// LRESULT OnClose(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* terminate the apllication
*
* \param wParam
* \param bHandled
* \return 0
*
*/
//------------------------------------------------------------------------------
LRESULT OnClose(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
{
DestroyWindow();
::PostQuitMessage(wParam);
return 0;
}
// step 6 add a message handler OnSize
//------------------------------------------------------------------------------
// LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* Resize the BcamTopolagyViewCtl and move the buttos, such that they are on the right side of the dialog window
*
* \param bHandled
* \return 0
*
*/
//------------------------------------------------------------------------------
LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
if (!IsIconic() && (m_TopologyWnd != NULL))
{
RECT rect; GetWindowRect(&rect);
long width = rect.right-rect.left;
long height = rect.bottom - rect.top;
// Make sure that the TopologyViewClt and the buttons remain visible
// force a minimal width and height of 250 and 300
if (width < 250 || height < 300)
{
if (width < 250) rect.right = rect.left + 250;
if (height < 300) rect.bottom = rect.top + 300;
::MoveWindow(m_hWnd,rect.left,rect.top,rect.right- rect.left,rect.bottom-rect.top,TRUE);
}
// resize the control and move the buttons
MoveItems();
// force redrawing
Invalidate();
}
return 0;
}
//------------------------------------------------------------------------------
// LRESULT OnClickedResetbus(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* let the BcamTopologyViewCtl generate a bus reset
*
* \param bHandled
* \return 0
*
*/
//------------------------------------------------------------------------------
LRESULT OnClickedResetbus(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
{
if (m_ptrToplogyView != NULL) m_ptrToplogyView->ResetBus();
return 0;
}
//------------------------------------------------------------------------------
// LRESULT OnClickedDetails(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* Set the Detailed state of the BcamTopologyViewCtl to the state of the checkbox
*
* \param bHandled
* \return
*
*/
//------------------------------------------------------------------------------
LRESULT OnClickedDetails(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
{
DDX_Check(IDC_DETAILS, m_CheckBoxDetails, fromDialog);
if (m_ptrToplogyView != NULL) m_ptrToplogyView->Details = (m_CheckBoxDetails != 0);
return 0;
}
//------------------------------------------------------------------------------
// LRESULT OnClickedDetails(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* Set the Detailed state of the BcamTopologyViewCtl to the state of the checkbox
*
* \param bHandled
* \return
*
*/
//------------------------------------------------------------------------------
LRESULT OnClickedStayTop(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
{
DDX_Check(IDC_STAY_TOP, m_CheckBoxStayTop, fromDialog);
if (m_CheckBoxStayTop)
::SetWindowPos(m_hWnd,HWND_TOPMOST,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
else
::SetWindowPos(m_hWnd,HWND_NOTOPMOST,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
return 0;
}
//------------------------------------------------------------------------------
// LRESULT OnClickedHelp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* Opens the BCAMTopologyViewer help topic
*
* \param bHandled
* \return
*
*/
//------------------------------------------------------------------------------
LRESULT OnClickedHelp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
{
HWND hwnd =
HtmlHelp(
GetDesktopWindow(),
"..\\doc\\Bcam_Topology_Viewer_Help.chm",
HH_DISPLAY_TOPIC,
NULL) ;
if (hwnd == NULL) ::MessageBox(m_hWnd,"Help file not found","Error",MB_OK);
return 0;
}
//------------------------------------------------------------------------------
// LRESULT OnHelp(UINT i, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
// Author:
// Date: 30.08.2002
//------------------------------------------------------------------------------
/**
* Opens the BCAMTopologyViewer help topic
*
* \param i not used
* \param wParam not used
* \param lParam not used
* \param bHandled
* \return
*
*/
//------------------------------------------------------------------------------
LRESULT OnHelp(UINT i, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{ // cast the parameter to suit OnClickedHelp
return OnClickedHelp((WORD)i, (WORD)wParam, (HWND)lParam, bHandled);
}
protected:
// step 2 add member variables to hold the window handle and interface pointer
HWND m_TopologyWnd; // the window handle of the topology view control
IBcamTopologyViewCtlPtr m_ptrToplogyView; // the IBcamTopologyViewCtl interface of the control
int m_CheckBoxDetails; // indicates whether to show details
int m_CheckBoxStayTop; // indicates whether to show details
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINDLG_H__A70445E7_6325_4D08_851F_6C100428865A__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -