aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-11-19 23:50:32 +0000
committernyamatongwe <devnull@localhost>2001-11-19 23:50:32 +0000
commit1b5aa5d55b88286adfdacd340531799c1da98066 (patch)
tree743495ff4d07a8ff0c9177f773d2eec5dcabe738 /win32
parent4ef16ca85bcf0ba44d85c4b35fbf4206b392ef8c (diff)
downloadscintilla-mirror-1b5aa5d55b88286adfdacd340531799c1da98066.tar.gz
Added virtual GetCtrlID method so that the ID can change dynamically
on Windoes when caused by SetWindowLong.
Diffstat (limited to 'win32')
-rw-r--r--win32/ScintillaWin.cxx13
1 files changed, 9 insertions, 4 deletions
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) {