diff options
| author | nyamatongwe <devnull@localhost> | 2011-06-13 19:40:18 +1000 |
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2011-06-13 19:40:18 +1000 |
| commit | e97276184dc260742cf34229395753caf12c43bb (patch) | |
| tree | 3ef58dff035379a7797a4aa96cb0f172ee83369b /win32 | |
| parent | bd0968c217d7385c9801ba51da45add548c63941 (diff) | |
| download | scintilla-mirror-e97276184dc260742cf34229395753caf12c43bb.tar.gz | |
Added Identifier property.
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/ScintillaWin.cxx | 45 |
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. |
