Dejo aunsin publicar la funcion de busquedas hasta que quede mas claro la mejor manera de inplementarla .
El código para la lcase :
Code: Select all
METHOD AddSeparator() INLINE AAdd( ::aButtons, TToolBarBtn():Separator( Self ) )
METHOD AddSpaceFlex() INLINE AAdd( ::aButtons, TToolBarBtn():Spaceflex( Self ) )
METHOD AddSpace() INLINE AAdd( ::aButtons, TToolBarBtn():Space( Self ) )
Code: Select all
METHOD SEPARATOR( oToolBar ) CLASS TToolBarBtn
::oToolBar = oToolBar
::hWnd = TBRADDSEPARATOR( oToolBar:hWnd, Len( oToolBar:aButtons ) )
return Self
METHOD SpaceFlex( oToolBar ) CLASS TToolBarBtn
::oToolBar = oToolBar
::hWnd = TBRAddSpaceFlex( oToolBar:hWnd, Len( oToolBar:aButtons ) )
return Self
METHOD Space( oToolBar ) CLASS TToolBarBtn
::oToolBar = oToolBar
::hWnd = TBRAddSpace( oToolBar:hWnd, Len( oToolBar:aButtons ) )
return Self
El codigo para toolbars.m
Code: Select all
HB_FUNC( TBRADDSEPARATOR )
{
ToolBar * toolbar = ( ToolBar * ) hb_parnl( 1 );
NSToolbarItem * item;
[ toolbar insertItemWithItemIdentifier : NSToolbarSeparatorItemIdentifier atIndex : hb_parnl( 2 ) ];
item = [ [ toolbar items ] objectAtIndex : hb_parnl( 2 ) ];
hb_retnl( ( LONG ) item );
}
HB_FUNC( TBRADDSPACEFLEX )
{
ToolBar * toolbar = ( ToolBar * ) hb_parnl( 1 );
NSToolbarItem * item;
[ toolbar insertItemWithItemIdentifier : NSToolbarFlexibleSpaceItemIdentifier atIndex : hb_parnl( 2 ) ];
item = [ [ toolbar items ] objectAtIndex : hb_parnl( 2 ) ];
hb_retnl( ( LONG ) item );
}
HB_FUNC( TBRADDSPACE )
{
ToolBar * toolbar = ( ToolBar * ) hb_parnl( 1 );
NSToolbarItem * item;
[ toolbar insertItemWithItemIdentifier : NSToolbarSpaceItemIdentifier atIndex : hb_parnl( 2 ) ];
item = [ [ toolbar items ] objectAtIndex : hb_parnl( 2 ) ];
hb_retnl( ( LONG ) item );
}