зеркало из https://github.com/mozilla/pjs.git
Adding several new cursor types
This commit is contained in:
Родитель
fb6ac06b53
Коммит
dbdb373103
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "resource.h"
|
||||
|
||||
IDC_SELECTANCHOR CURSOR DISCARDABLE "res\\select.cur"
|
Загрузка…
Ссылка в новой задаче