diff options
-rw-r--r-- | gtk/ScintillaGTK.cxx | 8 | ||||
-rw-r--r-- | src/Editor.h | 3 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 13 |
3 files changed, 15 insertions, 9 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 13271bcd7..cfaa70971 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -734,19 +734,19 @@ void ScintillaGTK::ReconfigureScrollBars() { void ScintillaGTK::NotifyChange() { gtk_signal_emit(GTK_OBJECT(sci), scintilla_signals[COMMAND_SIGNAL], - Platform::LongFromTwoShorts(ctrlID, SCEN_CHANGE), PWidget(wMain)); + Platform::LongFromTwoShorts(GetCtrlID(), SCEN_CHANGE), PWidget(wMain)); } void ScintillaGTK::NotifyFocus(bool focus) { gtk_signal_emit(GTK_OBJECT(sci), scintilla_signals[COMMAND_SIGNAL], - Platform::LongFromTwoShorts(ctrlID, focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS), PWidget(wMain)); + Platform::LongFromTwoShorts(GetCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS), PWidget(wMain)); } void ScintillaGTK::NotifyParent(SCNotification scn) { scn.nmhdr.hwndFrom = PWidget(wMain); - scn.nmhdr.idFrom = ctrlID; + scn.nmhdr.idFrom = GetCtrlID(); gtk_signal_emit(GTK_OBJECT(sci), scintilla_signals[NOTIFY_SIGNAL], - ctrlID, &scn); + GetCtrlID(), &scn); } void ScintillaGTK::NotifyKey(int key, int modifiers) { diff --git a/src/Editor.h b/src/Editor.h index 3561cee78..2e419d9b2 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -263,6 +263,7 @@ protected: // ScintillaBase subclass needs access to much of Editor virtual void NotifyChange() = 0; virtual void NotifyFocus(bool focus); + virtual int GetCtrlID() { return ctrlID; } virtual void NotifyParent(SCNotification scn) = 0; virtual void NotifyStyleToNeeded(int endStyleNeeded); void NotifyChar(int ch); @@ -342,7 +343,7 @@ public: // Public so scintilla_send_message can use it virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); // Public so scintilla_set_id can use it - int ctrlID; + int ctrlID; }; #endif diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 8b3714c7d..1669c366e 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -187,6 +187,7 @@ class ScintillaWin : virtual bool ModifyScrollBars(int nMax, int nPage); virtual void NotifyChange(); virtual void NotifyFocus(bool focus); + virtual int GetCtrlID(); virtual void NotifyParent(SCNotification scn); virtual void NotifyDoubleClick(Point pt, bool shift); virtual void Copy(); @@ -880,21 +881,25 @@ bool ScintillaWin::ModifyScrollBars(int nMax, int nPage) { void ScintillaWin::NotifyChange() { ::SendMessage(::GetParent(MainHWND()), WM_COMMAND, - MAKELONG(ctrlID, SCEN_CHANGE), + MAKELONG(GetCtrlID(), SCEN_CHANGE), reinterpret_cast<LPARAM>(MainHWND())); } void ScintillaWin::NotifyFocus(bool focus) { ::SendMessage(::GetParent(MainHWND()), WM_COMMAND, - MAKELONG(ctrlID, focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS), + MAKELONG(GetCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS), reinterpret_cast<LPARAM>(MainHWND())); } +int ScintillaWin::GetCtrlID() { + return ::GetDlgCtrlID(reinterpret_cast<HWND>(wMain.GetID())); +} + void ScintillaWin::NotifyParent(SCNotification scn) { scn.nmhdr.hwndFrom = MainHWND(); - scn.nmhdr.idFrom = ctrlID; + scn.nmhdr.idFrom = GetCtrlID(); ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY, - ctrlID, reinterpret_cast<LPARAM>(&scn)); + GetCtrlID(), reinterpret_cast<LPARAM>(&scn)); } void ScintillaWin::NotifyDoubleClick(Point pt, bool shift) { |