PPageSubStyle.h

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 #pragma once
00023 
00024 #include "PPageBase.h"
00025 #include "..\..\subtitles\STS.h"
00026 
00027 class CColorStatic : public CStatic
00028 {
00029 //      DECLARE_DYNAMIC(CColorStatic)
00030 
00031         COLORREF* m_pColor;
00032 
00033 public:
00034         CColorStatic(CWnd* pParent = NULL) : m_pColor(NULL) {}
00035         virtual ~CColorStatic() {}
00036 
00037         void SetColorPtr(COLORREF* pColor) {m_pColor = pColor;}
00038 
00039 //      DECLARE_MESSAGE_MAP()
00040 
00041 protected:
00042         virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00043         {
00044                 CRect r;
00045                 GetClientRect(r);
00046                 CDC::FromHandle(lpDrawItemStruct->hDC)->FillSolidRect(r, m_pColor ? *m_pColor : ::GetSysColor(COLOR_BTNFACE));
00047         }
00048 };
00049 
00050 // CPPageSubStyle dialog
00051 
00052 class CPPageSubStyle : public CPPageBase
00053 {
00054         DECLARE_DYNAMIC(CPPageSubStyle)
00055 
00056 private:
00057         CString m_title;
00058         STSStyle m_stss;
00059         bool m_fUseDefaultStyle;
00060 
00061         void AskColor(int i);
00062 
00063 public:
00064         CPPageSubStyle();
00065         virtual ~CPPageSubStyle();
00066 
00067         void InitStyle(CString title, STSStyle& stss);
00068         void GetStyle(STSStyle& stss) {stss = m_stss;}
00069 
00070 // Dialog Data
00071         enum { IDD = IDD_PPAGESUBSTYLE };
00072         CButton m_font;
00073         int m_iCharset;
00074         CComboBox m_charset;
00075         int m_spacing;
00076         CSpinButtonCtrl m_spacingspin;
00077         int m_angle;
00078         CSpinButtonCtrl m_anglespin;
00079         int m_scalex;
00080         CSpinButtonCtrl m_scalexspin;
00081         int m_scaley;
00082         CSpinButtonCtrl m_scaleyspin;
00083         int m_borderstyle;
00084         int m_borderwidth;
00085         CSpinButtonCtrl m_borderwidthspin;
00086         int m_shadowdepth;
00087         CSpinButtonCtrl m_shadowdepthspin;
00088         int m_screenalignment;
00089         CRect m_margin;
00090         CSpinButtonCtrl m_marginleftspin;
00091         CSpinButtonCtrl m_marginrightspin;
00092         CSpinButtonCtrl m_margintopspin;
00093         CSpinButtonCtrl m_marginbottomspin;
00094         CColorStatic m_color[4];
00095         int m_alpha[4];
00096         CSliderCtrl m_alphasliders[4];
00097         BOOL m_linkalphasliders;
00098         BOOL m_relativeTo;
00099 
00100 protected:
00101         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00102         virtual BOOL OnInitDialog();
00103         virtual BOOL OnApply();
00104 
00105         DECLARE_MESSAGE_MAP()
00106         afx_msg void OnBnClickedButton1();
00107         afx_msg void OnStnClickedColorpri();
00108         afx_msg void OnStnClickedColorsec();
00109         afx_msg void OnStnClickedColoroutl();
00110         afx_msg void OnStnClickedColorshad();
00111         afx_msg void OnBnClickedCheck1();
00112         afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00113 public:
00114 };

Generated on Tue Dec 13 14:47:02 2005 for guliverkli by  doxygen 1.4.5