Mercurial > dwindows
comparison win/dw.c @ 1653:a7a24a3b8899
Fixes for the latest MinGW (gcc 4.6.2). Only ANSI mode is currently supported.
Was unable to get Unicode mode to work... added missing ANSI _tstol define....
Lots of other unicode related #defines also seem to be missing...
MIM_MENUDATA is now defined in the latest headers so remove old fix for it.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 09 Apr 2012 07:15:05 +0000 |
parents | 08da4840dfc3 |
children | 3d4066aab4e0 |
comparison
equal
deleted
inserted
replaced
1652:202b1affc706 | 1653:a7a24a3b8899 |
---|---|
218 /* | 218 /* |
219 * MinGW Is missing a bunch of definitions | 219 * MinGW Is missing a bunch of definitions |
220 * so #define them here... | 220 * so #define them here... |
221 */ | 221 */ |
222 | 222 |
223 #if !defined( MIM_MENUDATA ) | 223 #if !defined( _tstol ) |
224 # define MIM_MENUDATA 0x00000008 | 224 # define _tstol atol |
225 #endif | 225 #endif |
226 #if !defined(PBS_MARQUEE) | 226 #if !defined(PBS_MARQUEE) |
227 # define PBS_MARQUEE 0x08 | 227 # define PBS_MARQUEE 0x08 |
228 #endif | 228 #endif |
229 #if !defined(PBM_SETMARQUEE) | 229 #if !defined(PBM_SETMARQUEE) |
1766 | 1766 |
1767 /* The main window procedure for Dynamic Windows, all the resizing code is done here. */ | 1767 /* The main window procedure for Dynamic Windows, all the resizing code is done here. */ |
1768 LRESULT CALLBACK _wndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2) | 1768 LRESULT CALLBACK _wndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2) |
1769 { | 1769 { |
1770 int result = -1, taskbar = FALSE; | 1770 int result = -1, taskbar = FALSE; |
1771 static int command_active = 0; | |
1772 SignalHandler *tmp = Root; | 1771 SignalHandler *tmp = Root; |
1773 void (*windowfunc)(PVOID); | 1772 void (*windowfunc)(PVOID); |
1774 ULONG origmsg = msg; | 1773 ULONG origmsg = msg; |
1775 | 1774 |
1776 /* Deal with translating some messages */ | 1775 /* Deal with translating some messages */ |
1788 else if (msg == WM_KEYDOWN) /* && mp1 >= VK_F1 && mp1 <= VK_F24) allow ALL special keys */ | 1787 else if (msg == WM_KEYDOWN) /* && mp1 >= VK_F1 && mp1 <= VK_F24) allow ALL special keys */ |
1789 msg = WM_CHAR; | 1788 msg = WM_CHAR; |
1790 | 1789 |
1791 if (result == -1) | 1790 if (result == -1) |
1792 { | 1791 { |
1793 /* Avoid infinite recursion */ | |
1794 command_active = 1; | |
1795 | |
1796 /* Find any callbacks for this function */ | 1792 /* Find any callbacks for this function */ |
1797 while (tmp) | 1793 while (tmp) |
1798 { | 1794 { |
1799 if (tmp->message == msg || msg == WM_COMMAND || msg == WM_NOTIFY || tmp->message == WM_USER+1) | 1795 if (tmp->message == msg || msg == WM_COMMAND || msg == WM_NOTIFY || tmp->message == WM_USER+1) |
1800 { | 1796 { |
2029 else if(tem->hdr.code == NM_RCLICK && tmp->message == NM_RCLICK) | 2025 else if(tem->hdr.code == NM_RCLICK && tmp->message == NM_RCLICK) |
2030 { | 2026 { |
2031 if(tmp->window == tem->hdr.hwndFrom) | 2027 if(tmp->window == tem->hdr.hwndFrom) |
2032 { | 2028 { |
2033 int (*containercontextfunc)(HWND, char *, int, int, void *, void *) = tmp->signalfunction; | 2029 int (*containercontextfunc)(HWND, char *, int, int, void *, void *) = tmp->signalfunction; |
2034 HTREEITEM hti, last; | 2030 HTREEITEM hti; |
2035 TVITEM tvi; | 2031 TVITEM tvi; |
2036 TVHITTESTINFO thi; | 2032 TVHITTESTINFO thi; |
2037 void **ptrs = NULL; | 2033 void **ptrs = NULL; |
2038 LONG x, y; | 2034 LONG x, y; |
2039 | 2035 |
2042 thi.pt.x = x; | 2038 thi.pt.x = x; |
2043 thi.pt.y = y; | 2039 thi.pt.y = y; |
2044 | 2040 |
2045 MapWindowPoints(HWND_DESKTOP, tmp->window, &thi.pt, 1); | 2041 MapWindowPoints(HWND_DESKTOP, tmp->window, &thi.pt, 1); |
2046 | 2042 |
2047 last = TreeView_GetSelection(tmp->window); | |
2048 hti = TreeView_HitTest(tmp->window, &thi); | 2043 hti = TreeView_HitTest(tmp->window, &thi); |
2049 | 2044 |
2050 if(hti) | 2045 if(hti) |
2051 { | 2046 { |
2052 tvi.mask = TVIF_HANDLE | TVIF_PARAM; | 2047 tvi.mask = TVIF_HANDLE | TVIF_PARAM; |
2218 } | 2213 } |
2219 } | 2214 } |
2220 if(tmp) | 2215 if(tmp) |
2221 tmp = tmp->next; | 2216 tmp = tmp->next; |
2222 } | 2217 } |
2223 command_active = 0; | |
2224 } | 2218 } |
2225 | 2219 |
2226 /* Now that any handlers are done... do normal processing */ | 2220 /* Now that any handlers are done... do normal processing */ |
2227 switch( msg ) | 2221 switch( msg ) |
2228 { | 2222 { |