Page 8 of 43

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 2:22 pm
by Antonio Linares
Massimo,

Yes, by now, it is required that you jailbreak it :-)

(Sí, por ahora, es necesario hacerle el jailbreak)

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 7:35 pm
by mastintin
Seguimos testeando cosas ....
Buenas noticias ....
con este codigo ....
Code: Select all  Expand view

function Main()
     local oWnd := TWindow():New()
     local cpath:= apppath()

   local cDbf:= cpath+"/test.dbf"
   local cAlias
   oWnd:Activate()
   
   MsgInfo( "Hello world! "+cDbf )
   use (cDbf) New
   calias:=alias()
   Msginfo(calias)
   dbgoto(5)
   msginfo( (calias)->last )
   dbskip(5)
   msginfo( (calias)->last )
  close(calias)

 

La gestion de dbfs parece que funciona sin problema . Me enconrado con una sorpresa los distintos msginfo se muestran en orden inverso a como deberian .. . primero aparece el último de ellos y según le vamos dando al ok van apareciendo el resto..

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 8:34 pm
by Antonio Linares
Manuel,

Parece que el MsgInfo() aun no se muestra modal, de ahi que se habran todos y se vea el ultimo.

Tenemos que buscar la forma de hacerlo modal. Debe existir alguna opcion.

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 9:03 pm
by mastintin
Una especie de msgGet ....
de momento no estamos pasando los distintos "datos" al harbour solo estamos colocando en pantalla cosas y viendo ideas y problemas , pero queda muy aparente .
Saludos.
Image

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 9:22 pm
by mastintin
Antonio al tema del modal ... mira este codigo , puede ser una solución
Code: Select all  Expand view
http://www.ikangai.com/blog/development/code-snippet-of-the-week-modal-uialertview-update

. En principio el iphone esta pensado para no modal ..
Saludso.

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 9:32 pm
by Antonio Linares
Manuel, Daniel,

He actualizado el repositorio del FivePhone a la versión más reciente. Podeis actualizar desde:
https://fivephone.googlecode.com/svn/trunk/

samples/tutor03 ya funciona, aunque con limitaciones que hay que implementar :-)

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 10:01 pm
by mastintin
Antonio he encontrado este codigo ,pero no consiguo que funcione como se espera , yo por hoy lo dejo ...
Code: Select all  Expand view


@interface MyUIAlertViewDelegate : NSObject <UIActionSheetDelegate, UIAlertViewDelegate>  
{  
    int result;  
}  

-(int)getResult;  

@end;  

@implementation MyUIAlertViewDelegate  

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex  
{  
    result = buttonIndex;  
}  

-(int)getResult  
{  
    return result;  
}  

@end;  
 
void MimsSleep(uint32_t msec)
{
    struct timespec timeout0;
    struct timespec timeout1;
    struct timespec* tmp;
    struct timespec* t0 = &timeout0;
    struct timespec* t1 = &timeout1;
   
    t0->tv_sec = msec / 1000;
    t0->tv_nsec = (msec % 1000) * (1000 * 1000);
   
    while ((nanosleep(t0, t1) == (-1)) && (errno == EINTR))
    {
        tmp = t0;
        t0 = t1;
t1 = tmp;
}
}

HB_FUNC( MSGBEEP )
{
   // NSBeep();
}  

void MsgInfo( NSString * text )
{
   
    MyUIAlertViewDelegate *lpDelegate = [[MyUIAlertViewDelegate alloc] init];
   
    UIAlertView * alert = [ [ UIAlertView alloc ] initWithTitle : @"Information"
                                                        message : text delegate : lpDelegate
                                              cancelButtonTitle : @"OK" otherButtonTitles : nil ];  
   
        [ alert show ];
   
   
    // Run modally!
    // By the time this loop terminates, our delegate will have been called and we can
    // get the result from the delegate (i.e. what button was pressed...)
    while ((!alert.hidden) && (alert.superview!=nil))
    {
        [[NSRunLoop currentRunLoop] limitDateForMode:NSDefaultRunLoopMode];
        Mimssleep(10);
    }
   
    // Grab the result from our delegate (via a custom property)
    int nResult = [lpDelegate getResult];
   
    // aqui damos salida al resultado
   
       
    [ alert release ];  
   
    [lpDelegate release];
   
}





 

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 10:38 pm
by Daniel Garcia-Gil
....

Sono la flauta ( a medias )...
(efectivamente faltaba el uso de ldid -S)

he logrado compilar tutor03 pero al copiarla al telefono no se ejecuta, puedo ejecutar la aplicacion desde el emulador?

se ve como si estuviese abriendo pero vuelve al springboard sin mostrar nada

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 10:43 pm
by Antonio Linares
Daniel,

No se puede usar el emulador porque en realidad es un simulador que ejecuta código intel, no arm.

Prueba con tutor02 que es más simple

Re: he conseguido un iphone

PostPosted: Fri Oct 22, 2010 10:54 pm
by Daniel Garcia-Gil
Antonio...

Antonio Linares wrote:No se puede usar el emulador porque en realidad es un simulador que ejecuta código intel, no arm.

Entendido

mismo resultado con tutor02

si ejecuta "hello.prg"

Re: he conseguido un iphone

PostPosted: Sat Oct 23, 2010 5:19 am
by Antonio Linares
Daniel,

Te digo como lo estamos usando nosotros:

una vez construido el ejecutable, copialo dentro de la aplicacion TabBarSample, renombrando tu ejecutable a TabBarSample y hazle chmod +x TabBarSample

Re: he conseguido un iphone

PostPosted: Sat Oct 23, 2010 7:01 am
by Antonio Linares
Progresando con el UINavigationBar:

tutor03.prg
Code: Select all  Expand view

function Main()

   local oWnd := TWindow():New()

   TNavBar():New( oWnd, "FivePhone", "Exit", "About" )

   oWnd:Activate()
   
return nil
 

Image

Re: he conseguido un iphone

PostPosted: Sat Oct 23, 2010 9:38 am
by Antonio Linares
Ejecutando acciones desde los botones de la barra de navegación:

Image

Re: he conseguido un iphone

PostPosted: Sat Oct 23, 2010 9:45 am
by mastintin
Antonio , no se muy bien como subir archivos al repositorio , lo he intentado con el snvX paro me da un error ( puede que sea solo cosas de permisos ) dejo el archivo system.m con una sola funcion :
Code: Select all  Expand view

#import <UIKit/UIKit.h>
#import <UIKit/UIApplication.h>
#define HB_DONT_DEFINE_BOOL
#include <hbapi.h>


HB_FUNC( APPPATH )
{
   NSString * buPath = [ [ NSBundle mainBundle ] bundlePath ];

   hb_retc( [ buPath cStringUsingEncoding : NSASCIIStringEncoding ] );      
}
 

Re: he conseguido un iphone

PostPosted: Sat Oct 23, 2010 9:49 am
by Daniel Garcia-Gil
Antonio Linares wrote:Daniel,

Te digo como lo estamos usando nosotros:

una vez construido el ejecutable, copialo dentro de la aplicacion TabBarSample, renombrando tu ejecutable a TabBarSample y hazle chmod +x TabBarSample


Antonio

es exactamente lo que hago, de hecho lo hace buildmac automáticamente