- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

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