mirror of
https://github.com/zodiacon/WFPExplorer
synced 2026-06-08 18:39:31 +00:00
generic page properties for a layer
some tweaks and refactorings
This commit is contained in:
@@ -22,9 +22,27 @@ LRESULT CFilterGeneralPage::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) {
|
||||
SetDlgItemText(IDC_WEIGHT, StringHelper::WFPValueToString(m_Filter.Weight, true));
|
||||
SetDlgItemText(IDC_EFFECTIVEWEIGHT, StringHelper::WFPValueToString(m_Filter.EffectiveWeight, true));
|
||||
|
||||
auto flags = StringHelper::WFPFilterFlagsToString(m_Filter.Flags);
|
||||
if (!flags.IsEmpty())
|
||||
flags = std::format(L"0x{:X} ({})", (UINT32)m_Filter.Flags, (PCWSTR)flags).c_str();
|
||||
else
|
||||
flags = L"(None)";
|
||||
SetDlgItemText(IDC_FLAGS, flags);
|
||||
|
||||
AddIconToButton(IDC_PROVIDER_PROP, IDI_PROVIDER);
|
||||
AddIconToButton(IDC_LAYER_PROP, IDI_LAYERS);
|
||||
AddIconToButton(IDC_SUBLAYER_PROP, IDI_SUBLAYER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CFilterGeneralPage::OnShowLayer(WORD, WORD, HWND, BOOL&) {
|
||||
auto layer = m_Engine.GetLayerByKey(m_Filter.LayerKey);
|
||||
ATLASSERT(layer);
|
||||
if (!layer)
|
||||
AtlMessageBox(m_hWnd, L"Layer not found", IDS_TITLE, MB_ICONERROR);
|
||||
else
|
||||
WFPHelper::ShowLayerProperties(m_Engine, *layer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
CFilterGeneralPage(WFPEngine& engine, WFPFilterInfo& filter);
|
||||
|
||||
BEGIN_MSG_MAP(CFilterGeneralPage)
|
||||
COMMAND_ID_HANDLER(IDC_LAYER_PROP, OnShowLayer)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
END_MSG_MAP()
|
||||
|
||||
@@ -25,6 +26,7 @@ private:
|
||||
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
||||
|
||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||
LRESULT OnShowLayer(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
|
||||
private:
|
||||
WFPEngine& m_Engine;
|
||||
|
||||
@@ -133,20 +133,8 @@ LRESULT CFiltersView::OnRefresh(WORD, WORD, HWND, BOOL&) {
|
||||
LRESULT CFiltersView::OnProperties(WORD, WORD, HWND, BOOL&) {
|
||||
ATLASSERT(m_List.GetSelectedIndex() >= 0);
|
||||
auto& filter = m_Filters[m_List.GetSelectedIndex()];
|
||||
CPropertySheet sheet((PCWSTR)(L"Filter Properties (" + WFPHelper::GetFilterName(m_Engine, filter.FilterKey) + L")"));
|
||||
sheet.m_psh.dwFlags |= PSH_NOAPPLYNOW | PSH_USEICONID | PSH_NOCONTEXTHELP | PSH_RESIZABLE;
|
||||
sheet.m_psh.pszIcon = MAKEINTRESOURCE(IDI_FILTER);
|
||||
CFilterGeneralPage general(m_Engine, filter);
|
||||
general.m_psp.dwFlags |= PSP_USEICONID;
|
||||
general.m_psp.pszIcon = MAKEINTRESOURCE(IDI_CUBE);
|
||||
CFilterConditionsPage cond(m_Engine, filter);
|
||||
sheet.AddPage(general);
|
||||
if (filter.ConditionCount > 0) {
|
||||
cond.m_psp.dwFlags |= PSP_USEICONID;
|
||||
cond.m_psp.pszIcon = MAKEINTRESOURCE(IDI_CONDITION);
|
||||
sheet.AddPage(cond);
|
||||
}
|
||||
sheet.DoModal();
|
||||
WFPHelper::ShowFilterProperties(m_Engine, filter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -195,7 +183,8 @@ int CFiltersView::GetRowImage(HWND, int row, int col) const {
|
||||
}
|
||||
|
||||
void CFiltersView::OnStateChanged(HWND, int from, int to, UINT oldState, UINT newState) {
|
||||
UpdateUI();
|
||||
if((newState & LVIS_SELECTED) || (oldState & LVIS_SELECTED))
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
bool CFiltersView::OnDoubleClickList(HWND, int row, int col, POINT const& pt) {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#include "pch.h"
|
||||
#include "LayerGeneralPage.h"
|
||||
#include <WFPEngine.h>
|
||||
#include "StringHelper.h"
|
||||
#include "WFPHelper.h"
|
||||
|
||||
CLayerGeneralPage::CLayerGeneralPage(WFPEngine& engine, WFPLayerInfo& layer) : m_Engine(engine), m_Layer(layer) {
|
||||
}
|
||||
|
||||
LRESULT CLayerGeneralPage::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) {
|
||||
SetDlgItemText(IDC_NAME, m_Layer.Name.c_str());
|
||||
SetDlgItemText(IDC_DESC, m_Layer.Desc.c_str());
|
||||
SetDlgItemText(IDC_KEY, StringHelper::GuidToString(m_Layer.LayerKey));
|
||||
SetDlgItemInt(IDC_FIELDS, m_Layer.NumFields);
|
||||
SetDlgItemInt(IDC_ID, m_Layer.LayerId);
|
||||
auto flags = StringHelper::WFPLayerFlagsToString(m_Layer.Flags);
|
||||
if (!flags.IsEmpty())
|
||||
flags = std::format(L"0x{:X} ({})", (UINT32)m_Layer.Flags, (PCWSTR)flags).c_str();
|
||||
else
|
||||
flags = L"(None)";
|
||||
SetDlgItemText(IDC_FLAGS, flags);
|
||||
SetDlgItemText(IDC_SUBLAYER, WFPHelper::GetSublayerName(m_Engine, m_Layer.DefaultSubLayerKey));
|
||||
|
||||
AddIconToButton(IDC_SUBLAYER_PROP, IDI_SUBLAYER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <DialogHelper.h>
|
||||
#include "resource.h"
|
||||
|
||||
class WFPEngine;
|
||||
struct WFPLayerInfo;
|
||||
|
||||
class CLayerGeneralPage :
|
||||
public CPropertyPageImpl<CLayerGeneralPage>,
|
||||
public CDialogHelper<CLayerGeneralPage> {
|
||||
public:
|
||||
enum { IDD = IDD_LAYERINFO };
|
||||
|
||||
CLayerGeneralPage(WFPEngine& engine, WFPLayerInfo& layer);
|
||||
|
||||
BEGIN_MSG_MAP(CLayerGeneralPage)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
END_MSG_MAP()
|
||||
|
||||
private:
|
||||
// Handler prototypes (uncomment arguments if needed):
|
||||
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
||||
|
||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||
|
||||
private:
|
||||
WFPEngine& m_Engine;
|
||||
WFPLayerInfo& m_Layer;
|
||||
};
|
||||
@@ -2,14 +2,15 @@
|
||||
#include "LayersView.h"
|
||||
#include "StringHelper.h"
|
||||
#include <SortHelper.h>
|
||||
#include "resource.h"
|
||||
#include "WFPHelper.h"
|
||||
#include "LayerGeneralPage.h"
|
||||
|
||||
CLayersView::CLayersView(IMainFrame* frame, WFPEngine& engine) : CFrameView(frame), m_Engine(engine) {
|
||||
}
|
||||
|
||||
LRESULT CLayersView::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
|
||||
m_hWndClient = m_List.Create(m_hWnd, rcDefault, nullptr,
|
||||
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | LVS_OWNERDATA | LVS_REPORT | LVS_SHOWSELALWAYS);
|
||||
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | LVS_OWNERDATA | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL);
|
||||
m_List.SetExtendedListViewStyle(LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
|
||||
|
||||
auto cm = GetColumnManager(m_List);
|
||||
@@ -31,11 +32,25 @@ LRESULT CLayersView::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CLayersView::OnActivate(UINT, WPARAM active, LPARAM, BOOL&) {
|
||||
if (active) {
|
||||
UpdateUI();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CLayersView::OnRefresh(WORD, WORD, HWND, BOOL&) {
|
||||
Refresh();
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CLayersView::OnProperties(WORD, WORD, HWND, BOOL&) {
|
||||
auto& layer = m_Layers[m_List.GetSelectedIndex()];
|
||||
WFPHelper::ShowLayerProperties(m_Engine, layer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CLayersView::Refresh() {
|
||||
m_Layers = m_Engine.EnumLayers<LayerInfo>();
|
||||
m_List.SetItemCountEx((int)m_Layers.size(), LVSICF_NOSCROLL);
|
||||
@@ -100,3 +115,18 @@ int CLayersView::GetSaveColumnRange(HWND, int&) const {
|
||||
int CLayersView::GetRowImage(HWND, int row, int col) const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CLayersView::UpdateUI() {
|
||||
auto& ui = Frame()->UI();
|
||||
ui.UIEnable(ID_EDIT_PROPERTIES, m_List.GetSelectedCount() == 1);
|
||||
}
|
||||
|
||||
void CLayersView::OnStateChanged(HWND, int from, int to, UINT oldState, UINT newState) {
|
||||
if ((newState & LVIS_SELECTED) || (oldState & LVIS_SELECTED))
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
bool CLayersView::OnDoubleClickList(HWND, int row, int col, POINT const& pt) {
|
||||
LRESULT result;
|
||||
return ProcessWindowMessage(m_hWnd, WM_COMMAND, ID_EDIT_PROPERTIES, 0, result, 1);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <VirtualListView.h>
|
||||
#include "Interfaces.h"
|
||||
#include <WFPEngine.h>
|
||||
#include "resource.h"
|
||||
|
||||
class WFPEngine;
|
||||
|
||||
@@ -19,12 +20,16 @@ public:
|
||||
void DoSort(SortInfo const* si);
|
||||
int GetSaveColumnRange(HWND, int&) const;
|
||||
int GetRowImage(HWND, int row, int col) const;
|
||||
void OnStateChanged(HWND, int from, int to, UINT oldState, UINT newState);
|
||||
bool OnDoubleClickList(HWND, int row, int col, POINT const& pt);
|
||||
|
||||
BEGIN_MSG_MAP(CLayersView)
|
||||
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
||||
MESSAGE_HANDLER(WM_CREATE, OnCreate)
|
||||
CHAIN_MSG_MAP(CVirtualListView<CLayersView>)
|
||||
CHAIN_MSG_MAP(BaseFrame)
|
||||
ALT_MSG_MAP(1)
|
||||
COMMAND_ID_HANDLER(ID_EDIT_PROPERTIES, OnProperties)
|
||||
COMMAND_ID_HANDLER(ID_VIEW_REFRESH, OnRefresh)
|
||||
END_MSG_MAP()
|
||||
|
||||
@@ -34,6 +39,8 @@ public:
|
||||
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
||||
|
||||
private:
|
||||
void UpdateUI();
|
||||
|
||||
enum class ColumnType {
|
||||
Key, Name, Desc, Flags, Fields, DefaultSubLayer, Id,
|
||||
};
|
||||
@@ -43,7 +50,9 @@ private:
|
||||
};
|
||||
|
||||
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||
LRESULT OnActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||
LRESULT OnRefresh(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
LRESULT OnProperties(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
|
||||
WFPEngine& m_Engine;
|
||||
|
||||
|
||||
+58
-20
@@ -177,29 +177,31 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Key:",IDC_STATIC,7,15,16,8
|
||||
EDITTEXT IDC_KEY,51,13,248,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Name:",IDC_STATIC,7,37,22,8
|
||||
LTEXT "Name:",IDC_STATIC,7,36,22,8
|
||||
EDITTEXT IDC_NAME,51,34,359,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Description:",IDC_STATIC,7,58,39,8
|
||||
LTEXT "Description:",IDC_STATIC,7,57,39,8
|
||||
EDITTEXT IDC_DESC,51,55,359,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Provider:",IDC_STATIC,7,81,30,8
|
||||
EDITTEXT IDC_PROVIDER,51,78,290,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Provider...",IDC_PROVIDER_PROP,350,78,60,14
|
||||
LTEXT "Layer:",IDC_STATIC,7,102,30,8
|
||||
EDITTEXT IDC_LAYER,51,99,290,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Layer...",IDC_LAYER_PROP,350,99,60,14
|
||||
LTEXT "Action:",IDC_STATIC,7,167,30,8
|
||||
LTEXT "Callout/Filter:",IDC_STATIC,158,167,44,8
|
||||
EDITTEXT IDC_CALLOUT_OR_FILTER,211,163,199,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "ID:",IDC_STATIC,308,16,17,8
|
||||
LTEXT "Provider:",IDC_STATIC,7,97,30,8
|
||||
EDITTEXT IDC_PROVIDER,51,95,290,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Provider...",IDC_PROVIDER_PROP,347,95,63,14
|
||||
LTEXT "Layer:",IDC_STATIC,7,118,30,8
|
||||
EDITTEXT IDC_LAYER,51,116,290,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Layer...",IDC_LAYER_PROP,347,116,63,14
|
||||
LTEXT "Action:",IDC_STATIC,7,183,30,8
|
||||
LTEXT "Callout/Filter:",IDC_STATIC,158,184,44,8
|
||||
EDITTEXT IDC_CALLOUT_OR_FILTER,211,180,199,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "ID:",IDC_STATIC,309,15,12,8
|
||||
EDITTEXT IDC_ID,327,13,70,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Weight:",IDC_STATIC,7,144,26,8
|
||||
EDITTEXT IDC_WEIGHT,51,142,117,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Effective Weight:",IDC_STATIC,182,145,57,8
|
||||
EDITTEXT IDC_EFFECTIVEWEIGHT,244,142,117,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Sublayer:",IDC_STATIC,7,123,32,8
|
||||
EDITTEXT IDC_SUBLAYER,51,120,290,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Sublayer...",IDC_SUBLAYER_PROP,350,120,60,14
|
||||
EDITTEXT IDC_ACTIONTYPE,51,165,82,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Weight:",IDC_STATIC,7,160,26,8
|
||||
EDITTEXT IDC_WEIGHT,51,159,117,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Effective Weight:",IDC_STATIC,182,161,57,8
|
||||
EDITTEXT IDC_EFFECTIVEWEIGHT,244,159,117,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Sublayer:",IDC_STATIC,7,139,32,8
|
||||
EDITTEXT IDC_SUBLAYER,51,137,290,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Sublayer...",IDC_SUBLAYER_PROP,347,137,63,14
|
||||
EDITTEXT IDC_ACTIONTYPE,51,182,95,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Flags:",IDC_STATIC,7,75,20,8
|
||||
EDITTEXT IDC_FLAGS,51,75,261,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
IDD_FILTERCONDITIONS DIALOGEX 0, 0, 389, 254
|
||||
@@ -211,6 +213,28 @@ BEGIN
|
||||
EDITTEXT IDC_VALUE,7,175,375,72,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL,WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
IDD_LAYERINFO DIALOGEX 0, 0, 421, 219
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "General"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Key:",IDC_STATIC,9,15,16,8
|
||||
EDITTEXT IDC_KEY,53,14,248,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Name:",IDC_STATIC,9,36,22,8
|
||||
EDITTEXT IDC_NAME,53,34,359,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Description:",IDC_STATIC,9,57,39,8
|
||||
EDITTEXT IDC_DESC,53,55,359,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Flags:",IDC_STATIC,9,77,20,8
|
||||
EDITTEXT IDC_FLAGS,53,76,254,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "ID:",IDC_STATIC,311,15,12,8
|
||||
EDITTEXT IDC_ID,329,14,70,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Default Sublayer:",IDC_STATIC,7,97,57,8
|
||||
EDITTEXT IDC_SUBLAYER,67,96,274,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Sublayer...",IDC_SUBLAYER_PROP,350,95,60,14
|
||||
LTEXT "Fields:",IDC_STATIC,317,78,22,8
|
||||
EDITTEXT IDC_FIELDS,344,76,42,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -243,6 +267,14 @@ BEGIN
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 247
|
||||
END
|
||||
|
||||
IDD_LAYERINFO, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 414
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 212
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
@@ -333,6 +365,11 @@ BEGIN
|
||||
0, 0, 100, 0
|
||||
END
|
||||
|
||||
IDD_LAYERINFO AFX_DIALOG_LAYOUT
|
||||
BEGIN
|
||||
0
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -342,6 +379,7 @@ END
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDR_MAINFRAME "Windows Filtering Platform Explorer"
|
||||
IDS_TITLE "WFP Explorer"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
|
||||
@@ -232,6 +232,7 @@
|
||||
<ClCompile Include="FilterConditionsPage.cpp" />
|
||||
<ClCompile Include="FilterGeneralPage.cpp" />
|
||||
<ClCompile Include="FiltersView.cpp" />
|
||||
<ClCompile Include="LayerGeneralPage.cpp" />
|
||||
<ClCompile Include="LayersView.cpp" />
|
||||
<ClCompile Include="MainFrm.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
@@ -256,6 +257,7 @@
|
||||
<ClInclude Include="FilterGeneralPage.h" />
|
||||
<ClInclude Include="FiltersView.h" />
|
||||
<ClInclude Include="Interfaces.h" />
|
||||
<ClInclude Include="LayerGeneralPage.h" />
|
||||
<ClInclude Include="LayersView.h" />
|
||||
<ClInclude Include="MainFrm.h" />
|
||||
<ClInclude Include="ProcessHelper.h" />
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
<ClCompile Include="FilterConditionsPage.cpp">
|
||||
<Filter>PropertyPages</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="LayerGeneralPage.cpp">
|
||||
<Filter>PropertyPages</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h">
|
||||
@@ -128,6 +131,9 @@
|
||||
<ClInclude Include="FilterConditionsPage.h">
|
||||
<Filter>PropertyPages</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="LayerGeneralPage.h">
|
||||
<Filter>PropertyPages</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="WFPExplorer.rc">
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include "WFPHelper.h"
|
||||
#include <WFPEngine.h>
|
||||
#include "StringHelper.h"
|
||||
#include "LayerGeneralPage.h"
|
||||
#include "FilterGeneralPage.h"
|
||||
#include "FilterConditionsPage.h"
|
||||
|
||||
CString WFPHelper::GetProviderName(WFPEngine const& engine, GUID const& key) {
|
||||
if (key != GUID_NULL) {
|
||||
@@ -42,3 +45,34 @@ CString WFPHelper::GetSublayerName(WFPEngine const& engine, GUID const& key) {
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
int WFPHelper::ShowLayerProperties(WFPEngine& engine, WFPLayerInfo& layer) {
|
||||
auto name = L"Layer Properties (" + GetLayerName(engine, layer.LayerKey) + L")";
|
||||
CPropertySheet sheet((PCWSTR)name);
|
||||
sheet.m_psh.dwFlags |= PSH_NOAPPLYNOW | PSH_USEICONID | PSH_NOCONTEXTHELP | PSH_RESIZABLE;
|
||||
sheet.m_psh.pszIcon = MAKEINTRESOURCE(IDI_LAYERS);
|
||||
CLayerGeneralPage general(engine, layer);
|
||||
general.m_psp.dwFlags |= PSP_USEICONID;
|
||||
general.m_psp.pszIcon = MAKEINTRESOURCE(IDI_CUBE);
|
||||
sheet.AddPage(general);
|
||||
|
||||
return (int)sheet.DoModal();
|
||||
}
|
||||
|
||||
int WFPHelper::ShowFilterProperties(WFPEngine& engine, WFPFilterInfo& filter) {
|
||||
auto name = L"Filter Properties (" + GetFilterName(engine, filter.FilterKey) + L")";
|
||||
CPropertySheet sheet((PCWSTR)name);
|
||||
sheet.m_psh.dwFlags |= PSH_NOAPPLYNOW | PSH_USEICONID | PSH_NOCONTEXTHELP | PSH_RESIZABLE;
|
||||
sheet.m_psh.pszIcon = MAKEINTRESOURCE(IDI_FILTER);
|
||||
CFilterGeneralPage general(engine, filter);
|
||||
general.m_psp.dwFlags |= PSP_USEICONID;
|
||||
general.m_psp.pszIcon = MAKEINTRESOURCE(IDI_CUBE);
|
||||
CFilterConditionsPage cond(engine, filter);
|
||||
sheet.AddPage(general);
|
||||
if (filter.ConditionCount > 0) {
|
||||
cond.m_psp.dwFlags |= PSP_USEICONID;
|
||||
cond.m_psp.pszIcon = MAKEINTRESOURCE(IDI_CONDITION);
|
||||
sheet.AddPage(cond);
|
||||
}
|
||||
return (int)sheet.DoModal();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
class WFPEngine;
|
||||
struct WFPLayerInfo;
|
||||
struct WFPFilterInfo;
|
||||
|
||||
struct WFPHelper abstract final {
|
||||
static CString GetProviderName(WFPEngine const& engine, GUID const& key);
|
||||
static CString GetFilterName(WFPEngine const& engine, GUID const& key);
|
||||
static CString GetLayerName(WFPEngine const& engine, GUID const& key);
|
||||
static CString GetSublayerName(WFPEngine const& engine, GUID const& key);
|
||||
static int ShowLayerProperties(WFPEngine& engine, WFPLayerInfo& layer);
|
||||
static int ShowFilterProperties(WFPEngine& engine, WFPFilterInfo& layer);
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDD_FILTERCONDITIONS 107
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDS_TITLE 129
|
||||
#define IDI_CALLOUT 202
|
||||
#define IDI_COPY 203
|
||||
#define IDI_CUT 204
|
||||
@@ -26,6 +27,7 @@
|
||||
#define IDI_FILTER_BLOCK 221
|
||||
#define IDI_FILTER_PERMIT 222
|
||||
#define IDD_FILTERINFO 223
|
||||
#define IDD_LAYERINFO 224
|
||||
#define IDI_PROPERTIES 226
|
||||
#define IDI_CONDITION 227
|
||||
#define IDI_CUBE 228
|
||||
@@ -39,6 +41,7 @@
|
||||
#define IDC_LAYER 1006
|
||||
#define IDC_LAYER_PROP 1007
|
||||
#define IDC_ACTIONTYPE 1008
|
||||
#define IDC_FIELDS 1008
|
||||
#define IDC_CALLOUT_OR_FILTER 1009
|
||||
#define IDC_LIST 1009
|
||||
#define IDC_ID 1010
|
||||
@@ -46,8 +49,9 @@
|
||||
#define IDC_EFFECTIVEWEIGHT 1012
|
||||
#define IDC_SUBLAYER 1013
|
||||
#define IDC_SUBLAYER_PROP 1014
|
||||
#define IDC_EDIT1 1016
|
||||
#define IDC_DESC2 1015
|
||||
#define IDC_VALUE 1016
|
||||
#define IDC_FLAGS 1017
|
||||
#define ID_WINDOW_CLOSE 32772
|
||||
#define ID_WINDOW_CLOSE_ALL 32773
|
||||
#define ID_OPTIONS_ALWAYSONTOP 32775
|
||||
@@ -67,9 +71,9 @@
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 229
|
||||
#define _APS_NEXT_RESOURCE_VALUE 230
|
||||
#define _APS_NEXT_COMMAND_VALUE 32789
|
||||
#define _APS_NEXT_CONTROL_VALUE 1017
|
||||
#define _APS_NEXT_CONTROL_VALUE 1018
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user