added conversion routines to CIconHandle, removing pre 8.6 routines
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2fb4d7b86e
commit
7205570233
@ -12,33 +12,10 @@
|
||||
#ifndef H_UMA
|
||||
#define H_UMA
|
||||
|
||||
// define this to be 1 if you have the 8.6 libs (weak linked)
|
||||
|
||||
#define UMA_USE_8_6 0
|
||||
|
||||
#if TARGET_CARBON
|
||||
#undef UMA_USE_8_6
|
||||
#define UMA_USE_8_6 1
|
||||
#endif
|
||||
|
||||
#if defined(__POWERPC__)
|
||||
#define UMA_USE_APPEARANCE 1
|
||||
#define UMA_USE_WINDOWMGR 1
|
||||
#if defined(__DARWIN__)
|
||||
#include <Carbon/Carbon.h>
|
||||
#endif
|
||||
#else
|
||||
#define UMA_USE_APPEARANCE 1
|
||||
#define UMA_USE_WINDOWMGR 0
|
||||
#endif
|
||||
|
||||
#if UMA_USE_APPEARANCE == 0
|
||||
#pragma error "wxMac needs appearance"
|
||||
#endif
|
||||
|
||||
#if !UMA_USE_8_6 && UMA_USE_WINDOWMGR
|
||||
#undef UMA_USE_WINDOWMGR
|
||||
#define UMA_USE_WINDOWMGR 0
|
||||
#endif
|
||||
|
||||
#if !TARGET_CARBON
|
||||
@ -50,6 +27,8 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
|
||||
void UMACleanupToolbox() ;
|
||||
bool UMAHasAppearance() ;
|
||||
long UMAGetAppearanceVersion() ;
|
||||
bool UMAHasWindowManager() ;
|
||||
long UMAGetWindowManagerAttr() ;
|
||||
|
||||
// process manager
|
||||
|
||||
@ -66,16 +45,16 @@ void UMAAppendSubMenuItem( MenuRef menu , StringPtr label , SInt16 submenuid )
|
||||
void UMAInsertSubMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 submenuid ) ;
|
||||
void UMAAppendMenuItem( MenuRef menu , StringPtr label , SInt16 key= 0, UInt8 modifiers = 0 ) ;
|
||||
void UMAInsertMenuItem( MenuRef menu , StringPtr label , MenuItemIndex item , SInt16 key = 0 , UInt8 modifiers = 0 ) ;
|
||||
void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
|
||||
// void UMASetMenuItemText( MenuRef menu , MenuItemIndex item , StringPtr label ) ;
|
||||
|
||||
MenuRef UMANewMenu( SInt16 menuid , StringPtr label ) ;
|
||||
void UMADisposeMenu( MenuRef menu ) ;
|
||||
// MenuRef ::NewMenu( SInt16 menuid , StringPtr label ) ;
|
||||
// void UMADisposeMenu( MenuRef menu ) ;
|
||||
|
||||
// handling the menubar
|
||||
|
||||
void UMADeleteMenu( SInt16 menuId ) ;
|
||||
void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
|
||||
void UMADrawMenuBar() ;
|
||||
// void UMADeleteMenu( SInt16 menuId ) ;
|
||||
// void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) ;
|
||||
// void UMADrawMenuBar() ;
|
||||
|
||||
// quickdraw
|
||||
|
||||
@ -98,13 +77,13 @@ void UMASetWTitleC( WindowRef inWindowRef , const char *title ) ;
|
||||
void UMAGetWTitleC( WindowRef inWindowRef , char *title ) ;
|
||||
|
||||
void UMADrawGrowIcon( WindowRef inWindowRef ) ;
|
||||
void UMAShowWindow( WindowRef inWindowRef ) ;
|
||||
void UMAHideWindow( WindowRef inWindowRef ) ;
|
||||
//void UMAShowWindow( WindowRef inWindowRef ) ;
|
||||
//void UMAHideWindow( WindowRef inWindowRef ) ;
|
||||
void UMAShowHide( WindowRef inWindowRef , Boolean show) ;
|
||||
void UMASelectWindow( WindowRef inWindowRef ) ;
|
||||
void UMABringToFront( WindowRef inWindowRef ) ;
|
||||
void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
|
||||
void UMACloseWindow(WindowRef inWindowRef) ;
|
||||
//void UMASelectWindow( WindowRef inWindowRef ) ;
|
||||
//void UMABringToFront( WindowRef inWindowRef ) ;
|
||||
//void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ;
|
||||
// void UMACloseWindow(WindowRef inWindowRef) ;
|
||||
|
||||
// appearance manager
|
||||
|
||||
@ -114,15 +93,16 @@ void UMAEnableControl( ControlHandle inControl ) ;
|
||||
void UMADisableControl( ControlHandle inControl ) ;
|
||||
void UMAActivateControl( ControlHandle inControl ) ;
|
||||
void UMADeactivateControl( ControlHandle inControl ) ;
|
||||
void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
|
||||
const Rect * bounds,
|
||||
ThemeDrawState inState,
|
||||
SInt16 inDepth,
|
||||
Boolean inColorDev);
|
||||
void UMASetThemeWindowBackground (WindowRef inWindow,
|
||||
ThemeBrush inBrush,
|
||||
Boolean inUpdate) ;
|
||||
ControlHandle UMANewControl(WindowPtr owningWindow,
|
||||
//void UMAApplyThemeBackground (ThemeBackgroundKind inKind,
|
||||
// const Rect * bounds,
|
||||
// ThemeDrawState inState,
|
||||
// SInt16 inDepth,
|
||||
// Boolean inColorDev);
|
||||
//void UMASetThemeWindowBackground (WindowRef inWindow,
|
||||
// ThemeBrush inBrush,
|
||||
// Boolean inUpdate) ;
|
||||
/*
|
||||
ControlHandle ::NewControl(WindowPtr owningWindow,
|
||||
const Rect * boundsRect,
|
||||
ConstStr255Param controlTitle,
|
||||
Boolean initiallyVisible,
|
||||
@ -131,36 +111,37 @@ ControlHandle UMANewControl(WindowPtr owningWindow,
|
||||
SInt16 maximumValue,
|
||||
SInt16 procID,
|
||||
SInt32 controlReference) ;
|
||||
void UMADisposeControl (ControlHandle theControl) ;
|
||||
void UMAHiliteControl (ControlHandle theControl,
|
||||
ControlPartCode hiliteState) ;
|
||||
*/
|
||||
//void UMADisposeControl (ControlHandle theControl) ;
|
||||
//void UMAHiliteControl (ControlHandle theControl,
|
||||
// ControlPartCode hiliteState) ;
|
||||
void UMAShowControl (ControlHandle theControl) ;
|
||||
void UMAHideControl (ControlHandle theControl);
|
||||
void UMASetControlVisibility (ControlHandle inControl,
|
||||
Boolean inIsVisible,
|
||||
Boolean inDoDraw);
|
||||
//void UMAHideControl (ControlHandle theControl);
|
||||
//void UMASetControlVisibility (ControlHandle inControl,
|
||||
// Boolean inIsVisible,
|
||||
// Boolean inDoDraw);
|
||||
|
||||
bool UMAIsControlActive (ControlHandle inControl);
|
||||
bool UMAIsControlVisible (ControlHandle inControl);
|
||||
//bool UMAIsControlActive (ControlHandle inControl);
|
||||
//bool UMAIsControlVisible (ControlHandle inControl);
|
||||
void UMAActivateControl (ControlHandle inControl);
|
||||
void UMADeactivateControl (ControlHandle inControl);
|
||||
|
||||
OSErr UMAGetBestControlRect (ControlHandle inControl,
|
||||
Rect * outRect,
|
||||
SInt16 * outBaseLineOffset);
|
||||
OSErr UMASetControlFontStyle (ControlHandle inControl,
|
||||
const ControlFontStyleRec * inStyle) ;
|
||||
//OSErr UMAGetBestControlRect (ControlHandle inControl,
|
||||
// Rect * outRect,
|
||||
// SInt16 * outBaseLineOffset);
|
||||
//OSErr UMASetControlFontStyle (ControlHandle inControl,
|
||||
// const ControlFontStyleRec * inStyle) ;
|
||||
|
||||
|
||||
void UMAMoveControl( ControlHandle inControl , short x , short y ) ;
|
||||
void UMASizeControl( ControlHandle inControl , short x , short y ) ;
|
||||
// control hierarchy
|
||||
|
||||
OSErr UMACreateRootControl (WindowPtr inWindow,
|
||||
ControlHandle * outControl) ;
|
||||
//OSErr UMACreateRootControl (WindowPtr inWindow,
|
||||
// ControlHandle * outControl) ;
|
||||
|
||||
OSErr UMAEmbedControl (ControlHandle inControl,
|
||||
ControlHandle inContainer);
|
||||
//OSErr UMAEmbedControl (ControlHandle inControl,
|
||||
// ControlHandle inContainer);
|
||||
|
||||
// keyboard focus
|
||||
OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
||||
@ -170,35 +151,35 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
||||
|
||||
// events
|
||||
|
||||
ControlPartCode UMAHandleControlClick (ControlHandle inControl,
|
||||
Point inWhere,
|
||||
SInt16 inModifiers,
|
||||
ControlActionUPP inAction) ;
|
||||
SInt16 UMAHandleControlKey (ControlHandle inControl,
|
||||
SInt16 inKeyCode,
|
||||
SInt16 inCharCode,
|
||||
SInt16 inModifiers);
|
||||
//ControlPartCode UMAHandleControlClick (ControlHandle inControl,
|
||||
// Point inWhere,
|
||||
// SInt16 inModifiers,
|
||||
// ControlActionUPP inAction) ;
|
||||
//SInt16 UMAHandleControlKey (ControlHandle inControl,
|
||||
// SInt16 inKeyCode,
|
||||
// SInt16 inCharCode,
|
||||
// SInt16 inModifiers);
|
||||
|
||||
void UMAIdleControls (WindowPtr inWindow) ;
|
||||
//void UMAIdleControls (WindowPtr inWindow) ;
|
||||
|
||||
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ;
|
||||
OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ;
|
||||
|
||||
// handling control data
|
||||
|
||||
OSErr UMASetControlData (ControlHandle inControl,
|
||||
/*
|
||||
OSErr ::SetControlData (ControlHandle inControl,
|
||||
ControlPartCode inPart,
|
||||
ResType inTagName,
|
||||
Size inSize,
|
||||
Ptr inData) ;
|
||||
|
||||
OSErr UMAGetControlData (ControlHandle inControl,
|
||||
OSErr ::GetControlData (ControlHandle inControl,
|
||||
ControlPartCode inPart,
|
||||
ResType inTagName,
|
||||
Size inBufferSize,
|
||||
Ptr outBuffer,
|
||||
Size * outActualSize) ;
|
||||
OSErr UMAGetControlDataSize (ControlHandle inControl,
|
||||
OSErr ::GetControlDataSize (ControlHandle inControl,
|
||||
ControlPartCode inPart,
|
||||
ResType inTagName,
|
||||
Size * outMaxSize);
|
||||
@ -227,12 +208,13 @@ WindowRef UMAFrontWindow() ;
|
||||
WindowRef UMAFrontNonFloatingWindow() ;
|
||||
|
||||
// floaters support
|
||||
|
||||
*/
|
||||
bool UMAIsWindowFloating( WindowRef inWindow ) ;
|
||||
bool UMAIsWindowModal( WindowRef inWindow ) ;
|
||||
/*
|
||||
WindowRef UMAGetActiveWindow() ;
|
||||
WindowRef UMAGetActiveNonFloatingWindow() ;
|
||||
|
||||
*/
|
||||
void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
|
||||
|
||||
#if !TARGET_CARBON
|
||||
@ -250,8 +232,12 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
|
||||
#define GetQDGlobalsArrow( a ) (&((*a) = qd.arrow))
|
||||
#define GetControlBounds( c , b ) &((*b) = (**c).contrlRect )
|
||||
#define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
|
||||
#define GetControlOwner( control ) (**control).contrlOwner
|
||||
#define InvalWindowRgn( window , rgn ) InvalRgn( rgn )
|
||||
#endif
|
||||
#if TARGET_CARBON
|
||||
#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
|
||||
#endif
|
||||
|
||||
// Appearance Drawing
|
||||
|
||||
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "wx/mac/uma.h"
|
||||
#include "wx/mac/aga.h"
|
||||
|
||||
#if !TARGET_CARBON
|
||||
#if 0 // TO BE REMOVED SOON
|
||||
|
||||
#include <extcdef.h>
|
||||
#include <PictUtils.h>
|
||||
|
@ -94,41 +94,31 @@ bool wxApp::s_macSupportPCMenuShortcuts = true ;
|
||||
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
|
||||
wxString wxApp::s_macHelpMenuTitleName = "&Help" ;
|
||||
|
||||
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon ) ;
|
||||
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon ) ;
|
||||
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon ) ;
|
||||
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon ) ;
|
||||
|
||||
|
||||
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon )
|
||||
#else
|
||||
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||
#endif
|
||||
{
|
||||
wxApp* app = (wxApp*) refcon ;
|
||||
return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ;
|
||||
}
|
||||
|
||||
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon )
|
||||
#else
|
||||
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||
#endif
|
||||
{
|
||||
wxApp* app = (wxApp*) refcon ;
|
||||
return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ;
|
||||
}
|
||||
|
||||
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon )
|
||||
#else
|
||||
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||
#endif
|
||||
{
|
||||
wxApp* app = (wxApp*) refcon ;
|
||||
return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ;
|
||||
}
|
||||
|
||||
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon )
|
||||
#else
|
||||
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||
#endif
|
||||
{
|
||||
wxApp* app = (wxApp*) refcon ;
|
||||
return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ;
|
||||
@ -430,7 +420,7 @@ bool wxApp::Initialize()
|
||||
{
|
||||
error = kMacSTROldSystem ;
|
||||
}
|
||||
else if ( theSystem < 0x0750 )
|
||||
else if ( theSystem < 0x0860 )
|
||||
{
|
||||
error = kMacSTROldSystem ;
|
||||
}
|
||||
@ -976,7 +966,7 @@ void wxApp::MacSuspend( bool convertClipboard )
|
||||
MacConvertPrivateToPublicScrap() ;
|
||||
}
|
||||
|
||||
UMAHideFloatingWindows() ;
|
||||
::HideFloatingWindows() ;
|
||||
}
|
||||
|
||||
void wxApp::MacResume( bool convertClipboard )
|
||||
@ -987,7 +977,7 @@ void wxApp::MacResume( bool convertClipboard )
|
||||
MacConvertPublicToPrivateScrap() ;
|
||||
}
|
||||
|
||||
UMAShowFloatingWindows() ;
|
||||
::ShowFloatingWindows() ;
|
||||
}
|
||||
|
||||
void wxApp::MacConvertPrivateToPublicScrap()
|
||||
@ -1011,9 +1001,9 @@ void wxApp::MacDoOneEvent()
|
||||
else
|
||||
{
|
||||
// idlers
|
||||
WindowPtr window = UMAFrontWindow() ;
|
||||
WindowPtr window = ::FrontWindow() ;
|
||||
if ( window )
|
||||
UMAIdleControls( window ) ;
|
||||
::IdleControls( window ) ;
|
||||
|
||||
wxTheApp->ProcessIdle() ;
|
||||
}
|
||||
@ -1093,10 +1083,10 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
|
||||
wxToolTip::RemoveToolTips() ;
|
||||
|
||||
WindowRef window;
|
||||
WindowRef frontWindow = UMAFrontNonFloatingWindow() ;
|
||||
WindowRef frontWindow = ::FrontNonFloatingWindow() ;
|
||||
WindowAttributes frontWindowAttributes = NULL ;
|
||||
if ( frontWindow )
|
||||
UMAGetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
|
||||
::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
|
||||
|
||||
short windowPart = ::FindWindow(ev->where, &window);
|
||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||
@ -1233,7 +1223,7 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
|
||||
{
|
||||
if ( win )
|
||||
win->MacMouseDown( ev , windowPart ) ;
|
||||
UMASelectWindow( window ) ;
|
||||
::SelectWindow( window ) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1270,6 +1260,7 @@ void wxApp::MacHandleMouseUpEvent( EventRecord *ev )
|
||||
}
|
||||
}
|
||||
|
||||
long wxMacTranslateKey(unsigned char key, unsigned char code) ;
|
||||
long wxMacTranslateKey(unsigned char key, unsigned char code)
|
||||
{
|
||||
long retval = key ;
|
||||
@ -1517,11 +1508,11 @@ void wxApp::MacHandleActivateEvent( EventRecord *ev )
|
||||
{
|
||||
bool activate = (ev->modifiers & activeFlag ) ;
|
||||
WindowClass wclass ;
|
||||
UMAGetWindowClass ( window , &wclass ) ;
|
||||
::GetWindowClass ( window , &wclass ) ;
|
||||
if ( wclass == kFloatingWindowClass )
|
||||
{
|
||||
// if it is a floater we activate/deactivate the front non-floating window instead
|
||||
window = UMAFrontNonFloatingWindow() ;
|
||||
window = ::FrontNonFloatingWindow() ;
|
||||
}
|
||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||
if ( win )
|
||||
@ -1585,11 +1576,11 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
||||
// our idea of the active window with the process manager's - which it already activated
|
||||
|
||||
if ( !doesActivate )
|
||||
oldFrontWindow = UMAFrontNonFloatingWindow() ;
|
||||
oldFrontWindow = ::FrontNonFloatingWindow() ;
|
||||
|
||||
MacResume( convertClipboard ) ;
|
||||
|
||||
newFrontWindow = UMAFrontNonFloatingWindow() ;
|
||||
newFrontWindow = ::FrontNonFloatingWindow() ;
|
||||
|
||||
if ( oldFrontWindow )
|
||||
{
|
||||
@ -1611,13 +1602,15 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
||||
// in case this suspending did close an active window, another one might
|
||||
// have surfaced -> lets deactivate that one
|
||||
|
||||
WindowRef newActiveWindow = UMAGetActiveNonFloatingWindow() ;
|
||||
/* TODO : find out what to do on systems < 10 , perhaps FrontNonFloatingWindow
|
||||
WindowRef newActiveWindow = ::ActiveNonFloatingWindow() ;
|
||||
if ( newActiveWindow )
|
||||
{
|
||||
wxWindow* win = wxFindWinFromMacWindow( newActiveWindow ) ;
|
||||
if ( win )
|
||||
win->MacActivate( ev , false ) ;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
break ;
|
||||
|
@ -11,7 +11,7 @@ resource 'STR#' ( 128 , "Simple Alert Messages" )
|
||||
"This application needs at least a MacPlus" ,
|
||||
"This application needs more memory" ,
|
||||
"This application is out of memory" ,
|
||||
"This application needs at least System 7.5" ,
|
||||
"This application needs at least System 8.6" ,
|
||||
"About this wxWindows Application" ,
|
||||
"This application needs Appearance extension (built in with System 8) - this restriction will be relieved in the final release"
|
||||
}
|
||||
|
@ -93,95 +93,204 @@ void wxMacDestroyGWorld( GWorldPtr gw )
|
||||
DisposeGWorld( gw ) ;
|
||||
}
|
||||
|
||||
#define kDefaultRes 0x00480000 /* Default resolution is 72 DPI; Fixed type */
|
||||
|
||||
OSErr SetupCIconHandlePixMap( CIconHandle icon , short depth , Rect *bounds , CTabHandle colors )
|
||||
{
|
||||
CTabHandle newColors; /* Color table used for the off-screen PixMap */
|
||||
Ptr offBaseAddr; /* Pointer to the off-screen pixel image */
|
||||
OSErr error; /* Returns error code */
|
||||
short bytesPerRow; /* Number of bytes per row in the PixMap */
|
||||
|
||||
|
||||
error = noErr;
|
||||
newColors = nil;
|
||||
offBaseAddr = nil;
|
||||
|
||||
bytesPerRow = ((depth * (bounds->right - bounds->left) + 31) / 32) * 4;
|
||||
|
||||
/* Clone the clut if indexed color; allocate a dummy clut if direct color*/
|
||||
if (depth <= 8)
|
||||
{
|
||||
newColors = colors;
|
||||
error = HandToHand((Handle *) &newColors);
|
||||
}
|
||||
else
|
||||
{
|
||||
newColors = (CTabHandle) NewHandle(sizeof(ColorTable) -
|
||||
sizeof(CSpecArray));
|
||||
error = MemError();
|
||||
}
|
||||
if (error == noErr)
|
||||
{
|
||||
/* Allocate pixel image; long integer multiplication avoids overflow */
|
||||
(**icon).iconData = NewHandle((unsigned long) bytesPerRow * (bounds->bottom -
|
||||
bounds->top));
|
||||
if ((**icon).iconData != nil)
|
||||
{
|
||||
/* Initialize fields common to indexed and direct PixMaps */
|
||||
(**icon).iconPMap.baseAddr = 0; /* Point to image */
|
||||
(**icon).iconPMap.rowBytes = bytesPerRow | /* MSB set for PixMap */
|
||||
0x8000;
|
||||
(**icon).iconPMap.bounds = *bounds; /* Use given bounds */
|
||||
(**icon).iconPMap.pmVersion = 0; /* No special stuff */
|
||||
(**icon).iconPMap.packType = 0; /* Default PICT pack */
|
||||
(**icon).iconPMap.packSize = 0; /* Always zero in mem */
|
||||
(**icon).iconPMap.hRes = kDefaultRes; /* 72 DPI default res */
|
||||
(**icon).iconPMap.vRes = kDefaultRes; /* 72 DPI default res */
|
||||
(**icon).iconPMap.pixelSize = depth; /* Set # bits/pixel */
|
||||
|
||||
/* Initialize fields specific to indexed and direct PixMaps */
|
||||
if (depth <= 8)
|
||||
{
|
||||
/* PixMap is indexed */
|
||||
(**icon).iconPMap.pixelType = 0; /* Indicates indexed */
|
||||
(**icon).iconPMap.cmpCount = 1; /* Have 1 component */
|
||||
(**icon).iconPMap.cmpSize = depth; /* Component size=depth */
|
||||
(**icon).iconPMap.pmTable = newColors; /* Handle to CLUT */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* PixMap is direct */
|
||||
(**icon).iconPMap.pixelType = RGBDirect; /* Indicates direct */
|
||||
(**icon).iconPMap.cmpCount = 3; /* Have 3 components */
|
||||
if (depth == 16)
|
||||
(**icon).iconPMap.cmpSize = 5; /* 5 bits/component */
|
||||
else
|
||||
(**icon).iconPMap.cmpSize = 8; /* 8 bits/component */
|
||||
(**newColors).ctSeed = 3 * (**icon).iconPMap.cmpSize;
|
||||
(**newColors).ctFlags = 0;
|
||||
(**newColors).ctSize = 0;
|
||||
(**icon).iconPMap.pmTable = newColors;
|
||||
}
|
||||
}
|
||||
else
|
||||
error = MemError();
|
||||
}
|
||||
else
|
||||
newColors = nil;
|
||||
|
||||
/* If no errors occured, return a handle to the new off-screen PixMap */
|
||||
if (error != noErr)
|
||||
{
|
||||
if (newColors != nil)
|
||||
DisposeCTable(newColors);
|
||||
}
|
||||
|
||||
/* Return the error code */
|
||||
return error;
|
||||
}
|
||||
|
||||
CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize )
|
||||
{
|
||||
GWorldPtr saveWorld;
|
||||
GDHandle saveHandle;
|
||||
|
||||
GetGWorld(&saveWorld,&saveHandle); // save Graphics env state
|
||||
SetGWorld(image,nil);
|
||||
|
||||
Rect frame = { 0 , 0 , iconSize , iconSize } ;
|
||||
Rect imageBounds = frame ;
|
||||
GetPortBounds( image , &imageBounds ) ;
|
||||
|
||||
int bwSize = iconSize / 8 * iconSize ;
|
||||
CIconHandle icon = (CIconHandle) NewHandleClear( sizeof ( CIcon ) + 2 * bwSize) ;
|
||||
HLock((Handle)icon) ;
|
||||
SetupCIconHandlePixMap( icon , dstDepth , &frame,GetCTable(dstDepth)) ;
|
||||
HLock( (**icon).iconData ) ;
|
||||
(**icon).iconPMap.baseAddr = *(**icon).iconData ;
|
||||
|
||||
LockPixels(GetGWorldPixMap(image));
|
||||
|
||||
CopyBits(GetPortBitMapForCopyBits(image),
|
||||
(BitMapPtr)&((**icon).iconPMap),
|
||||
&imageBounds,
|
||||
&imageBounds,
|
||||
srcCopy | ditherCopy, nil);
|
||||
|
||||
|
||||
UnlockPixels(GetGWorldPixMap(image));
|
||||
HUnlock( (**icon).iconData ) ;
|
||||
|
||||
(**icon).iconMask.rowBytes = iconSize / 8 ;
|
||||
(**icon).iconMask.bounds = frame ;
|
||||
|
||||
(**icon).iconBMap.rowBytes = iconSize / 8 ;
|
||||
(**icon).iconBMap.bounds = frame ;
|
||||
(**icon).iconMask.baseAddr = (char*) &(**icon).iconMaskData ;
|
||||
(**icon).iconBMap.baseAddr = (char*) &(**icon).iconMaskData + bwSize ;
|
||||
|
||||
if ( mask )
|
||||
{
|
||||
LockPixels(GetGWorldPixMap(mask) ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(mask) ,
|
||||
&(**icon).iconBMap , &imageBounds , &imageBounds, srcCopy , nil ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(mask) ,
|
||||
&(**icon).iconMask , &imageBounds , &imageBounds, srcCopy , nil ) ;
|
||||
UnlockPixels(GetGWorldPixMap( mask ) ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
LockPixels(GetGWorldPixMap(image));
|
||||
CopyBits(GetPortBitMapForCopyBits(image) ,
|
||||
&(**icon).iconBMap , &imageBounds , &imageBounds, srcCopy , nil ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(image) ,
|
||||
&(**icon).iconMask , &imageBounds , &imageBounds, srcCopy , nil ) ;
|
||||
UnlockPixels(GetGWorldPixMap(image));
|
||||
}
|
||||
|
||||
(**icon).iconMask.baseAddr = NULL ;
|
||||
(**icon).iconBMap.baseAddr = NULL ;
|
||||
(**icon).iconPMap.baseAddr = NULL ;
|
||||
HUnlock((Handle)icon) ;
|
||||
SetGWorld(saveWorld,saveHandle);
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
|
||||
{
|
||||
CGrafPtr origPort ;
|
||||
GDHandle origDev ;
|
||||
CGrafPtr origPort ;
|
||||
GDHandle origDev ;
|
||||
|
||||
PicHandle pict; // this is the Picture we give back
|
||||
PicHandle pict;
|
||||
|
||||
RGBColor gray = { 0xCCCC ,0xCCCC , 0xCCCC } ;
|
||||
RGBColor white = { 0xffff ,0xffff , 0xffff } ;
|
||||
RGBColor black = { 0x0000 ,0x0000 , 0x0000 } ;
|
||||
RGBColor white = { 0xffff ,0xffff , 0xffff } ;
|
||||
RGBColor black = { 0x0000 ,0x0000 , 0x0000 } ;
|
||||
|
||||
unsigned char *maskimage = NULL ;
|
||||
Rect portRect ;
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
int width = portRect.right - portRect.left ;
|
||||
int height = portRect.bottom - portRect.top ;
|
||||
GetGWorld( &origPort , &origDev ) ;
|
||||
|
||||
LockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
GetGWorld( &origPort , &origDev ) ;
|
||||
RgnHandle clipRgn = NULL ;
|
||||
|
||||
if ( mask )
|
||||
{
|
||||
maskimage = (unsigned char*) malloc( width * height ) ;
|
||||
SetGWorld( mask , NULL ) ;
|
||||
LockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
for ( int y = 0 ; y < height ; y++ )
|
||||
{
|
||||
for( int x = 0 ; x < width ; x++ )
|
||||
{
|
||||
RGBColor col ;
|
||||
if ( mask )
|
||||
{
|
||||
clipRgn = NewRgn() ;
|
||||
LockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( mask ) ) ;
|
||||
UnlockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
}
|
||||
|
||||
SetGWorld( wp , NULL ) ;
|
||||
Rect portRect ;
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
|
||||
GetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
maskimage[y*width + x] = ( col.red == 0 ) ; // for monochrome masks
|
||||
}
|
||||
}
|
||||
UnlockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
}
|
||||
pict = OpenPicture(&portRect);
|
||||
if(pict)
|
||||
{
|
||||
RGBForeColor( &black ) ;
|
||||
RGBBackColor( &white ) ;
|
||||
|
||||
SetGWorld( wp , NULL ) ;
|
||||
|
||||
pict = OpenPicture(&portRect); // open a picture, this disables drawing
|
||||
if(!pict)
|
||||
return NULL;
|
||||
|
||||
if ( maskimage )
|
||||
{
|
||||
RGBForeColor( &black ) ;
|
||||
RGBBackColor( &white ) ;
|
||||
PenMode(transparent);
|
||||
|
||||
for ( int y = 0 ; y < height ; ++y )
|
||||
{
|
||||
for( int x = 0 ; x < width ; ++x )
|
||||
{
|
||||
if ( maskimage[y*width + x] )
|
||||
{
|
||||
RGBColor col ;
|
||||
|
||||
GetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
SetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
}
|
||||
else {
|
||||
// With transparency set this sets a blank pixel not a white one
|
||||
SetCPixel( x + portRect.left , y + portRect.top , &white);
|
||||
}
|
||||
}
|
||||
}
|
||||
free( maskimage ) ;
|
||||
maskimage = NULL ;
|
||||
}
|
||||
else
|
||||
{
|
||||
RGBBackColor( &gray ) ;
|
||||
EraseRect(&portRect);
|
||||
RGBForeColor( &black ) ;
|
||||
RGBBackColor( &white ) ;
|
||||
|
||||
CopyBits(GetPortBitMapForCopyBits(wp), /* src PixMap - we copy image over
|
||||
* itself - */
|
||||
GetPortBitMapForCopyBits(wp), // dst PixMap - no drawing occurs
|
||||
&portRect, // srcRect - it will be recorded and compressed -
|
||||
&portRect, // dstRect - into the picture that is open -
|
||||
srcCopy,NULL); // copyMode and no clip region
|
||||
}
|
||||
ClosePicture(); // We are done recording the picture
|
||||
UnlockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
|
||||
return pict; // return our groovy pict handle
|
||||
LockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(wp),
|
||||
GetPortBitMapForCopyBits(wp),
|
||||
&portRect,
|
||||
&portRect,
|
||||
srcCopy,clipRgn);
|
||||
UnlockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
ClosePicture();
|
||||
}
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
return pict;
|
||||
}
|
||||
|
||||
wxBitmapRefData::wxBitmapRefData()
|
||||
|
@ -21,8 +21,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
|
||||
#endif
|
||||
|
||||
#include "wx/mac/uma.h"
|
||||
|
||||
PicHandle MakePict(GWorldPtr wp, GWorldPtr mask ) ;
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||
const wxPoint& pos,
|
||||
@ -58,7 +57,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 ,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 ,
|
||||
kControlBehaviorOffsetContents +
|
||||
( bmap->m_bitmapType == kMacBitmapTypeIcon ? kControlContentCIconHandle : kControlContentPictHandle ) , 0,
|
||||
(( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevelProc : kControlBevelButtonNormalBevelProc ), (long) this ) ;
|
||||
@ -70,19 +69,22 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
||||
if ( m_buttonBitmap.Ok() )
|
||||
{
|
||||
if ( bmap->m_bitmapType == kMacBitmapTypePict ) {
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld )
|
||||
{
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
if ( m_buttonBitmap.GetMask() )
|
||||
{
|
||||
info.u.picture = MakePict( bmap->m_hBitmap , m_buttonBitmap.GetMask()->GetMaskBitmap() ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , m_buttonBitmap.GetMask()->GetMaskBitmap() ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.u.picture = MakePict( bmap->m_hBitmap , NULL ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , NULL ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeIcon )
|
||||
@ -92,7 +94,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
||||
}
|
||||
}
|
||||
|
||||
UMASetControlData( m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
::SetControlData( m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
||||
@ -107,21 +109,23 @@ void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
|
||||
if ( m_buttonBitmap.Ok() )
|
||||
{
|
||||
wxBitmapRefData * bmap = (wxBitmapRefData*) ( m_buttonBitmap.GetRefData()) ;
|
||||
if ( bmap->m_bitmapType == kMacBitmapTypePict )
|
||||
{
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
if ( bmap->m_bitmapType == kMacBitmapTypePict ) {
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld )
|
||||
{
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
if ( m_buttonBitmap.GetMask() )
|
||||
{
|
||||
info.u.picture = MakePict( bmap->m_hBitmap , m_buttonBitmap.GetMask()->GetMaskBitmap() ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , m_buttonBitmap.GetMask()->GetMaskBitmap() ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.u.picture = MakePict( bmap->m_hBitmap , NULL ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , NULL ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeIcon )
|
||||
@ -129,8 +133,9 @@ void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = bmap->m_hIcon ;
|
||||
}
|
||||
|
||||
|
||||
UMASetControlData( m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
::SetControlData( m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlPushButtonProc , (long) this ) ;
|
||||
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
|
||||
|
||||
@ -58,32 +58,19 @@ void wxButton::SetDefault()
|
||||
panel->SetDefaultItem(this);
|
||||
}
|
||||
|
||||
#ifdef __DARWIN__
|
||||
Boolean inData;
|
||||
if ( btnOldDefault && btnOldDefault->m_macControl )
|
||||
{
|
||||
inData = 0;
|
||||
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
|
||||
::SetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
|
||||
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
|
||||
}
|
||||
if ( m_macControl )
|
||||
{
|
||||
inData = 1;
|
||||
UMASetControlData( m_macControl , kControlButtonPart ,
|
||||
::SetControlData( m_macControl , kControlButtonPart ,
|
||||
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
|
||||
}
|
||||
#else
|
||||
if ( btnOldDefault && btnOldDefault->m_macControl )
|
||||
{
|
||||
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
|
||||
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
|
||||
}
|
||||
if ( m_macControl )
|
||||
{
|
||||
UMASetControlData( m_macControl , kControlButtonPart ,
|
||||
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
wxSize wxButton::DoGetBestSize() const
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "wx/mac/uma.h"
|
||||
#include "wx/mac/aga.h"
|
||||
|
||||
#if !TARGET_CARBON
|
||||
#if 0 // TO BE REMOVED SOON
|
||||
|
||||
#include <extcdef.h>
|
||||
#include <PictUtils.h>
|
||||
|
@ -94,41 +94,31 @@ bool wxApp::s_macSupportPCMenuShortcuts = true ;
|
||||
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
|
||||
wxString wxApp::s_macHelpMenuTitleName = "&Help" ;
|
||||
|
||||
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon ) ;
|
||||
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon ) ;
|
||||
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon ) ;
|
||||
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon ) ;
|
||||
|
||||
|
||||
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon )
|
||||
#else
|
||||
pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||
#endif
|
||||
{
|
||||
wxApp* app = (wxApp*) refcon ;
|
||||
return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ;
|
||||
}
|
||||
|
||||
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon )
|
||||
#else
|
||||
pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||
#endif
|
||||
{
|
||||
wxApp* app = (wxApp*) refcon ;
|
||||
return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ;
|
||||
}
|
||||
|
||||
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon )
|
||||
#else
|
||||
pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||
#endif
|
||||
{
|
||||
wxApp* app = (wxApp*) refcon ;
|
||||
return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ;
|
||||
}
|
||||
|
||||
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
|
||||
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon )
|
||||
#else
|
||||
pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
|
||||
#endif
|
||||
{
|
||||
wxApp* app = (wxApp*) refcon ;
|
||||
return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ;
|
||||
@ -430,7 +420,7 @@ bool wxApp::Initialize()
|
||||
{
|
||||
error = kMacSTROldSystem ;
|
||||
}
|
||||
else if ( theSystem < 0x0750 )
|
||||
else if ( theSystem < 0x0860 )
|
||||
{
|
||||
error = kMacSTROldSystem ;
|
||||
}
|
||||
@ -976,7 +966,7 @@ void wxApp::MacSuspend( bool convertClipboard )
|
||||
MacConvertPrivateToPublicScrap() ;
|
||||
}
|
||||
|
||||
UMAHideFloatingWindows() ;
|
||||
::HideFloatingWindows() ;
|
||||
}
|
||||
|
||||
void wxApp::MacResume( bool convertClipboard )
|
||||
@ -987,7 +977,7 @@ void wxApp::MacResume( bool convertClipboard )
|
||||
MacConvertPublicToPrivateScrap() ;
|
||||
}
|
||||
|
||||
UMAShowFloatingWindows() ;
|
||||
::ShowFloatingWindows() ;
|
||||
}
|
||||
|
||||
void wxApp::MacConvertPrivateToPublicScrap()
|
||||
@ -1011,9 +1001,9 @@ void wxApp::MacDoOneEvent()
|
||||
else
|
||||
{
|
||||
// idlers
|
||||
WindowPtr window = UMAFrontWindow() ;
|
||||
WindowPtr window = ::FrontWindow() ;
|
||||
if ( window )
|
||||
UMAIdleControls( window ) ;
|
||||
::IdleControls( window ) ;
|
||||
|
||||
wxTheApp->ProcessIdle() ;
|
||||
}
|
||||
@ -1093,10 +1083,10 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
|
||||
wxToolTip::RemoveToolTips() ;
|
||||
|
||||
WindowRef window;
|
||||
WindowRef frontWindow = UMAFrontNonFloatingWindow() ;
|
||||
WindowRef frontWindow = ::FrontNonFloatingWindow() ;
|
||||
WindowAttributes frontWindowAttributes = NULL ;
|
||||
if ( frontWindow )
|
||||
UMAGetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
|
||||
::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
|
||||
|
||||
short windowPart = ::FindWindow(ev->where, &window);
|
||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||
@ -1233,7 +1223,7 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
|
||||
{
|
||||
if ( win )
|
||||
win->MacMouseDown( ev , windowPart ) ;
|
||||
UMASelectWindow( window ) ;
|
||||
::SelectWindow( window ) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1270,6 +1260,7 @@ void wxApp::MacHandleMouseUpEvent( EventRecord *ev )
|
||||
}
|
||||
}
|
||||
|
||||
long wxMacTranslateKey(unsigned char key, unsigned char code) ;
|
||||
long wxMacTranslateKey(unsigned char key, unsigned char code)
|
||||
{
|
||||
long retval = key ;
|
||||
@ -1517,11 +1508,11 @@ void wxApp::MacHandleActivateEvent( EventRecord *ev )
|
||||
{
|
||||
bool activate = (ev->modifiers & activeFlag ) ;
|
||||
WindowClass wclass ;
|
||||
UMAGetWindowClass ( window , &wclass ) ;
|
||||
::GetWindowClass ( window , &wclass ) ;
|
||||
if ( wclass == kFloatingWindowClass )
|
||||
{
|
||||
// if it is a floater we activate/deactivate the front non-floating window instead
|
||||
window = UMAFrontNonFloatingWindow() ;
|
||||
window = ::FrontNonFloatingWindow() ;
|
||||
}
|
||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||
if ( win )
|
||||
@ -1585,11 +1576,11 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
||||
// our idea of the active window with the process manager's - which it already activated
|
||||
|
||||
if ( !doesActivate )
|
||||
oldFrontWindow = UMAFrontNonFloatingWindow() ;
|
||||
oldFrontWindow = ::FrontNonFloatingWindow() ;
|
||||
|
||||
MacResume( convertClipboard ) ;
|
||||
|
||||
newFrontWindow = UMAFrontNonFloatingWindow() ;
|
||||
newFrontWindow = ::FrontNonFloatingWindow() ;
|
||||
|
||||
if ( oldFrontWindow )
|
||||
{
|
||||
@ -1611,13 +1602,15 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
||||
// in case this suspending did close an active window, another one might
|
||||
// have surfaced -> lets deactivate that one
|
||||
|
||||
WindowRef newActiveWindow = UMAGetActiveNonFloatingWindow() ;
|
||||
/* TODO : find out what to do on systems < 10 , perhaps FrontNonFloatingWindow
|
||||
WindowRef newActiveWindow = ::ActiveNonFloatingWindow() ;
|
||||
if ( newActiveWindow )
|
||||
{
|
||||
wxWindow* win = wxFindWinFromMacWindow( newActiveWindow ) ;
|
||||
if ( win )
|
||||
win->MacActivate( ev , false ) ;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
break ;
|
||||
|
@ -11,7 +11,7 @@ resource 'STR#' ( 128 , "Simple Alert Messages" )
|
||||
"This application needs at least a MacPlus" ,
|
||||
"This application needs more memory" ,
|
||||
"This application is out of memory" ,
|
||||
"This application needs at least System 7.5" ,
|
||||
"This application needs at least System 8.6" ,
|
||||
"About this wxWindows Application" ,
|
||||
"This application needs Appearance extension (built in with System 8) - this restriction will be relieved in the final release"
|
||||
}
|
||||
|
@ -93,95 +93,204 @@ void wxMacDestroyGWorld( GWorldPtr gw )
|
||||
DisposeGWorld( gw ) ;
|
||||
}
|
||||
|
||||
#define kDefaultRes 0x00480000 /* Default resolution is 72 DPI; Fixed type */
|
||||
|
||||
OSErr SetupCIconHandlePixMap( CIconHandle icon , short depth , Rect *bounds , CTabHandle colors )
|
||||
{
|
||||
CTabHandle newColors; /* Color table used for the off-screen PixMap */
|
||||
Ptr offBaseAddr; /* Pointer to the off-screen pixel image */
|
||||
OSErr error; /* Returns error code */
|
||||
short bytesPerRow; /* Number of bytes per row in the PixMap */
|
||||
|
||||
|
||||
error = noErr;
|
||||
newColors = nil;
|
||||
offBaseAddr = nil;
|
||||
|
||||
bytesPerRow = ((depth * (bounds->right - bounds->left) + 31) / 32) * 4;
|
||||
|
||||
/* Clone the clut if indexed color; allocate a dummy clut if direct color*/
|
||||
if (depth <= 8)
|
||||
{
|
||||
newColors = colors;
|
||||
error = HandToHand((Handle *) &newColors);
|
||||
}
|
||||
else
|
||||
{
|
||||
newColors = (CTabHandle) NewHandle(sizeof(ColorTable) -
|
||||
sizeof(CSpecArray));
|
||||
error = MemError();
|
||||
}
|
||||
if (error == noErr)
|
||||
{
|
||||
/* Allocate pixel image; long integer multiplication avoids overflow */
|
||||
(**icon).iconData = NewHandle((unsigned long) bytesPerRow * (bounds->bottom -
|
||||
bounds->top));
|
||||
if ((**icon).iconData != nil)
|
||||
{
|
||||
/* Initialize fields common to indexed and direct PixMaps */
|
||||
(**icon).iconPMap.baseAddr = 0; /* Point to image */
|
||||
(**icon).iconPMap.rowBytes = bytesPerRow | /* MSB set for PixMap */
|
||||
0x8000;
|
||||
(**icon).iconPMap.bounds = *bounds; /* Use given bounds */
|
||||
(**icon).iconPMap.pmVersion = 0; /* No special stuff */
|
||||
(**icon).iconPMap.packType = 0; /* Default PICT pack */
|
||||
(**icon).iconPMap.packSize = 0; /* Always zero in mem */
|
||||
(**icon).iconPMap.hRes = kDefaultRes; /* 72 DPI default res */
|
||||
(**icon).iconPMap.vRes = kDefaultRes; /* 72 DPI default res */
|
||||
(**icon).iconPMap.pixelSize = depth; /* Set # bits/pixel */
|
||||
|
||||
/* Initialize fields specific to indexed and direct PixMaps */
|
||||
if (depth <= 8)
|
||||
{
|
||||
/* PixMap is indexed */
|
||||
(**icon).iconPMap.pixelType = 0; /* Indicates indexed */
|
||||
(**icon).iconPMap.cmpCount = 1; /* Have 1 component */
|
||||
(**icon).iconPMap.cmpSize = depth; /* Component size=depth */
|
||||
(**icon).iconPMap.pmTable = newColors; /* Handle to CLUT */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* PixMap is direct */
|
||||
(**icon).iconPMap.pixelType = RGBDirect; /* Indicates direct */
|
||||
(**icon).iconPMap.cmpCount = 3; /* Have 3 components */
|
||||
if (depth == 16)
|
||||
(**icon).iconPMap.cmpSize = 5; /* 5 bits/component */
|
||||
else
|
||||
(**icon).iconPMap.cmpSize = 8; /* 8 bits/component */
|
||||
(**newColors).ctSeed = 3 * (**icon).iconPMap.cmpSize;
|
||||
(**newColors).ctFlags = 0;
|
||||
(**newColors).ctSize = 0;
|
||||
(**icon).iconPMap.pmTable = newColors;
|
||||
}
|
||||
}
|
||||
else
|
||||
error = MemError();
|
||||
}
|
||||
else
|
||||
newColors = nil;
|
||||
|
||||
/* If no errors occured, return a handle to the new off-screen PixMap */
|
||||
if (error != noErr)
|
||||
{
|
||||
if (newColors != nil)
|
||||
DisposeCTable(newColors);
|
||||
}
|
||||
|
||||
/* Return the error code */
|
||||
return error;
|
||||
}
|
||||
|
||||
CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize )
|
||||
{
|
||||
GWorldPtr saveWorld;
|
||||
GDHandle saveHandle;
|
||||
|
||||
GetGWorld(&saveWorld,&saveHandle); // save Graphics env state
|
||||
SetGWorld(image,nil);
|
||||
|
||||
Rect frame = { 0 , 0 , iconSize , iconSize } ;
|
||||
Rect imageBounds = frame ;
|
||||
GetPortBounds( image , &imageBounds ) ;
|
||||
|
||||
int bwSize = iconSize / 8 * iconSize ;
|
||||
CIconHandle icon = (CIconHandle) NewHandleClear( sizeof ( CIcon ) + 2 * bwSize) ;
|
||||
HLock((Handle)icon) ;
|
||||
SetupCIconHandlePixMap( icon , dstDepth , &frame,GetCTable(dstDepth)) ;
|
||||
HLock( (**icon).iconData ) ;
|
||||
(**icon).iconPMap.baseAddr = *(**icon).iconData ;
|
||||
|
||||
LockPixels(GetGWorldPixMap(image));
|
||||
|
||||
CopyBits(GetPortBitMapForCopyBits(image),
|
||||
(BitMapPtr)&((**icon).iconPMap),
|
||||
&imageBounds,
|
||||
&imageBounds,
|
||||
srcCopy | ditherCopy, nil);
|
||||
|
||||
|
||||
UnlockPixels(GetGWorldPixMap(image));
|
||||
HUnlock( (**icon).iconData ) ;
|
||||
|
||||
(**icon).iconMask.rowBytes = iconSize / 8 ;
|
||||
(**icon).iconMask.bounds = frame ;
|
||||
|
||||
(**icon).iconBMap.rowBytes = iconSize / 8 ;
|
||||
(**icon).iconBMap.bounds = frame ;
|
||||
(**icon).iconMask.baseAddr = (char*) &(**icon).iconMaskData ;
|
||||
(**icon).iconBMap.baseAddr = (char*) &(**icon).iconMaskData + bwSize ;
|
||||
|
||||
if ( mask )
|
||||
{
|
||||
LockPixels(GetGWorldPixMap(mask) ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(mask) ,
|
||||
&(**icon).iconBMap , &imageBounds , &imageBounds, srcCopy , nil ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(mask) ,
|
||||
&(**icon).iconMask , &imageBounds , &imageBounds, srcCopy , nil ) ;
|
||||
UnlockPixels(GetGWorldPixMap( mask ) ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
LockPixels(GetGWorldPixMap(image));
|
||||
CopyBits(GetPortBitMapForCopyBits(image) ,
|
||||
&(**icon).iconBMap , &imageBounds , &imageBounds, srcCopy , nil ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(image) ,
|
||||
&(**icon).iconMask , &imageBounds , &imageBounds, srcCopy , nil ) ;
|
||||
UnlockPixels(GetGWorldPixMap(image));
|
||||
}
|
||||
|
||||
(**icon).iconMask.baseAddr = NULL ;
|
||||
(**icon).iconBMap.baseAddr = NULL ;
|
||||
(**icon).iconPMap.baseAddr = NULL ;
|
||||
HUnlock((Handle)icon) ;
|
||||
SetGWorld(saveWorld,saveHandle);
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
PicHandle wxMacCreatePict(GWorldPtr wp, GWorldPtr mask)
|
||||
{
|
||||
CGrafPtr origPort ;
|
||||
GDHandle origDev ;
|
||||
CGrafPtr origPort ;
|
||||
GDHandle origDev ;
|
||||
|
||||
PicHandle pict; // this is the Picture we give back
|
||||
PicHandle pict;
|
||||
|
||||
RGBColor gray = { 0xCCCC ,0xCCCC , 0xCCCC } ;
|
||||
RGBColor white = { 0xffff ,0xffff , 0xffff } ;
|
||||
RGBColor black = { 0x0000 ,0x0000 , 0x0000 } ;
|
||||
RGBColor white = { 0xffff ,0xffff , 0xffff } ;
|
||||
RGBColor black = { 0x0000 ,0x0000 , 0x0000 } ;
|
||||
|
||||
unsigned char *maskimage = NULL ;
|
||||
Rect portRect ;
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
int width = portRect.right - portRect.left ;
|
||||
int height = portRect.bottom - portRect.top ;
|
||||
GetGWorld( &origPort , &origDev ) ;
|
||||
|
||||
LockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
GetGWorld( &origPort , &origDev ) ;
|
||||
RgnHandle clipRgn = NULL ;
|
||||
|
||||
if ( mask )
|
||||
{
|
||||
maskimage = (unsigned char*) malloc( width * height ) ;
|
||||
SetGWorld( mask , NULL ) ;
|
||||
LockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
for ( int y = 0 ; y < height ; y++ )
|
||||
{
|
||||
for( int x = 0 ; x < width ; x++ )
|
||||
{
|
||||
RGBColor col ;
|
||||
if ( mask )
|
||||
{
|
||||
clipRgn = NewRgn() ;
|
||||
LockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( mask ) ) ;
|
||||
UnlockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
}
|
||||
|
||||
SetGWorld( wp , NULL ) ;
|
||||
Rect portRect ;
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
|
||||
GetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
maskimage[y*width + x] = ( col.red == 0 ) ; // for monochrome masks
|
||||
}
|
||||
}
|
||||
UnlockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
}
|
||||
pict = OpenPicture(&portRect);
|
||||
if(pict)
|
||||
{
|
||||
RGBForeColor( &black ) ;
|
||||
RGBBackColor( &white ) ;
|
||||
|
||||
SetGWorld( wp , NULL ) ;
|
||||
|
||||
pict = OpenPicture(&portRect); // open a picture, this disables drawing
|
||||
if(!pict)
|
||||
return NULL;
|
||||
|
||||
if ( maskimage )
|
||||
{
|
||||
RGBForeColor( &black ) ;
|
||||
RGBBackColor( &white ) ;
|
||||
PenMode(transparent);
|
||||
|
||||
for ( int y = 0 ; y < height ; ++y )
|
||||
{
|
||||
for( int x = 0 ; x < width ; ++x )
|
||||
{
|
||||
if ( maskimage[y*width + x] )
|
||||
{
|
||||
RGBColor col ;
|
||||
|
||||
GetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
SetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
}
|
||||
else {
|
||||
// With transparency set this sets a blank pixel not a white one
|
||||
SetCPixel( x + portRect.left , y + portRect.top , &white);
|
||||
}
|
||||
}
|
||||
}
|
||||
free( maskimage ) ;
|
||||
maskimage = NULL ;
|
||||
}
|
||||
else
|
||||
{
|
||||
RGBBackColor( &gray ) ;
|
||||
EraseRect(&portRect);
|
||||
RGBForeColor( &black ) ;
|
||||
RGBBackColor( &white ) ;
|
||||
|
||||
CopyBits(GetPortBitMapForCopyBits(wp), /* src PixMap - we copy image over
|
||||
* itself - */
|
||||
GetPortBitMapForCopyBits(wp), // dst PixMap - no drawing occurs
|
||||
&portRect, // srcRect - it will be recorded and compressed -
|
||||
&portRect, // dstRect - into the picture that is open -
|
||||
srcCopy,NULL); // copyMode and no clip region
|
||||
}
|
||||
ClosePicture(); // We are done recording the picture
|
||||
UnlockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
|
||||
return pict; // return our groovy pict handle
|
||||
LockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
CopyBits(GetPortBitMapForCopyBits(wp),
|
||||
GetPortBitMapForCopyBits(wp),
|
||||
&portRect,
|
||||
&portRect,
|
||||
srcCopy,clipRgn);
|
||||
UnlockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
ClosePicture();
|
||||
}
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
return pict;
|
||||
}
|
||||
|
||||
wxBitmapRefData::wxBitmapRefData()
|
||||
|
@ -21,8 +21,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
|
||||
#endif
|
||||
|
||||
#include "wx/mac/uma.h"
|
||||
|
||||
PicHandle MakePict(GWorldPtr wp, GWorldPtr mask ) ;
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||
const wxPoint& pos,
|
||||
@ -58,7 +57,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 ,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 ,
|
||||
kControlBehaviorOffsetContents +
|
||||
( bmap->m_bitmapType == kMacBitmapTypeIcon ? kControlContentCIconHandle : kControlContentPictHandle ) , 0,
|
||||
(( style & wxBU_AUTODRAW ) ? kControlBevelButtonSmallBevelProc : kControlBevelButtonNormalBevelProc ), (long) this ) ;
|
||||
@ -70,19 +69,22 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
||||
if ( m_buttonBitmap.Ok() )
|
||||
{
|
||||
if ( bmap->m_bitmapType == kMacBitmapTypePict ) {
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld )
|
||||
{
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
if ( m_buttonBitmap.GetMask() )
|
||||
{
|
||||
info.u.picture = MakePict( bmap->m_hBitmap , m_buttonBitmap.GetMask()->GetMaskBitmap() ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , m_buttonBitmap.GetMask()->GetMaskBitmap() ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.u.picture = MakePict( bmap->m_hBitmap , NULL ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , NULL ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeIcon )
|
||||
@ -92,7 +94,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
||||
}
|
||||
}
|
||||
|
||||
UMASetControlData( m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
::SetControlData( m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
||||
@ -107,21 +109,23 @@ void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
|
||||
if ( m_buttonBitmap.Ok() )
|
||||
{
|
||||
wxBitmapRefData * bmap = (wxBitmapRefData*) ( m_buttonBitmap.GetRefData()) ;
|
||||
if ( bmap->m_bitmapType == kMacBitmapTypePict )
|
||||
{
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
if ( bmap->m_bitmapType == kMacBitmapTypePict ) {
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld )
|
||||
{
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
if ( m_buttonBitmap.GetMask() )
|
||||
{
|
||||
info.u.picture = MakePict( bmap->m_hBitmap , m_buttonBitmap.GetMask()->GetMaskBitmap() ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , m_buttonBitmap.GetMask()->GetMaskBitmap() ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.u.picture = MakePict( bmap->m_hBitmap , NULL ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , NULL ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeIcon )
|
||||
@ -129,8 +133,9 @@ void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = bmap->m_hIcon ;
|
||||
}
|
||||
|
||||
|
||||
UMASetControlData( m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
::SetControlData( m_macControl , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlPushButtonProc , (long) this ) ;
|
||||
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
|
||||
|
||||
@ -58,32 +58,19 @@ void wxButton::SetDefault()
|
||||
panel->SetDefaultItem(this);
|
||||
}
|
||||
|
||||
#ifdef __DARWIN__
|
||||
Boolean inData;
|
||||
if ( btnOldDefault && btnOldDefault->m_macControl )
|
||||
{
|
||||
inData = 0;
|
||||
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
|
||||
::SetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
|
||||
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
|
||||
}
|
||||
if ( m_macControl )
|
||||
{
|
||||
inData = 1;
|
||||
UMASetControlData( m_macControl , kControlButtonPart ,
|
||||
::SetControlData( m_macControl , kControlButtonPart ,
|
||||
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
|
||||
}
|
||||
#else
|
||||
if ( btnOldDefault && btnOldDefault->m_macControl )
|
||||
{
|
||||
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
|
||||
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
|
||||
}
|
||||
if ( m_macControl )
|
||||
{
|
||||
UMASetControlData( m_macControl , kControlButtonPart ,
|
||||
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
wxSize wxButton::DoGetBestSize() const
|
||||
|
@ -36,7 +36,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlCheckBoxProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -45,7 +45,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0 ,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0 ,
|
||||
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
|
||||
|
||||
m_macPopUpMenuHandle = NewUniqueMenu() ;
|
||||
|
@ -47,7 +47,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0,
|
||||
kControlPopupButtonProc , (long) this ) ;
|
||||
|
||||
m_macPopUpMenuHandle = NewUniqueMenu() ;
|
||||
|
@ -111,7 +111,7 @@ wxControl::~wxControl()
|
||||
}
|
||||
if ( m_macControl )
|
||||
{
|
||||
UMADisposeControl( m_macControl ) ;
|
||||
::DisposeControl( m_macControl ) ;
|
||||
m_macControl = NULL ;
|
||||
}
|
||||
}
|
||||
@ -146,7 +146,7 @@ wxSize wxControl::DoGetBestSize() const
|
||||
Rect bestsize = { 0 , 0 , 0 , 0 } ;
|
||||
short baselineoffset ;
|
||||
int bestWidth, bestHeight ;
|
||||
UMAGetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
|
||||
::GetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
|
||||
|
||||
if ( EmptyRect( &bestsize ) )
|
||||
{
|
||||
@ -297,7 +297,7 @@ void wxControl::MacPostControlCreate()
|
||||
controlstyle.flags = kControlUseFontMask ;
|
||||
controlstyle.font = kControlFontSmallBoldSystemFont ;
|
||||
|
||||
::UMASetControlFontStyle( m_macControl , &controlstyle ) ;
|
||||
::SetControlFontStyle( m_macControl , &controlstyle ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -305,11 +305,11 @@ void wxControl::MacPostControlCreate()
|
||||
controlstyle.flags = kControlUseFontMask ;
|
||||
controlstyle.font = kControlFontSmallSystemFont ;
|
||||
|
||||
::UMASetControlFontStyle( m_macControl , &controlstyle ) ;
|
||||
::SetControlFontStyle( m_macControl , &controlstyle ) ;
|
||||
}
|
||||
ControlHandle container = GetParent()->MacGetContainerForEmbedding() ;
|
||||
wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
|
||||
::UMAEmbedControl( m_macControl , container ) ;
|
||||
::EmbedControl( m_macControl , container ) ;
|
||||
m_macControlIsShown = true ;
|
||||
|
||||
wxAssociateControlWithMacControl( m_macControl , this ) ;
|
||||
@ -342,7 +342,7 @@ void wxControl::MacAdjustControlRect()
|
||||
Rect bestsize = { 0 , 0 , 0 , 0 } ;
|
||||
short baselineoffset ;
|
||||
|
||||
UMAGetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
|
||||
::GetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
|
||||
|
||||
if ( EmptyRect( &bestsize ) )
|
||||
{
|
||||
@ -415,7 +415,7 @@ void wxControl::MacSuperChangedPosition()
|
||||
|
||||
WindowRef rootwindow = GetMacRootWindow() ;
|
||||
wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
wxMacDrawingHelper focus( wxrootwindow ) ;
|
||||
|
||||
if ( mac_x != former_mac_x || mac_y != former_mac_y )
|
||||
@ -435,7 +435,7 @@ void wxControl::MacSuperChangedPosition()
|
||||
}
|
||||
else
|
||||
{
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -484,7 +484,7 @@ void wxControl::MacSuperShown( bool show )
|
||||
{
|
||||
if ( m_macControlIsShown )
|
||||
{
|
||||
::UMAHideControl( m_macControl ) ;
|
||||
::HideControl( m_macControl ) ;
|
||||
m_macControlIsShown = false ;
|
||||
}
|
||||
}
|
||||
@ -619,7 +619,7 @@ void wxControl::DoSetSize(int x, int y,
|
||||
wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
|
||||
wxMacDrawingHelper focus( wxrootwindow );
|
||||
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
// Update window at old and new positions
|
||||
SetRect(&newbounds, m_x, m_y, m_x + m_width, m_y + m_height);
|
||||
InvalWindowRect( rootwindow , &oldbounds );
|
||||
@ -629,7 +629,7 @@ void wxControl::DoSetSize(int x, int y,
|
||||
|
||||
if ( !wxrootwindow->IsKindOf( CLASSINFO( wxDialog ) ) )
|
||||
{
|
||||
UMASetThemeWindowBackground( rootwindow, kThemeBrushDocumentWindowBackground, false );
|
||||
::SetThemeWindowBackground( rootwindow, kThemeBrushDocumentWindowBackground, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -645,7 +645,7 @@ bool wxControl::Show(bool show)
|
||||
{
|
||||
if ( m_macControlIsShown )
|
||||
{
|
||||
::UMAHideControl( m_macControl ) ;
|
||||
::HideControl( m_macControl ) ;
|
||||
m_macControlIsShown = false ;
|
||||
}
|
||||
}
|
||||
@ -707,7 +707,7 @@ void wxControl::MacRedrawControl()
|
||||
{
|
||||
if( parent->MacGetWindowData() )
|
||||
{
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
@ -722,7 +722,7 @@ void wxControl::MacRedrawControl()
|
||||
}
|
||||
|
||||
UMADrawControl( m_macControl ) ;
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -747,7 +747,7 @@ void wxControl::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
if( parent->MacGetWindowData() )
|
||||
{
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
@ -762,7 +762,7 @@ void wxControl::OnPaint(wxPaintEvent& event)
|
||||
}
|
||||
|
||||
UMADrawControl( m_macControl ) ;
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -791,7 +791,7 @@ void wxControl::OnKeyDown( wxKeyEvent &event )
|
||||
keychar = short(ev->message & charCodeMask);
|
||||
keycode = short(ev->message & keyCodeMask) >> 8 ;
|
||||
|
||||
UMAHandleControlKey( m_macControl , keycode , keychar , ev->modifiers ) ;
|
||||
::HandleControlKey( m_macControl , keycode , keychar , ev->modifiers ) ;
|
||||
}
|
||||
|
||||
void wxControl::OnMouseEvent( wxMouseEvent &event )
|
||||
@ -848,13 +848,13 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
||||
SetFocus() ;
|
||||
}
|
||||
*/
|
||||
if ( control && UMAIsControlActive( control ) )
|
||||
if ( control && ::IsControlActive( control ) )
|
||||
{
|
||||
{
|
||||
if ( controlpart == kControlIndicatorPart && !UMAHasAppearance() )
|
||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
|
||||
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
|
||||
else
|
||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||
wxTheApp->s_lastMouseDown = 0 ;
|
||||
if ( control && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) )
|
||||
&& (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
|
||||
|
@ -93,7 +93,7 @@ NavEventProc(
|
||||
}
|
||||
}
|
||||
|
||||
char * gfilters[] =
|
||||
const char * gfilters[] =
|
||||
{
|
||||
"*.TXT" ,
|
||||
"*.TIF" ,
|
||||
|
@ -41,7 +41,7 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , range,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , range,
|
||||
kControlProgressBarProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -99,10 +99,10 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
#else
|
||||
long result ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false ,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false ,
|
||||
kwxMacListWithVerticalScrollbar , 0 , 0,
|
||||
kControlListBoxProc , (long) this ) ;
|
||||
UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
|
||||
::GetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
|
||||
sizeof( ListHandle ) , (char*) &m_macList , &result ) ;
|
||||
|
||||
HLock( (Handle) m_macList ) ;
|
||||
@ -664,7 +664,7 @@ void wxListBox::MacHandleControlClick( ControlHandle control , SInt16 controlpar
|
||||
Boolean wasDoubleClick = false ;
|
||||
long result ;
|
||||
|
||||
UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxDoubleClickTag , sizeof( wasDoubleClick ) , (char*) &wasDoubleClick , &result ) ;
|
||||
::GetControlData( m_macControl , kControlNoPart , kControlListBoxDoubleClickTag , sizeof( wasDoubleClick ) , (char*) &wasDoubleClick , &result ) ;
|
||||
if ( !wasDoubleClick )
|
||||
{
|
||||
MacDoClick() ;
|
||||
|
@ -71,7 +71,7 @@ void wxMenu::Init()
|
||||
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_title , false );
|
||||
m_macMenuId = s_macNextMenuId++;
|
||||
wxCHECK_RET( s_macNextMenuId < 236 , "menu ids > 235 cannot be used for submenus on mac" );
|
||||
m_hMenu = UMANewMenu(m_macMenuId, label);
|
||||
m_hMenu = ::NewMenu(m_macMenuId, label);
|
||||
|
||||
if ( !m_hMenu )
|
||||
{
|
||||
@ -89,7 +89,7 @@ void wxMenu::Init()
|
||||
wxMenu::~wxMenu()
|
||||
{
|
||||
if (m_hMenu)
|
||||
UMADisposeMenu(m_hMenu);
|
||||
::DisposeMenu(m_hMenu);
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
// delete accels
|
||||
@ -183,7 +183,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
||||
|
||||
if (wxMenuBar::MacGetInstalledMenuBar() == m_menuBar)
|
||||
{
|
||||
UMAInsertMenu( pSubMenu->m_hMenu , -1 ) ;
|
||||
::InsertMenu( pSubMenu->m_hMenu , -1 ) ;
|
||||
}
|
||||
|
||||
if ( pos == (size_t)-1 )
|
||||
@ -683,7 +683,7 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
}
|
||||
if ( item->GetId() == wxApp::s_macAboutMenuItemId )
|
||||
{
|
||||
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||
::SetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 );
|
||||
}
|
||||
else
|
||||
@ -707,7 +707,7 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
subMenu = item->GetSubMenu() ;
|
||||
if (subMenu)
|
||||
{
|
||||
UMAInsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||
::InsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -717,12 +717,12 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
UInt8 modifiers ;
|
||||
SInt16 key ;
|
||||
wxMenuItem::MacBuildMenuString( label, &key , &modifiers , item->GetText(), item->GetId() != wxApp::s_macAboutMenuItemId); // no shortcut in about menu
|
||||
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||
::SetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
UMAInsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||
::InsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
@ -735,13 +735,13 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
subMenu = item->GetSubMenu() ;
|
||||
if (subMenu)
|
||||
{
|
||||
UMAInsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||
::InsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||
}
|
||||
}
|
||||
UMAInsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||
::InsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||
}
|
||||
}
|
||||
UMADrawMenuBar() ;
|
||||
::DrawMenuBar() ;
|
||||
|
||||
s_macInstalledMenuBar = this;
|
||||
}
|
||||
@ -816,18 +816,18 @@ wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
|
||||
{
|
||||
if (s_macInstalledMenuBar == this)
|
||||
{
|
||||
UMADeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ;
|
||||
::DeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ;
|
||||
{
|
||||
Str255 label;
|
||||
wxMenuItem::MacBuildMenuString( label, NULL , NULL , title , false );
|
||||
UMASetMenuTitle( menu->GetHMenu() , label ) ;
|
||||
if ( pos == m_menus.GetCount() - 1)
|
||||
{
|
||||
UMAInsertMenu( menu->GetHMenu() , 0 ) ;
|
||||
::InsertMenu( menu->GetHMenu() , 0 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
UMAInsertMenu( menu->GetHMenu() , m_menus[pos+1]->MacGetMenuId() ) ;
|
||||
::InsertMenu( menu->GetHMenu() , m_menus[pos+1]->MacGetMenuId() ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ void wxMenuItem::SetText(const wxString& text)
|
||||
{
|
||||
Str255 label;
|
||||
MacBuildMenuString( label , NULL , NULL , text ,false);
|
||||
UMASetMenuItemText( m_parentMenu->GetHMenu() , index , label ) ; // checkmark
|
||||
::SetMenuItemText( m_parentMenu->GetHMenu() , index , label ) ; // checkmark
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ bool wxNotebook::Create(wxWindow *parent,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlTabSmallProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -117,7 +117,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, val , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlGroupBoxTextTitleProc , (long) this ) ;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
|
@ -35,7 +35,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlRadioButtonProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -43,7 +43,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 100,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 100,
|
||||
kControlScrollBarLiveProc , (long) this ) ;
|
||||
|
||||
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
|
||||
|
@ -84,7 +84,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
||||
}
|
||||
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow(), &bounds, title, false,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow(), &bounds, title, false,
|
||||
value, minValue, maxValue, procID, (long) this);
|
||||
|
||||
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
|
||||
|
@ -49,7 +49,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 100,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 100,
|
||||
kControlLittleArrowsProc , (long) this ) ;
|
||||
|
||||
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
|
||||
|
@ -43,7 +43,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlGroupBoxTextTitleProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -54,7 +54,7 @@ bool wxStaticLine::Create( wxWindow *parent,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlSeparatorLineProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -41,7 +41,7 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlTabSmallProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -19,6 +19,7 @@
|
||||
#include "wx/toolbar.h"
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/tabctrl.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxToolBarBase)
|
||||
@ -160,90 +161,6 @@ wxToolBar::~wxToolBar()
|
||||
// is not - otherwise toolbar leaves a hole in the place it used to occupy
|
||||
}
|
||||
|
||||
PicHandle MakePict(GWorldPtr wp, GWorldPtr mask ) ;
|
||||
PicHandle MakePict(GWorldPtr wp, GWorldPtr mask )
|
||||
{
|
||||
CGrafPtr origPort ;
|
||||
GDHandle origDev ;
|
||||
|
||||
PicHandle pict; // this is the Picture we give back
|
||||
|
||||
RGBColor gray = { 0xCCCC ,0xCCCC , 0xCCCC } ;
|
||||
RGBColor white = { 0xffff ,0xffff , 0xffff } ;
|
||||
RGBColor black = { 0x0000 ,0x0000 , 0x0000 } ;
|
||||
|
||||
unsigned char *maskimage = NULL ;
|
||||
Rect portRect ;
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
int width = portRect.right - portRect.left ;
|
||||
int height = portRect.bottom - portRect.top ;
|
||||
|
||||
LockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
GetGWorld( &origPort , &origDev ) ;
|
||||
|
||||
if ( mask )
|
||||
{
|
||||
|
||||
maskimage = (unsigned char*) malloc( width * height ) ;
|
||||
SetGWorld( mask , NULL ) ;
|
||||
LockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
for ( int y = 0 ; y < height ; ++y )
|
||||
{
|
||||
for( int x = 0 ; x < width ; ++x )
|
||||
{
|
||||
RGBColor col ;
|
||||
|
||||
GetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
maskimage[y*width + x] = ( col.red == 0 ) ; // for monochrome masks
|
||||
}
|
||||
}
|
||||
UnlockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
}
|
||||
|
||||
SetGWorld( wp , NULL ) ;
|
||||
|
||||
pict = OpenPicture(&portRect); // open a picture, this disables drawing
|
||||
if(!pict)
|
||||
return NULL;
|
||||
|
||||
RGBBackColor( &gray ) ;
|
||||
RGBForeColor( &black ) ;
|
||||
EraseRect(&portRect) ;
|
||||
RGBBackColor( &white ) ;
|
||||
|
||||
if ( maskimage )
|
||||
{
|
||||
for ( int y = 0 ; y < height ; ++y )
|
||||
{
|
||||
for( int x = 0 ; x < width ; ++x )
|
||||
{
|
||||
if ( maskimage[y*width + x] )
|
||||
{
|
||||
RGBColor col ;
|
||||
|
||||
GetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
SetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
free( maskimage ) ;
|
||||
maskimage = NULL ;
|
||||
}
|
||||
else
|
||||
{
|
||||
CopyBits(GetPortBitMapForCopyBits(wp), // src PixMap - we copy image over itself -
|
||||
GetPortBitMapForCopyBits(wp), // dst PixMap - no drawing occurs -
|
||||
&portRect, // srcRect - it will be recorded and compressed -
|
||||
&portRect, // dstRect - into the picture that is open -
|
||||
srcCopy,NULL); // copyMode and no clip region
|
||||
|
||||
}
|
||||
ClosePicture(); // We are done recording the picture
|
||||
UnlockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
return pict; // return our groovy pict handle
|
||||
}
|
||||
|
||||
bool wxToolBar::Realize()
|
||||
{
|
||||
if (m_tools.Number() == 0)
|
||||
@ -284,20 +201,27 @@ bool wxToolBar::Realize()
|
||||
toolrect.right = toolrect.left + toolSize.x ;
|
||||
toolrect.bottom = toolrect.top + toolSize.y ;
|
||||
|
||||
PicHandle icon = NULL ;
|
||||
ControlButtonContentInfo info ;
|
||||
if ( bmap )
|
||||
{
|
||||
if ( bmap->m_bitmapType == kMacBitmapTypePict )
|
||||
icon = bmap->m_hPict ;
|
||||
{
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld )
|
||||
{
|
||||
if ( tool->GetBitmap1().GetMask() )
|
||||
{
|
||||
icon = MakePict( bmap->m_hBitmap , tool->GetBitmap1().GetMask()->GetMaskBitmap() ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , tool->GetBitmap1().GetMask()->GetMaskBitmap() ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
icon = MakePict( bmap->m_hBitmap , NULL ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , NULL ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -308,20 +232,16 @@ bool wxToolBar::Realize()
|
||||
if ( tool->CanBeToggled() )
|
||||
behaviour += kControlBehaviorToggles ;
|
||||
|
||||
if ( icon )
|
||||
if ( info.u.cIconHandle ) // since it is a handle we can use one of them
|
||||
{
|
||||
m_macToolHandle = UMANewControl( window , &toolrect , "\p" , false , 0 ,
|
||||
behaviour + kControlContentPictHandle , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ;
|
||||
ControlButtonContentInfo info ;
|
||||
m_macToolHandle = ::NewControl( window , &toolrect , "\p" , false , 0 ,
|
||||
behaviour + info.contentType , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ;
|
||||
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = icon ;
|
||||
|
||||
UMASetControlData( m_macToolHandle , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
::SetControlData( m_macToolHandle , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_macToolHandle = UMANewControl( window , &toolrect , "\p" , false , 0 ,
|
||||
m_macToolHandle = ::NewControl( window , &toolrect , "\p" , false , 0 ,
|
||||
behaviour , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ;
|
||||
}
|
||||
UMAShowControl( m_macToolHandle ) ;
|
||||
@ -335,10 +255,16 @@ bool wxToolBar::Realize()
|
||||
{
|
||||
::SetControlValue( m_macToolHandle , 1 ) ;
|
||||
}
|
||||
UMASetControlFontStyle( m_macToolHandle , &controlstyle ) ;
|
||||
else
|
||||
{
|
||||
::SetControlValue( m_macToolHandle , 0 ) ;
|
||||
}
|
||||
/*
|
||||
::SetControlFontStyle( m_macToolHandle , &controlstyle ) ;
|
||||
*/
|
||||
ControlHandle container = GetParent()->MacGetContainerForEmbedding() ;
|
||||
wxASSERT_MSG( container != NULL , "No valid mac container control" ) ;
|
||||
UMAEmbedControl( m_macToolHandle , container ) ;
|
||||
::EmbedControl( m_macToolHandle , container ) ;
|
||||
|
||||
x += (int)toolSize.x;
|
||||
noButtons ++;
|
||||
@ -458,7 +384,7 @@ void wxToolBar::MacSuperChangedPosition()
|
||||
{
|
||||
WindowRef rootwindow = GetMacRootWindow() ;
|
||||
wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
wxMacDrawingHelper focus( wxrootwindow ) ;
|
||||
while (node)
|
||||
{
|
||||
@ -515,7 +441,7 @@ void wxToolBar::MacSuperChangedPosition()
|
||||
}
|
||||
else
|
||||
{
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -647,7 +573,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
if( parent->MacGetWindowData() )
|
||||
{
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
@ -675,7 +601,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event)
|
||||
}
|
||||
}
|
||||
}
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -718,13 +644,13 @@ void wxToolBar::OnMouse( wxMouseEvent &event )
|
||||
|
||||
controlpart = FindControl( localwhere , window , &control ) ;
|
||||
{
|
||||
if ( control && UMAIsControlActive( control ) )
|
||||
if ( control && ::IsControlActive( control ) )
|
||||
{
|
||||
{
|
||||
if ( controlpart == kControlIndicatorPart && !UMAHasAppearance() )
|
||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
|
||||
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
|
||||
else
|
||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||
wxTheApp->s_lastMouseDown = 0 ;
|
||||
if ( controlpart && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) )
|
||||
&& (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
|
||||
|
@ -271,12 +271,12 @@ void wxMacToolTip::Draw()
|
||||
NULL);
|
||||
|
||||
ClosePicture();
|
||||
RGBColor yellow = { 0xFFFF , 0xFFFF , (153<<8)+153 } ;
|
||||
RGBBackColor( &yellow ) ;
|
||||
EraseRect( &m_rect ) ;
|
||||
PenNormal() ;
|
||||
SetThemeBackground(kThemeBrushNotificationWindowBackground,32,true) ;
|
||||
BackColor( yellowColor ) ;
|
||||
ForeColor(magentaColor ) ;
|
||||
// EraseRect( &m_rect ) ;
|
||||
FrameRect( &m_rect ) ;
|
||||
BackColor( whiteColor ) ;
|
||||
ForeColor(blackColor ) ;
|
||||
::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder);
|
||||
|
||||
i = 0 ;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -774,8 +774,8 @@ bool wxWindowMac::Show(bool show)
|
||||
{
|
||||
if (show)
|
||||
{
|
||||
UMAShowWindow( m_macWindowData->m_macWindow ) ;
|
||||
UMASelectWindow( m_macWindowData->m_macWindow ) ;
|
||||
::ShowWindow( m_macWindowData->m_macWindow ) ;
|
||||
::SelectWindow( m_macWindowData->m_macWindow ) ;
|
||||
// no need to generate events here, they will get them triggered by macos
|
||||
// actually they should be , but apparently they are not
|
||||
wxSize size(m_width, m_height);
|
||||
@ -785,7 +785,7 @@ bool wxWindowMac::Show(bool show)
|
||||
}
|
||||
else
|
||||
{
|
||||
UMAHideWindow( m_macWindowData->m_macWindow ) ;
|
||||
::HideWindow( m_macWindowData->m_macWindow ) ;
|
||||
}
|
||||
}
|
||||
MacSuperShown( show ) ;
|
||||
@ -1179,7 +1179,7 @@ void wxWindowMac::MacCreateRealWindow( const wxString& title,
|
||||
attr |= kWindowCloseBoxAttribute ;
|
||||
}
|
||||
|
||||
UMACreateNewWindow( wclass , attr , &theBoundsRect , &m_macWindowData->m_macWindow ) ;
|
||||
::CreateNewWindow( wclass , attr , &theBoundsRect , &m_macWindowData->m_macWindow ) ;
|
||||
wxAssociateWinWithMacWindow( m_macWindowData->m_macWindow , this ) ;
|
||||
wxString label ;
|
||||
if( wxApp::s_macDefaultEncodingIsPC )
|
||||
@ -1187,7 +1187,7 @@ void wxWindowMac::MacCreateRealWindow( const wxString& title,
|
||||
else
|
||||
label = title ;
|
||||
UMASetWTitleC( m_macWindowData->m_macWindow , label ) ;
|
||||
UMACreateRootControl( m_macWindowData->m_macWindow , &m_macWindowData->m_macRootControl ) ;
|
||||
::CreateRootControl( m_macWindowData->m_macWindow , &m_macWindowData->m_macRootControl ) ;
|
||||
|
||||
m_macWindowData->m_macFocus = NULL ;
|
||||
m_macWindowData->m_macHasReceivedFirstActivate = true ;
|
||||
@ -1496,7 +1496,7 @@ void wxWindowMac::Clear()
|
||||
int w ,h ;
|
||||
wxPoint origin = GetClientAreaOrigin() ;
|
||||
GetClientSize( &w , &h ) ;
|
||||
UMASetThemeWindowBackground( m_macWindowData->m_macWindow , m_macWindowData->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( m_macWindowData->m_macWindow , m_macWindowData->m_macWindowBackgroundTheme , false ) ;
|
||||
Rect r = { origin.y , origin.x, origin.y+h , origin.x+w } ;
|
||||
EraseRect( &r ) ;
|
||||
}
|
||||
@ -1543,7 +1543,7 @@ void wxWindowMac::Raise()
|
||||
{
|
||||
if ( m_macWindowData )
|
||||
{
|
||||
UMABringToFront( m_macWindowData->m_macWindow ) ;
|
||||
::BringToFront( m_macWindowData->m_macWindow ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1552,7 +1552,7 @@ void wxWindowMac::Lower()
|
||||
{
|
||||
if ( m_macWindowData )
|
||||
{
|
||||
UMASendBehind( m_macWindowData->m_macWindow , NULL ) ;
|
||||
::SendBehind( m_macWindowData->m_macWindow , NULL ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1848,7 +1848,7 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time)
|
||||
eraseBackground = true ;
|
||||
if ( m_backgroundColour == wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE) )
|
||||
{
|
||||
UMASetThemeWindowBackground( window , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
::SetThemeWindowBackground( window , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
}
|
||||
else if ( m_backgroundColour == wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE ) )
|
||||
{
|
||||
@ -1880,7 +1880,7 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time)
|
||||
{
|
||||
Rect box ;
|
||||
GetRegionBounds( updatergn , &box) ;
|
||||
UMAApplyThemeBackground(kThemeBackgroundTabPane, &box , kThemeStateActive,8,true);
|
||||
::ApplyThemeBackground(kThemeBackgroundTabPane, &box , kThemeStateActive,8,true);
|
||||
break ;
|
||||
}
|
||||
}
|
||||
@ -1894,7 +1894,7 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time)
|
||||
if ( !parent )
|
||||
{
|
||||
// if there is nothing special -> use default
|
||||
UMASetThemeWindowBackground( window , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( window , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2233,7 +2233,7 @@ bool wxWindowMac::MacSetPortDrawingParams( const Point & localOrigin, const Rect
|
||||
Pattern whiteColor ;
|
||||
|
||||
::BackPat( GetQDGlobalsWhite( &whiteColor) ) ;
|
||||
::UMASetThemeWindowBackground( win->m_macWindowData->m_macWindow , win->m_macWindowData->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( win->m_macWindowData->m_macWindow , win->m_macWindowData->m_macWindowBackgroundTheme , false ) ;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlCheckBoxProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -45,7 +45,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0 ,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0 ,
|
||||
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
|
||||
|
||||
m_macPopUpMenuHandle = NewUniqueMenu() ;
|
||||
|
@ -47,7 +47,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , -12345 , 0,
|
||||
kControlPopupButtonProc , (long) this ) ;
|
||||
|
||||
m_macPopUpMenuHandle = NewUniqueMenu() ;
|
||||
|
@ -111,7 +111,7 @@ wxControl::~wxControl()
|
||||
}
|
||||
if ( m_macControl )
|
||||
{
|
||||
UMADisposeControl( m_macControl ) ;
|
||||
::DisposeControl( m_macControl ) ;
|
||||
m_macControl = NULL ;
|
||||
}
|
||||
}
|
||||
@ -146,7 +146,7 @@ wxSize wxControl::DoGetBestSize() const
|
||||
Rect bestsize = { 0 , 0 , 0 , 0 } ;
|
||||
short baselineoffset ;
|
||||
int bestWidth, bestHeight ;
|
||||
UMAGetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
|
||||
::GetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
|
||||
|
||||
if ( EmptyRect( &bestsize ) )
|
||||
{
|
||||
@ -297,7 +297,7 @@ void wxControl::MacPostControlCreate()
|
||||
controlstyle.flags = kControlUseFontMask ;
|
||||
controlstyle.font = kControlFontSmallBoldSystemFont ;
|
||||
|
||||
::UMASetControlFontStyle( m_macControl , &controlstyle ) ;
|
||||
::SetControlFontStyle( m_macControl , &controlstyle ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -305,11 +305,11 @@ void wxControl::MacPostControlCreate()
|
||||
controlstyle.flags = kControlUseFontMask ;
|
||||
controlstyle.font = kControlFontSmallSystemFont ;
|
||||
|
||||
::UMASetControlFontStyle( m_macControl , &controlstyle ) ;
|
||||
::SetControlFontStyle( m_macControl , &controlstyle ) ;
|
||||
}
|
||||
ControlHandle container = GetParent()->MacGetContainerForEmbedding() ;
|
||||
wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
|
||||
::UMAEmbedControl( m_macControl , container ) ;
|
||||
::EmbedControl( m_macControl , container ) ;
|
||||
m_macControlIsShown = true ;
|
||||
|
||||
wxAssociateControlWithMacControl( m_macControl , this ) ;
|
||||
@ -342,7 +342,7 @@ void wxControl::MacAdjustControlRect()
|
||||
Rect bestsize = { 0 , 0 , 0 , 0 } ;
|
||||
short baselineoffset ;
|
||||
|
||||
UMAGetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
|
||||
::GetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
|
||||
|
||||
if ( EmptyRect( &bestsize ) )
|
||||
{
|
||||
@ -415,7 +415,7 @@ void wxControl::MacSuperChangedPosition()
|
||||
|
||||
WindowRef rootwindow = GetMacRootWindow() ;
|
||||
wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
wxMacDrawingHelper focus( wxrootwindow ) ;
|
||||
|
||||
if ( mac_x != former_mac_x || mac_y != former_mac_y )
|
||||
@ -435,7 +435,7 @@ void wxControl::MacSuperChangedPosition()
|
||||
}
|
||||
else
|
||||
{
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -484,7 +484,7 @@ void wxControl::MacSuperShown( bool show )
|
||||
{
|
||||
if ( m_macControlIsShown )
|
||||
{
|
||||
::UMAHideControl( m_macControl ) ;
|
||||
::HideControl( m_macControl ) ;
|
||||
m_macControlIsShown = false ;
|
||||
}
|
||||
}
|
||||
@ -619,7 +619,7 @@ void wxControl::DoSetSize(int x, int y,
|
||||
wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
|
||||
wxMacDrawingHelper focus( wxrootwindow );
|
||||
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
// Update window at old and new positions
|
||||
SetRect(&newbounds, m_x, m_y, m_x + m_width, m_y + m_height);
|
||||
InvalWindowRect( rootwindow , &oldbounds );
|
||||
@ -629,7 +629,7 @@ void wxControl::DoSetSize(int x, int y,
|
||||
|
||||
if ( !wxrootwindow->IsKindOf( CLASSINFO( wxDialog ) ) )
|
||||
{
|
||||
UMASetThemeWindowBackground( rootwindow, kThemeBrushDocumentWindowBackground, false );
|
||||
::SetThemeWindowBackground( rootwindow, kThemeBrushDocumentWindowBackground, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -645,7 +645,7 @@ bool wxControl::Show(bool show)
|
||||
{
|
||||
if ( m_macControlIsShown )
|
||||
{
|
||||
::UMAHideControl( m_macControl ) ;
|
||||
::HideControl( m_macControl ) ;
|
||||
m_macControlIsShown = false ;
|
||||
}
|
||||
}
|
||||
@ -707,7 +707,7 @@ void wxControl::MacRedrawControl()
|
||||
{
|
||||
if( parent->MacGetWindowData() )
|
||||
{
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
@ -722,7 +722,7 @@ void wxControl::MacRedrawControl()
|
||||
}
|
||||
|
||||
UMADrawControl( m_macControl ) ;
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -747,7 +747,7 @@ void wxControl::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
if( parent->MacGetWindowData() )
|
||||
{
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
@ -762,7 +762,7 @@ void wxControl::OnPaint(wxPaintEvent& event)
|
||||
}
|
||||
|
||||
UMADrawControl( m_macControl ) ;
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -791,7 +791,7 @@ void wxControl::OnKeyDown( wxKeyEvent &event )
|
||||
keychar = short(ev->message & charCodeMask);
|
||||
keycode = short(ev->message & keyCodeMask) >> 8 ;
|
||||
|
||||
UMAHandleControlKey( m_macControl , keycode , keychar , ev->modifiers ) ;
|
||||
::HandleControlKey( m_macControl , keycode , keychar , ev->modifiers ) ;
|
||||
}
|
||||
|
||||
void wxControl::OnMouseEvent( wxMouseEvent &event )
|
||||
@ -848,13 +848,13 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
||||
SetFocus() ;
|
||||
}
|
||||
*/
|
||||
if ( control && UMAIsControlActive( control ) )
|
||||
if ( control && ::IsControlActive( control ) )
|
||||
{
|
||||
{
|
||||
if ( controlpart == kControlIndicatorPart && !UMAHasAppearance() )
|
||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
|
||||
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
|
||||
else
|
||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||
wxTheApp->s_lastMouseDown = 0 ;
|
||||
if ( control && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) )
|
||||
&& (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
|
||||
|
@ -93,7 +93,7 @@ NavEventProc(
|
||||
}
|
||||
}
|
||||
|
||||
char * gfilters[] =
|
||||
const char * gfilters[] =
|
||||
{
|
||||
"*.TXT" ,
|
||||
"*.TIF" ,
|
||||
|
@ -41,7 +41,7 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , range,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , range,
|
||||
kControlProgressBarProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
Binary file not shown.
@ -99,10 +99,10 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
#else
|
||||
long result ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false ,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false ,
|
||||
kwxMacListWithVerticalScrollbar , 0 , 0,
|
||||
kControlListBoxProc , (long) this ) ;
|
||||
UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
|
||||
::GetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
|
||||
sizeof( ListHandle ) , (char*) &m_macList , &result ) ;
|
||||
|
||||
HLock( (Handle) m_macList ) ;
|
||||
@ -664,7 +664,7 @@ void wxListBox::MacHandleControlClick( ControlHandle control , SInt16 controlpar
|
||||
Boolean wasDoubleClick = false ;
|
||||
long result ;
|
||||
|
||||
UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxDoubleClickTag , sizeof( wasDoubleClick ) , (char*) &wasDoubleClick , &result ) ;
|
||||
::GetControlData( m_macControl , kControlNoPart , kControlListBoxDoubleClickTag , sizeof( wasDoubleClick ) , (char*) &wasDoubleClick , &result ) ;
|
||||
if ( !wasDoubleClick )
|
||||
{
|
||||
MacDoClick() ;
|
||||
|
@ -71,7 +71,7 @@ void wxMenu::Init()
|
||||
wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_title , false );
|
||||
m_macMenuId = s_macNextMenuId++;
|
||||
wxCHECK_RET( s_macNextMenuId < 236 , "menu ids > 235 cannot be used for submenus on mac" );
|
||||
m_hMenu = UMANewMenu(m_macMenuId, label);
|
||||
m_hMenu = ::NewMenu(m_macMenuId, label);
|
||||
|
||||
if ( !m_hMenu )
|
||||
{
|
||||
@ -89,7 +89,7 @@ void wxMenu::Init()
|
||||
wxMenu::~wxMenu()
|
||||
{
|
||||
if (m_hMenu)
|
||||
UMADisposeMenu(m_hMenu);
|
||||
::DisposeMenu(m_hMenu);
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
// delete accels
|
||||
@ -183,7 +183,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
||||
|
||||
if (wxMenuBar::MacGetInstalledMenuBar() == m_menuBar)
|
||||
{
|
||||
UMAInsertMenu( pSubMenu->m_hMenu , -1 ) ;
|
||||
::InsertMenu( pSubMenu->m_hMenu , -1 ) ;
|
||||
}
|
||||
|
||||
if ( pos == (size_t)-1 )
|
||||
@ -683,7 +683,7 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
}
|
||||
if ( item->GetId() == wxApp::s_macAboutMenuItemId )
|
||||
{
|
||||
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||
::SetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 );
|
||||
}
|
||||
else
|
||||
@ -707,7 +707,7 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
subMenu = item->GetSubMenu() ;
|
||||
if (subMenu)
|
||||
{
|
||||
UMAInsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||
::InsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -717,12 +717,12 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
UInt8 modifiers ;
|
||||
SInt16 key ;
|
||||
wxMenuItem::MacBuildMenuString( label, &key , &modifiers , item->GetText(), item->GetId() != wxApp::s_macAboutMenuItemId); // no shortcut in about menu
|
||||
UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||
::SetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , label );
|
||||
UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
UMAInsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||
::InsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
@ -735,13 +735,13 @@ void wxMenuBar::MacInstallMenuBar()
|
||||
subMenu = item->GetSubMenu() ;
|
||||
if (subMenu)
|
||||
{
|
||||
UMAInsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||
::InsertMenu( subMenu->GetHMenu() , -1 ) ;
|
||||
}
|
||||
}
|
||||
UMAInsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||
::InsertMenu(m_menus[i]->GetHMenu(), 0);
|
||||
}
|
||||
}
|
||||
UMADrawMenuBar() ;
|
||||
::DrawMenuBar() ;
|
||||
|
||||
s_macInstalledMenuBar = this;
|
||||
}
|
||||
@ -816,18 +816,18 @@ wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
|
||||
{
|
||||
if (s_macInstalledMenuBar == this)
|
||||
{
|
||||
UMADeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ;
|
||||
::DeleteMenu( menuOld->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ;
|
||||
{
|
||||
Str255 label;
|
||||
wxMenuItem::MacBuildMenuString( label, NULL , NULL , title , false );
|
||||
UMASetMenuTitle( menu->GetHMenu() , label ) ;
|
||||
if ( pos == m_menus.GetCount() - 1)
|
||||
{
|
||||
UMAInsertMenu( menu->GetHMenu() , 0 ) ;
|
||||
::InsertMenu( menu->GetHMenu() , 0 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
UMAInsertMenu( menu->GetHMenu() , m_menus[pos+1]->MacGetMenuId() ) ;
|
||||
::InsertMenu( menu->GetHMenu() , m_menus[pos+1]->MacGetMenuId() ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ void wxMenuItem::SetText(const wxString& text)
|
||||
{
|
||||
Str255 label;
|
||||
MacBuildMenuString( label , NULL , NULL , text ,false);
|
||||
UMASetMenuItemText( m_parentMenu->GetHMenu() , index , label ) ; // checkmark
|
||||
::SetMenuItemText( m_parentMenu->GetHMenu() , index , label ) ; // checkmark
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ bool wxNotebook::Create(wxWindow *parent,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlTabSmallProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -117,7 +117,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, val , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlGroupBoxTextTitleProc , (long) this ) ;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
|
@ -35,7 +35,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlRadioButtonProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -43,7 +43,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 100,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 100,
|
||||
kControlScrollBarLiveProc , (long) this ) ;
|
||||
|
||||
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
|
||||
|
@ -84,7 +84,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
||||
}
|
||||
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow(), &bounds, title, false,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow(), &bounds, title, false,
|
||||
value, minValue, maxValue, procID, (long) this);
|
||||
|
||||
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
|
||||
|
@ -49,7 +49,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 100,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 100,
|
||||
kControlLittleArrowsProc , (long) this ) ;
|
||||
|
||||
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
|
||||
|
@ -43,7 +43,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
MacPreControlCreate( parent , id , label , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlGroupBoxTextTitleProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -54,7 +54,7 @@ bool wxStaticLine::Create( wxWindow *parent,
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlSeparatorLineProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
@ -41,7 +41,7 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons
|
||||
|
||||
MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
|
||||
|
||||
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1,
|
||||
kControlTabSmallProc , (long) this ) ;
|
||||
|
||||
MacPostControlCreate() ;
|
||||
|
1839
src/mac/textctrl.cpp
1839
src/mac/textctrl.cpp
File diff suppressed because it is too large
Load Diff
@ -19,6 +19,7 @@
|
||||
#include "wx/toolbar.h"
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/tabctrl.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxToolBarBase)
|
||||
@ -160,90 +161,6 @@ wxToolBar::~wxToolBar()
|
||||
// is not - otherwise toolbar leaves a hole in the place it used to occupy
|
||||
}
|
||||
|
||||
PicHandle MakePict(GWorldPtr wp, GWorldPtr mask ) ;
|
||||
PicHandle MakePict(GWorldPtr wp, GWorldPtr mask )
|
||||
{
|
||||
CGrafPtr origPort ;
|
||||
GDHandle origDev ;
|
||||
|
||||
PicHandle pict; // this is the Picture we give back
|
||||
|
||||
RGBColor gray = { 0xCCCC ,0xCCCC , 0xCCCC } ;
|
||||
RGBColor white = { 0xffff ,0xffff , 0xffff } ;
|
||||
RGBColor black = { 0x0000 ,0x0000 , 0x0000 } ;
|
||||
|
||||
unsigned char *maskimage = NULL ;
|
||||
Rect portRect ;
|
||||
GetPortBounds( wp , &portRect ) ;
|
||||
int width = portRect.right - portRect.left ;
|
||||
int height = portRect.bottom - portRect.top ;
|
||||
|
||||
LockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
GetGWorld( &origPort , &origDev ) ;
|
||||
|
||||
if ( mask )
|
||||
{
|
||||
|
||||
maskimage = (unsigned char*) malloc( width * height ) ;
|
||||
SetGWorld( mask , NULL ) ;
|
||||
LockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
for ( int y = 0 ; y < height ; ++y )
|
||||
{
|
||||
for( int x = 0 ; x < width ; ++x )
|
||||
{
|
||||
RGBColor col ;
|
||||
|
||||
GetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
maskimage[y*width + x] = ( col.red == 0 ) ; // for monochrome masks
|
||||
}
|
||||
}
|
||||
UnlockPixels( GetGWorldPixMap( mask ) ) ;
|
||||
}
|
||||
|
||||
SetGWorld( wp , NULL ) ;
|
||||
|
||||
pict = OpenPicture(&portRect); // open a picture, this disables drawing
|
||||
if(!pict)
|
||||
return NULL;
|
||||
|
||||
RGBBackColor( &gray ) ;
|
||||
RGBForeColor( &black ) ;
|
||||
EraseRect(&portRect) ;
|
||||
RGBBackColor( &white ) ;
|
||||
|
||||
if ( maskimage )
|
||||
{
|
||||
for ( int y = 0 ; y < height ; ++y )
|
||||
{
|
||||
for( int x = 0 ; x < width ; ++x )
|
||||
{
|
||||
if ( maskimage[y*width + x] )
|
||||
{
|
||||
RGBColor col ;
|
||||
|
||||
GetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
SetCPixel( x + portRect.left , y + portRect.top , &col ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
free( maskimage ) ;
|
||||
maskimage = NULL ;
|
||||
}
|
||||
else
|
||||
{
|
||||
CopyBits(GetPortBitMapForCopyBits(wp), // src PixMap - we copy image over itself -
|
||||
GetPortBitMapForCopyBits(wp), // dst PixMap - no drawing occurs -
|
||||
&portRect, // srcRect - it will be recorded and compressed -
|
||||
&portRect, // dstRect - into the picture that is open -
|
||||
srcCopy,NULL); // copyMode and no clip region
|
||||
|
||||
}
|
||||
ClosePicture(); // We are done recording the picture
|
||||
UnlockPixels( GetGWorldPixMap( wp ) ) ;
|
||||
SetGWorld( origPort , origDev ) ;
|
||||
return pict; // return our groovy pict handle
|
||||
}
|
||||
|
||||
bool wxToolBar::Realize()
|
||||
{
|
||||
if (m_tools.Number() == 0)
|
||||
@ -284,20 +201,27 @@ bool wxToolBar::Realize()
|
||||
toolrect.right = toolrect.left + toolSize.x ;
|
||||
toolrect.bottom = toolrect.top + toolSize.y ;
|
||||
|
||||
PicHandle icon = NULL ;
|
||||
ControlButtonContentInfo info ;
|
||||
if ( bmap )
|
||||
{
|
||||
if ( bmap->m_bitmapType == kMacBitmapTypePict )
|
||||
icon = bmap->m_hPict ;
|
||||
{
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = bmap->m_hPict ;
|
||||
}
|
||||
else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld )
|
||||
{
|
||||
if ( tool->GetBitmap1().GetMask() )
|
||||
{
|
||||
icon = MakePict( bmap->m_hBitmap , tool->GetBitmap1().GetMask()->GetMaskBitmap() ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , tool->GetBitmap1().GetMask()->GetMaskBitmap() ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
icon = MakePict( bmap->m_hBitmap , NULL ) ;
|
||||
info.contentType = kControlContentCIconHandle ;
|
||||
info.u.cIconHandle = wxMacCreateCIcon( bmap->m_hBitmap , NULL ,
|
||||
8 , 16 ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -308,20 +232,16 @@ bool wxToolBar::Realize()
|
||||
if ( tool->CanBeToggled() )
|
||||
behaviour += kControlBehaviorToggles ;
|
||||
|
||||
if ( icon )
|
||||
if ( info.u.cIconHandle ) // since it is a handle we can use one of them
|
||||
{
|
||||
m_macToolHandle = UMANewControl( window , &toolrect , "\p" , false , 0 ,
|
||||
behaviour + kControlContentPictHandle , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ;
|
||||
ControlButtonContentInfo info ;
|
||||
m_macToolHandle = ::NewControl( window , &toolrect , "\p" , false , 0 ,
|
||||
behaviour + info.contentType , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ;
|
||||
|
||||
info.contentType = kControlContentPictHandle ;
|
||||
info.u.picture = icon ;
|
||||
|
||||
UMASetControlData( m_macToolHandle , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
::SetControlData( m_macToolHandle , kControlButtonPart , kControlBevelButtonContentTag , sizeof(info) , (char*) &info ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_macToolHandle = UMANewControl( window , &toolrect , "\p" , false , 0 ,
|
||||
m_macToolHandle = ::NewControl( window , &toolrect , "\p" , false , 0 ,
|
||||
behaviour , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ;
|
||||
}
|
||||
UMAShowControl( m_macToolHandle ) ;
|
||||
@ -335,10 +255,16 @@ bool wxToolBar::Realize()
|
||||
{
|
||||
::SetControlValue( m_macToolHandle , 1 ) ;
|
||||
}
|
||||
UMASetControlFontStyle( m_macToolHandle , &controlstyle ) ;
|
||||
else
|
||||
{
|
||||
::SetControlValue( m_macToolHandle , 0 ) ;
|
||||
}
|
||||
/*
|
||||
::SetControlFontStyle( m_macToolHandle , &controlstyle ) ;
|
||||
*/
|
||||
ControlHandle container = GetParent()->MacGetContainerForEmbedding() ;
|
||||
wxASSERT_MSG( container != NULL , "No valid mac container control" ) ;
|
||||
UMAEmbedControl( m_macToolHandle , container ) ;
|
||||
::EmbedControl( m_macToolHandle , container ) ;
|
||||
|
||||
x += (int)toolSize.x;
|
||||
noButtons ++;
|
||||
@ -458,7 +384,7 @@ void wxToolBar::MacSuperChangedPosition()
|
||||
{
|
||||
WindowRef rootwindow = GetMacRootWindow() ;
|
||||
wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
wxMacDrawingHelper focus( wxrootwindow ) ;
|
||||
while (node)
|
||||
{
|
||||
@ -515,7 +441,7 @@ void wxToolBar::MacSuperChangedPosition()
|
||||
}
|
||||
else
|
||||
{
|
||||
UMASetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
::SetThemeWindowBackground( rootwindow , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -647,7 +573,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
if( parent->MacGetWindowData() )
|
||||
{
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
@ -675,7 +601,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event)
|
||||
}
|
||||
}
|
||||
}
|
||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -718,13 +644,13 @@ void wxToolBar::OnMouse( wxMouseEvent &event )
|
||||
|
||||
controlpart = FindControl( localwhere , window , &control ) ;
|
||||
{
|
||||
if ( control && UMAIsControlActive( control ) )
|
||||
if ( control && ::IsControlActive( control ) )
|
||||
{
|
||||
{
|
||||
if ( controlpart == kControlIndicatorPart && !UMAHasAppearance() )
|
||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
|
||||
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ;
|
||||
else
|
||||
controlpart = UMAHandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
|
||||
wxTheApp->s_lastMouseDown = 0 ;
|
||||
if ( controlpart && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) )
|
||||
&& (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice
|
||||
|
@ -271,12 +271,12 @@ void wxMacToolTip::Draw()
|
||||
NULL);
|
||||
|
||||
ClosePicture();
|
||||
RGBColor yellow = { 0xFFFF , 0xFFFF , (153<<8)+153 } ;
|
||||
RGBBackColor( &yellow ) ;
|
||||
EraseRect( &m_rect ) ;
|
||||
PenNormal() ;
|
||||
SetThemeBackground(kThemeBrushNotificationWindowBackground,32,true) ;
|
||||
BackColor( yellowColor ) ;
|
||||
ForeColor(magentaColor ) ;
|
||||
// EraseRect( &m_rect ) ;
|
||||
FrameRect( &m_rect ) ;
|
||||
BackColor( whiteColor ) ;
|
||||
ForeColor(blackColor ) ;
|
||||
::MoveTo( m_rect.left + kTipBorder , m_rect.top + fontInfo.ascent + kTipBorder);
|
||||
|
||||
i = 0 ;
|
||||
|
1052
src/mac/uma.cpp
1052
src/mac/uma.cpp
File diff suppressed because it is too large
Load Diff
@ -774,8 +774,8 @@ bool wxWindowMac::Show(bool show)
|
||||
{
|
||||
if (show)
|
||||
{
|
||||
UMAShowWindow( m_macWindowData->m_macWindow ) ;
|
||||
UMASelectWindow( m_macWindowData->m_macWindow ) ;
|
||||
::ShowWindow( m_macWindowData->m_macWindow ) ;
|
||||
::SelectWindow( m_macWindowData->m_macWindow ) ;
|
||||
// no need to generate events here, they will get them triggered by macos
|
||||
// actually they should be , but apparently they are not
|
||||
wxSize size(m_width, m_height);
|
||||
@ -785,7 +785,7 @@ bool wxWindowMac::Show(bool show)
|
||||
}
|
||||
else
|
||||
{
|
||||
UMAHideWindow( m_macWindowData->m_macWindow ) ;
|
||||
::HideWindow( m_macWindowData->m_macWindow ) ;
|
||||
}
|
||||
}
|
||||
MacSuperShown( show ) ;
|
||||
@ -1179,7 +1179,7 @@ void wxWindowMac::MacCreateRealWindow( const wxString& title,
|
||||
attr |= kWindowCloseBoxAttribute ;
|
||||
}
|
||||
|
||||
UMACreateNewWindow( wclass , attr , &theBoundsRect , &m_macWindowData->m_macWindow ) ;
|
||||
::CreateNewWindow( wclass , attr , &theBoundsRect , &m_macWindowData->m_macWindow ) ;
|
||||
wxAssociateWinWithMacWindow( m_macWindowData->m_macWindow , this ) ;
|
||||
wxString label ;
|
||||
if( wxApp::s_macDefaultEncodingIsPC )
|
||||
@ -1187,7 +1187,7 @@ void wxWindowMac::MacCreateRealWindow( const wxString& title,
|
||||
else
|
||||
label = title ;
|
||||
UMASetWTitleC( m_macWindowData->m_macWindow , label ) ;
|
||||
UMACreateRootControl( m_macWindowData->m_macWindow , &m_macWindowData->m_macRootControl ) ;
|
||||
::CreateRootControl( m_macWindowData->m_macWindow , &m_macWindowData->m_macRootControl ) ;
|
||||
|
||||
m_macWindowData->m_macFocus = NULL ;
|
||||
m_macWindowData->m_macHasReceivedFirstActivate = true ;
|
||||
@ -1496,7 +1496,7 @@ void wxWindowMac::Clear()
|
||||
int w ,h ;
|
||||
wxPoint origin = GetClientAreaOrigin() ;
|
||||
GetClientSize( &w , &h ) ;
|
||||
UMASetThemeWindowBackground( m_macWindowData->m_macWindow , m_macWindowData->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( m_macWindowData->m_macWindow , m_macWindowData->m_macWindowBackgroundTheme , false ) ;
|
||||
Rect r = { origin.y , origin.x, origin.y+h , origin.x+w } ;
|
||||
EraseRect( &r ) ;
|
||||
}
|
||||
@ -1543,7 +1543,7 @@ void wxWindowMac::Raise()
|
||||
{
|
||||
if ( m_macWindowData )
|
||||
{
|
||||
UMABringToFront( m_macWindowData->m_macWindow ) ;
|
||||
::BringToFront( m_macWindowData->m_macWindow ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1552,7 +1552,7 @@ void wxWindowMac::Lower()
|
||||
{
|
||||
if ( m_macWindowData )
|
||||
{
|
||||
UMASendBehind( m_macWindowData->m_macWindow , NULL ) ;
|
||||
::SendBehind( m_macWindowData->m_macWindow , NULL ) ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1848,7 +1848,7 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time)
|
||||
eraseBackground = true ;
|
||||
if ( m_backgroundColour == wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE) )
|
||||
{
|
||||
UMASetThemeWindowBackground( window , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
::SetThemeWindowBackground( window , kThemeBrushDocumentWindowBackground , false ) ;
|
||||
}
|
||||
else if ( m_backgroundColour == wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE ) )
|
||||
{
|
||||
@ -1880,7 +1880,7 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time)
|
||||
{
|
||||
Rect box ;
|
||||
GetRegionBounds( updatergn , &box) ;
|
||||
UMAApplyThemeBackground(kThemeBackgroundTabPane, &box , kThemeStateActive,8,true);
|
||||
::ApplyThemeBackground(kThemeBackgroundTabPane, &box , kThemeStateActive,8,true);
|
||||
break ;
|
||||
}
|
||||
}
|
||||
@ -1894,7 +1894,7 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time)
|
||||
if ( !parent )
|
||||
{
|
||||
// if there is nothing special -> use default
|
||||
UMASetThemeWindowBackground( window , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
::SetThemeWindowBackground( window , kThemeBrushDialogBackgroundActive , false ) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2233,7 +2233,7 @@ bool wxWindowMac::MacSetPortDrawingParams( const Point & localOrigin, const Rect
|
||||
Pattern whiteColor ;
|
||||
|
||||
::BackPat( GetQDGlobalsWhite( &whiteColor) ) ;
|
||||
::UMASetThemeWindowBackground( win->m_macWindowData->m_macWindow , win->m_macWindowData->m_macWindowBackgroundTheme , false ) ;
|
||||
::SetThemeWindowBackground( win->m_macWindowData->m_macWindow , win->m_macWindowData->m_macWindowBackgroundTheme , false ) ;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user