1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#if defined(Hiro_TreeView)
namespace hiro {
auto pTreeView::construct() -> void {
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE, WC_TREEVIEW, L"",
WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_SHOWSELALWAYS,
0, 0, 0, 0, _parentHandle(), nullptr, GetModuleHandle(0), 0
);
TreeView_SetExtendedStyle(hwnd, TVS_EX_DOUBLEBUFFER, TVS_EX_DOUBLEBUFFER);
pWidget::construct();
setActivation(state().activation);
setBackgroundColor(state().backgroundColor);
setForegroundColor(state().foregroundColor);
}
auto pTreeView::destruct() -> void {
DestroyWindow(hwnd);
}
//
auto pTreeView::append(sTreeViewItem item) -> void {
}
auto pTreeView::remove(sTreeViewItem item) -> void {
}
auto pTreeView::setActivation(Mouse::Click activation) -> void {
}
auto pTreeView::setBackgroundColor(Color color) -> void {
if(color) {
TreeView_SetBkColor(hwnd, CreateRGB(color));
}
}
auto pTreeView::setFocused() -> void {
}
auto pTreeView::setForegroundColor(Color color) -> void {
if(color) {
TreeView_SetTextColor(hwnd, CreateRGB(color));
}
}
auto pTreeView::setGeometry(Geometry geometry) -> void {
}
//
auto pTreeView::windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> maybe<LRESULT> {
if(msg == WM_ERASEBKGND) {
return 0;
}
if(msg == WM_GETDLGCODE) {
if(wparam == VK_RETURN) return DLGC_WANTALLKEYS;
}
return pWidget::windowProc(hwnd, msg, wparam, lparam);
}
}
#endif
|