X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0b48f2651beaccb480cc0a6e5ba8e8b3cfa0346..3678169caab0f713415414dce013a638305f3cce:/src/osx/iphone/toolbar.mm?ds=sidebyside diff --git a/src/osx/iphone/toolbar.mm b/src/osx/iphone/toolbar.mm index 7ec0bac59c..dcfe1a9bda 100644 --- a/src/osx/iphone/toolbar.mm +++ b/src/osx/iphone/toolbar.mm @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/osx/carbon/toolbar.cpp +// Name: src/osx/iphone/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 ///////////////////////////////////////////////////////////////////////////// @@ -121,7 +121,12 @@ wxToolBarToolBase( UIBarButtonItemStyle style = UIBarButtonItemStylePlain; wxUIToolbar* toolbar = (wxUIToolbar*) tbar->GetHandle(); - if ( bmpNormal.Ok() ) + if ( id == wxID_SEPARATOR ) + { + [bui initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; + bui.width = 25.0f; + } + else if ( bmpNormal.IsOk() ) { [bui initWithImage:bmpNormal.GetUIImage() style:UIBarButtonItemStylePlain target:toolbar action:@selector(clickedAction:)]; @@ -213,7 +218,7 @@ bool wxToolBar::Create( long style, const wxString& name ) { - m_macIsUserPane = false ; + DontCreatePeer(); if ( !wxToolBarBase::Create( parent, id, pos, size, style, wxDefaultValidator, name ) ) return false; @@ -227,6 +232,7 @@ bool wxToolBar::Create( switch ( [[UIApplication sharedApplication] statusBarStyle] ) { +#ifdef __IPHONE_3_0 case UIStatusBarStyleBlackOpaque: toolbar.barStyle = UIBarStyleBlack; break; @@ -234,15 +240,16 @@ bool wxToolBar::Create( toolbar.barStyle = UIBarStyleBlack; toolbar.translucent = YES; break; +#endif default: toolbar.barStyle = UIBarStyleDefault; break; } m_macToolbar = toolbar; - m_peer = new wxWidgetIPhoneImpl( this, toolbar ); + SetPeer(new wxWidgetIPhoneImpl( this, toolbar )); MacPostControlCreate(pos, size) ; - NSLog(@"toolbar was created %@",toolbar); + return true; } wxToolBar::~wxToolBar() @@ -259,6 +266,18 @@ bool wxToolBar::Realize() return true; } +void wxToolBar::DoLayout() +{ + // TODO port back osx_cocoa layout solution +} + +void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags) +{ + wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags); + + DoLayout(); +} + void wxToolBar::SetToolBitmapSize(const wxSize& size) { m_defaultWidth = size.x;