Page 1 of 1
listbox 2nd line
Posted: Tue Apr 07, 2009 1:09 pm
by Otto
Inserting the 2nd line into a listbox cause a double repaint of the line
- also in FWH . How can I to avoid this behavior.
Thanks in advance
Otto
Re: listbox 2nd line
Posted: Wed Apr 08, 2009 9:03 am
by Otto
Disturbing is that the listbox is opened without a scrollbar and after you insert the 2nd line the scrollbar is added.
On the PPC this makes an unstable impression to the user.
Best regards,
Otto
Re: listbox 2nd line
Posted: Thu Apr 09, 2009 5:37 pm
by Antonio Linares
Otto,
Could you please provide a small and self contained PRG to reproduce it ? thanks
Re: listbox 2nd line
Posted: Sun May 03, 2009 9:27 pm
by Otto
Hello Antonio,
attached the source code to test.
Please use the customer.dbf from the samples and delete all records.
Then add 2 records with the test program . You will see that the second
record forces the browser to insert the vertical scrollbar and repaints the
listbox. On a slow device and if you have many controls on the screen this looks
instable.
I would prefer if the scrollbar would be there immediately when I start.
Best regards,
Otto
Code: Select all
// FiveWin for Pocket PC - Testing browses with incremental search
#include "FWCE.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBrw, hBmp := ReadBitmap( CurDir() + "\go.bmp" )
local oSay, cSearch := ""
USE ( CurDir() + "\Customer" ) VIA "DBFCDX"
if ! File( CurDir() + "\LAST.CDX" )
INDEX ON Customer->Last TO ( CurDir() + "\LAST" )
endif
Customer->( OrdSetFocus( "LAST" ) )
Customer->( DbGoTop() )
DEFINE WINDOW oWnd TITLE "IncSearch"
@ 1, 1 LISTBOX oBrw ;
FIELDS hBmp, Customer->Last, Customer->First ;
HEADERS "", "Last", "First" ;
SIZE 220, 167
@ 12, 17 BUTTON "Add" SIZE 80, 30 ;
ACTION (addRec(),oBrw:gobottom(),oBrw:Refresh())
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function addRec
append blank
Customer->Last := "test"
Customer->First := "test"
return nil
//----------------------------------------------------------------------------//
Re: listbox 2nd line
Posted: Sun May 03, 2009 10:00 pm
by Antonio Linares
Otto,
If you want the scrollbar to be shown since the beginning maybe you could have a dummy record added, like "items" or "please select" so you never have only one record.
Its a workaround for it, as a scrollbar does not allow to manage only one item. It has no sense. It is a Windows listbox control (with WS_VSCROLL style) limitation.
Re: listbox 2nd line
Posted: Sun May 03, 2009 10:23 pm
by Otto
Hello Antonio,
Thank you for your answer.
But this workaround does not work well.
If I add only one record the flickering is there with the first I insert with the program.
If I start with 2 dummies on a pocket PC the screen is half full only with the dummies or does the new handy you are working on has such a big screen?
Best regards,
Otto
Re: listbox 2nd line
Posted: Mon May 04, 2009 12:35 am
by Antonio Linares
Otto,
Don't use WS_VSCROLL in the listbox. Paint the up and down as bitmaps, beside the listbox, and use them to oListBox:Select() the previous or next item (oListBox:GetSel())
