+#if !TARGET_CARBON
+
#include <wx/mac/uma.h>
#include <wx/mac/aga.h>
#include <extcdef.h>
}
}
}
+ else
+ {
+ ::HiliteControl( inControl , 255 ) ;
+ }
}
void AGAActivateControl( ControlHandle inControl )
}
}
}
+ else
+ {
+ ::HiliteControl( inControl , 0 ) ;
+ }
}
OSErr AGASetKeyboardFocus (WindowPtr inWindow,
DisposeHandle( info->children ) ;
info->children = NULL ;
free( (void*) (**theControl).contrlRfCon ) ;
+ (**theControl).contrlRfCon = NULL ;
}
}
}
::RGBBackColor( &fontstyle->backColor ) ;
} ;
-class AGAPortHelper
-{
-public :
- AGAPortHelper()
- {
- GetPenState( &oldPenState ) ;
- GetBackColor( &oldBackColor ) ;
- GetForeColor( &oldForeColor ) ;
-
- GetPort( &port ) ;
- clip = NewRgn() ;
- GetClip( clip );
- font = port->txFont;
- size = port->txSize;
- style = port->txFace;
- mode = port->txMode;
-
- }
- ~AGAPortHelper()
- {
- SetPort( port ) ;
- SetClip( clip ) ;
- DisposeRgn( clip ) ;
- RGBForeColor(&oldForeColor);
- RGBBackColor(&oldBackColor);
- SetPenState(&oldPenState);
-
- TextFont( font );
- TextSize( size );
- TextFace( style );
- TextMode( mode );
- }
-
-private :
- GrafPtr port ;
- PenState oldPenState ;
- RGBColor oldForeColor ;
- RGBColor oldBackColor ;
- RgnHandle clip ;
- short font ;
- short size ;
- short style ;
- short mode ;
-} ;
-
pascal SInt32 AGAProgressBarDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param)
{
switch( message )
return 0 ;
{
- AGAPortHelper help() ;
+ AGAPortHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
Boolean mRadioBehavior = false ;
return 0 ;
{
- AGAPortHelper help() ;
+ AGAPortHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
Boolean mRadioBehavior = false ;
return 0 ;
{
- AGAPortHelper help() ;
+ AGAPortHelper help((**theControl).contrlOwner) ;
Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ;
{
bool disabled = false ;
bool hasColor = true ;
- AGAPortHelper help() ;
+ AGAPortHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
FontInfo fi ;
::GetFontInfo( &fi ) ;
return 0 ;
{
- AGAPortHelper help() ;
+ AGAPortHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
int x = (**theControl).contrlRect.left ;
int y = (**theControl).contrlRect.top ;
{
case initCntl :
{
- AGAPortHelper help() ;
+ AGAPortHelper help((**theControl).contrlOwner) ;
SetPort( (**theControl).contrlOwner ) ;
::TextFont( kFontIDGeneva ) ;
::TextSize( 10 ) ;
break ;
case drawCntl :
{
- AGAPortHelper help() ;
+ AGAPortHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
SetPort( (**theControl).contrlOwner ) ;
RGBBackColor( &gAGARamp[ kAGAWhite ] ) ;
break ;
case kControlMsgKeyDown :
{
- AGAPortHelper help() ;
+ AGAPortHelper help( (**theControl).contrlOwner ) ;
AGASetFontStyle( &info->fontStyle ) ;
- SetPort( (**theControl).contrlOwner ) ;
RGBBackColor( &gAGARamp[ kAGAWhite ] ) ;
RGBForeColor( &gAGARamp[ kAGABlack ] ) ;
ControlKeyDownRec * rec = (ControlKeyDownRec*) param ;
break ;
case drawCntl :
{
- AGAPortHelper help() ;
+ AGAPortHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
RGBBackColor( &gAGARamp[ kAGAWhite ] ) ;
EraseRect( &(**theControl).contrlRect ) ;
SetPort( port ) ;
}
+void AGAApplyThemeBackground(ThemeBackgroundKind inKind,
+ const Rect * bounds,
+ ThemeDrawState inState,
+ SInt16 inDepth,
+ Boolean inColorDev)
+{
+}
+
+#endif
+AGAPortHelper::AGAPortHelper( GrafPtr newport)
+{
+ GetPort( &port ) ;
+ SetPort( newport ) ;
+// wxASSERT( newport->portRect.left == 0 && newport->portRect.top == 0 ) ;
+ GetPenState( &oldPenState ) ;
+ GetBackColor( &oldBackColor ) ;
+ GetForeColor( &oldForeColor ) ;
+
+ clip = NewRgn() ;
+ GetClip( clip );
+ font = GetPortTextFont( newport);
+ size = GetPortTextSize( newport);
+ style = GetPortTextFace( newport);
+ mode = GetPortTextMode( newport);
+ nport = newport ;
+
+}
+AGAPortHelper::AGAPortHelper()
+{
+ clip = NULL ;
+}
+void AGAPortHelper::Setup( GrafPtr newport )
+{
+ GetPort( &port ) ;
+ SetPort( newport ) ;
+// wxASSERT( newport->portRect.left == 0 && newport->portRect.top == 0 ) ;
+ GetPenState( &oldPenState ) ;
+ GetBackColor( &oldBackColor ) ;
+ GetForeColor( &oldForeColor ) ;
+
+ clip = NewRgn() ;
+ GetClip( clip );
+ font = GetPortTextFont( newport);
+ size = GetPortTextSize( newport);
+ style = GetPortTextFace( newport);
+ mode = GetPortTextMode( newport);
+ nport = newport ;
+}
+void AGAPortHelper::Clear()
+{
+ if ( clip )
+ {
+ DisposeRgn( clip ) ;
+ clip = NULL ;
+ }
+}
+AGAPortHelper::~AGAPortHelper()
+{
+ if ( clip )
+ {
+ SetPort( nport ) ;
+ SetClip( clip ) ;
+ DisposeRgn( clip ) ;
+ RGBForeColor(&oldForeColor);
+ RGBBackColor(&oldBackColor);
+ SetPenState(&oldPenState);
+
+ TextFont( font );
+ TextSize( size );
+ TextFace( style );
+ TextMode( mode );
+ SetPort( port ) ;
+ }
+}