2 #include "nlite_include.h"
5 BOOL CCookieSettingWindow::OnInitDialog(CWindow wndFocus, LPARAM lInitParam){
6 //
\83X
\83N
\83\8a\81[
\83\93\82Ì
\92\86\89\9b\82É
\94z
\92u
12 switch(this->browserType){
14 case BT_INTERNET_EXPLORER:
16 radio = GetDlgItem(IDC_RADIO_IE);
22 radio = GetDlgItem(IDC_RADIO_FIREFOX);
27 case BT_GOOGLE_CHROME:
29 radio = GetDlgItem(IDC_RADIO_CHROME);
35 radio = GetDlgItem(IDC_RADIO_IECM);
42 radio.SetCheck(BST_CHECKED);
49 VOID CCookieSettingWindow::OnOK(UINT uNotifyCode, int nID, CWindow wndCtl){
50 CButton ieRadio = GetDlgItem(IDC_RADIO_IE);
51 CButton firefoxRadio = GetDlgItem(IDC_RADIO_FIREFOX);
52 CButton chromeRadio = GetDlgItem(IDC_RADIO_CHROME);
53 CButton iecmRadio = GetDlgItem(IDC_RADIO_IECM);
55 if(ieRadio.GetCheck() == BST_CHECKED){
57 this->browserType = BT_INTERNET_EXPLORER;
61 if(firefoxRadio.GetCheck() == BST_CHECKED){
63 this->browserType = BT_FIRE_FOX;
67 if(chromeRadio.GetCheck() == BST_CHECKED){
69 this->browserType = BT_GOOGLE_CHROME;
73 if(iecmRadio.GetCheck() == BST_CHECKED){
75 this->browserType = BT_IE_COMPONENT;
83 VOID CCookieSettingWindow::OnCancel(UINT uNotifyCode, int nID, CWindow wndCtl){
87 VOID CCookieSettingWindow::SetBrowserType(BROWSERTYPE browserType){
89 this->browserType = browserType;
95 BROWSERTYPE CCookieSettingWindow::GetBrowserType(){
96 return this->browserType;
99 VOID CColorSettingButton::OnLButtonDown(UINT wParam,CPoint &point){
101 CColorDialog dlg(color);
103 if(dlg.DoModal() == IDOK){
104 this->SetColor(dlg.GetColor());
111 VOID CColorSettingButton::SetColor(COLORREF in_color){
114 if(brush.IsNull() != TRUE){
115 brush.DeleteObject();
117 if(color != ListenerData::INIT_COLOR){
119 brush.CreateSolidBrush(color);
120 this->SetWindowText(TEXT(""));
122 brush.CreateSolidBrush(RGB(255,255,255));
123 this->SetWindowText(TEXT("
\90F
\90Ý
\92è
\82È
\82µ"));
129 VOID CListenerSettingWindow::ShowSettingWindow(ListenerData &listenerData){
131 this->ShowWindow(SW_HIDE);
132 this->listenerData = &listenerData;
135 backColorButton.SetColor(this->listenerData->bgcolor);
136 nameColorButton.SetColor(this->listenerData->nameColor);
138 idField.SetWindowText(listenerData.user_id);
139 nameEdit.SetWindowText(listenerData.name);
141 this->ShowWindow(SW_SHOW);
146 BOOL CListenerSettingWindow::OnInitDialog(CWindow wndFocus, LPARAM lInitParam){
148 nameEdit = GetDlgItem(IDC_NICKNAME_EDIT);
150 nameColorButton.SubclassWindow(GetDlgItem(IDC_LT_NICKNAME_STATIC));
151 backColorButton.SubclassWindow(GetDlgItem(IDC_LT_BACKCOLOR_STATIC));
152 backColorReturnButton = GetDlgItem(IDC_BACKCOLOR_RETURN_BUTTON);
153 nameColorReturnButton = GetDlgItem(IDC_NAMECOLOR_RETURN_BUTTON);
154 idField = GetDlgItem(IDC_USERID_STATIC);
158 LRESULT CListenerSettingWindow::OnCtlColorStatic(HDC hdc,HWND hWnd){
161 if(hWnd == nameColorButton){
163 return (LRESULT)(HBRUSH)nameColorButton.brush;
165 } else if(hWnd == backColorButton){
168 return (LRESULT)(HBRUSH)backColorButton.brush;
179 VOID CListenerSettingWindow::OnOK(UINT uNotifyCode, int nID, CWindow wndCtl){
181 std::vector<TCHAR> nameBuf(nameEdit.GetWindowTextLength() + 1);
182 nameEdit.GetWindowText(&nameBuf[0],nameBuf.size());
183 this->listenerData->SetUserName(&nameBuf[0]);
184 this->listenerData->SetBkColor( backColorButton.color);
185 this->listenerData->SetNameColor( nameColorButton.color);
187 ::ShowWindow(::GetAncestor(*this,GA_ROOTOWNER),SW_HIDE);
188 ::ShowWindow(::GetAncestor(*this,GA_ROOTOWNER),SW_SHOW);
190 this->ShowWindow(SW_HIDE);
194 VOID CListenerSettingWindow::OnCancel(UINT uNotifyCode, int nID, CWindow wndCtl){
196 this->ShowWindow(SW_HIDE);
201 VOID CListenerSettingWindow::OnButton(UINT hiWParam,INT_PTR loWParam,HWND lParam){
203 if(this->backColorReturnButton == lParam){
205 backColorButton.SetColor(ListenerData::INIT_COLOR);
207 } else if(this->nameColorReturnButton == lParam){
209 nameColorButton.SetColor(ListenerData::INIT_COLOR);