Refreshing a Get

Post Reply
Wolfgang Ciriack
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin

Refreshing a Get

Post by Wolfgang Ciriack »

Hello,
i have a LISTBOX and a SAY object and i want to show some information of the selected item in the SAY object.

Code: Select all

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

Post by Antonio Linares »

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:

Code: Select all

@ 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
Wolfgang Ciriack
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin

Post by Wolfgang Ciriack »

Thanks Antonio, now its working :)
Best regards
Wolfgang Ciriack
Wolfgang Ciriack
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin

Post by Wolfgang Ciriack »

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

Post by Antonio Linares »

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

Code: Select all

// 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
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
Wolfgang Ciriack
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin

Post by Wolfgang Ciriack »

Thanks Antonio.
Best regards
Wolfgang Ciriack
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

You are welcome :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply