Sfoglia il codice sorgente

1、遥控器界面临时提交;

scbc.sat2 5 anni fa
parent
commit
687fa655a0

+ 24 - 1
VideoCapture/VideoCapture/DlgIRControl.cpp

@@ -53,6 +53,28 @@ void CDlgIRControl::OnCancel()
 
 void CDlgIRControl::AdjustLayout()
 {
+	// 布局按钮;
+	// 75*23,列间隔4像素,左右边距10像素,总共332
+	// 行间隔6像素,上下边距20像素;
+	CRect rc;
+	CWnd* pWnd = GetDlgItem(IDC_BUTTON1);
+	pWnd->GetWindowRect(&rc);
+	pWnd->GetClientRect(&rc);
+	int start_id = IDC_BUTTON1;
+	const int c_interval = 4;	// 列间隔;
+	const int r_interval = 6;	// 行间隔;
+	for ( int i = 0; i < 60; i++ )
+	{
+		// 逐个处理;
+		pWnd = GetDlgItem(start_id++);
+		if ( pWnd )
+		{
+		}
+
+		if ( i % 4 == 0 )
+		{
+		}
+	}
 }
 
 BOOL CDlgIRControl::OnInitDialog()
@@ -60,7 +82,7 @@ BOOL CDlgIRControl::OnInitDialog()
 	CDialogEx::OnInitDialog();
 
 	// TODO:  在此添加额外的初始化
-
+	AdjustLayout();
 	return TRUE;  // return TRUE unless you set the focus to a control
 				  // 异常: OCX 属性页应返回 FALSE
 }
@@ -70,5 +92,6 @@ void CDlgIRControl::OnSize(UINT nType, int cx, int cy)
 {
 	CDialogEx::OnSize(nType, cx, cy);
 
+	TRACE2("对话框坐标:%d,%d\n", cx, cy);
 	// TODO: 在此处添加消息处理程序代码
 }

+ 4 - 1
VideoCapture/VideoCapture/IRControlWnd.cpp

@@ -101,7 +101,7 @@ int CIRControlWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
 	m_dlgIRControl.ShowWindow(SW_SHOW);
 
 	// 设置最小窗体;
-	SetMinSize((350,300));
+	SetMinSize((350,332));
 
 	// 校正布局;
 	AdjustLayout();
@@ -112,6 +112,9 @@ int CIRControlWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
 void CIRControlWnd::OnSize(UINT nType, int cx, int cy)
 {
 	CDockablePane::OnSize(nType, cx, cy);
+
+	TRACE2("坐标:%d,%d\n", cx, cy);
+
 	AdjustLayout();
 }
 

+ 34 - 3
VideoCapture/VideoCapture/MainFrm.cpp

@@ -50,6 +50,7 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWndEx)
 	ON_COMMAND(ID_TRAYMENU_EXIT, &CMainFrame::OnTraymenuExit)
 	ON_MESSAGE(MSG_STATUS_BAR, &CMainFrame::OnMsgStatusBar)
 	ON_WM_CLOSE()
+	ON_WM_GETMINMAXINFO()
 END_MESSAGE_MAP()
 
 // CMainFrame 构造/析构
@@ -224,13 +225,20 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 		return -1;
 	}
 
+#if __FC_WIN__
 	m_wndFileView.EnableDocking(CBRS_ALIGN_ANY);
 	m_wndClassView.EnableDocking(CBRS_ALIGN_ANY);
 	DockPane(&m_wndFileView);
+#endif
+#if __FC_WIN__
 	CDockablePane* pTabbedBar = nullptr;
 	m_wndClassView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
+#endif
+
+#if __OUT_PUT_WIN__
 	m_wndOutput.EnableDocking(CBRS_ALIGN_ANY);
 	DockPane(&m_wndOutput);
+#endif
 	m_wndIRControl.EnableDocking(CBRS_ALIGN_ANY);
 	DockPane(&m_wndIRControl);
 #endif
@@ -249,7 +257,8 @@ BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
 	//  CREATESTRUCT cs 来修改窗口类或样式
 	//不把子框架标题添加到主框架标题(主框架中就不会再处理WM_SETTEXT消息)
 	cs.style &= ~FWS_ADDTOTITLE;
-
+	cs.cx = 640;
+	cs.cy = 480;
 	return TRUE;
 }
 
@@ -258,6 +267,7 @@ BOOL CMainFrame::CreateDockingWindows()
 {
 	BOOL bNameValid;
 
+#if __FC_WIN__
 	// 创建类视图
 	CString strClassView;
 	bNameValid = strClassView.LoadString(IDS_CLASS_VIEW);
@@ -277,7 +287,9 @@ BOOL CMainFrame::CreateDockingWindows()
 		TRACE0("未能创建“文件视图”窗口\n");
 		return FALSE; // 未能创建
 	}
+#endif
 
+#if __OUT_PUT_WIN__
 	// 创建输出窗口
 	CString strOutputWnd;
 	bNameValid = strOutputWnd.LoadString(IDS_OUTPUT_WND);
@@ -287,11 +299,12 @@ BOOL CMainFrame::CreateDockingWindows()
 		TRACE0("未能创建输出窗口\n");
 		return FALSE; // 未能创建
 	}
+#endif
 
 	// 创建遥控器窗口
 	CString strPropertiesWnd = _T("遥控器");
-	if (!m_wndIRControl.Create(strPropertiesWnd, this, CRect(0, 0, 350, 200), TRUE, ID_VIEW_PROPERTIESWND, 
-		WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI , AFX_CBRS_REGULAR_TABS, AFX_CBRS_RESIZE))
+	if (!m_wndIRControl.Create(strPropertiesWnd, this, CRect(0, 0, 332, 350), TRUE, ID_VIEW_PROPERTIESWND, 
+		WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI ))
 	{
 		TRACE0("未能创建“遥控器”窗口\n");
 		return FALSE; // 未能创建
@@ -303,14 +316,18 @@ BOOL CMainFrame::CreateDockingWindows()
 
 void CMainFrame::SetDockingWindowIcons(BOOL bHiColorIcons)
 {
+#if __FC_WIN__
 	HICON hFileViewIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_FILE_VIEW_HC : IDI_FILE_VIEW), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
 	m_wndFileView.SetIcon(hFileViewIcon, FALSE);
 
 	HICON hClassViewIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_CLASS_VIEW_HC : IDI_CLASS_VIEW), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
 	m_wndClassView.SetIcon(hClassViewIcon, FALSE);
+#endif
 
+#if __OUT_PUT_WIN__
 	HICON hOutputBarIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_OUTPUT_WND_HC : IDI_OUTPUT_WND), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
 	m_wndOutput.SetIcon(hOutputBarIcon, FALSE);
+#endif
 
 	HICON hPropertiesBarIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_PROPERTIES_WND_HC : IDI_PROPERTIES_WND), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
 	m_wndIRControl.SetIcon(hPropertiesBarIcon, FALSE);
@@ -506,7 +523,9 @@ void CMainFrame::OnApplicationLook(UINT id)
 	}
 
 #if __DOCKINGBAR__
+#if __OUT_PUT_WIN__
 	m_wndOutput.UpdateFonts();
+#endif
 #endif
 
 	RedrawWindow(nullptr, nullptr, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME | RDW_ERASE);
@@ -569,8 +588,10 @@ void CMainFrame::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
 {
 	CFrameWndEx::OnSettingChange(uFlags, lpszSection);
 #if __DOCKINGBAR__
+#if __OUT_PUT_WIN__
 	m_wndOutput.UpdateFonts();
 #endif
+#endif
 }
 
 LRESULT CMainFrame::OnMsgStatusBar(WPARAM wParam, LPARAM lParam)
@@ -631,3 +652,13 @@ void CMainFrame::OnClose()
 	CFrameWnd::OnClose();
 #endif
 }
+
+
+void CMainFrame::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
+{
+	// TODO: 在此添加消息处理程序代码和/或调用默认值
+	lpMMI->ptMinTrackSize.x = 640;
+	lpMMI->ptMinTrackSize.y = 480;
+
+	CFrameWndEx::OnGetMinMaxInfo(lpMMI);
+}

+ 5 - 0
VideoCapture/VideoCapture/MainFrm.h

@@ -61,9 +61,13 @@ protected:  // 控件条嵌入成员
 	CMFCToolBarImages m_PanelImages;
 	CMFCRibbonStatusBar  m_wndStatusBar;
 #if __DOCKINGBAR__
+#if __FC_WIN__
 	CFileView         m_wndFileView;
 	CClassView        m_wndClassView;
+#endif
+#if __OUT_PUT_WIN__
 	COutputWnd        m_wndOutput;
+#endif
 	CIRControlWnd     m_wndIRControl;
 #endif
 
@@ -152,6 +156,7 @@ public:
 	virtual BOOL PreTranslateMessage(MSG* pMsg);
 	afx_msg void OnTraymenuExit();
 	afx_msg void OnClose();
+	afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
 };
 
 

+ 44 - 0
VideoCapture/VideoCapture/Resource.h

@@ -136,6 +136,50 @@
 #define IDC_BUTTON22                    1022
 #define IDC_BUTTON23                    1023
 #define IDC_BUTTON24                    1024
+#define IDC_BUTTON25                    1025
+#define IDC_BUTTON26                    1026
+#define IDC_BUTTON27                    1027
+#define IDC_BUTTON28                    1028
+#define IDC_BUTTON29                    1029
+#define IDC_BUTTON30                    1030
+#define IDC_BUTTON31                    1031
+#define IDC_BUTTON32                    1032
+#define IDC_BUTTON33                    1033
+#define IDC_BUTTON34                    1034
+#define IDC_BUTTON35                    1035
+#define IDC_BUTTON36                    1036
+#define IDC_BUTTON37                    1037
+#define IDC_BUTTON38                    1038
+#define IDC_BUTTON39                    1039
+#define IDC_BUTTON40                    1040
+#define IDC_BUTTON41                    1041
+#define IDC_BUTTON42                    1042
+#define IDC_BUTTON43                    1043
+#define IDC_BUTTON44                    1044
+#define IDC_BUTTON45                    1045
+#define IDC_BUTTON46                    1046
+#define IDC_BUTTON47                    1047
+#define IDC_BUTTON48                    1048
+#define IDC_BUTTON49                    1049
+#define IDC_BUTTON50                    1050
+#define IDC_BUTTON51                    1051
+#define IDC_BUTTON52                    1052
+#define IDC_BUTTON53                    1053
+#define IDC_BUTTON54                    1054
+#define IDC_BUTTON55                    1055
+#define IDC_BUTTON56                    1056
+#define IDC_BUTTON57                    1057
+#define IDC_BUTTON58                    1058
+#define IDC_BUTTON59                    1059
+#define IDC_BUTTON60                    1060
+#define IDC_BUTTON61                    1061
+#define IDC_BUTTON62                    1062
+#define IDC_BUTTON63                    1063
+#define IDC_BUTTON64                    1064
+#define IDC_BUTTON65                    1065
+#define IDC_BUTTON66                    1066
+#define IDC_BUTTON67                    1067
+#define IDC_BUTTON68                    1068
 #define ID_WRITE_PASTEASHYPERLINK       32770
 #define ID_CHECK_HDMI                   32771
 #define ID_CHECK_DVID                   32772

BIN
VideoCapture/VideoCapture/VideoCapture.rc


+ 4 - 1
VideoCapture/VideoCapture/stdafx.h

@@ -26,7 +26,10 @@ using namespace chrono;
 #define __CAPTIONBAR__ 0
 // 快速访问工具栏
 #define __QUICKACCESS_COMMAND__ 0
-
+// 输出窗口;
+#define __OUT_PUT_WIN__ 0
+// 文件、类窗口
+#define __FC_WIN__ 0
 
 //////////////////////////////////////////////////////////////////////////
 // START;