DlgIRControl.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // DlgIRControl.cpp: 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "VideoCapture.h"
  5. #include "DlgIRControl.h"
  6. #include "afxdialogex.h"
  7. // CDlgIRControl 对话框
  8. IMPLEMENT_DYNAMIC(CDlgIRControl, CDialogEx)
  9. CDlgIRControl::CDlgIRControl(CWnd* pParent /*=nullptr*/)
  10. : CDialogEx(IDD_DLG_IRCONTROL, pParent)
  11. {
  12. }
  13. CDlgIRControl::~CDlgIRControl()
  14. {
  15. }
  16. void CDlgIRControl::DoDataExchange(CDataExchange* pDX)
  17. {
  18. CDialogEx::DoDataExchange(pDX);
  19. }
  20. BEGIN_MESSAGE_MAP(CDlgIRControl, CDialogEx)
  21. ON_WM_SIZE()
  22. END_MESSAGE_MAP()
  23. // CDlgIRControl 消息处理程序
  24. void CDlgIRControl::OnOK()
  25. {
  26. // TODO: 在此添加专用代码和/或调用基类
  27. //CDialogEx::OnOK();
  28. }
  29. void CDlgIRControl::OnCancel()
  30. {
  31. // TODO: 在此添加专用代码和/或调用基类
  32. //CDialogEx::OnCancel();
  33. }
  34. void CDlgIRControl::AdjustLayout()
  35. {
  36. // 布局按钮;
  37. // 75*23,列间隔4像素,左右边距10像素,总共332
  38. // 行间隔6像素,上下边距20像素;
  39. CRect rc;
  40. CWnd* pWnd = GetDlgItem(IDC_BUTTON1);
  41. pWnd->GetWindowRect(&rc);
  42. //pWnd->GetClientRect(&rc);
  43. int start_id = IDC_BUTTON1;
  44. const int c_interval = 4; // 列间隔;
  45. const int r_interval = 6; // 行间隔;
  46. for ( int i = 0; i < 60; i++ )
  47. {
  48. // 逐个处理;
  49. pWnd = GetDlgItem(start_id++);
  50. if ( pWnd )
  51. {
  52. }
  53. if ( i % 4 == 0 )
  54. {
  55. }
  56. }
  57. }
  58. BOOL CDlgIRControl::OnInitDialog()
  59. {
  60. CDialogEx::OnInitDialog();
  61. // TODO: 在此添加额外的初始化
  62. AdjustLayout();
  63. return TRUE; // return TRUE unless you set the focus to a control
  64. // 异常: OCX 属性页应返回 FALSE
  65. }
  66. void CDlgIRControl::OnSize(UINT nType, int cx, int cy)
  67. {
  68. CDialogEx::OnSize(nType, cx, cy);
  69. TRACE2("对话框坐标:%d,%d\n", cx, cy);
  70. // TODO: 在此处添加消息处理程序代码
  71. }