Refreshing a Get

Refreshing a Get

Postby Wolfgang Ciriack » Wed Aug 06, 2008 9: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.

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

Postby Antonio Linares » 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:
Code: Select all  Expand view
@ 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42084
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Wolfgang Ciriack » Wed Aug 06, 2008 2:11 pm

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

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

Postby Antonio Linares » 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
Code: Select all  Expand view
// 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42084
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Wolfgang Ciriack » Mon Aug 18, 2008 11:58 am

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

Postby Antonio Linares » Tue Aug 19, 2008 6:05 am

You are welcome :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42084
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 14 guests