FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Refreshing a Get
Posts: 37
Joined: Sun Aug 03, 2008 08:02 AM
Refreshing a Get
Posted: Wed Aug 06, 2008 09:04 AM
Hello,
i have a LISTBOX and a SAY object and i want to show some information of the selected item in the SAY object.

@ 0, 0 LISTBOX oBrw ;                        
      FIELDS hBmp, auftrag->zeit, auftrag->strasse ;
      HEADERS "", "Zeit", "Strasse" ;
      ON DBLCLICK ShowDetails(auftrag->(recno())) ;
      ON CHANGE (cTxt:=auftrag->straufart, oS1:SetText(cTxt)) ;
      SIZE 240, 180

@12,0 SAY oS1 VAR cTxt SIZE 240,20 OF oWnd FONT oSayFont BORDER


I tried oS1:Refresh() and oS1:SetText(cTxt) in the ON CHANGE statement of the LISTBOX, but i get always "No exported method". Is the GET object not of type TSay or is there simply something wrong with my coding ?
Best regards

Wolfgang Ciriack
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Refreshing a Get
Posted: Wed Aug 06, 2008 11:12 AM
Wolfgang,

Your code is fine, except that it tries to send a message to the SAY object before it is created. Modify it this way:
@ 0, 0 LISTBOX oBrw ;                        
      FIELDS hBmp, auftrag->zeit, auftrag->strasse ; 
      HEADERS "", "Zeit", "Strasse" ; 
      ON DBLCLICK ShowDetails(auftrag->(recno())) ; 
      ON CHANGE (cTxt:=auftrag->straufart, If( oS1 != nil, oS1:SetText(cTxt),)) ; 
      SIZE 240, 180
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 37
Joined: Sun Aug 03, 2008 08:02 AM
Refreshing a Get
Posted: Wed Aug 06, 2008 02:11 PM

Thanks Antonio, now its working :)

Best regards

Wolfgang Ciriack
Posts: 37
Joined: Sun Aug 03, 2008 08:02 AM
Refreshing a Get
Posted: Sun Aug 17, 2008 05:43 PM

Hi Antonio,
i have two more questions.

Is there a possibilty to have a bigger row height in the LISTBOX or two rows for each record ?

How can i have different bitmaps (hbmp) dependant on the content of one field ?

Best regards

Wolfgang Ciriack
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Refreshing a Get
Posted: Mon Aug 18, 2008 10:46 AM
Wolfgang,

>
Is there a possibilty to have a bigger row height in the LISTBOX or two rows for each record ?
>

Yes, you have to use a larger font for it. Here I show you a working example.

>
How can i have different bitmaps (hbmp) dependant on the content of one field ?
>

Yes, in this same example I show you how to use as many bitmaps as needed.

test.prg
// FiveWin for Pocket PC - Testing browses

#include "FWCE.ch"

REQUEST DBFCDX

function Main()

   local oWnd, oBrw, hBmp1 := ReadBitmap( CurDir() + "\go.bmp" ), hBmp2 := ReadBitmap( CurDir() + "\browse.bmp" )
   local oFont
 
   USE ( CurDir() + "\Customer" ) VIA "DBFCDX"

   DEFINE WINDOW oWnd TITLE "Tutor10"
   
   DEFINE FONT oFont NAME "Verdana" SIZE 0, -14
   
   @ 1, 1 LISTBOX oBrw ;
      FIELDS If( RecNo() % 2 == 0, hBmp1, hBmp2 ), Customer->Last, Customer->First ;
      HEADERS "", "Last", "First" ;
      COLSIZES 20, 70, 80 ;
      SIZE 220, 167 FONT oFont
   
   @ 12, 17 BUTTON "Done" SIZE 80, 30 ;
      ACTION oWnd:End()
   
   ACTIVATE WINDOW oWnd ;
      ON CLICK MsgInfo( "Click!" )
      
   DeleteObject( hBmp1 )
   DeleteObject( hBmp2 ) 
   
   oFont:End()   
   
return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 37
Joined: Sun Aug 03, 2008 08:02 AM
Refreshing a Get
Posted: Mon Aug 18, 2008 11:58 AM

Thanks Antonio.

Best regards

Wolfgang Ciriack
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Refreshing a Get
Posted: Tue Aug 19, 2008 06:05 AM

You are welcome :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion