he conseguido un iphone

User avatar
mastintin
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Post by mastintin »

Probado y funcionando desde recursos webview,imgview,progress,pickerview . Subidas pequeñas correcciones a bugs.
Saludos.
User avatar
mastintin
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Post by mastintin »

Daniel ,tengo problemas para poner a funcionar el button a recursos ...
El problema parece que viene por que la clase button no deriva de uibutton ,sino de nsobject .
el codigo que tengo pare e correcto , te lo pongo a continuación :
en nibs.m una funcion especial para que coja los button :

Code: Select all | Expand


HB_FUNC( GETBUTTONRESOURCE )
{
    UIWindow * window = ( UIWindow * ) hb_parnl( 1 );
   NSObject * miobj = (NSObject *) [window viewWithTag:hb_parnl( 2 )];
   
   hb_OBJECT_ret( miobj );  
   
}

 


en buttons.m

Code: Select all | Expand


HB_FUNC( CREATEBUTTONRESOURCES )
{
    Button * button = ( Button * ) hb_OBJECT_par( 1 );
    [ button setSender : hb_gcGripGet( hb_param( 2, HB_IT_ANY ) ) ];
}

 


en button.prg

Code: Select all | Expand




METHOD Resources( oWnd, idResource, bAction ) CLASS TButton
 
   ::hWnd = GetbuttonResource( oWnd:hWnd,idResource )  

   ::bAction = bAction

   CreateButtonResources(::hWnd,Self)
   
return Self

 


El tema es que si en recursos pongo un uibutton puro , o button derivado de nsobject o button derivado de uibutton con su tag asociado , el programa casca..
Salidos.
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: he conseguido un iphone

Post by Daniel Garcia-Gil »

Manuel

el iphone se me daño y mañana (11-11) me llega el nuevo iphone (4) :D

por eso he estado algo ausente y de poca productividad

lo veo tan pronto tenga el telefono en mi poder nuevamente
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Antonio Linares
Site Admin
Posts: 42516
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: he conseguido un iphone

Post by Antonio Linares »

Added background image support for tableview cells. New samples/brwarray.prg

Affected files expand all collapse all
Add /trunk/images/cell.png diff
Modify /trunk/include/fmsgs.h diff
Modify /trunk/makefile diff
Add /trunk/samples/brwarray.prg diff
Modify /trunk/samples/buildmac.sh diff
Modify /trunk/source/classes/tblview.prg diff
Modify /trunk/source/sdkapi/tableview.m diff

Code: Select all | Expand


function Main()

   local oWnd := TWindow():New(), oBrw  
   
   oBrw = TTableView():New( oWnd, 20,, { "One", "Two", "Three", "Four", "Five" } )

   oBrw:bCellImage = { || "cell.png" }

   oWnd:Activate()
   
return nil
 

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42516
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: he conseguido un iphone

Post by Antonio Linares »

Setting the desired height for the TableView cell, samples/brwarray.prg

Affected files expand all collapse all
Modify /trunk/samples/brwarray.prg diff
Modify /trunk/source/classes/tblview.prg diff
Modify /trunk/source/sdkapi/tableview.m diff

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42516
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: he conseguido un iphone

Post by Antonio Linares »

accessoryType for TableView cells, samples/brwarray.prg

Affected files expand all collapse all
Modify /trunk/source/sdkapi/tableview.m diff

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42516
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: he conseguido un iphone

Post by Antonio Linares »

Support for TableViell cell background and image, samples/brwarray.prg

Affected files expand all collapse all
Add /trunk/images/fts.png diff
Modify /trunk/include/fmsgs.h diff
Modify /trunk/samples/brwarray.prg diff
Modify /trunk/samples/buildmac.sh diff
Modify /trunk/source/classes/tblview.prg diff
Modify /trunk/source/sdkapi/tableview.m diff

Code: Select all | Expand


function Main()

   local oWnd := TWindow():New(), oBrw  
   
   // 92 is the cell desired height
   oBrw = TTableView():New( oWnd, 20,, { "One", "Two", "Three", "Four", "Five" },, 92 )

   oBrw:bCellBack = { || "cell.png" }
   oBrw:bCellImage = { || "fts.png" }

   oWnd:Activate()
   
return nil
 

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
mastintin
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Post by mastintin »

Antonio , tremendo ... :shock: :D
Saludos.
User avatar
Antonio Linares
Site Admin
Posts: 42516
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: he conseguido un iphone

Post by Antonio Linares »

Firing an action when a TableView cell is selected, samples/brwarray.prg

Affected files expand all collapse all
Modify /trunk/include/fmsgs.h diff
Modify /trunk/samples/brwarray.prg diff
Modify /trunk/source/classes/tblview.prg diff
Modify /trunk/source/sdkapi/tableview.m diff

Code: Select all | Expand


function Main()

   local oWnd := TWindow():New(), oBrw  
   
   // 92 is the cell desired height
   oBrw = TTableView():New( oWnd, 20,, { "One", "Two", "Three", "Four", "Five" },, 92 )

   oBrw:bSelect   = { | nRow, nSection | MsgInfo( Str( nRow ) ) }
   oBrw:bCellBack = { || "cell.png" }
   oBrw:bCellImage = { || "fts.png" }

   oWnd:Activate()
   
return nil
 

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
mastintin
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Post by mastintin »

Añadido las nuevas caracteristicas de tableview desde recursos ....

Antonio , la implementación es muy buena , pero nos limita mucho la construcción de celdas "personalizadas" ( con controles dentro y esas cosas ) . Pienso que debemos crear una clase tableviewcell y mirar como colocarla en la tableview ( pasandola igual que brwvalue pero su hwnd , creo yo)

Voy a implementar una clase base ( cells.m ) y miramos como queda.
Saludos.
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: he conseguido un iphone

Post by Daniel Garcia-Gil »

Saludos

Ya tengo el nuevo iphone :D :D
retome las riendas, los botones ya no cascan en los recursos estoy tratando de resolver el rutado de los eventos para subir los cambios
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
mastintin
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Post by mastintin »

Daniel bienvenido :D .
En el codigo de tableview m veo que todo lo que se devuelve son texto para asignar propiedades . mi idea era crear una clase cell con todas las propiedades y devolverla al tableview igual que hacemos con el texto de nombre de imagen pero devolviendo el objeto completo ( me imagino que mediante su hwnd ) ¿ como se podría hacer ? .
User avatar
Antonio Linares
Site Admin
Posts: 42516
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: he conseguido un iphone

Post by Antonio Linares »

Daniel,

Que bueno que ya tengas iphone de nuevo :-)

Manuel,

Si, se puede hacer de ambas maneras. De todas formas, hoy solo he estado haciendo pruebas para ir afianzando conceptos y entenderlo mejor :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
mastintin
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Post by mastintin »

Ya lo tengo . Subo el codigo al repositorio ,aunque falla el cells.m ( tenemos que crear bien la clase, para que se vea bien ) , pero pasar pasa y devolver se devuelve ....
La idea es que tableview tiene una data ocell ( para celda personalizada ) . Si quiero personalizar las celdas creo un objeto celda y lo asigno a ocell sino devuelve nil .
se pueden tener los objetos ocell que queramos todos distintos , y segun que celda sea ,hacer que se asigne uno u otro ( se me ocurre)
Falta por implementar tambien que no se haga la asignacion si hb_parl(-1) es nil , pero no se exactamente como se hace.

Code: Select all | Expand



cell =  ( UITableViewCell * ) hb_parnl( -1 ) ;

 


El codigo ejemplo :

Code: Select all | Expand


function Main()

   local oWnd := TWindow():New(), oBrw  
   
   // 92 is the cell desired height
   oBrw = TTableView():New( oWnd, 20,, { "One", "Two", "Three", "Four", "Five" },, 92 )


//   oBrw:bSelect   = { | nRow, nSection | MsgInfo( nRow ) }
//   oBrw:bCellBack = { || "cell.png" }
 //  oBrw:bCellImage = { || "fts.png" }
    obrw:ocell:= CREATECELL()
   oWnd:Activate()
   
return nil
 
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: he conseguido un iphone

Post by Daniel Garcia-Gil »

Saludos

He subido las pruebas que hice de los botones desde recursos, el punto esta en que no retorna un Handle valido window viewWithTag:
lo probe con varios controles y en lo unico que funciona es en los LABEL

el ejemplo tutornibs tiene una trazamostarnado el valor del handle del botton despues de usar window viewWithTag:

no he podido encontrar el problema
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Post Reply