Less hacky Win32 API use

This commit is contained in:
Jack Andersen 2016-06-16 15:30:18 -10:00
parent 7b9c7a4eb6
commit 3f98ada70a
2 changed files with 47 additions and 20 deletions

View File

@ -231,19 +231,47 @@ bool VSTEditor::open(void* ptr)
TreeView_InsertItem(m_collectionTree, &treeItem); TreeView_InsertItem(m_collectionTree, &treeItem);
ShowWindow(m_collectionTree, SW_SHOW); ShowWindow(m_collectionTree, SW_SHOW);
m_collectionHeader = CreateWindowW(WC_HEADER, HWND cHeader = CreateWindowW(WC_HEADER,
L"", L"",
WS_CHILD, WS_CHILD,
1, 1, 1, 1,
199, 199,
24, 24,
m_rootView, m_rootView,
nullptr, nullptr,
nullptr, nullptr,
nullptr); nullptr);
SetWindowLongPtrW(m_collectionHeader, GWLP_USERDATA, LONG_PTR(L"Collection")); SetWindowLongPtrW(cHeader, GWLP_USERDATA, LONG_PTR(L"Collection"));
OriginalListViewProc = WNDPROC(SetWindowLongPtr(m_collectionHeader, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc))); OriginalListViewProc = WNDPROC(SetWindowLongPtr(cHeader, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc)));
ShowWindow(m_collectionHeader, SW_SHOW); ShowWindow(cHeader, SW_SHOW);
HWND gHeader = CreateWindowW(WC_HEADER,
L"",
WS_CHILD,
201, 1,
199,
24,
m_rootView,
nullptr,
nullptr,
nullptr);
SetWindowLongPtrW(gHeader, GWLP_USERDATA, LONG_PTR(L"Group"));
OriginalListViewProc = WNDPROC(SetWindowLongPtr(gHeader, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc)));
ShowWindow(gHeader, SW_SHOW);
HWND pHeader = CreateWindowW(WC_HEADER,
L"",
WS_CHILD,
401, 1,
198,
24,
m_rootView,
nullptr,
nullptr,
nullptr);
SetWindowLongPtrW(pHeader, GWLP_USERDATA, LONG_PTR(L"Page"));
OriginalListViewProc = WNDPROC(SetWindowLongPtr(pHeader, GWLP_WNDPROC, LONG_PTR(ColHeaderWindowProc)));
ShowWindow(pHeader, SW_SHOW);
m_collectionAdd = CreateWindowW(WC_BUTTON, m_collectionAdd = CreateWindowW(WC_BUTTON,
L"+", L"+",
@ -274,10 +302,10 @@ bool VSTEditor::open(void* ptr)
m_groupListView = CreateWindowW(WC_LISTVIEW, m_groupListView = CreateWindowW(WC_LISTVIEW,
L"", L"",
WS_CHILD | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER, WS_CHILD | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER,
201, 1, 201, 25,
199, 199,
m_windowRect.bottom - m_windowRect.top - 2, m_windowRect.bottom - m_windowRect.top - 26,
m_rootView, m_rootView,
nullptr, nullptr,
nullptr, nullptr,
@ -294,10 +322,10 @@ bool VSTEditor::open(void* ptr)
m_pageListView = CreateWindowW(WC_LISTVIEW, m_pageListView = CreateWindowW(WC_LISTVIEW,
L"", L"",
WS_CHILD | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER, WS_CHILD | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER,
401, 1, 401, 25,
198, 198,
m_windowRect.bottom - m_windowRect.top - 2, m_windowRect.bottom - m_windowRect.top - 26,
m_rootView, m_rootView,
nullptr, nullptr,
nullptr, nullptr,

View File

@ -22,7 +22,6 @@ class VSTEditor : public AEffEditor
ERect m_windowRect = {0, 0, 420, 600}; ERect m_windowRect = {0, 0, 420, 600};
HWND m_rootView = 0; HWND m_rootView = 0;
HWND m_collectionHeader = 0;
HWND m_collectionTree = 0; HWND m_collectionTree = 0;
HWND m_collectionAdd = 0; HWND m_collectionAdd = 0;
HWND m_collectionRemove = 0; HWND m_collectionRemove = 0;