From 15dadf3155f879f8c5031e452566a7b1859e01e3 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 15 Mar 2002 22:52:15 +0000 Subject: [PATCH] Added wxCURSOR_RIGHT_ARROW, which is like the typical wxCURSOR_ARROR, but points to the right, (duh...) This cursor is now used in wxSTC in the margin area. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/PlatWX.cpp | 2 +- docs/latex/wx/cursor.tex | 2 ++ include/wx/gdicmn.h | 1 + include/wx/msw/rightarr.cur | Bin 0 -> 326 bytes include/wx/msw/wx.rc | 2 ++ src/gtk/cursor.cpp | 12 ++++++------ src/gtk1/cursor.cpp | 12 ++++++------ src/msw/cursor.cpp | 7 ++++++- src/stc/PlatWX.cpp | 2 +- 9 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 include/wx/msw/rightarr.cur diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index dda64f77b2..52a351218a 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -437,7 +437,7 @@ void Window::SetCursor(Cursor curs) { cursorId = wxCURSOR_SIZENS; break; case cursorReverseArrow: - cursorId = wxCURSOR_POINT_RIGHT; + cursorId = wxCURSOR_RIGHT_ARROW; break; default: cursorId = wxCURSOR_ARROW; diff --git a/docs/latex/wx/cursor.tex b/docs/latex/wx/cursor.tex index 44e28edc18..fa34e256cb 100644 --- a/docs/latex/wx/cursor.tex +++ b/docs/latex/wx/cursor.tex @@ -120,6 +120,8 @@ is enabled in setup.h). Specify {\it hotSpotX} and {\it hotSpotY}.} \twocolwidtha{6cm} \begin{twocollist}\itemsep=0pt \twocolitem{{\bf wxCURSOR\_ARROW}}{A standard arrow cursor.} +\twocolitem{{\bf wxCURSOR\_RIGHT\_ARROW}}{A standard arrow cursor +pointing to the right.} \twocolitem{{\bf wxCURSOR\_BULLSEYE}}{Bullseye cursor.} \twocolitem{{\bf wxCURSOR\_CHAR}}{Rectangular character cursor.} \twocolitem{{\bf wxCURSOR\_CROSS}}{A cross cursor.} diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 15a0c8d25b..d8d1bb44d6 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -90,6 +90,7 @@ enum wxStockCursor { wxCURSOR_NONE, // should be 0 wxCURSOR_ARROW, + wxCURSOR_RIGHT_ARROW, wxCURSOR_BULLSEYE, wxCURSOR_CHAR, wxCURSOR_CROSS, diff --git a/include/wx/msw/rightarr.cur b/include/wx/msw/rightarr.cur new file mode 100644 index 0000000000000000000000000000000000000000..9e0e79066182455e5a01b60145f4c8b99ac4595c GIT binary patch literal 326 zcmZ|JJqiLb5QgC|27ihLE5&k4OG``dvPZD7_Yxk(Qt%>*7YNt{6vubmz!s7TPrghN zLZp#`+E!XIJjvNXpO5#Gxku*C}8 nuM~f%*OQ}rk;wEi%X@TY@7TMLHzee;_aV(4am54v*nfQi*MWc% literal 0 HcmV?d00001 diff --git a/include/wx/msw/wx.rc b/include/wx/msw/wx.rc index 4553137c51..9b860f2313 100644 --- a/include/wx/msw/wx.rc +++ b/include/wx/msw/wx.rc @@ -71,6 +71,8 @@ WXCURSOR_PLEFT CURSOR DISCARDABLE "wx/msw/pntleft.cur" WXCURSOR_PRIGHT CURSOR DISCARDABLE "wx/msw/pntright.cur" WXCURSOR_QARROW CURSOR DISCARDABLE "wx/msw/query.cur" WXCURSOR_BLANK CURSOR DISCARDABLE "wx/msw/blank.cur" +WXCURSOR_RIGHT_ARROW CURSOR DISCARDABLE "wx/msw/rightarr.cur" + ////////////////////////////////////////////////////////////////////////////// // diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index adf882b133..c4b56c6172 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -68,7 +68,9 @@ wxCursor::wxCursor( int cursorId ) GdkCursorType gdk_cur = GDK_LEFT_PTR; switch (cursorId) { + case wxCURSOR_ARROW: // fall through to default case wxCURSOR_DEFAULT: gdk_cur = GDK_LEFT_PTR; break; + case wxCURSOR_RIGHT_ARROW: gdk_cur = GDK_RIGHT_PTR; break; case wxCURSOR_HAND: gdk_cur = GDK_HAND1; break; case wxCURSOR_CROSS: gdk_cur = GDK_CROSSHAIR; break; case wxCURSOR_SIZEWE: gdk_cur = GDK_SB_H_DOUBLE_ARROW; break; @@ -103,8 +105,6 @@ wxCursor::wxCursor( int cursorId ) default: wxFAIL_MSG(wxT("unsupported cursor type")); // will use the standard one - - case wxCURSOR_ARROW: break; } @@ -211,7 +211,7 @@ wxCursor::wxCursor( const wxImage & image ) unsigned long key; unsigned long value; unsigned long keyMaskColor = 0; - if (bHasMask) + if (bHasMask) keyMaskColor = (r << 16) | (g << 8) | b; tmpImage.ComputeHistogram(histogram); @@ -249,14 +249,14 @@ wxCursor::wxCursor( const wxImage & image ) (unsigned char)(NextFreqCol >> 8), (unsigned char)(NextFreqCol) ) ; - int hotSpotX=0; + int hotSpotX=0; int hotSpotY=0; if (image.HasOption(wxCUR_HOTSPOT_X)) hotSpotX = image.GetOptionInt(wxCUR_HOTSPOT_X); if (image.HasOption(wxCUR_HOTSPOT_Y)) hotSpotY = image.GetOptionInt(wxCUR_HOTSPOT_Y); - + if (hotSpotX < 0 || hotSpotX >= w) hotSpotX = 0; if (hotSpotY < 0 || hotSpotY >= h) @@ -358,7 +358,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) if (wxTheApp) wxTheApp->SendIdleEvents(); - + gdk_flush(); } diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index adf882b133..c4b56c6172 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -68,7 +68,9 @@ wxCursor::wxCursor( int cursorId ) GdkCursorType gdk_cur = GDK_LEFT_PTR; switch (cursorId) { + case wxCURSOR_ARROW: // fall through to default case wxCURSOR_DEFAULT: gdk_cur = GDK_LEFT_PTR; break; + case wxCURSOR_RIGHT_ARROW: gdk_cur = GDK_RIGHT_PTR; break; case wxCURSOR_HAND: gdk_cur = GDK_HAND1; break; case wxCURSOR_CROSS: gdk_cur = GDK_CROSSHAIR; break; case wxCURSOR_SIZEWE: gdk_cur = GDK_SB_H_DOUBLE_ARROW; break; @@ -103,8 +105,6 @@ wxCursor::wxCursor( int cursorId ) default: wxFAIL_MSG(wxT("unsupported cursor type")); // will use the standard one - - case wxCURSOR_ARROW: break; } @@ -211,7 +211,7 @@ wxCursor::wxCursor( const wxImage & image ) unsigned long key; unsigned long value; unsigned long keyMaskColor = 0; - if (bHasMask) + if (bHasMask) keyMaskColor = (r << 16) | (g << 8) | b; tmpImage.ComputeHistogram(histogram); @@ -249,14 +249,14 @@ wxCursor::wxCursor( const wxImage & image ) (unsigned char)(NextFreqCol >> 8), (unsigned char)(NextFreqCol) ) ; - int hotSpotX=0; + int hotSpotX=0; int hotSpotY=0; if (image.HasOption(wxCUR_HOTSPOT_X)) hotSpotX = image.GetOptionInt(wxCUR_HOTSPOT_X); if (image.HasOption(wxCUR_HOTSPOT_Y)) hotSpotY = image.GetOptionInt(wxCUR_HOTSPOT_Y); - + if (hotSpotX < 0 || hotSpotX >= w) hotSpotX = 0; if (hotSpotY < 0 || hotSpotY >= h) @@ -358,7 +358,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) if (wxTheApp) wxTheApp->SendIdleEvents(); - + gdk_flush(); } diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index bbe9e4662c..feb1390dc3 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -187,7 +187,7 @@ wxCursor::wxCursor( const wxImage & image ) wxCursorRefData *refData = new wxCursorRefData; m_refData = refData; refData->m_hCursor = (WXHCURSOR) CreateCursor ( wxGetInstance(), hotSpotX, hotSpotY, w, h, /*AND*/ maskBits, /*XOR*/ bits ); - + delete [] bits ; delete [] maskBits; @@ -383,6 +383,11 @@ wxCursor::wxCursor(int cursor_type) refData->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_BLANK")); break; } + case wxCURSOR_RIGHT_ARROW: + { + refData->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_RIGHT_ARROW")); + break; + } default: case wxCURSOR_ARROW: refData->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW); diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index dda64f77b2..52a351218a 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -437,7 +437,7 @@ void Window::SetCursor(Cursor curs) { cursorId = wxCURSOR_SIZENS; break; case cursorReverseArrow: - cursorId = wxCURSOR_POINT_RIGHT; + cursorId = wxCURSOR_RIGHT_ARROW; break; default: cursorId = wxCURSOR_ARROW; -- 2.45.2