diff options
Diffstat (limited to 'src/apps/mplayerc/PPageSubStyle.cpp')
-rw-r--r-- | src/apps/mplayerc/PPageSubStyle.cpp | 396 |
1 files changed, 198 insertions, 198 deletions
diff --git a/src/apps/mplayerc/PPageSubStyle.cpp b/src/apps/mplayerc/PPageSubStyle.cpp index b78e3de79..ef216bfd3 100644 --- a/src/apps/mplayerc/PPageSubStyle.cpp +++ b/src/apps/mplayerc/PPageSubStyle.cpp @@ -39,22 +39,22 @@ IMPLEMENT_DYNAMIC(CPPageSubStyle, CPPageBase)
CPPageSubStyle::CPPageSubStyle()
- : CPPageBase(CPPageSubStyle::IDD, CPPageSubStyle::IDD)
- , m_iCharset(0)
- , m_spacing(0)
- , m_angle(0)
- , m_scalex(0)
- , m_scaley(0)
- , m_borderstyle(0)
- , m_borderwidth(0)
- , m_shadowdepth(0)
- , m_screenalignment(0)
- , m_margin(0,0,0,0)
- , m_linkalphasliders(FALSE)
- , m_relativeTo(FALSE)
+ : CPPageBase(CPPageSubStyle::IDD, CPPageSubStyle::IDD)
+ , m_iCharset(0)
+ , m_spacing(0)
+ , m_angle(0)
+ , m_scalex(0)
+ , m_scaley(0)
+ , m_borderstyle(0)
+ , m_borderwidth(0)
+ , m_shadowdepth(0)
+ , m_screenalignment(0)
+ , m_margin(0,0,0,0)
+ , m_linkalphasliders(FALSE)
+ , m_relativeTo(FALSE)
{
- m_stss = AfxGetAppSettings().subdefstyle;
- m_fUseDefaultStyle = true;
+ m_stss = AfxGetAppSettings().subdefstyle;
+ m_fUseDefaultStyle = true;
}
CPPageSubStyle::~CPPageSubStyle()
@@ -63,77 +63,77 @@ CPPageSubStyle::~CPPageSubStyle() void CPPageSubStyle::InitStyle(CString title, STSStyle& stss)
{
- m_pPSP->pszTitle = (m_title = title);
- m_psp.dwFlags |= PSP_USETITLE;
+ m_pPSP->pszTitle = (m_title = title);
+ m_psp.dwFlags |= PSP_USETITLE;
- m_stss = stss;
- m_fUseDefaultStyle = false;
+ m_stss = stss;
+ m_fUseDefaultStyle = false;
}
void CPPageSubStyle::AskColor(int i)
{
- CColorDialog dlg(m_stss.colors[i]);
- dlg.m_cc.Flags |= CC_FULLOPEN;
- if(dlg.DoModal() == IDOK)
- {
- m_stss.colors[i] = dlg.m_cc.rgbResult;
- m_color[i].Invalidate();
- }
+ CColorDialog dlg(m_stss.colors[i]);
+ dlg.m_cc.Flags |= CC_FULLOPEN;
+ if(dlg.DoModal() == IDOK)
+ {
+ m_stss.colors[i] = dlg.m_cc.rgbResult;
+ m_color[i].Invalidate();
+ }
}
void CPPageSubStyle::DoDataExchange(CDataExchange* pDX)
{
- CPPageBase::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_BUTTON1, m_font);
- DDX_CBIndex(pDX, IDC_COMBO1, m_iCharset);
- DDX_Control(pDX, IDC_COMBO1, m_charset);
- DDX_Text(pDX, IDC_EDIT3, m_spacing);
- DDX_Control(pDX, IDC_SPIN3, m_spacingspin);
- DDX_Text(pDX, IDC_EDIT4, m_angle);
- DDX_Control(pDX, IDC_SPIN10, m_anglespin);
- DDX_Text(pDX, IDC_EDIT5, m_scalex);
- DDX_Control(pDX, IDC_SPIN4, m_scalexspin);
- DDX_Text(pDX, IDC_EDIT6, m_scaley);
- DDX_Control(pDX, IDC_SPIN5, m_scaleyspin);
- DDX_Radio(pDX, IDC_RADIO1, m_borderstyle);
- DDX_Text(pDX, IDC_EDIT1, m_borderwidth);
- DDX_Control(pDX, IDC_SPIN1, m_borderwidthspin);
- DDX_Text(pDX, IDC_EDIT2, m_shadowdepth);
- DDX_Control(pDX, IDC_SPIN2, m_shadowdepthspin);
- DDX_Radio(pDX, IDC_RADIO3, m_screenalignment);
- DDX_Text(pDX, IDC_EDIT7, m_margin.left);
- DDX_Control(pDX, IDC_SPIN6, m_marginleftspin);
- DDX_Text(pDX, IDC_EDIT8, m_margin.right);
- DDX_Control(pDX, IDC_SPIN7, m_marginrightspin);
- DDX_Text(pDX, IDC_EDIT9, m_margin.top);
- DDX_Control(pDX, IDC_SPIN8, m_margintopspin);
- DDX_Text(pDX, IDC_EDIT10, m_margin.bottom);
- DDX_Control(pDX, IDC_SPIN9, m_marginbottomspin);
- DDX_Control(pDX, IDC_COLORPRI, m_color[0]);
- DDX_Control(pDX, IDC_COLORSEC, m_color[1]);
- DDX_Control(pDX, IDC_COLOROUTL, m_color[2]);
- DDX_Control(pDX, IDC_COLORSHAD, m_color[3]);
- DDX_Slider(pDX, IDC_SLIDER1, m_alpha[0]);
- DDX_Slider(pDX, IDC_SLIDER2, m_alpha[1]);
- DDX_Slider(pDX, IDC_SLIDER3, m_alpha[2]);
- DDX_Slider(pDX, IDC_SLIDER4, m_alpha[3]);
- DDX_Control(pDX, IDC_SLIDER1, m_alphasliders[0]);
- DDX_Control(pDX, IDC_SLIDER2, m_alphasliders[1]);
- DDX_Control(pDX, IDC_SLIDER3, m_alphasliders[2]);
- DDX_Control(pDX, IDC_SLIDER4, m_alphasliders[3]);
- DDX_Check(pDX, IDC_CHECK1, m_linkalphasliders);
- DDX_Check(pDX, IDC_CHECK_RELATIVETO, m_relativeTo);
+ CPPageBase::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_BUTTON1, m_font);
+ DDX_CBIndex(pDX, IDC_COMBO1, m_iCharset);
+ DDX_Control(pDX, IDC_COMBO1, m_charset);
+ DDX_Text(pDX, IDC_EDIT3, m_spacing);
+ DDX_Control(pDX, IDC_SPIN3, m_spacingspin);
+ DDX_Text(pDX, IDC_EDIT4, m_angle);
+ DDX_Control(pDX, IDC_SPIN10, m_anglespin);
+ DDX_Text(pDX, IDC_EDIT5, m_scalex);
+ DDX_Control(pDX, IDC_SPIN4, m_scalexspin);
+ DDX_Text(pDX, IDC_EDIT6, m_scaley);
+ DDX_Control(pDX, IDC_SPIN5, m_scaleyspin);
+ DDX_Radio(pDX, IDC_RADIO1, m_borderstyle);
+ DDX_Text(pDX, IDC_EDIT1, m_borderwidth);
+ DDX_Control(pDX, IDC_SPIN1, m_borderwidthspin);
+ DDX_Text(pDX, IDC_EDIT2, m_shadowdepth);
+ DDX_Control(pDX, IDC_SPIN2, m_shadowdepthspin);
+ DDX_Radio(pDX, IDC_RADIO3, m_screenalignment);
+ DDX_Text(pDX, IDC_EDIT7, m_margin.left);
+ DDX_Control(pDX, IDC_SPIN6, m_marginleftspin);
+ DDX_Text(pDX, IDC_EDIT8, m_margin.right);
+ DDX_Control(pDX, IDC_SPIN7, m_marginrightspin);
+ DDX_Text(pDX, IDC_EDIT9, m_margin.top);
+ DDX_Control(pDX, IDC_SPIN8, m_margintopspin);
+ DDX_Text(pDX, IDC_EDIT10, m_margin.bottom);
+ DDX_Control(pDX, IDC_SPIN9, m_marginbottomspin);
+ DDX_Control(pDX, IDC_COLORPRI, m_color[0]);
+ DDX_Control(pDX, IDC_COLORSEC, m_color[1]);
+ DDX_Control(pDX, IDC_COLOROUTL, m_color[2]);
+ DDX_Control(pDX, IDC_COLORSHAD, m_color[3]);
+ DDX_Slider(pDX, IDC_SLIDER1, m_alpha[0]);
+ DDX_Slider(pDX, IDC_SLIDER2, m_alpha[1]);
+ DDX_Slider(pDX, IDC_SLIDER3, m_alpha[2]);
+ DDX_Slider(pDX, IDC_SLIDER4, m_alpha[3]);
+ DDX_Control(pDX, IDC_SLIDER1, m_alphasliders[0]);
+ DDX_Control(pDX, IDC_SLIDER2, m_alphasliders[1]);
+ DDX_Control(pDX, IDC_SLIDER3, m_alphasliders[2]);
+ DDX_Control(pDX, IDC_SLIDER4, m_alphasliders[3]);
+ DDX_Check(pDX, IDC_CHECK1, m_linkalphasliders);
+ DDX_Check(pDX, IDC_CHECK_RELATIVETO, m_relativeTo);
}
BEGIN_MESSAGE_MAP(CPPageSubStyle, CPPageBase)
- ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
- ON_STN_CLICKED(IDC_COLORPRI, OnStnClickedColorpri)
- ON_STN_CLICKED(IDC_COLORSEC, OnStnClickedColorsec)
- ON_STN_CLICKED(IDC_COLOROUTL, OnStnClickedColoroutl)
- ON_STN_CLICKED(IDC_COLORSHAD, OnStnClickedColorshad)
- ON_BN_CLICKED(IDC_CHECK1, OnBnClickedCheck1)
- ON_WM_HSCROLL()
+ ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
+ ON_STN_CLICKED(IDC_COLORPRI, OnStnClickedColorpri)
+ ON_STN_CLICKED(IDC_COLORSEC, OnStnClickedColorsec)
+ ON_STN_CLICKED(IDC_COLOROUTL, OnStnClickedColoroutl)
+ ON_STN_CLICKED(IDC_COLORSHAD, OnStnClickedColorshad)
+ ON_BN_CLICKED(IDC_CHECK1, OnBnClickedCheck1)
+ ON_WM_HSCROLL()
END_MESSAGE_MAP()
@@ -141,165 +141,165 @@ END_MESSAGE_MAP() BOOL CPPageSubStyle::OnInitDialog()
{
- __super::OnInitDialog();
-
- SetHandCursor(m_hWnd, IDC_COMBO1);
-
- m_font.SetWindowText(m_stss.fontName);
- m_iCharset = -1;
- for(int i = 0; i < CharSetLen; i++)
- {
- CString str;
- str.Format(_T("%s (%d)"), CharSetNames[i], CharSetList[i]);
- m_charset.AddString(str);
- m_charset.SetItemData(i, CharSetList[i]);
- if(m_stss.charSet == CharSetList[i]) m_iCharset = i;
- }
-
- // TODO: allow floats in these edit boxes
- m_spacing = (int)m_stss.fontSpacing;
- m_spacingspin.SetRange32(-10000, 10000);
- while(m_stss.fontAngleZ < 0) m_stss.fontAngleZ += 360;
- m_angle = (int)fmod(m_stss.fontAngleZ, 360);
- m_anglespin.SetRange32(0, 359);
- m_scalex = (int)m_stss.fontScaleX;
- m_scalexspin.SetRange32(-10000, 10000);
- m_scaley = (int)m_stss.fontScaleY;
- m_scaleyspin.SetRange32(-10000, 10000);
-
- m_borderstyle = m_stss.borderStyle;
- m_borderwidth = min(m_stss.outlineWidthX, m_stss.outlineWidthY);
- m_borderwidthspin.SetRange32(0, 10000);
- m_shadowdepth = min(m_stss.shadowDepthX, m_stss.shadowDepthY);
- m_shadowdepthspin.SetRange32(0, 10000);
-
- m_screenalignment = m_stss.scrAlignment-1;
- m_margin = m_stss.marginRect;
- m_marginleftspin.SetRange32(-10000, 10000);
- m_marginrightspin.SetRange32(-10000, 10000);
- m_margintopspin.SetRange32(-10000, 10000);
- m_marginbottomspin.SetRange32(-10000, 10000);
- m_relativeTo = m_stss.relativeTo;
-
- for(int i = 0; i < 4; i++)
- {
- m_color[i].SetColorPtr(&m_stss.colors[i]);
- m_alpha[i] = 255-m_stss.alpha[i];
- m_alphasliders[i].SetRange(0, 255);
- }
-
- m_linkalphasliders = FALSE;
-
- UpdateData(FALSE);
-
- CreateToolTip();
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
+ __super::OnInitDialog();
+
+ SetHandCursor(m_hWnd, IDC_COMBO1);
+
+ m_font.SetWindowText(m_stss.fontName);
+ m_iCharset = -1;
+ for(int i = 0; i < CharSetLen; i++)
+ {
+ CString str;
+ str.Format(_T("%s (%d)"), CharSetNames[i], CharSetList[i]);
+ m_charset.AddString(str);
+ m_charset.SetItemData(i, CharSetList[i]);
+ if(m_stss.charSet == CharSetList[i]) m_iCharset = i;
+ }
+
+ // TODO: allow floats in these edit boxes
+ m_spacing = (int)m_stss.fontSpacing;
+ m_spacingspin.SetRange32(-10000, 10000);
+ while(m_stss.fontAngleZ < 0) m_stss.fontAngleZ += 360;
+ m_angle = (int)fmod(m_stss.fontAngleZ, 360);
+ m_anglespin.SetRange32(0, 359);
+ m_scalex = (int)m_stss.fontScaleX;
+ m_scalexspin.SetRange32(-10000, 10000);
+ m_scaley = (int)m_stss.fontScaleY;
+ m_scaleyspin.SetRange32(-10000, 10000);
+
+ m_borderstyle = m_stss.borderStyle;
+ m_borderwidth = min(m_stss.outlineWidthX, m_stss.outlineWidthY);
+ m_borderwidthspin.SetRange32(0, 10000);
+ m_shadowdepth = min(m_stss.shadowDepthX, m_stss.shadowDepthY);
+ m_shadowdepthspin.SetRange32(0, 10000);
+
+ m_screenalignment = m_stss.scrAlignment-1;
+ m_margin = m_stss.marginRect;
+ m_marginleftspin.SetRange32(-10000, 10000);
+ m_marginrightspin.SetRange32(-10000, 10000);
+ m_margintopspin.SetRange32(-10000, 10000);
+ m_marginbottomspin.SetRange32(-10000, 10000);
+ m_relativeTo = m_stss.relativeTo;
+
+ for(int i = 0; i < 4; i++)
+ {
+ m_color[i].SetColorPtr(&m_stss.colors[i]);
+ m_alpha[i] = 255-m_stss.alpha[i];
+ m_alphasliders[i].SetRange(0, 255);
+ }
+
+ m_linkalphasliders = FALSE;
+
+ UpdateData(FALSE);
+
+ CreateToolTip();
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CPPageSubStyle::OnApply()
{
- UpdateData();
-
- if(m_iCharset >= 0) m_stss.charSet = m_charset.GetItemData(m_iCharset);
- m_stss.fontSpacing = m_spacing;
- m_stss.fontAngleZ = m_angle;
- m_stss.fontScaleX = m_scalex;
- m_stss.fontScaleY = m_scaley;
-
- m_stss.borderStyle = m_borderstyle;
- m_stss.outlineWidthX = m_stss.outlineWidthY = m_borderwidth;
- m_stss.shadowDepthX = m_stss.shadowDepthY = m_shadowdepth;
-
- m_stss.scrAlignment = m_screenalignment+1;
- m_stss.marginRect = m_margin;
- m_stss.relativeTo = m_relativeTo;
-
- for(int i = 0; i < 4; i++) m_stss.alpha[i] = 255-m_alpha[i];
-
- if(m_fUseDefaultStyle)
- {
- STSStyle& stss = AfxGetAppSettings().subdefstyle;
- if(!(stss == m_stss))
- {
- stss = m_stss;
- if(CMainFrame* pFrame = dynamic_cast<CMainFrame*>(AfxGetMainWnd()))
- pFrame->UpdateSubtitle(false, true);
- }
- }
-
- return __super::OnApply();
+ UpdateData();
+
+ if(m_iCharset >= 0) m_stss.charSet = m_charset.GetItemData(m_iCharset);
+ m_stss.fontSpacing = m_spacing;
+ m_stss.fontAngleZ = m_angle;
+ m_stss.fontScaleX = m_scalex;
+ m_stss.fontScaleY = m_scaley;
+
+ m_stss.borderStyle = m_borderstyle;
+ m_stss.outlineWidthX = m_stss.outlineWidthY = m_borderwidth;
+ m_stss.shadowDepthX = m_stss.shadowDepthY = m_shadowdepth;
+
+ m_stss.scrAlignment = m_screenalignment+1;
+ m_stss.marginRect = m_margin;
+ m_stss.relativeTo = m_relativeTo;
+
+ for(int i = 0; i < 4; i++) m_stss.alpha[i] = 255-m_alpha[i];
+
+ if(m_fUseDefaultStyle)
+ {
+ STSStyle& stss = AfxGetAppSettings().subdefstyle;
+ if(!(stss == m_stss))
+ {
+ stss = m_stss;
+ if(CMainFrame* pFrame = dynamic_cast<CMainFrame*>(AfxGetMainWnd()))
+ pFrame->UpdateSubtitle(false, true);
+ }
+ }
+
+ return __super::OnApply();
}
void CPPageSubStyle::OnBnClickedButton1()
{
- LOGFONT lf;
- lf <<= m_stss;
-
- CFontDialog dlg(&lf, CF_SCREENFONTS|CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|CF_SCALABLEONLY|CF_EFFECTS);
- if(dlg.DoModal() == IDOK)
- {
- CString str(lf.lfFaceName);
- if(str.GetLength() > 16) str = str.Left(14) + _T("...");
- m_font.SetWindowText(str);
-
- for(int i = 0, j = m_charset.GetCount(); i < j; i++)
- {
- if(m_charset.GetItemData(i) == lf.lfCharSet)
- {
- m_charset.SetCurSel(i);
- break;
- }
- }
-
- m_stss = lf;
-
- SetModified();
- }
+ LOGFONT lf;
+ lf <<= m_stss;
+
+ CFontDialog dlg(&lf, CF_SCREENFONTS|CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|CF_SCALABLEONLY|CF_EFFECTS);
+ if(dlg.DoModal() == IDOK)
+ {
+ CString str(lf.lfFaceName);
+ if(str.GetLength() > 16) str = str.Left(14) + _T("...");
+ m_font.SetWindowText(str);
+
+ for(int i = 0, j = m_charset.GetCount(); i < j; i++)
+ {
+ if(m_charset.GetItemData(i) == lf.lfCharSet)
+ {
+ m_charset.SetCurSel(i);
+ break;
+ }
+ }
+
+ m_stss = lf;
+
+ SetModified();
+ }
}
void CPPageSubStyle::OnStnClickedColorpri()
{
- AskColor(0);
+ AskColor(0);
}
void CPPageSubStyle::OnStnClickedColorsec()
{
- AskColor(1);
+ AskColor(1);
}
void CPPageSubStyle::OnStnClickedColoroutl()
{
- AskColor(2);
+ AskColor(2);
}
void CPPageSubStyle::OnStnClickedColorshad()
{
- AskColor(3);
+ AskColor(3);
}
void CPPageSubStyle::OnBnClickedCheck1()
{
- UpdateData();
+ UpdateData();
- int avg = 0;
- for(int i = 0; i < 4; i++) avg += m_alphasliders[i].GetPos();
- avg /= 4;
- for(int i = 0; i < 4; i++) m_alphasliders[i].SetPos(avg);
+ int avg = 0;
+ for(int i = 0; i < 4; i++) avg += m_alphasliders[i].GetPos();
+ avg /= 4;
+ for(int i = 0; i < 4; i++) m_alphasliders[i].SetPos(avg);
- SetModified();
+ SetModified();
}
void CPPageSubStyle::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- if(m_linkalphasliders && pScrollBar)
- {
- int pos = ((CSliderCtrl*)pScrollBar)->GetPos();
- for(int i = 0; i < 4; i++) m_alphasliders[i].SetPos(pos);
- }
+ if(m_linkalphasliders && pScrollBar)
+ {
+ int pos = ((CSliderCtrl*)pScrollBar)->GetPos();
+ for(int i = 0; i < 4; i++) m_alphasliders[i].SetPos(pos);
+ }
- SetModified();
+ SetModified();
- __super::OnHScroll(nSBCode, nPos, pScrollBar);
+ __super::OnHScroll(nSBCode, nPos, pScrollBar);
}
|