diff --git a/widget/src/os2/nsModule.cpp b/widget/src/os2/nsModule.cpp index eccaf86187aa..0620c1ff9263 100644 --- a/widget/src/os2/nsModule.cpp +++ b/widget/src/os2/nsModule.cpp @@ -80,6 +80,7 @@ void nsWidgetModuleData::Init( nsIAppShell *aPrimaevalAppShell) pszFontNameSize = strdup( buffer); hptrSelect = hptrFrameIcon = 0; + idSelect = 0; // Work out if the system is DBCS COUNTRYCODE cc = { 0 }; @@ -155,13 +156,52 @@ nsWidgetModuleData::~nsWidgetModuleData() HPOINTER nsWidgetModuleData::GetPointer( nsCursor aCursor) { - if( aCursor != eCursor_hyperlink) - printf( "\n*** Need to implement cursor type %d (see widget/os2/nsModule.cpp)\n\n", (int) aCursor); + ULONG idPtr = 0; + + switch( aCursor) + { + case eCursor_hyperlink: idPtr = ID_PTR_SELECTURL ; break; + case eCursor_arrow_north: idPtr = ID_PTR_ARROWNORTH ; break; + case eCursor_arrow_north_plus: idPtr = ID_PTR_ARROWNORTHP; break; + case eCursor_arrow_south: idPtr = ID_PTR_ARROWSOUTH ; break; + case eCursor_arrow_south_plus: idPtr = ID_PTR_ARROWSOUTHP; break; + case eCursor_arrow_west: idPtr = ID_PTR_ARROWWEST ; break; + case eCursor_arrow_west_plus: idPtr = ID_PTR_ARROWWESTP ; break; + case eCursor_arrow_east: idPtr = ID_PTR_ARROWEAST ; break; + case eCursor_arrow_east_plus: idPtr = ID_PTR_ARROWEASTP ; break; + case eCursor_copy: idPtr = ID_PTR_COPY ; break; + case eCursor_alias: idPtr = ID_PTR_ALIAS ; break; + case eCursor_cell: idPtr = ID_PTR_CELL ; break; + case eCursor_grab: idPtr = ID_PTR_GRAB ; break; + case eCursor_grabbing: idPtr = ID_PTR_GRABBING ; break; + + case eCursor_crosshair: + case eCursor_help: + case eCursor_spinning: + case eCursor_context_menu: + case eCursor_count_up: + case eCursor_count_down: + case eCursor_count_up_down: + break; + + default: + NS_ASSERTION( 0, "Unknown cursor type"); + break; + } + + if( idPtr == 0) + { + idPtr = ID_PTR_SELECTURL; // default to hyperlink cursor? + printf( "\n*** Need to implement cursor type %d (see widget/src/os2/nsModule.cpp)\n\n", (int) aCursor); + } + + // Use an array and indices here since we have all the pointers in place? + if( idSelect != idPtr) + { + idSelect = idPtr; + hptrSelect = WinLoadPointer( HWND_DESKTOP, hModResources, idSelect); + } - // Use an array and indices here when we have all the pointers in place. - if( !hptrSelect) - hptrSelect = WinLoadPointer( HWND_DESKTOP, - hModResources, ID_PTR_SELECTURL); return hptrSelect; } diff --git a/widget/src/os2/nsWidgetDefs.h b/widget/src/os2/nsWidgetDefs.h index 52d77745bdf8..3fd71f8853a3 100644 --- a/widget/src/os2/nsWidgetDefs.h +++ b/widget/src/os2/nsWidgetDefs.h @@ -88,6 +88,7 @@ class nsWidgetModuleData void Init( nsIAppShell *aPrimaevalAppShell); private: + ULONG idSelect; HPOINTER hptrSelect; // !! be more sensible about this... HPOINTER hptrFrameIcon; #if 0 diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index 1807ddc054d9..eee6c7213520 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -503,7 +503,7 @@ MRESULT EXPENTRY fnwpNSWindow( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) // check to see if we have a rollup listener registered if (nsnull != gRollupListener && nsnull != gRollupWidget) { - if (msg == WM_ACTIVATE || msg == WM_BUTTON1DOWN || + if (msg == WM_ACTIVATE || msg == WM_BUTTON1DOWN || msg == WM_BUTTON2DOWN || msg == WM_BUTTON3DOWN) { // Rollup if the event is outside the popup if (PR_FALSE == nsWindow::EventIsInsideWindow((nsWindow*)gRollupWidget)) { @@ -511,12 +511,17 @@ MRESULT EXPENTRY fnwpNSWindow( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) // if we are supposed to be consuming events and it is // a Mouse Button down, let it go through - if (gRollupConsumeRollupEvent && msg != WM_BUTTON1DOWN) { +// if (gRollupConsumeRollupEvent && msg != WM_BUTTON1DOWN) { // return FALSE; - } +// } } } - } + else if (msg == WM_SETFOCUS) { + if (!mp2 && hwnd != WinQueryWindow((HWND)mp1, QW_OWNER)) { + gRollupListener->Rollup(); + } + } + } // Messages which get re-routed if their source was an nsWindow // (it's very bad to reroute messages whose source isn't an nsWindow, diff --git a/widget/src/os2/res/aliasb.ptr b/widget/src/os2/res/aliasb.ptr new file mode 100644 index 000000000000..f5f4654f261b Binary files /dev/null and b/widget/src/os2/res/aliasb.ptr differ diff --git a/widget/src/os2/res/arrow_east.ptr b/widget/src/os2/res/arrow_east.ptr new file mode 100644 index 000000000000..76339af6e98a Binary files /dev/null and b/widget/src/os2/res/arrow_east.ptr differ diff --git a/widget/src/os2/res/arrow_east_plus.ptr b/widget/src/os2/res/arrow_east_plus.ptr new file mode 100644 index 000000000000..f5b9b37f1b48 Binary files /dev/null and b/widget/src/os2/res/arrow_east_plus.ptr differ diff --git a/widget/src/os2/res/arrow_north.ptr b/widget/src/os2/res/arrow_north.ptr new file mode 100644 index 000000000000..e8189a727335 Binary files /dev/null and b/widget/src/os2/res/arrow_north.ptr differ diff --git a/widget/src/os2/res/arrow_north_plus.ptr b/widget/src/os2/res/arrow_north_plus.ptr new file mode 100644 index 000000000000..065b914c168c Binary files /dev/null and b/widget/src/os2/res/arrow_north_plus.ptr differ diff --git a/widget/src/os2/res/arrow_south.ptr b/widget/src/os2/res/arrow_south.ptr new file mode 100644 index 000000000000..65055430830b Binary files /dev/null and b/widget/src/os2/res/arrow_south.ptr differ diff --git a/widget/src/os2/res/arrow_south_plus.ptr b/widget/src/os2/res/arrow_south_plus.ptr new file mode 100644 index 000000000000..79723ea58f7d Binary files /dev/null and b/widget/src/os2/res/arrow_south_plus.ptr differ diff --git a/widget/src/os2/res/arrow_west.ptr b/widget/src/os2/res/arrow_west.ptr new file mode 100644 index 000000000000..8f399df4b244 Binary files /dev/null and b/widget/src/os2/res/arrow_west.ptr differ diff --git a/widget/src/os2/res/arrow_west_plus.ptr b/widget/src/os2/res/arrow_west_plus.ptr new file mode 100644 index 000000000000..31640d774b2d Binary files /dev/null and b/widget/src/os2/res/arrow_west_plus.ptr differ diff --git a/widget/src/os2/res/cell.ptr b/widget/src/os2/res/cell.ptr new file mode 100644 index 000000000000..1f87f08c1112 Binary files /dev/null and b/widget/src/os2/res/cell.ptr differ diff --git a/widget/src/os2/res/copy.ptr b/widget/src/os2/res/copy.ptr new file mode 100644 index 000000000000..bc46eb1ffec4 Binary files /dev/null and b/widget/src/os2/res/copy.ptr differ diff --git a/widget/src/os2/res/grab.ptr b/widget/src/os2/res/grab.ptr new file mode 100644 index 000000000000..1f9b2d6b1248 Binary files /dev/null and b/widget/src/os2/res/grab.ptr differ diff --git a/widget/src/os2/res/grabbing.ptr b/widget/src/os2/res/grabbing.ptr new file mode 100644 index 000000000000..9f1c424b0461 Binary files /dev/null and b/widget/src/os2/res/grabbing.ptr differ diff --git a/widget/src/os2/res/select.ptr b/widget/src/os2/res/select.ptr index fbc0faa2611c..61eab042e00a 100644 Binary files a/widget/src/os2/res/select.ptr and b/widget/src/os2/res/select.ptr differ diff --git a/widget/src/os2/res/wdgtres.rc b/widget/src/os2/res/wdgtres.rc index 982d762773cf..9fb902d22256 100644 --- a/widget/src/os2/res/wdgtres.rc +++ b/widget/src/os2/res/wdgtres.rc @@ -46,7 +46,20 @@ ICON ID_ICO_FOLDER folder.ico ICON ID_ICO_DRAGITEM dragitem.ico /* pointers */ -POINTER ID_PTR_SELECTURL select.ptr +POINTER ID_PTR_SELECTURL select.ptr +POINTER ID_PTR_ARROWNORTH arrow_north.ptr +POINTER ID_PTR_ARROWNORTHP arrow_north_plus.ptr +POINTER ID_PTR_ARROWSOUTH arrow_south.ptr +POINTER ID_PTR_ARROWSOUTHP arrow_south_plus.ptr +POINTER ID_PTR_ARROWWEST arrow_west.ptr +POINTER ID_PTR_ARROWWESTP arrow_west_plus.ptr +POINTER ID_PTR_ARROWEAST arrow_east.ptr +POINTER ID_PTR_ARROWEASTP arrow_east_plus.ptr +POINTER ID_PTR_COPY copy.ptr +POINTER ID_PTR_ALIAS aliasb.ptr +POINTER ID_PTR_CELL cell.ptr +POINTER ID_PTR_GRAB grab.ptr +POINTER ID_PTR_GRABBING grabbing.ptr /* stringtable */ STRINGTABLE diff --git a/widget/src/os2/resID.h b/widget/src/os2/resID.h index 50e9cd124514..0fe77cba236d 100644 --- a/widget/src/os2/resID.h +++ b/widget/src/os2/resID.h @@ -33,15 +33,28 @@ #define IDD_HELPBUTTON 104 // Icons -#define ID_ICO_FRAME 500 -#define ID_ICO_FOLDER 501 -#define ID_ICO_DRAGITEM 502 +#define ID_ICO_FRAME 500 +#define ID_ICO_FOLDER 501 +#define ID_ICO_DRAGITEM 502 -#define ID_PTR_SELECTURL 2000 +#define ID_PTR_SELECTURL 2000 +#define ID_PTR_ARROWNORTH 2001 +#define ID_PTR_ARROWNORTHP 2002 +#define ID_PTR_ARROWSOUTH 2003 +#define ID_PTR_ARROWSOUTHP 2004 +#define ID_PTR_ARROWWEST 2005 +#define ID_PTR_ARROWWESTP 2006 +#define ID_PTR_ARROWEAST 2007 +#define ID_PTR_ARROWEASTP 2008 +#define ID_PTR_COPY 2009 +#define ID_PTR_ALIAS 2010 +#define ID_PTR_CELL 2011 +#define ID_PTR_GRAB 2012 +#define ID_PTR_GRABBING 2013 -#define ID_STR_FONT 10000 -#define ID_STR_HMMDIR 10001 -#define ID_STR_NOCDIR 10002 +#define ID_STR_FONT 10000 +#define ID_STR_HMMDIR 10001 +#define ID_STR_NOCDIR 10002 // OS2TODO HCT temporary bug fix #ifndef FCF_CLOSEBUTTON // defined in the Merlin toolkit