Add wxHtmlWindow::SetDefaultHTMLCursor().
This allows to change the cursors used by any HTML windows, before creating them. Closes #15324. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -12,4 +12,5 @@ Note: This file contains the list of changes since wxWidgets 3.x, please see
 | 
			
		||||
All (GUI):
 | 
			
		||||
 | 
			
		||||
- XRC handler for wxAuiToolBar added (Kinaou Hervé).
 | 
			
		||||
- Add wxHtmlWindow::SetDefaultHTMLCursor() (Jeff A. Marr).
 | 
			
		||||
- Add default ctor and Create() to wxContextHelpButton (Hanmac).
 | 
			
		||||
 
 | 
			
		||||
@@ -387,6 +387,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    /// Returns standard HTML cursor as used by wxHtmlWindow
 | 
			
		||||
    static wxCursor GetDefaultHTMLCursor(HTMLCursor type);
 | 
			
		||||
    static void SetDefaultHTMLCursor(HTMLCursor type, const wxCursor& cursor);
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    void Init();
 | 
			
		||||
@@ -552,6 +553,7 @@ private:
 | 
			
		||||
    // standard mouse cursors
 | 
			
		||||
    static wxCursor *ms_cursorLink;
 | 
			
		||||
    static wxCursor *ms_cursorText;
 | 
			
		||||
    static wxCursor *ms_cursorDefault;
 | 
			
		||||
 | 
			
		||||
    DECLARE_EVENT_TABLE()
 | 
			
		||||
    wxDECLARE_NO_COPY_CLASS(wxHtmlWindow);
 | 
			
		||||
 
 | 
			
		||||
@@ -466,6 +466,31 @@ public:
 | 
			
		||||
    virtual void WriteCustomization(wxConfigBase* cfg,
 | 
			
		||||
                                    wxString path = wxEmptyString);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
        Retrieves the default cursor for a given HTMLCursor type.
 | 
			
		||||
 | 
			
		||||
        @param type
 | 
			
		||||
            HTMLCursor type to retrieve.
 | 
			
		||||
 | 
			
		||||
        @since 3.1.0
 | 
			
		||||
    */
 | 
			
		||||
    static wxCursor GetDefaultHTMLCursor(HTMLCursor type);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
        Sets the default cursor for a given HTMLCursor type.
 | 
			
		||||
 | 
			
		||||
        These cursors are used for all wxHtmlWindow objects by default, but can
 | 
			
		||||
        be overridden on a per-window basis.
 | 
			
		||||
 | 
			
		||||
        @param type
 | 
			
		||||
            HTMLCursor type to retrieve.
 | 
			
		||||
        @param cursor
 | 
			
		||||
            The default cursor for the specified cursor type.
 | 
			
		||||
 | 
			
		||||
        @since 3.1.0
 | 
			
		||||
    */
 | 
			
		||||
    static void SetDefaultHTMLCursor(HTMLCursor type, const wxCursor& cursor);
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -283,6 +283,7 @@ wxHtmlFilter *wxHtmlWindow::m_DefaultFilter = NULL;
 | 
			
		||||
wxHtmlProcessorList *wxHtmlWindow::m_GlobalProcessors = NULL;
 | 
			
		||||
wxCursor *wxHtmlWindow::ms_cursorLink = NULL;
 | 
			
		||||
wxCursor *wxHtmlWindow::ms_cursorText = NULL;
 | 
			
		||||
wxCursor *wxHtmlWindow::ms_cursorDefault = NULL;
 | 
			
		||||
 | 
			
		||||
void wxHtmlWindow::CleanUpStatics()
 | 
			
		||||
{
 | 
			
		||||
@@ -293,6 +294,7 @@ void wxHtmlWindow::CleanUpStatics()
 | 
			
		||||
    wxDELETE(m_GlobalProcessors);
 | 
			
		||||
    wxDELETE(ms_cursorLink);
 | 
			
		||||
    wxDELETE(ms_cursorText);
 | 
			
		||||
    wxDELETE(ms_cursorDefault);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void wxHtmlWindow::Init()
 | 
			
		||||
@@ -1787,7 +1789,9 @@ wxCursor wxHtmlWindow::GetDefaultHTMLCursor(HTMLCursor type)
 | 
			
		||||
 | 
			
		||||
        case HTMLCursor_Default:
 | 
			
		||||
        default:
 | 
			
		||||
            return *wxSTANDARD_CURSOR;
 | 
			
		||||
            if ( !ms_cursorDefault )
 | 
			
		||||
                ms_cursorDefault = new wxCursor(wxCURSOR_ARROW);
 | 
			
		||||
            return *ms_cursorDefault;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1796,6 +1800,27 @@ wxCursor wxHtmlWindow::GetHTMLCursor(HTMLCursor type) const
 | 
			
		||||
    return GetDefaultHTMLCursor(type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*static*/
 | 
			
		||||
void wxHtmlWindow::SetDefaultHTMLCursor(HTMLCursor type, const wxCursor& cursor)
 | 
			
		||||
{
 | 
			
		||||
    switch (type)
 | 
			
		||||
    {
 | 
			
		||||
        case HTMLCursor_Link:
 | 
			
		||||
            delete ms_cursorLink;
 | 
			
		||||
            ms_cursorLink = new wxCursor(cursor);
 | 
			
		||||
            return;
 | 
			
		||||
 | 
			
		||||
        case HTMLCursor_Text:
 | 
			
		||||
            delete ms_cursorText;
 | 
			
		||||
            ms_cursorText = new wxCursor(cursor);
 | 
			
		||||
            return;
 | 
			
		||||
 | 
			
		||||
        case HTMLCursor_Default:
 | 
			
		||||
        default:
 | 
			
		||||
            delete ms_cursorText;
 | 
			
		||||
            ms_cursorDefault = new wxCursor(cursor);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//-----------------------------------------------------------------------------
 | 
			
		||||
// wxHtmlWinModule
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user