HB_FUNC( IMGSETRESFILE )
{
NSImageView * image = ( NSImageView * ) hb_parnl( 1 );
NSString * string = [ [ [ NSString alloc ] initWithCString: ISCHAR( 2 ) ? hb_parc( 2 ) : "" ] autorelease ];
NSString *myImagePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/"+string];
[ image setImage : [ [ NSImage alloc ] initWithContentsOfFile : myImagePath ] ];
}
# FiveMac makefile sample (c) FiveTech Software 2007
# Use TABs instead of spaces
# just type make to build it
all : ./one.app/Contents/MacOS/one
./one.app/Contents/MacOS/one
reset
PRG_OBJS = ./one.o \
./two.o \
./three.o \
./one.app/Contents/MacOS/one : $(PRG_OBJS)
if [ ! -d one.app ]; then mkdir one.app; fi
if [ ! -d one.app/Contents ]; then mkdir one.app/Contents; fi
if [ ! -d one.app/Contents/MacOS ]; then mkdir one.app/Contents/MacOS; fi
gcc one.o two.o three.o -o ./one.app/Contents/MacOS/one -L./../lib -lfive -lfivec -L./../../harbour/lib -lhbdebug -lhbvm -lhbrtl -lhblang -lhbrdd -lhbrtl -lgtstd -lgttrm -lhbvm -lhbmacro -lhbpp -lrddntx -lrddcdx -lrddfpt -lhbsix -lhbcommon -framework Cocoa
./%.c : ./%.prg
./../../harbour/bin/harbour $< -o./$@ -n -I./../../harbour/include -I./../include
./%.o : ./%.c
gcc -c -o $@ -I./../../harbour/include $<
#xcommand @ <nRow>, <nCol> RESIMAGE [ <oImg> ] ;
[ OF <oWnd> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FILENAME <cFileName> ] ;
=> ;
[ <oImg> := ] TImage():New( <nRow>, <nCol>, <nWidth>, <nHeight>, [<oWnd>],;
[<cFileName>] , .t. )
METHOD SetResfile(cFileName) INLINE ImgSetresFile( ::hWnd , cFileName )
METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, cFileName, lres ) CLASS TImage
DEFAULT nWidth := 100, nHeight := 100
DEFAULT lres:= .f.
::hWnd = ImgCreate( nTop, nLeft, nWidth, nHeight, oWnd:hWnd )
::oWnd = oWnd
if lres
if ! Empty( cFileName )
::SetresFile( cFileName )
endif
else
if ! Empty( cFileName ) .and. File( cFileName )
::SetFile( cFileName )
endif
endif
oWnd:AddControl( Self )
return Self
HB_FUNC( IMGSETRESFILE )
{
NSImageView * image = ( NSImageView * ) hb_parnl( 1 );
NSString * string = [ [ [ NSString alloc ] initWithCString: ISCHAR( 2 ) ? hb_parc( 2 ) : "" ] autorelease ];
NSString *myImagePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:string];
[ image setImage : [ [ NSImage alloc ] initWithContentsOfFile : myImagePath ] ];
}
HB_FUNC( RESPATH )
{
NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
hb_retc( [ bundlePath cStringUsingEncoding : NSASCIIStringEncoding ] );
}
HB_FUNC( APPPATH )
{
NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
NSString *secondParentPath = [[bundlePath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent];
hb_retc( [ secondParentPath cStringUsingEncoding : NSASCIIStringEncoding ] );
}
He estado corrigiendo el archivo makefile que viene en la distrbución con los nombres correctos de las librerias para que funcione . .
browse funcionando con la dbf dentro del contenedor y con su propio icono tambien en el contenedor
#xcommand @ <nRow>, <nCol> IMAGE [ <oImg> ] ;
[ OF <oWnd> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FILENAME <cFileName> ] ;
[ <resource: NAME, RESOURCE, RESNAME> <cResName> ] ;
=> ;
[ <oImg> := ] TImage():New( <nRow>, <nCol>, <nWidth>, <nHeight>, [<oWnd>],;
[<cFileName>], [<cResName>] )
local cpath:=apppath()
USE ( cpath+"/Test" )
HB_FUNC( APPPATH2 )
{
NSString *buPath = [[NSBundle mainBundle] bundlePath];
hb_retc( [ buPath cStringUsingEncoding : NSASCIIStringEncoding ] );
}
HB_FUNC( IMGSETSCALENONE )
{
NSImageView * image = ( NSImageView * ) hb_parnl( 1 );
[ image setImageScaling : NSImageScaleNone ];
}
HB_FUNC( IMGSETSCALEAJUST )
{
NSImageView * image = ( NSImageView * ) hb_parnl( 1 );
[ image setImageScaling : NSImageScaleProportionallyDown ];
}
HB_FUNC( IMGSETSCALEINDEPENDEN )
{
NSImageView * image = ( NSImageView * ) hb_parnl( 1 );
[ image setImageScaling : NSImageScaleAxesIndependently ];
}
HB_FUNC( IMGSETSCALEAJUSTRATIO )
{
NSImageView * image = ( NSImageView * ) hb_parnl( 1 );
[ image setImageScaling :NSImageScaleProportionallyUpOrDown ];
}
HB_FUNC( TBSETMODEICOLBL )
{
ToolBar * toolbar = ( ToolBar * ) hb_parnl( 1 );
[toolbar setDisplayMode : NSToolbarDisplayModeIconAndLabel ] ;
}
HB_FUNC( TBSETMODEICO )
{
ToolBar * toolbar = ( ToolBar * ) hb_parnl( 1 );
[toolbar setDisplayMode : NSToolbarDisplayModeIconOnly ] ;
}
HB_FUNC( TBSETMODEICOLBL )
{
ToolBar * toolbar = ( ToolBar * ) hb_parnl( 1 );
[toolbar setDisplayMode : NSToolbarDisplayModeLabelOnly ] ;
}
HB_FUNC( TBSETMODEDEFAULT )
{
ToolBar * toolbar = ( ToolBar * ) hb_parnl( 1 );
[toolbar setDisplayMode : NSToolbarDisplayModeDefault ] ;
}
Return to FiveMac / FivePhone (iPhone, iPad)
Users browsing this forum: No registered users and 11 guests