GME  13
SvnTestDlg.cpp
Go to the documentation of this file.
00001 // SvnTestDlg.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "GME.h"
00006 #include "SvnTestDlg.h"
00007 
00008 
00009 // CSvnTestDlg dialog
00010 
00011 IMPLEMENT_DYNAMIC(CSvnTestDlg, CDialog)
00012 CSvnTestDlg::CSvnTestDlg(CWnd* pParent /*=NULL*/)
00013         : CDialog(CSvnTestDlg::IDD, pParent)
00014 {
00015 }
00016 
00017 CSvnTestDlg::~CSvnTestDlg()
00018 {
00019 }
00020 
00021 void CSvnTestDlg::DoDataExchange(CDataExchange* pDX)
00022 {
00023         CDialog::DoDataExchange(pDX);
00024         DDX_Control(pDX, IDC_EDIT1, m_field);
00025         DDX_Control(pDX, IDOK,      m_btn);
00026 }
00027 
00028 
00029 BEGIN_MESSAGE_MAP(CSvnTestDlg, CDialog)
00030         ON_WM_SIZE()
00031 END_MESSAGE_MAP()
00032 
00033 
00034 // CSvnTestDlg message handlers
00035 
00036 void CSvnTestDlg::OnSize(UINT nType, int cx, int cy)
00037 {
00038         CDialog::OnSize(nType, cx, cy);
00039 
00040         CRect field_rect, btn_rect;
00041         if (m_field.GetSafeHwnd() && m_btn.GetSafeHwnd()) {
00042                 m_field.GetWindowRect( &field_rect);
00043                 ScreenToClient( &field_rect);
00044 
00045                 m_btn.GetWindowRect( &btn_rect);
00046                 ScreenToClient( &btn_rect);
00047 
00048                 int pad = field_rect.left;
00049                 int spc = btn_rect.top - field_rect.bottom;
00050 
00051                 //m_field.SetWindowPos( NULL, 0, 0, cx, cy - btn_rect.Height(), SWP_NOZORDER);
00052                 m_field.SetWindowPos( NULL, pad, field_rect.top, cx - 2*pad, cy - field_rect.top - pad - spc - btn_rect.Height(), SWP_NOZORDER);
00053                 m_btn.SetWindowPos( NULL, cx - btn_rect.Width() - pad, cy - btn_rect.Height() - pad, btn_rect.Width(), btn_rect.Height(), SWP_NOZORDER);
00054         }
00055 }
00056 
00057 void CSvnTestDlg::setContent( const CString& p_cont)
00058 {
00059         m_defContent = p_cont;
00060 }
00061 
00062 BOOL CSvnTestDlg::OnInitDialog()
00063 {
00064         CDialog::OnInitDialog();
00065 
00066         m_field.SetWindowText( m_defContent);
00067 
00068         return TRUE;  // return TRUE unless you set the focus to a control
00069         // EXCEPTION: OCX Property Pages should return FALSE
00070 }