// menu manager
-MenuRef UMANewMenu( SInt16 id , const wxString& title )
+MenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding )
{
wxString str = wxStripMenuCodes( title ) ;
MenuRef menu ;
#if TARGET_CARBON
CreateNewMenu( id , 0 , &menu ) ;
- SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str) ) ;
+ SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding ) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
return menu ;
}
-void UMASetMenuTitle( MenuRef menu , const wxString& title )
+void UMASetMenuTitle( MenuRef menu , const wxString& title , wxFontEncoding encoding)
{
wxString str = wxStripMenuCodes( title ) ;
#if TARGET_CARBON
- SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str) ) ;
+ SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
#endif
}
-void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title )
+void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title , wxFontEncoding encoding)
{
wxString str = wxStripMenuCodes( title ) ;
#if TARGET_CARBON
- SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str) ) ;
+ SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str , encoding) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( str , ptitle ) ;
DisableMenuItem( inMenu , inItem ) ;
}
-void UMAAppendSubMenuItem( MenuRef menu , const wxString& title , SInt16 id )
+void UMAAppendSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , SInt16 id )
{
MacAppendMenu(menu, "\pA");
- UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title );
+ UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding );
SetMenuItemHierarchicalID( menu , CountMenuItems( menu ) , id ) ;
}
-void UMAInsertSubMenuItem( MenuRef menu , const wxString& title , MenuItemIndex item , SInt16 id )
+void UMAInsertSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , SInt16 id )
{
MacInsertMenuItem(menu, "\pA" , item);
- UMASetMenuItemText(menu, item , title );
+ UMASetMenuItemText(menu, item , title , encoding);
SetMenuItemHierarchicalID( menu , item , id ) ;
}
}
}
-void UMAAppendMenuItem( MenuRef menu , const wxString& title , wxAcceleratorEntry *entry )
+void UMAAppendMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , wxAcceleratorEntry *entry )
{
MacAppendMenu(menu, "\pA");
- UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title );
+ UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding );
UMASetMenuItemShortcut( menu , (SInt16) ::CountMenuItems(menu), entry ) ;
}
-void UMAInsertMenuItem( MenuRef menu , const wxString& title , MenuItemIndex item , wxAcceleratorEntry *entry )
+void UMAInsertMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , wxAcceleratorEntry *entry )
{
MacInsertMenuItem( menu , "\pA" , item) ;
- UMASetMenuItemText(menu, item+1 , title );
+ UMASetMenuItemText(menu, item+1 , title , encoding );
UMASetMenuItemShortcut( menu , item+1 , entry ) ;
}
DisposeWindow( inWindowRef ) ;
}
-void UMASetWTitle( WindowRef inWindowRef , const wxString& title )
+void UMASetWTitle( WindowRef inWindowRef , const wxString& title , wxFontEncoding encoding)
{
#if TARGET_CARBON
- SetWindowTitleWithCFString( inWindowRef , wxMacCFStringHolder(title) ) ;
+ SetWindowTitleWithCFString( inWindowRef , wxMacCFStringHolder(title , encoding) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( title , ptitle ) ;
#endif
}
-void UMAGetWTitleC( WindowRef inWindowRef , char *title )
-{
- GetWTitle( inWindowRef , (unsigned char*)title ) ;
-#if TARGET_CARBON
- p2cstrcpy( title, (unsigned char *)title ) ;
-#else
- p2cstr( (unsigned char*)title ) ;
-#endif
-}
-
// appearance additions
-void UMASetControlTitle( ControlHandle inControl , const wxString& title )
+void UMASetControlTitle( ControlHandle inControl , const wxString& title , wxFontEncoding encoding)
{
#if TARGET_CARBON
- SetControlTitleWithCFString( inControl , wxMacCFStringHolder(title) ) ;
+ SetControlTitleWithCFString( inControl , wxMacCFStringHolder(title , encoding) ) ;
#else
Str255 ptitle ;
wxMacStringToPascal( title , ptitle ) ;
void UMADrawControl( ControlHandle inControl )
{
WindowRef theWindow = GetControlOwner(inControl) ;
+ wxMacPortStateHelper help( (GrafPtr) GetWindowPort(theWindow) ) ;
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( theWindow , updateRgn ) ;
Point zero = { 0 , 0 } ;
// events
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{
+ wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) inWindow) ) ;
RgnHandle updateRgn = NewRgn() ;
GetWindowUpdateRgn( inWindow , updateRgn ) ;
{
GetPort( &m_oldPort ) ;
SetPort( newport ) ;
+ SetOrigin(0,0);
wxASSERT_MSG( m_clip == NULL , wxT("Cannot call setup twice") ) ;
m_clip = NewRgn() ;
GetClip( m_clip );