Back to index

lightning-sunbird  0.9+nobinonly
PropDlg.cpp
Go to the documentation of this file.
00001 // PropDlg.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "winldap.h"
00006 #include "PropDlg.h"
00007 
00008 #ifdef _DEBUG
00009 #ifdef _WIN32
00010 #define new DEBUG_NEW
00011 #endif
00012 #undef THIS_FILE
00013 static char THIS_FILE[] = __FILE__;
00014 #endif
00015 
00017 // PropDlg dialog
00018 
00019 
00020 PropDlg::PropDlg(CWnd* pParent /*=NULL*/)
00021        : CDialog(PropDlg::IDD, pParent)
00022 {
00023        //{{AFX_DATA_INIT(PropDlg)
00024               // NOTE: the ClassWizard will add member initialization here
00025        //}}AFX_DATA_INIT
00026 }
00027 
00028 
00029 void PropDlg::DoDataExchange(CDataExchange* pDX)
00030 {
00031        CDialog::DoDataExchange(pDX);
00032        //{{AFX_DATA_MAP(PropDlg)
00033               // NOTE: the ClassWizard will add DDX and DDV calls here
00034        //}}AFX_DATA_MAP
00035 }
00036 
00037 
00038 BEGIN_MESSAGE_MAP(PropDlg, CDialog)
00039        //{{AFX_MSG_MAP(PropDlg)
00040        ON_WM_SIZE()
00041        //}}AFX_MSG_MAP
00042 END_MESSAGE_MAP()
00043 
00045 // PropDlg message handlers
00046 
00047 void PropDlg::OnSize(UINT nType, int cx, int cy) 
00048 {
00049        CDialog::OnSize(nType, cx, cy);
00050        
00051        if ( ::IsWindow( m_list.m_hWnd ) )
00052               m_list.SetWindowPos( &wndTop, 0, 0, cx, cy, SWP_NOZORDER );
00053 }
00054 
00055 BOOL PropDlg::OnInitDialog() 
00056 {
00057        CDialog::OnInitDialog();
00058        if ( m_title.GetLength() > 0 )
00059               SetWindowText( m_title );
00060        CRect rect;
00061        GetClientRect( &rect );
00062        m_list.Create( WS_CHILD|WS_VISIBLE|WS_VSCROLL|LBS_NOTIFY, rect, this, 5000 );
00063        
00064        POSITION pos;
00065        // Iterate through the list in head-to-tail order.
00066        for( pos = m_strings.GetHeadPosition(); pos != NULL; )
00067        {
00068               m_list.AddString( m_strings.GetNext( pos ) );
00069        }
00070        
00071        return TRUE;  // return TRUE unless you set the focus to a control
00072                      // EXCEPTION: OCX Property Pages should return FALSE
00073 }
00074 
00075 void PropDlg::AddLine( const char *str )
00076 {
00077        m_strings.AddTail( str );
00078 }