From bb4dc0fab56e542e784311f95ae6d7e7dd785a8f Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期二, 29 十月 2024 17:10:33 +0800
Subject: [PATCH] update
---
jrj/xframe/xcontrol/xtreeview.hpp | 41 +++++++++++++++++++++++++++++------------
1 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/jrj/xframe/xcontrol/xtreeview.hpp b/jrj/xframe/xcontrol/xtreeview.hpp
index 0d27f16..715eda7 100644
--- a/jrj/xframe/xcontrol/xtreeview.hpp
+++ b/jrj/xframe/xcontrol/xtreeview.hpp
@@ -49,6 +49,7 @@
#define TV_FIRST 0x1100
+#ifdef XWIN
struct SCROLLINFO
{
int cbSize;
@@ -59,6 +60,8 @@
int nPos;
int nTrackPos;
};
+#endif
+
struct tvitem
{
@@ -123,7 +126,7 @@
return (HTREEITEM)SendMessage(GetHWND(), TVM_GETNEXTITEM, TVGN_CARET,0);
}
- string GetItemLabel(HTREEITEM hItem)
+ xstring GetItemLabel(HTREEITEM hItem)
{
int TVM_GETITEM = TV_FIRST + 62;
@@ -169,6 +172,11 @@
return tvi.lParam;
}
+ int SetItemData(HTREEITEM hItem, KXMLDOMElement value)
+ {
+ return SetItemData(hItem, (LPARAM)value.ptr());
+ }
+
int SetItemData(HTREEITEM hItem,LPARAM value)
{
int TVM_SETITEM = TV_FIRST + 63;
@@ -349,6 +357,11 @@
return 1;
}
+ HTREEITEM InsertChildItem(HTREEITEM hItem, string label, KXMLDOMElement ele, int image = 0)
+ {
+ return InsertChildItem(hItem, label, ele.ptr(), image);
+ }
+
HTREEITEM InsertChildItem(HTREEITEM hItem,string label,LPARAM data,int image = 0)
{
HTREEITEM h;
@@ -377,7 +390,12 @@
return h;
}
- HTREEITEM InsertChildItemEx(HTREEITEM hItem,string label,int data,int image = 0,int image2 = 0)
+ HTREEITEM InsertChildItemEx(HTREEITEM hItem, string label, KXMLDOMElement ele, int image = 0, int image2 = 0)
+ {
+ return InsertChildItemEx(hItem, label, ele.ptr(), image,image2);
+ }
+
+ HTREEITEM InsertChildItemEx(HTREEITEM hItem,string label,LPARAM data,int image = 0,int image2 = 0)
{
int TVM_INSERTITEM = TV_FIRST + 50;
@@ -495,28 +513,27 @@
SendMessage(GetHWND(), TVM_GETITEMW, 0,(LPARAM)&xitem);
return xitem.cChildren;
}
-#if 0
- string PopupMenu(string str)
+
+ xstring PopupMenu(string str)
{
- return (str)SendMessage(GetHWND(), 0x402, (WPARAM)str, 0);
+ return (string)SendMessage(GetHWND(), 0x402, (WPARAM)str, 0);
}
string PopupMenu(KXMLDOMElement e)
{
- return PopupMenu(e.xml);
+ return PopupMenu(e.xml());
}
-#endif
void SetLineAtRoot(bool value)
{
- int GWL_STYLE = -16;
- int TVS_LINESATROOT = 0x0004;
- int style = GetWindowLong(GetHWND(), GWL_STYLE);
+ int GWL_STYLE_ = -16;
+ int TVS_LINESATROOT_ = 0x0004;
+ int style = GetWindowLong(GetHWND(), GWL_STYLE_);
if (value)
- SetWindowLong(GetHWND(), GWL_STYLE, style | TVS_LINESATROOT);
+ SetWindowLong(GetHWND(), GWL_STYLE_, style | TVS_LINESATROOT_);
else
- SetWindowLong(GetHWND(), GWL_STYLE, style & ~TVS_LINESATROOT);
+ SetWindowLong(GetHWND(), GWL_STYLE_, style & ~TVS_LINESATROOT_);
}
};
\ No newline at end of file
--
Gitblit v1.9.3