/////////////////////////////////////////////////////////////////////////////
-// Name: src/osx/carbon/toolbar.cpp
+// Name: src/osx/cocoa/toolbar.mm
// Purpose: wxToolBar
// Author: Stefan Csomor
// Modified by:
// Created: 04/01/98
-// RCS-ID: $Id: toolbar.cpp 54954 2008-08-03 11:27:03Z VZ $
+// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
- (id)initWithItemIdentifier: (NSString*) identifier
{
- [super initWithItemIdentifier:identifier];
+ self = [super initWithItemIdentifier:identifier];
impl = NULL;
[self setTarget: self];
[self setAction: @selector(clickedAction:)];
- (id)initWithFrame:(NSRect)frame
{
- [super initWithFrame:frame];
+ self = [super initWithFrame:frame];
impl = NULL;
[self setTarget: self];
[self setAction: @selector(clickedAction:)];
[tlw setToolbar:(NSToolbar*) m_macToolbar];
[(NSToolbar*) m_macToolbar setVisible:YES];
- m_peer->Move(0,0,0,0 );
+ GetPeer()->Move(0,0,0,0 );
SetSize( wxSIZE_AUTO_WIDTH, 0 );
- m_peer->SetVisibility( false );
+ GetPeer()->SetVisibility( false );
wxToolBarBase::Show( false );
}
}
bResult = true;
[(NSToolbar*) m_macToolbar setVisible:NO];
MacUninstallNativeToolbar();
- m_peer->SetVisibility( true );
+ GetPeer()->SetVisibility( true );
}
}
// find the maximum tool width and height
// and the number of stretchable items
- unsigned numStretchableSpaces = 0;
+ int numStretchableSpaces = 0;
wxToolBarTool *tool;
wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
while ( node )
[v setButtonType: ( tool->CanBeToggled() ? NSToggleButton : NSMomentaryPushInButton )];
[v setImplementation:tool];
- if ( style & wxTB_NOICONS )
- [v setImagePosition:NSNoImage];
- else if ( style & wxTB_TEXT )
- [v setImagePosition:NSImageAbove];
- else
- [v setImagePosition:NSImageOnly];
-
-
controlHandle = v;
#if wxOSX_USE_NATIVE_TOOLBAR
tool->SetControlHandle( controlHandle );
tool->UpdateImages();
tool->UpdateLabel();
+
+ if ( style & wxTB_NOICONS )
+ [v setImagePosition:NSNoImage];
+ else if ( style & wxTB_TEXT )
+ [v setImagePosition:NSImageAbove];
+ else
+ [v setImagePosition:NSImageOnly];
[v sizeToFit];
#if 0