aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2009-05-03 03:52:19 +0000
committernyamatongwe <devnull@localhost>2009-05-03 03:52:19 +0000
commit37f710d4eea40efa99d8c1973f69f0fcf3e07aec (patch)
tree869861d1a6c1d1eb9cf7f1f2d0e2f4f6616f7cb0 /win32/PlatWin.cxx
parentf215b1c33bc8fac405d7b82f6697fc7b9332369b (diff)
downloadscintilla-mirror-37f710d4eea40efa99d8c1973f69f0fcf3e07aec.tar.gz
Turned on exceptions.
Translate exceptions into status codes before leaving Scintilla. Pick up status codes in SciTE and throw a ScintillaFailure exception. SciTE on Windows catches ScintillaFailure, shows message and exits.
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx84
1 files changed, 44 insertions, 40 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 7345fc8f2..012d8a9af 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -1809,53 +1809,57 @@ void ListBoxX::Paint(HDC hDC) {
}
LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- switch (uMsg) {
- case WM_ERASEBKGND:
- return TRUE;
-
- case WM_PAINT: {
- PAINTSTRUCT ps;
- HDC hDC = ::BeginPaint(hWnd, &ps);
- ListBoxX *lbx = reinterpret_cast<ListBoxX *>(PointerFromWindow(::GetParent(hWnd)));
- if (lbx)
- lbx->Paint(hDC);
- ::EndPaint(hWnd, &ps);
- }
- return 0;
-
- case WM_MOUSEACTIVATE:
- // This prevents the view activating when the scrollbar is clicked
- return MA_NOACTIVATE;
-
- case WM_LBUTTONDOWN: {
- // We must take control of selection to prevent the ListBox activating
- // the popup
- LRESULT lResult = ::SendMessage(hWnd, LB_ITEMFROMPOINT, 0, lParam);
- int item = LOWORD(lResult);
- if (HIWORD(lResult) == 0 && item >= 0) {
- ::SendMessage(hWnd, LB_SETCURSEL, item, 0);
+ try {
+ switch (uMsg) {
+ case WM_ERASEBKGND:
+ return TRUE;
+
+ case WM_PAINT: {
+ PAINTSTRUCT ps;
+ HDC hDC = ::BeginPaint(hWnd, &ps);
+ ListBoxX *lbx = reinterpret_cast<ListBoxX *>(PointerFromWindow(::GetParent(hWnd)));
+ if (lbx)
+ lbx->Paint(hDC);
+ ::EndPaint(hWnd, &ps);
}
- }
- return 0;
+ return 0;
+
+ case WM_MOUSEACTIVATE:
+ // This prevents the view activating when the scrollbar is clicked
+ return MA_NOACTIVATE;
+
+ case WM_LBUTTONDOWN: {
+ // We must take control of selection to prevent the ListBox activating
+ // the popup
+ LRESULT lResult = ::SendMessage(hWnd, LB_ITEMFROMPOINT, 0, lParam);
+ int item = LOWORD(lResult);
+ if (HIWORD(lResult) == 0 && item >= 0) {
+ ::SendMessage(hWnd, LB_SETCURSEL, item, 0);
+ }
+ }
+ return 0;
- case WM_LBUTTONUP:
- return 0;
+ case WM_LBUTTONUP:
+ return 0;
- case WM_LBUTTONDBLCLK: {
- ListBoxX *lbx = reinterpret_cast<ListBoxX *>(PointerFromWindow(::GetParent(hWnd)));
- if (lbx) {
- lbx->OnDoubleClick();
+ case WM_LBUTTONDBLCLK: {
+ ListBoxX *lbx = reinterpret_cast<ListBoxX *>(PointerFromWindow(::GetParent(hWnd)));
+ if (lbx) {
+ lbx->OnDoubleClick();
+ }
}
+ return 0;
}
- return 0;
- }
- WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
- if (prevWndProc) {
- return ::CallWindowProc(prevWndProc, hWnd, uMsg, wParam, lParam);
- } else {
- return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
+ WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
+ if (prevWndProc) {
+ return ::CallWindowProc(prevWndProc, hWnd, uMsg, wParam, lParam);
+ } else {
+ return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
+ }
+ } catch (...) {
}
+ return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}
LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) {