/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef FILTERPAGE_H
#define FILTERPAGE_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "PropPage.h"
#include "ExListViewCtrl.h"
#include "../client/Client.h"
#include <atlcrack.h>
#include "WinUtil.h"
class FilterPage : public CPropertyPage<IDD_FILTER_PAGE>, public PropPage
{
public:
FilterPage(SettingsManager *s) : PropPage(s) {
SetTitle(CTSTRING(FILTER_PAGE));
m_psp.dwFlags |= PSP_HASHELP | PSP_RTLREADING;
};
virtual ~FilterPage() {
ctrlFilters.Detach();
};
BEGIN_MSG_MAP(FilterPage)
MESSAGE_HANDLER(WM_INITDIALOG, onInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnCtlColor)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColor)
COMMAND_ID_HANDLER(IDC_ADD_FILTER, onAddFilter)
COMMAND_ID_HANDLER(IDC_REMOVE_FILTER, onRemoveFilter)
COMMAND_ID_HANDLER(IDC_CHANGE_FILTER, onChangeFilter)
NOTIFY_HANDLER(IDC_FILTER_PAGE_ITEMS, BN_DOUBLECLICKED, onDblClick)
END_MSG_MAP()
LRESULT onInitDialog(UINT, WPARAM, LPARAM, BOOL&);
LRESULT onAddFilter(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT onChangeFilter(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT onRemoveFilter(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT onDblClick(int /*idCtrl*/, LPNMHDR /* pnmh */, BOOL& bHandled) {
return onChangeFilter(0, 0, 0, bHandled);
}
LRESULT OnCtlColor(UINT, WPARAM wParam, LPARAM, BOOL&) {
SetBkMode((HDC)wParam, SETTING(BK_SETTING));
SetTextColor((HDC)wParam, SETTING(BK_SETTING_TEXT));
return (LRESULT)WinUtil::bkBrush;
}
// Common PropPage interface
PROPSHEETPAGE *getPSP() { return (PROPSHEETPAGE *)*this; }
virtual void write();
protected:
ExListViewCtrl ctrlFilters;
Client* client;
static Item items[];
static TextItem texts[];
};
#endif //FILTERPAGE_H
/**
* @file
* $Id: FilterPage.h 73 2006-01-20 17:35:16Z crakter $
*/