From e3f724c9fd36995c207a6ed173849c20aaa2e3d7 Mon Sep 17 00:00:00 2001
From: LiFan <2308045698@qq.com>
Date: 星期二, 17 十二月 2024 13:06:22 +0800
Subject: [PATCH] update

---
 jrj/xframe/xcontrol/xcombobox.hpp |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/jrj/xframe/xcontrol/xcombobox.hpp b/jrj/xframe/xcontrol/xcombobox.hpp
index 4b7cafd..2bed6f1 100644
--- a/jrj/xframe/xcontrol/xcombobox.hpp
+++ b/jrj/xframe/xcontrol/xcombobox.hpp
@@ -16,12 +16,6 @@
         return *this;
     }
 public:
-    static int GetCurSel(HWND hWnd)
-    {
-        int CB_GETCURSEL_ = 0x0147;
-        return SendMessage(hWnd, CB_GETCURSEL_, 0, 0);
-    }
-
     int GetCurSel()
     {
         int CB_GETCURSEL_  = 0x0147;
@@ -109,6 +103,11 @@
         return SendMessage(GetHWND(),CB_RESETCONTENT_,0,0);
     }
 
+   int SetItemData(int nIndex, KXMLDOMElement p)
+   {
+       return  SetItemData(nIndex, p.ptr());
+    }
+
    int SetItemData(int nIndex, LPARAM p) 
     {
         int CB_SETITEMDATA_  =   0x0151;
@@ -131,7 +130,11 @@
         return SendMessage(GetHWND(),CB_GETITEMDATA_,nIndex,0);
     }
 
-   int AddItem(string str, int p)
+   int AddItem(string str, KXMLDOMElement ele)
+   {
+       return AddItem(str, ele.ptr());
+   }
+   int AddItem(string str, LPARAM p)
     {
         int CB_ADDSTRING_ =  0x0143;
         int h = SendMessage(GetHWND(),CB_ADDSTRING_  ,0,(LPARAM)str);
@@ -146,6 +149,15 @@
         SetItemData( h, (LPARAM)p);
         return h;
     }
+
+   int InsertString(string str, KXMLDOMElement p)
+   {
+       int CB_INSERTSTRING_ = 0x014A;
+       int h = SendMessage(GetHWND(), CB_INSERTSTRING_, 0, (LPARAM)str);
+
+       SetItemData(h, p);
+       return h;
+   }
 
    int InsertString( string str, LPARAM p) 
     {
@@ -267,7 +279,7 @@
        return SendMessage(hWnd, CB_GETITEMDATA_, nIndex, 0);
    }
 
-   static int AddItem(HWND hWnd,string str, int p)
+   static int AddItem(HWND hWnd,string str, LPARAM p)
    {
        int CB_ADDSTRING_ = 0x0143;
        int h = SendMessage(hWnd, CB_ADDSTRING_, 0, (LPARAM)str);

--
Gitblit v1.9.3