#pragma mark -
#pragma mark Tool Implementation
-#if wxOSX_USE_COCOA
-#define wxOSX_USE_NATIVE_TOOLBAR 1
-#endif
-
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
void UpdateLabel()
{
+#if wxOSX_USE_NATIVE_TOOLBAR
if ( m_toolbarItem )
{
// strip mnemonics from the label for compatibility with the usual
wxCFStringRef sh( GetShortHelp(), GetToolBarFontEncoding() );
[m_toolbarItem setToolTip:sh.AsNSString()];
}
+#endif
}
void Action()
#endif
};
+#if wxOSX_USE_NATIVE_TOOLBAR
+
@interface wxNSToolbarItem : NSToolbarItem
{
wxToolBarTool* impl;
@end
+#endif
+
@interface wxNSToolBarButton : NSButton
{
@end
+#if wxOSX_USE_NATIVE_TOOLBAR
+
@implementation wxNSToolbarItem
- (id)initWithItemIdentifier: (NSString*) identifier
- (NSToolbarItem*) toolbar:(NSToolbar*) toolbar itemForItemIdentifier:(NSString*) itemIdentifier willBeInsertedIntoToolbar:(BOOL) flag
{
+#ifdef __LP64__
+ wxToolBarTool* tool = (wxToolBarTool*) [itemIdentifier longLongValue];
+#else
wxToolBarTool* tool = (wxToolBarTool*) [itemIdentifier intValue];
+#endif
if ( tool )
{
wxNSToolbarItem* item = (wxNSToolbarItem*) tool->GetToolbarItemRef();
@end
+#endif
+
@implementation wxNSToolBarButton
- (id)initWithFrame:(NSRect)frame
}
}
}
- wxString identifier = wxString::Format( wxT("%d"), (int) tool );
+ wxString identifier = wxString::Format( wxT("%ld"), (long) tool );
wxCFStringRef cfidentifier(identifier);
[refTB insertItemWithItemIdentifier:cfidentifier.AsNSString() atIndex:currentPosition];
void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
{
- wxToolBarTool *tool = wx_static_cast( wxToolBarTool*, toolBase );
+ wxToolBarTool *tool = static_cast< wxToolBarTool*>(toolBase );
if (tool == NULL)
return false;
#if wxOSX_USE_NATIVE_TOOLBAR
if (m_macToolbar != NULL)
{
- wxString identifier = wxString::Format(wxT("%d"), (int) tool);
+ wxString identifier = wxString::Format(wxT("%ld"), (long) tool);
wxCFStringRef cfidentifier( identifier, wxFont::GetDefaultEncoding() );
wxNSToolbarItem* item = [[wxNSToolbarItem alloc] initWithItemIdentifier:cfidentifier.AsNSString() ];
[item setImplementation:tool];
WXWidget view = (WXWidget) tool->GetControl()->GetHandle() ;
wxCHECK_MSG( view, false, _T("control must be non-NULL") );
- wxString identifier = wxString::Format(wxT("%d"), (int) tool);
+ wxString identifier = wxString::Format(wxT("%ld"), (long) tool);
wxCFStringRef cfidentifier( identifier, wxFont::GetDefaultEncoding() );
wxNSToolbarItem* item = [[wxNSToolbarItem alloc] initWithItemIdentifier:cfidentifier.AsNSString() ];
[item setImplementation:tool];
bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolbase)
{
- wxToolBarTool* tool = wx_static_cast( wxToolBarTool*, toolbase );
+ wxToolBarTool* tool = static_cast< wxToolBarTool*>(toolbase );
wxToolBarToolsList::compatibility_iterator node;
for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
{