Adding several new cursor types

This commit is contained in:
spider%netscape.com 1998-08-07 14:45:46 +00:00
parent c8b7588195
commit 31d7a10536
12 changed files with 79 additions and 2 deletions

View File

@ -943,10 +943,29 @@ void nsWindow::SetCursor(nsCursor aCursor)
break;
case eCursor_standard:
// newCursor = XCreateFontCursor(display, XC_left_ptr);
newCursor = XCreateFontCursor(display, XC_left_ptr);
break;
case eCursor_arrow_south:
case eCursor_arrow_south_plus:
newCursor = XCreateFontCursor(display, XC_bottom_side);
break;
case eCursor_arrow_north:
case eCursor_arrow_north_plus:
newCursor = XCreateFontCursor(display, XC_top_side);
break;
case eCursor_arrow_east:
case eCursor_arrow_east_plus:
newCursor = XCreateFontCursor(display, XC_right_side);
break;
case eCursor_arrow_east:
case eCursor_arrow_east_plus:
newCursor = XCreateFontCursor(display, XC_left_side);
break;
default:
NS_ASSERTION(0, "Invalid cursor type");
break;

View File

@ -1065,6 +1065,7 @@ void nsWindow::SetCursor(nsCursor aCursor)
// Only change cursor if it's changing
if (aCursor != mCursor) {
HCURSOR newCursor = NULL;
HMODULE hm ;
switch(aCursor) {
case eCursor_select:
@ -1076,7 +1077,7 @@ void nsWindow::SetCursor(nsCursor aCursor)
break;
case eCursor_hyperlink: {
HMODULE hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_SELECTANCHOR));
break;
}
@ -1093,6 +1094,46 @@ void nsWindow::SetCursor(nsCursor aCursor)
newCursor = ::LoadCursor(NULL, IDC_SIZENS);
break;
case eCursor_arrow_north:
hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_ARROWNORTH));
break;
case eCursor_arrow_north_plus:
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_ARROWNORTHPLUS));
break;
case eCursor_arrow_south:
hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_ARROWSOUTH));
break;
case eCursor_arrow_south_plus:
hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_ARROWSOUTHPLUS));
break;
case eCursor_arrow_east:
hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_ARROWEAST));
break;
case eCursor_arrow_east_plus:
hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_ARROWEASTPLUS));
break;
case eCursor_arrow_west:
hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_ARROWWEST));
break;
case eCursor_arrow_west_plus:
hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME));
newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_ARROWWESTPLUS));
break;
default:
NS_ASSERTION(0, "Invalid cursor type");
break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

View File

@ -16,3 +16,12 @@
* Reserved.
*/
#define IDC_SELECTANCHOR 4100
#define IDC_ARROWSOUTH 4101
#define IDC_ARROWNORTH 4102
#define IDC_ARROWEAST 4103
#define IDC_ARROWWEST 4104
#define IDC_ARROWSOUTHPLUS 4105
#define IDC_ARROWNORTHPLUS 4106
#define IDC_ARROWEASTPLUS 4107
#define IDC_ARROWWESTPLUS 4108

View File

@ -18,3 +18,11 @@
#include "resource.h"
IDC_SELECTANCHOR CURSOR DISCARDABLE "res\\select.cur"
IDC_ARROWSOUTH CURSOR DISCARDABLE "res\\arrow_south.cur"
IDC_ARROWNORTH CURSOR DISCARDABLE "res\\arrow_north.cur"
IDC_ARROWEAST CURSOR DISCARDABLE "res\\arrow_east.cur"
IDC_ARROWWEST CURSOR DISCARDABLE "res\\arrow_west.cur"
IDC_ARROWSOUTHPLUS CURSOR DISCARDABLE "res\\arrow_south_plus.cur"
IDC_ARROWNORTHPLUS CURSOR DISCARDABLE "res\\arrow_north_plus.cur"
IDC_ARROWEASTPLUS CURSOR DISCARDABLE "res\\arrow_east_plus.cur"
IDC_ARROWWESTPLUS CURSOR DISCARDABLE "res\\arrow_west_plus.cur"