FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveMac / FivePhone (iPhone, iPad) ¿ Recambio en mensajes?
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
¿ Recambio en mensajes?
Posted: Thu Sep 02, 2010 07:25 AM
Segun la documentación que he leido de apple NSRunAlertMessage está "Superada" por NSalert y probablemente en futuras versiones de xCode quede "descontinuada" . La forma correcta segun ellos sería algo asi :-) no esta probado aún )

Code (fw): Select all Collapse
HB_FUNC( MSGYESNO ) // cMsg --> lYesNo
{
   NSString * msg;
   NSString * msg2;
   NSString * cIcon;
   CocoaInit();

   ValToChar( hb_param( 1, HB_IT_ANY ) );
   msg = [ [ [ NSString alloc ] initWithCString: ISCHAR( -1 ) ? hb_parc( -1 ) : "" ] autorelease ];
   
   ValToChar( hb_param( 2, HB_IT_ANY ) );
   msg2 = [ [ [ NSString alloc ] initWithCString: ISCHAR( -2 ) ? hb_parc( -2 ) : "" ] autorelease ];
 
   cIcon = [ [ [ NSString alloc ] initWithCString: ISCHAR( -3 ) ? hb_parc( -3 ) : "" ] autorelease ];

 //  hb_retl( NSRunAlertPanel( @"Please select", msg, @"No", @"Yes", NULL, NULL ) == NSAlertAlternateReturn );
  
 
NSAlert *alert = [[NSAlert alloc] init];

int choice = 0 ;

[alert addButtonWithTitle:@"No"];
[alert addButtonWithTitle:@"Yes"];

[alert setMessageText: msg ];
[alert setInformativeText: msg2 ];
[alert setIcon: cIcon ];
[alert setAlertStyle:NSWarningAlertStyle];

 choice = [ alert runModal] ;
 
 [alert release];
 
 kb_retl(choice == 0) ;
 
  }
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ¿ Recambio en mensajes?
Posted: Thu Sep 02, 2010 08:57 AM

Manuel,

gracias por la información. Si, tendremos que migrar el código de los Msg... a ese nuevo formato :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion