Antonio Linares
Site Admin
Posts: 37485 Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:
Post
by Antonio Linares » Fri Oct 22, 2010 2:22 pm
Massimo,
Yes, by now, it is required that you jailbreak it
(Sí, por ahora, es necesario hacerle el jailbreak)
mastintin
Posts: 1502 Joined: Thu May 27, 2010 2:06 pm
Post
by mastintin » Fri Oct 22, 2010 7:35 pm
Seguimos testeando cosas ....
Buenas noticias ....
con este codigo ....
Code: Select all
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..
Antonio Linares
Site Admin
Posts: 37485 Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:
Post
by Antonio Linares » Fri Oct 22, 2010 8:34 pm
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.
mastintin
Posts: 1502 Joined: Thu May 27, 2010 2:06 pm
Post
by mastintin » Fri Oct 22, 2010 9:03 pm
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.
mastintin
Posts: 1502 Joined: Thu May 27, 2010 2:06 pm
Post
by mastintin » Fri Oct 22, 2010 9:22 pm
Antonio al tema del modal ... mira este codigo , puede ser una solución
Code: Select all
http://www.ikangai.com/blog/development/code-snippet-of-the-week-modal-uialertview-update
. En principio el iphone esta pensado para no modal ..
Saludso.
mastintin
Posts: 1502 Joined: Thu May 27, 2010 2:06 pm
Post
by mastintin » Fri Oct 22, 2010 10:01 pm
Antonio he encontrado este codigo ,pero no consiguo que funcione como se espera , yo por hoy lo dejo ...
Code: Select all
@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];
}
Daniel Garcia-Gil
Posts: 2365 Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:
Post
by Daniel Garcia-Gil » Fri Oct 22, 2010 10:38 pm
....
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
Antonio Linares
Site Admin
Posts: 37485 Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:
Post
by Antonio Linares » Fri Oct 22, 2010 10:43 pm
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
Daniel Garcia-Gil
Posts: 2365 Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:
Post
by Daniel Garcia-Gil » Fri Oct 22, 2010 10:54 pm
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"
Antonio Linares
Site Admin
Posts: 37485 Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:
Post
by Antonio Linares » Sat Oct 23, 2010 5:19 am
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 Linares
Site Admin
Posts: 37485 Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:
Post
by Antonio Linares » Sat Oct 23, 2010 7:01 am
Progresando con el UINavigationBar:
tutor03.prg
Code: Select all
function Main()
local oWnd := TWindow():New()
TNavBar():New( oWnd, "FivePhone", "Exit", "About" )
oWnd:Activate()
return nil
Antonio Linares
Site Admin
Posts: 37485 Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:
Post
by Antonio Linares » Sat Oct 23, 2010 9:38 am
Ejecutando acciones desde los botones de la barra de navegación:
mastintin
Posts: 1502 Joined: Thu May 27, 2010 2:06 pm
Post
by mastintin » Sat Oct 23, 2010 9:45 am
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
#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 ] );
}
Daniel Garcia-Gil
Posts: 2365 Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:
Post
by Daniel Garcia-Gil » Sat Oct 23, 2010 9:49 am
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