Mercurial > vba-linux
comparison src/win32/TextOptions.cpp @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 // TextOptions.cpp : implementation file | |
2 // | |
3 | |
4 #include "stdafx.h" | |
5 #include "../common/Text.h" | |
6 #include "resource.h" | |
7 #include "TextOptions.h" | |
8 | |
9 // TextOptions dialog | |
10 | |
11 IMPLEMENT_DYNAMIC(TextOptions, CDialog) | |
12 TextOptions::TextOptions(CWnd*pParent /*=NULL*/) | |
13 : CDialog(TextOptions::IDD, pParent) | |
14 {} | |
15 | |
16 TextOptions::~TextOptions() | |
17 {} | |
18 | |
19 BOOL TextOptions::OnInitDialog() | |
20 { | |
21 CDialog::OnInitDialog(); | |
22 | |
23 CheckRadioButton(IDC_RADIO_WHITE, IDC_RADIO_BLACK, IDC_RADIO_WHITE + textColor); | |
24 CheckRadioButton(IDC_RADIO_PREFILTER, IDC_RADIO_POSTRENDER, IDC_RADIO_PREFILTER + textMethod); | |
25 CheckDlgButton(IDC_CHECK_OUTLINED, outlinedText); | |
26 CheckDlgButton(IDC_CHECK_TRANSPARENT, transparentText); | |
27 GetDlgItem(IDC_CHECK_TRANSPARENT)->EnableWindow(GetCheckedRadioButton(IDC_RADIO_PREFILTER, | |
28 IDC_RADIO_POSTRENDER) != IDC_RADIO_POSTRENDER); | |
29 | |
30 return TRUE; // return TRUE unless you set the focus to a control | |
31 // EXCEPTION: OCX Property Pages should return FALSE | |
32 } | |
33 | |
34 void TextOptions::DoDataExchange(CDataExchange*pDX) | |
35 { | |
36 CDialog::DoDataExchange(pDX); | |
37 } | |
38 | |
39 BEGIN_MESSAGE_MAP(TextOptions, CDialog) | |
40 ON_BN_CLICKED(IDOK, OnBnClickedOk) | |
41 ON_BN_CLICKED(IDC_RADIO_PREFILTER, OnBnClickedRadioPrefilter) | |
42 ON_BN_CLICKED(IDC_RADIO_POSTFILTER, OnBnClickedRadioPostfilter) | |
43 ON_BN_CLICKED(IDC_RADIO_POSTRENDER, OnBnClickedRadioPostrender) | |
44 END_MESSAGE_MAP() | |
45 | |
46 // TextOptions message handlers | |
47 | |
48 void TextOptions::OnBnClickedOk() | |
49 { | |
50 transparentText = IsDlgButtonChecked(IDC_CHECK_TRANSPARENT) != 0; | |
51 outlinedText = IsDlgButtonChecked(IDC_CHECK_OUTLINED) != 0; | |
52 textMethod = GetCheckedRadioButton(IDC_RADIO_PREFILTER, IDC_RADIO_POSTRENDER) - IDC_RADIO_PREFILTER; | |
53 textColor = GetCheckedRadioButton(IDC_RADIO_WHITE, IDC_RADIO_BLACK) - IDC_RADIO_WHITE; | |
54 if (textMethod < 0) | |
55 textMethod = 0; | |
56 if (textMethod > 2) | |
57 textMethod = 2; | |
58 if (textColor < 0) | |
59 textColor = 0; | |
60 if (textColor > 7) | |
61 textColor = 7; | |
62 | |
63 OnOK(); | |
64 } | |
65 | |
66 void TextOptions::OnBnClickedRadioPrefilter() | |
67 { | |
68 GetDlgItem(IDC_CHECK_TRANSPARENT)->EnableWindow(TRUE); | |
69 } | |
70 | |
71 void TextOptions::OnBnClickedRadioPostfilter() | |
72 { | |
73 GetDlgItem(IDC_CHECK_TRANSPARENT)->EnableWindow(TRUE); | |
74 } | |
75 | |
76 void TextOptions::OnBnClickedRadioPostrender() | |
77 { | |
78 GetDlgItem(IDC_CHECK_TRANSPARENT)->EnableWindow(FALSE); | |
79 CheckDlgButton(IDC_CHECK_TRANSPARENT, FALSE); | |
80 } | |
81 |