he conseguido un iphone

Re: he conseguido un iphone

Postby mastintin » Wed Nov 10, 2010 10:13 pm

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

Postby mastintin » Wed Nov 10, 2010 11:01 pm

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 view

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 view

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 view



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
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby Daniel Garcia-Gil » Wed Nov 10, 2010 11:15 pm

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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: he conseguido un iphone

Postby Antonio Linares » Thu Nov 11, 2010 10:51 am

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 view

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: 41450
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby Antonio Linares » Thu Nov 11, 2010 11:21 am

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: 41450
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby Antonio Linares » Thu Nov 11, 2010 11:32 am

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: 41450
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby Antonio Linares » Thu Nov 11, 2010 12:18 pm

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 view

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
Antonio Linares
Site Admin
 
Posts: 41450
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby mastintin » Thu Nov 11, 2010 12:27 pm

Antonio , tremendo ... :shock: :D
Saludos.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby Antonio Linares » Thu Nov 11, 2010 3:45 pm

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 view

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
Antonio Linares
Site Admin
 
Posts: 41450
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby mastintin » Thu Nov 11, 2010 9:14 pm

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
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby Daniel Garcia-Gil » Thu Nov 11, 2010 9:22 pm

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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: he conseguido un iphone

Postby mastintin » Thu Nov 11, 2010 10:07 pm

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
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby Antonio Linares » Thu Nov 11, 2010 10:54 pm

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
Antonio Linares
Site Admin
 
Posts: 41450
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby mastintin » Thu Nov 11, 2010 10:57 pm

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 view


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

 


El codigo ejemplo :
Code: Select all  Expand view

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
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby Daniel Garcia-Gil » Sat Nov 13, 2010 12:45 am

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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

PreviousNext

Return to FiveMac / FivePhone (iPhone, iPad)

Who is online

Users browsing this forum: No registered users and 2 guests