FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveMac / FivePhone (iPhone, iPad) he conseguido un iphone
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: he conseguido un iphone
Posted: Mon Nov 29, 2010 10:22 AM

Muy bueno lo del hack :D .
Antonio, Daniel quiero implementar los comandos para la clase View , pero no se si usar el comando DIALOG ,por similitud con el resto de los productos five o usar un nuevo comando VIEW . ¿ Como lo veis ?.
Saludos.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: he conseguido un iphone
Posted: Mon Nov 29, 2010 11:10 AM

Manuel,

Mi voto es ambos :-)

Que pueda escribirse como VIEW ó DIALOG, asi ayudamos a los FiveWinners que vayan llegando :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: he conseguido un iphone
Posted: Mon Nov 29, 2010 12:30 PM
Antonio Linares wrote:Manuel,

Mi voto es ambos :-)

Que pueda escribirse como VIEW ó DIALOG, asi ayudamos a los FiveWinners que vayan llegando :-)


Misma opinion
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: he conseguido un iphone
Posted: Mon Nov 29, 2010 11:06 PM
Implementados los commandos de Dialog - View
Implementados los commandos del tabbar ....
ahora es muy facil crear tabbars genericos ...
Code (fw): Select all Collapse
function Main()

   local oWnd , oLabel
   
   local oVista1, oView2, oTabbar
   local onavitem , onav1,onav2   
   
    DEFINE WINDOW oWnd COLOR 255,255,0,100

   DEFINE TABS oTabBar OF oWnd ITEMS "UNO","DOS","TRES"  OPTION 2  
      
 @ 100, 130 SAY "First" OF oTabBar:aView[1] 
 @ 100, 130 SAY "Second" OF oTabBar:aView[2] 
 @ 100, 130 SAY "TRES" OF oTabBar:aView[3]  
  
   ACTIVATE WINDOW oWnd
   
return nil

el resultado :
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: he conseguido un iphone
Posted: Tue Nov 30, 2010 01:52 PM
primera implementacion de comandos NavBar funcionando.
el codigo que ejemplo de tabbar y navbar con comandos :
Code (fw): Select all Collapse
#include "fivephone.ch"
 
function Main()

   local oWnd , oLabel
   
   local oVista1, oView2, oTabbar
   local onavitem , onav1,onav2   
   
    DEFINE WINDOW oWnd COLOR 255,255,0,100

    DEFINE TABS oTabBar OF oWnd ITEMS "UNO","DOS","TRES" ;
    OPTION 2  
  
    
 @ 100, 130 SAY "First" OF oTabBar:aView[1] 
 @ 100, 130 SAY "Second" OF oTabBar:aView[2] 
 @ 100, 130 SAY "TRES" OF oTabBar:aView[3]  
 
 
 DEFINE NAVBAR oNav1 TITLE "Vista 1" OF oTabBar:aView[1] ;
            BTNLEFT "Exit 1"   ACTION msginfo("exit1")  ;
            BTNRIGHT "About 1" ACTION msginfo("About1") 
  
 DEFINE NAVBAR oNav2 TITLE "Vista 2" OF oTabBar:aView[2] ;
            BTNLEFT "Exit 2"   ACTION msginfo("exit2")  ;
            BTNRIGHT "About 2" ACTION msginfo("About2") 
                             
  ACTIVATE WINDOW oWnd
   
return nil
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: he conseguido un iphone
Posted: Wed Dec 01, 2010 09:55 PM
Implementado el comando listbox .Se puede mejorar aun mucho pero por ahora lo dejo asi .
Un ejemplo , tres tabs y en el segundo tab el listbox :

Code (fw): Select all Collapse
 #include "fivephone.ch"
 
function Main()

   local oWnd , oTabbar
   local  onav1,onav2 , oBrw
      
    DEFINE WINDOW oWnd COLOR 255,255,0,100

   DEFINE TABS oTabBar OF oWnd ITEMS "UNO","DOS","TRES" ;
    OPTION 2  
  
    
 @ 100, 130 SAY "First" OF oTabBar:aView[1] 
 @ 100, 130 SAY "TRES" OF oTabBar:aView[3]  
 
 
 DEFINE NAVBAR oNav1 TITLE "Vista 1" OF oTabBar:aView[1] ;
            BTNLEFT "Exit 1"   ACTION msginfo("exit1")  ;
            BTNRIGHT "About 1" ACTION msginfo("About1") 
  
 DEFINE NAVBAR oNav2 TITLE "Configuracion" OF oTabBar:aView[2] ;
            BTNLEFT "Exit 2"   ACTION msginfo("exit2")  ;
            BTNRIGHT "About 2" ACTION msginfo("About2") 
            
                             
  @  10, 100  LISTBOX oBrw ;
              ITEMS { "Indices","Parametros","Conexiones"} ;
              HEADS {space(21)+"Varios"} ;
              OF oTabBar:aView[2]  ;
              SIZE 300,190 ;
              CELLHEIGHT 90 ;
              CELLSTYLE  1   ;
              CELLACCESORY 2 ;
              GROUP 
             
            obrw:SetBackClear()
            
         
   ACTIVATE WINDOW oWnd
   
return nil


Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: he conseguido un iphone
Posted: Thu Dec 02, 2010 01:16 AM

Manuel,

Está estupendo, enhorabuena! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 145
Joined: Wed Nov 03, 2010 09:16 AM
Re: he conseguido un iphone
Posted: Thu Dec 02, 2010 07:34 AM

¡¡Bonito!! Esto se está convirtiendo en una costumbre, llegar al curro y tirarse al post "he conseguido un iphone", jajajaja

Enhorabuena

Paco García
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: he conseguido un iphone
Posted: Thu Dec 02, 2010 09:09 PM
Antonio tenemos un problema en la libreria de harbour ....
Al usar la funcion alias() en un prg en el simulador me da este error :
Code (fw): Select all Collapse
ld: duplicate symbol _HB_FUN_ALIAS in /Users/manuel/Desktop/paraiphone/harbour/lib/libharbour.a(dbcmd.o) and /Users/manuel/Desktop/paraiphone/harbour/lib/libharbour.a(nulsys.o)
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1


A sumar ... el mismo código , si me paso al Device en vez el simulador meda otro error distinto :
Code (fw): Select all Collapse
ld: duplicate symbol _HB_FUN_DBUNLOCK in /Users/manuel/Desktop/paraiphone/harbour/lib/libharbour.a(dbcmd.o) and /Users/manuel/Desktop/paraiphone/harbour/lib/libharbour.a(nulsys.o)
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1


Si uso el simulador y quito la referencia a la funcion alias() del prg ahora el error es :
Code (fw): Select all Collapse
ld: duplicate symbol _hb_rddSelectWorkAreaAlias in /Users/manuel/Desktop/paraiphone/harbour/lib/libharbour.a(nulsys.o) and /Users/manuel/Desktop/paraiphone/harbour/lib/libharbour.a(wafunc.o)
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1


Si usamos las librerias antiguas de harbour para iphone y compilamos desde terminal funciona sin problemas ...
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: he conseguido un iphone
Posted: Fri Dec 03, 2010 08:53 AM

Manuel,

El problema es que hemos añadido la librería libnullrdd.a junto con las otras librerias de RDDs al construir la librería única.

Hay que quitar libnullrdd.a al construir la libreria completa de Harbour

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: he conseguido un iphone
Posted: Fri Dec 03, 2010 09:32 AM

Quedaría así:

libtool -static -o libharbour.a libhbcommon.a libhbcpage.a libhbcplr.a libhbdebug.a libhbextern.a libhbhsx.a libhblang.a libhbmacro.a libhbrdd.a libhbrtl.a libhbsix.a libhbuddall.a libhbusrrdd.a libhbvm.a libjpeg.a liblibhpdf.a libminizip.a libpng.a librddcdx.a librddfpt.a librddnsx.a librddntx.a

Aqui está la librería completa de Harbour (iPhone/iPad y simuladores) de nuevo:

http://fivephone.googlecode.com/files/libharbour.a

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: he conseguido un iphone
Posted: Fri Dec 03, 2010 10:54 PM

Antonio nos falta un methodo para oview:end() .
si creamos una ventana ,matarla , se te ocurre algo ?

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: he conseguido un iphone
Posted: Sat Dec 04, 2010 09:17 AM

Manuel,

En la Clase TWindow tenemos:

METHOD End() INLINE WndClose( ::hWnd ), EndPool()

Que destruye la ventana y hace que se salga del bucle principal, liberando el pool de memoria. Pues las aplicaciones del iPhone/iPad solo tienen una única ventana.

Para el método End() de la Clase TView solo tendriamos que hacer:

[ view release ];

y removerla de nuestro array devuelto por GetAllWin(). Creo que con eso es suficiente :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: he conseguido un iphone
Posted: Sat Dec 04, 2010 11:27 AM
Añadido el methodo end a los view . Ya esta funcionando bien .
Realizaba el borrado y redimensionamiento del array de controles de harbour , y el release del objeto , pero el detalle que me tenia parado es que no realizaba la "baja" del objeto en el su superview de objective c :
Ahora si funciona . :-)
Code (fw): Select all Collapse
HB_FUNC( VIEWEND )
{
    UIView * view = ( UIView * ) hb_parnl( 1 );
    [view removeFromSuperview ];
    [view release];        
}
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: he conseguido un iphone
Posted: Sat Dec 04, 2010 12:24 PM
que numeros son los que tendría que pasar como parametros para las animaciones ? . No entiendo que devuelve cada cosa
el problema es que es una variable NSUInteger y yo paso una variable hb_parnl que se supone es integer , por lo que no tiene el mismo tipo ...

Code (fw): Select all Collapse
UIViewAnimationOptions
Specifies options for animating views with blocks.

enum {
   UIViewAnimationOptionLayoutSubviews            = 1 <<  0,
   UIViewAnimationOptionAllowUserInteraction      = 1 <<  1,
   UIViewAnimationOptionBeginFromCurrentState     = 1 <<  2,
   UIViewAnimationOptionRepeat                    = 1 <<  3,
   UIViewAnimationOptionAutoreverse               = 1 <<  4,
   UIViewAnimationOptionOverrideInheritedDuration = 1 <<  5,
   UIViewAnimationOptionOverrideInheritedCurve    = 1 <<  6,
   UIViewAnimationOptionAllowAnimatedContent      = 1 <<  7,
   UIViewAnimationOptionShowHideTransitionViews   = 1 <<  8,
   
   UIViewAnimationOptionCurveEaseInOut            = 0 << 16,
   UIViewAnimationOptionCurveEaseIn               = 1 << 16,
   UIViewAnimationOptionCurveEaseOut              = 2 << 16,
   UIViewAnimationOptionCurveLinear               = 3 << 16,
   
   UIViewAnimationOptionTransitionNone            = 0 << 20,
   UIViewAnimationOptionTransitionFlipFromLeft    = 1 << 20,
   UIViewAnimationOptionTransitionFlipFromRight   = 2 << 20,
   UIViewAnimationOptionTransitionCurlUp          = 3 << 20,
   UIViewAnimationOptionTransitionCurlDown        = 4 << 20,
};
typedef NSUInteger UIViewAnimationOptions;


----------------- edito -------------------
Resuelto he cambiado la forma de implementarlo y ya no necesito lo anterior .. :-)
Saludos.
como ampliacion y que quede aqui .....

UIViewAnimationOptionTransitionFlipFromLeft = 1 << 20 => su valor es 1048576 * 1
UIViewAnimationOptionTransitionFlipFromRight = 2 << 20, => su valor es 1048576 * 2 .....

UIViewAnimationOptionCurveEaseIn = 1 << 16 => su valor 65536 *1 .....