diff options
Diffstat (limited to 'src/apps/mplayerc/PPageLogo.cpp')
-rw-r--r-- | src/apps/mplayerc/PPageLogo.cpp | 204 |
1 files changed, 102 insertions, 102 deletions
diff --git a/src/apps/mplayerc/PPageLogo.cpp b/src/apps/mplayerc/PPageLogo.cpp index ab17bb347..3f8bdccc4 100644 --- a/src/apps/mplayerc/PPageLogo.cpp +++ b/src/apps/mplayerc/PPageLogo.cpp @@ -31,19 +31,19 @@ IMPLEMENT_DYNAMIC(CPPageLogo, CPPageBase)
CPPageLogo::CPPageLogo()
- : CPPageBase(CPPageLogo::IDD, CPPageLogo::IDD)
- , m_intext(0)
- , m_logofn(_T(""))
- , m_author(_T(""))
+ : CPPageBase(CPPageLogo::IDD, CPPageLogo::IDD)
+ , m_intext(0)
+ , m_logofn(_T(""))
+ , m_author(_T(""))
{
- m_logoids.AddTail(IDF_LOGO0);
- m_logoids.AddTail(IDF_LOGO1);
- m_logoids.AddTail(IDF_LOGO2);
- m_logoids.AddTail(IDF_LOGO3);
- m_logoids.AddTail(IDF_LOGO4);
- m_logoids.AddTail(IDF_LOGO5);
- m_logoids.AddTail(IDF_LOGO6);
- m_logoids.AddTail(IDF_LOGO7);
+ m_logoids.AddTail(IDF_LOGO0);
+ m_logoids.AddTail(IDF_LOGO1);
+ m_logoids.AddTail(IDF_LOGO2);
+ m_logoids.AddTail(IDF_LOGO3);
+ m_logoids.AddTail(IDF_LOGO4);
+ m_logoids.AddTail(IDF_LOGO5);
+ m_logoids.AddTail(IDF_LOGO6);
+ m_logoids.AddTail(IDF_LOGO7);
}
CPPageLogo::~CPPageLogo()
@@ -52,19 +52,19 @@ CPPageLogo::~CPPageLogo() void CPPageLogo::DoDataExchange(CDataExchange* pDX)
{
- __super::DoDataExchange(pDX);
- DDX_Radio(pDX, IDC_RADIO1, m_intext);
- DDX_Text(pDX, IDC_LOGOFILENAME, m_logofn);
- DDX_Control(pDX, IDC_LOGOPREVIEW, m_logopreview);
- DDX_Text(pDX, IDC_AUTHOR, m_author);
+ __super::DoDataExchange(pDX);
+ DDX_Radio(pDX, IDC_RADIO1, m_intext);
+ DDX_Text(pDX, IDC_LOGOFILENAME, m_logofn);
+ DDX_Control(pDX, IDC_LOGOPREVIEW, m_logopreview);
+ DDX_Text(pDX, IDC_AUTHOR, m_author);
}
BEGIN_MESSAGE_MAP(CPPageLogo, CPPageBase)
- ON_BN_CLICKED(IDC_RADIO1, OnBnClickedRadio1)
- ON_BN_CLICKED(IDC_RADIO2, OnBnClickedRadio2)
- ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN1, OnDeltaposSpin1)
- ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
+ ON_BN_CLICKED(IDC_RADIO1, OnBnClickedRadio1)
+ ON_BN_CLICKED(IDC_RADIO2, OnBnClickedRadio2)
+ ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN1, OnDeltaposSpin1)
+ ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
END_MESSAGE_MAP()
@@ -72,125 +72,125 @@ END_MESSAGE_MAP() BOOL CPPageLogo::OnInitDialog()
{
- __super::OnInitDialog();
+ __super::OnInitDialog();
- AppSettings& s = AfxGetAppSettings();
+ AppSettings& s = AfxGetAppSettings();
- m_intext = s.logoext?1:0;
- m_logofn = s.logofn;
- m_logoidpos = NULL;
+ m_intext = s.logoext?1:0;
+ m_logofn = s.logofn;
+ m_logoidpos = NULL;
- UpdateData(FALSE);
+ UpdateData(FALSE);
- for(POSITION pos = m_logoids.GetHeadPosition(); pos; m_logoids.GetNext(pos))
- {
- if(m_logoids.GetAt(pos) == s.logoid)
- {
- m_logoidpos = pos;
- break;
- }
- }
+ for(POSITION pos = m_logoids.GetHeadPosition(); pos; m_logoids.GetNext(pos))
+ {
+ if(m_logoids.GetAt(pos) == s.logoid)
+ {
+ m_logoidpos = pos;
+ break;
+ }
+ }
- if(!m_intext) OnBnClickedRadio1();
- else OnBnClickedRadio2();
+ if(!m_intext) OnBnClickedRadio1();
+ else OnBnClickedRadio2();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CPPageLogo::OnApply()
{
- UpdateData();
+ UpdateData();
- AppSettings& s = AfxGetAppSettings();
+ AppSettings& s = AfxGetAppSettings();
- s.logoext = !!m_intext;
- s.logofn = m_logofn;
- s.logoid = m_logoids.GetAt(m_logoidpos);
+ s.logoext = !!m_intext;
+ s.logofn = m_logofn;
+ s.logoid = m_logoids.GetAt(m_logoidpos);
- ((CMainFrame*)AfxGetMainWnd())->m_wndView.LoadLogo();
+ ((CMainFrame*)AfxGetMainWnd())->m_wndView.LoadLogo();
- return __super::OnApply();
+ return __super::OnApply();
}
void CPPageLogo::OnBnClickedRadio1()
{
- ASSERT(m_logoidpos);
+ ASSERT(m_logoidpos);
- m_author.Empty();
+ m_author.Empty();
- m_logobm.Destroy();
- UINT id = m_logoids.GetAt(m_logoidpos);
- if(IDF_LOGO0 != id)
- {
- m_logobm.LoadFromResource(id);
- // m_logobm.LoadFromResource(::AfxGetInstanceHandle(), id);
- if(!m_author.LoadString(id)) m_author = ResStr(IDS_LOGO_AUTHOR);
- }
- m_logopreview.SetBitmap(m_logobm);
- Invalidate();
+ m_logobm.Destroy();
+ UINT id = m_logoids.GetAt(m_logoidpos);
+ if(IDF_LOGO0 != id)
+ {
+ m_logobm.LoadFromResource(id);
+ // m_logobm.LoadFromResource(::AfxGetInstanceHandle(), id);
+ if(!m_author.LoadString(id)) m_author = ResStr(IDS_LOGO_AUTHOR);
+ }
+ m_logopreview.SetBitmap(m_logobm);
+ Invalidate();
- m_intext = 0;
- UpdateData(FALSE);
+ m_intext = 0;
+ UpdateData(FALSE);
- SetModified();
+ SetModified();
}
void CPPageLogo::OnBnClickedRadio2()
{
- UpdateData();
+ UpdateData();
- m_author.Empty();
+ m_author.Empty();
- m_logobm.Destroy();
- if(AfxGetAppSettings().fXpOrBetter)
- m_logobm.Load(m_logofn);
- else if(HANDLE h = LoadImage(NULL, m_logofn, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE))
- m_logobm.Attach((HBITMAP)h);
- m_logopreview.SetBitmap(m_logobm);
- Invalidate();
+ m_logobm.Destroy();
+ if(AfxGetAppSettings().fXpOrBetter)
+ m_logobm.Load(m_logofn);
+ else if(HANDLE h = LoadImage(NULL, m_logofn, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE))
+ m_logobm.Attach((HBITMAP)h);
+ m_logopreview.SetBitmap(m_logobm);
+ Invalidate();
- m_intext = 1;
- UpdateData(FALSE);
+ m_intext = 1;
+ UpdateData(FALSE);
- SetModified();
+ SetModified();
}
void CPPageLogo::OnDeltaposSpin1(NMHDR *pNMHDR, LRESULT *pResult)
{
- LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
-
- if(pNMUpDown->iDelta < 0)
- {
- m_logoids.GetNext(m_logoidpos);
- if(!m_logoidpos) m_logoidpos = m_logoids.GetHeadPosition();
- }
- else
- {
- m_logoids.GetPrev(m_logoidpos);
- if(!m_logoidpos) m_logoidpos = m_logoids.GetTailPosition();
- }
-
- OnBnClickedRadio1();
-
- *pResult = 0;
+ LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
+
+ if(pNMUpDown->iDelta < 0)
+ {
+ m_logoids.GetNext(m_logoidpos);
+ if(!m_logoidpos) m_logoidpos = m_logoids.GetHeadPosition();
+ }
+ else
+ {
+ m_logoids.GetPrev(m_logoidpos);
+ if(!m_logoidpos) m_logoidpos = m_logoids.GetTailPosition();
+ }
+
+ OnBnClickedRadio1();
+
+ *pResult = 0;
}
void CPPageLogo::OnBnClickedButton2()
{
- CFileDialog dlg(TRUE, NULL, m_logofn,
- OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY,
- AfxGetAppSettings().fXpOrBetter
- ? _T("Images (*.bmp;*.jpg;*.gif;*.png)|*.bmp;*.jpg;*.gif;*.png|All files (*.*)|*.*||")
- : _T("Images (*.bmp)|*.bmp|All files (*.*)|*.*||")
- , this, 0);
-
- if(dlg.DoModal() == IDOK)
- {
- m_logofn = dlg.GetPathName();
- UpdateData(FALSE);
- OnBnClickedRadio2();
- }
+ CFileDialog dlg(TRUE, NULL, m_logofn,
+ OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY,
+ AfxGetAppSettings().fXpOrBetter
+ ? _T("Images (*.bmp;*.jpg;*.gif;*.png)|*.bmp;*.jpg;*.gif;*.png|All files (*.*)|*.*||")
+ : _T("Images (*.bmp)|*.bmp|All files (*.*)|*.*||")
+ , this, 0);
+
+ if(dlg.DoModal() == IDOK)
+ {
+ m_logofn = dlg.GetPathName();
+ UpdateData(FALSE);
+ OnBnClickedRadio2();
+ }
}
|