listbox 2nd line

listbox 2nd line

Postby Otto » Tue Apr 07, 2009 1:09 pm

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6068
Joined: Fri Oct 07, 2005 7:07 pm

Re: listbox 2nd line

Postby Otto » Wed Apr 08, 2009 9:03 am

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6068
Joined: Fri Oct 07, 2005 7:07 pm

Re: listbox 2nd line

Postby Antonio Linares » Thu Apr 09, 2009 5:37 pm

Otto,

Could you please provide a small and self contained PRG to reproduce it ? thanks
regards, saludos

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

Re: listbox 2nd line

Postby Otto » Sun May 03, 2009 9:27 pm

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  Expand view
// 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
//----------------------------------------------------------------------------//

 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6068
Joined: Fri Oct 07, 2005 7:07 pm

Re: listbox 2nd line

Postby Antonio Linares » Sun May 03, 2009 10:00 pm

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.
regards, saludos

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

Re: listbox 2nd line

Postby Otto » Sun May 03, 2009 10:23 pm

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6068
Joined: Fri Oct 07, 2005 7:07 pm

Re: listbox 2nd line

Postby Antonio Linares » Mon May 04, 2009 12:35 am

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()) :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41408
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 1 guest