HB_FUNC( LLAMAVIEW )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
NSArray *topLevelObjs = nil;
topLevelObjs = [[NSBundle mainBundle] loadNibNamed:@"Hola" owner:window options:nil];
if (topLevelObjs == nil)
MsgInfo(@"no encuentra nada");
UIView * control = [ topLevelObjs objectAtIndex : 0 ];
if (control == nil)
MsgInfo(@"no encuentra nada ");
[window addSubview: control ];
}
HB_FUNC( LLAMAVIEW )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
NSArray *topLevelObjs = nil;
topLevelObjs = [[NSBundle mainBundle] loadNibNamed:@"Hola" owner:window options:nil];
for ( NSObject * obj in topLevelObjs )
{
if ( [obj isKindOfClass:[UIView class]] )
{
return (UIView*)obj;
}
}
return nil ;
}
HB_FUNC( LLAMANavController )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
NSArray *topLevelObjs = nil;
topLevelObjs = [[NSBundle mainBundle] loadNibNamed:@"Hola" owner:window options:nil];
for ( NSObject * obj in topLevelObjs )
{
if ( [obj isKindOfClass:[UINavigationController class]] )
{
return (UINavigationController*)obj;
}
}
return nil ;
}
Daniel Garcia-Gil wrote:pregunto (realmente no he googleado)
desde window se incluye el RES al exe... pero como se hace aqui?
HB_FUNC( HOLA )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
NSArray *topLevelObjs = nil;
topLevelObjs = [[NSBundle mainBundle] loadNibNamed:@"Hola" owner:window options:nil];
UIView * view = [ topLevelObjs objectAtIndex : 0 ];
UILabel *nameLabel = (UILabel*) [view viewWithTag:3];
nameLabel.text = @"Name";
Switch * miswitch = (Switch *) [view viewWithTag:66];
[ miswitch setOn : NO animated : YES ];
[window addSubview: view ];
hb_retnl( ( LONG ) view );
}
abtn[1]:bAction:={|| yo:=Adios(oWnd:hwnd) , tu:=Micontrol(yo,3), SETLABELFONT(tu,"Arial",50) ,SETLABELTEXT(tu,"LUYEGO")) }
HB_FUNC( ADIOS )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
NSArray *topLevelObjs = nil;
topLevelObjs = [[NSBundle mainBundle] loadNibNamed:@"Hola" owner:window options:nil];
UIView * view = [ topLevelObjs objectAtIndex : 0 ];
// UILabel *nameLabel = (UILabel*) [view viewWithTag:3];
// nameLabel.text = @"Name";
// Switch * miswitch = (Switch *) [view viewWithTag:66];
// [ miswitch setOn : NO animated : YES ];
[window addSubview: view ];
hb_retnl( ( LONG ) view );
}
HB_FUNC( MICONTROL )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
;
NSObject * miobj = (NSObject *) [window viewWithTag:hb_parnl( 2 )];
hb_retnl( ( LONG ) miobj );
}
HB_FUNC( GETVIEWRESOURCE )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
NSString * cNib = hb_NSSTRING_par( 2 );
NSArray *topLevelObjs = nil;
topLevelObjs = [[NSBundle mainBundle] loadNibNamed: cNib owner:window options:nil];
UIView * view = [ topLevelObjs objectAtIndex : 0 ];
[window addSubview: view ];
hb_retnl( ( LONG ) view );
}
HB_FUNC( GETCONTROLRESOURCE )
{
UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
NSObject * miobj = (NSObject *) [window viewWithTag:hb_parnl( 2 )];
hb_retnl( ( LONG ) miobj );
}
METHOD Resources( oWnd, cResource ) CLASS TView
::hWnd = GETVIEWRESOURCE( oWnd:hWnd,cResource )
AAdd( GetAllWin(), Self )
return Self
METHOD Resources( oWnd, idResource ) CLASS TLabel
::hWnd = GetControlResource( oWnd:hWnd,idResource )
return Self
......
abtn[1]:bAction:={|| llamaview(ownd) }
.....
return nil
Function llamaview(ownd)
local oView:=tView():resources(ownd,"Hola")
local oLabel:=tLabel():resources(oView,3)
oLabel:SETFONT("Helvetica",20)
olabel:setText("SI")
Return nil
mastintin wrote:Daniel Garcia-Gil wrote:pregunto (realmente no he googleado)
desde window se incluye el RES al exe... pero como se hace aqui?
Daniel mirate esto :
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/IB_UserGuide/BuildingaNibFile/BuildingaNibFile.html
Return to FiveMac / FivePhone (iPhone, iPad)
Users browsing this forum: No registered users and 3 guests