FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC @ ...,... listbox
Posts: 16
Joined: Fri Feb 09, 2007 06:43 PM

@ ...,... listbox

Posted: Fri Feb 09, 2007 06:59 PM
Hello,
I'm new to FiveWin and i got into trouble with listboxes:

I have a program with this code:

#include "FWCE.ch"
REQUEST DBFCDX
STATIC oWnd, oBrw

function Main()
  USE ( CurDir() + "\dbfs\pedido" ) alias pedido VIA "DBFCDX"	   	
  desenhar_janela()
  ACTIVATE WINDOW oWnd
return nil

function desenhar_tabela()
.
.
  @ 70, 3 LISTBOX oBrw FIELDS pedido->cama HEADERS "Cama" ;
      SIZE 237, 150 pixel
.
.
return nil


where: pedido is a DBF table with a field called "cama" and 3 records on it.

I open the table in the
All seems to work fine, but all i see is the listbox space with the "Cama" header, nut no records on it.

What am i doing wrong?

Thank you,
Joaquim
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM

Re: @ ...,... listbox

Posted: Fri Feb 09, 2007 07:57 PM

Joaquim

It is not the correct way to do it

Try to code something like the ollowing

Define window first,
Open the file
Define the listbox object
Activate the window

This is a workig sample

DEFINE WINDOW OWND1 TITLE "A Faire"
DEFINE FONT aFONT NAME "TAHOMA" SIZE 0,-12

// HideKeyboard()

@ 0, 0 LISTBOX oBrw ;
FIELDS DEPANBMP(BLEU,JAUNE,vert,rouge,blanc), ;
SUBS(TRNDATE(PKDEPAN->DATEDEP),1,5), ;
TRANSFORM(PKDEPAN->Hdeb,"@Z 99.99") , ;
GETCLI(PKDEPAN->CLIREEL) ;
HEADERS " ","Date","Heure","Client" ;
FIELDSIZES 15,40,30,150 ;
ON CLICK SHOWstat(OBRW) ;
FONT AFONT ;
COLORS CLR_BLACK, CLR_WHITE ;
SIZE GETSYSMETRICS( SM_CXSCREEN ) , GETSYSMETRICS( SM_CYSCREEN ) - 30 OF OWND1

OBRW:nClrBackHead := CLR_YELLOW // header
OBRW:nClrForeHead := CLR_HBLUE // header

ACTIVATE WINDOW OWND1 MODAL
AFONT:END()

Hth

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 16
Joined: Fri Feb 09, 2007 06:43 PM

@ ...,... listbox

Posted: Fri Feb 09, 2007 11:31 PM

Thank you Richard, your reply was very helpful.

But the real problem was in something that i didn't said in the first post:
Before the grid was displayed, the program called a function that opened another table, and because i didn' put the clause 'new' in 'use' (i'm a VFP man - i'm used to 'use table in 0') the program opened the new table in the work area of the first table, therefore there was nothing to show.

Thank you anyway.
Joaquim

Continue the discussion