#pragma implementation "cursor.h"
#endif
+#include "wx/defs.h"
+
+#include "wx/app.h"
#include "wx/cursor.h"
#include "wx/icon.h"
+#include "wx/mac/private.h"
+#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap)
+#endif
const short kwxCursorHandId = 9 ;
const short kwxCursorSizeWEId = 10 ;
const short kwxCursorSizeNSId = 11 ;
+#if !TARGET_CARBON
Cursor* MacArrowCursorPtr = &qd.arrow ;
CursHandle MacArrowCursor = &MacArrowCursorPtr ;
+#else
+bool MacArrowInstalled = false ;
+Cursor MacArrow ;
+Cursor* MacArrowCursorPtr = &MacArrow ;
+CursHandle MacArrowCursor = &MacArrowCursorPtr ;
+#endif
CursHandle gMacCurrentCursor = NULL ;
wxCursorRefData::wxCursorRefData()
{
+#if TARGET_CARBON
+ if ( !MacArrowInstalled )
+ {
+ MacArrowCursorPtr = GetQDGlobalsArrow( &MacArrow ) ;
+ MacArrowInstalled = true ;
+ }
+#endif
m_width = 32;
m_height = 32;
m_hCursor = NULL ;
wxCursorRefData::~wxCursorRefData()
{
- if ( m_hCursor && ( m_hCursor != MacArrowCursor ) )
- ::DisposeHandle( (Handle) m_hCursor ) ;
+// if ( m_hCursor && ( m_hCursor != MacArrowCursor ) )
+// ::ReleaseResource( (Handle) m_hCursor ) ;
}
// Cursors
wxCursor::wxCursor(int cursor_type)
{
m_refData = new wxCursorRefData;
-
+
+
switch (cursor_type)
{
case wxCURSOR_WAIT:
M_CURSORDATA->m_hCursor = ::GetCursor(crossCursor);
break;
case wxCURSOR_SIZENWSE:
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeWEId);
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeWEId);
+ }
break;
case wxCURSOR_SIZENESW:
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeWEId);
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeWEId);
+ }
break;
case wxCURSOR_SIZEWE:
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeWEId);
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeWEId);
+ }
break;
case wxCURSOR_SIZENS:
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeNSId);
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorSizeNSId);
+ }
break;
case wxCURSOR_CHAR:
- {
- M_CURSORDATA->m_hCursor = MacArrowCursor;
- break;
- }
+ {
+ M_CURSORDATA->m_hCursor = MacArrowCursor;
+ break;
+ }
case wxCURSOR_HAND:
- {
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
- break;
- }
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
+ }
+ break;
case wxCURSOR_BULLSEYE:
- {
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
- break;
- }
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
+ }
+ break;
case wxCURSOR_PENCIL:
- {
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
- break;
- }
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
+ }
+ break;
case wxCURSOR_MAGNIFIER:
- {
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
- break;
- }
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
+ }
+ break;
case wxCURSOR_NO_ENTRY:
- {
- M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
- break;
- }
+ {
+ wxStAppResource resload ;
+ M_CURSORDATA->m_hCursor = ::GetCursor(kwxCursorHandId);
+ }
+ break;
case wxCURSOR_LEFT_BUTTON:
{
M_CURSORDATA->m_hCursor = MacArrowCursor;
{
if ( m_refData && M_CURSORDATA->m_hCursor )
{
- ::SetCursor( *M_CURSORDATA->m_hCursor ) ;
- gMacCurrentCursor = M_CURSORDATA->m_hCursor ;
+ CursHandle ch = ((CursHandle)M_CURSORDATA->m_hCursor) ;
+ ::SetCursor( *ch ) ;
+ gMacCurrentCursor = ch ;
}
else
{