aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2011-06-13 19:40:18 +1000
committernyamatongwe <unknown>2011-06-13 19:40:18 +1000
commitde1ba6ffa1e4c3fff61f6bcfb3315357ff28ae08 (patch)
treedbfb97a4518e6c30471f88d49c13379eefe858d6 /win32/ScintillaWin.cxx
parent1741f339d4cac847cf9c465a8a1494fe7b50629a (diff)
downloadscintilla-mirror-de1ba6ffa1e4c3fff61f6bcfb3315357ff28ae08.tar.gz
Added Identifier property.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx45
1 files changed, 28 insertions, 17 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index d4d3b24da..8092edcd8 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -102,6 +102,29 @@ const TCHAR callClassName[] = TEXT("CallTip");
using namespace Scintilla;
#endif
+// Take care of 32/64 bit pointers
+#ifdef GetWindowLongPtr
+static void *PointerFromWindow(HWND hWnd) {
+ return reinterpret_cast<void *>(::GetWindowLongPtr(hWnd, 0));
+}
+static void SetWindowPointer(HWND hWnd, void *ptr) {
+ ::SetWindowLongPtr(hWnd, 0, reinterpret_cast<LONG_PTR>(ptr));
+}
+static void SetWindowID(HWND hWnd, int identifier) {
+ ::SetWindowLongPtr(hWnd, GWLP_ID, identifier);
+}
+#else
+static void *PointerFromWindow(HWND hWnd) {
+ return reinterpret_cast<void *>(::GetWindowLong(hWnd, 0));
+}
+static void SetWindowPointer(HWND hWnd, void *ptr) {
+ ::SetWindowLong(hWnd, 0, reinterpret_cast<LONG>(ptr));
+}
+static void SetWindowID(HWND hWnd, int identifier) {
+ ::SetWindowLong(hWnd, GWL_ID, identifier);
+}
+#endif
+
class ScintillaWin; // Forward declaration for COM interface subobjects
typedef void VFunction(void);
@@ -211,6 +234,7 @@ class ScintillaWin :
virtual bool ModifyScrollBars(int nMax, int nPage);
virtual void NotifyChange();
virtual void NotifyFocus(bool focus);
+ virtual void SetCtrlID(int identifier);
virtual int GetCtrlID();
virtual void NotifyParent(SCNotification scn);
virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt);
@@ -1278,6 +1302,10 @@ void ScintillaWin::NotifyFocus(bool focus) {
reinterpret_cast<LPARAM>(MainHWND()));
}
+void ScintillaWin::SetCtrlID(int identifier) {
+ ::SetWindowID(reinterpret_cast<HWND>(wMain.GetID()), identifier);
+}
+
int ScintillaWin::GetCtrlID() {
return ::GetDlgCtrlID(reinterpret_cast<HWND>(wMain.GetID()));
}
@@ -2628,23 +2656,6 @@ BOOL ScintillaWin::DestroySystemCaret() {
return retval;
}
-// Take care of 32/64 bit pointers
-#ifdef GetWindowLongPtr
-static void *PointerFromWindow(HWND hWnd) {
- return reinterpret_cast<void *>(::GetWindowLongPtr(hWnd, 0));
-}
-static void SetWindowPointer(HWND hWnd, void *ptr) {
- ::SetWindowLongPtr(hWnd, 0, reinterpret_cast<LONG_PTR>(ptr));
-}
-#else
-static void *PointerFromWindow(HWND hWnd) {
- return reinterpret_cast<void *>(::GetWindowLong(hWnd, 0));
-}
-static void SetWindowPointer(HWND hWnd, void *ptr) {
- ::SetWindowLong(hWnd, 0, reinterpret_cast<LONG>(ptr));
-}
-#endif
-
sptr_t PASCAL ScintillaWin::CTWndProc(
HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam) {
// Find C++ object associated with window.