FavoriteAddDlg.cpp

00001 /* 
00002  *      Copyright (C) 2003-2005 Gabest
00003  *      http://www.gabest.org
00004  *
00005  *  This Program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2, or (at your option)
00008  *  any later version.
00009  *   
00010  *  This Program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  *  GNU General Public License for more details.
00014  *   
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with GNU Make; see the file COPYING.  If not, write to
00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
00018  *  http://www.gnu.org/copyleft/gpl.html
00019  *
00020  */
00021 
00022 // FavoritAddDlg.cpp : implementation file
00023 //
00024 
00025 #include "stdafx.h"
00026 #include "mplayerc.h"
00027 #include "FavoriteAddDlg.h"
00028 
00029 
00030 // CFavoriteAddDlg dialog
00031 
00032 IMPLEMENT_DYNAMIC(CFavoriteAddDlg, CCmdUIDialog)
00033 CFavoriteAddDlg::CFavoriteAddDlg(CString shortname, CString fullname, CWnd* pParent /*=NULL*/)
00034         : CCmdUIDialog(CFavoriteAddDlg::IDD, pParent)
00035         , m_shortname(shortname)
00036         , m_fullname(fullname)
00037         , m_fRememberPos(FALSE)
00038 {
00039 }
00040 
00041 CFavoriteAddDlg::~CFavoriteAddDlg()
00042 {
00043 }
00044 
00045 void CFavoriteAddDlg::DoDataExchange(CDataExchange* pDX)
00046 {
00047         __super::DoDataExchange(pDX);
00048         DDX_Control(pDX, IDC_COMBO1, m_namectrl);
00049         DDX_CBString(pDX, IDC_COMBO1, m_name);  
00050         DDX_Check(pDX, IDC_CHECK1, m_fRememberPos);
00051 }
00052 
00053 BOOL CFavoriteAddDlg::OnInitDialog()
00054 {
00055         __super::OnInitDialog();
00056 
00057         if(!m_shortname.IsEmpty()) m_namectrl.AddString(m_shortname);
00058         if(!m_fullname.IsEmpty()) m_namectrl.AddString(m_fullname);
00059         m_namectrl.SetCurSel(0);
00060 
00061         ::CorrectComboListWidth(m_namectrl, GetFont());
00062 
00063         return TRUE;  // return TRUE unless you set the focus to a control
00064         // EXCEPTION: OCX Property Pages should return FALSE
00065 }
00066 
00067 
00068 BEGIN_MESSAGE_MAP(CFavoriteAddDlg, CCmdUIDialog)
00069         ON_UPDATE_COMMAND_UI(IDOK, OnUpdateOk)
00070 END_MESSAGE_MAP()
00071 
00072 
00073 // CFavoriteAddDlg message handlers
00074 
00075 void CFavoriteAddDlg::OnUpdateOk(CCmdUI* pCmdUI)
00076 {
00077         UpdateData();
00078         pCmdUI->Enable(!m_name.IsEmpty());
00079 }

Generated on Tue Dec 13 14:46:49 2005 for guliverkli by  doxygen 1.4.5