FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Vertical Scroll Bar xBrowse
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Vertical Scroll Bar xBrowse
Posted: Mon Jul 23, 2012 08:57 AM
Hi All

I use xbrowse in all my apps and dont usually have any problems with scroll bars - but in a function where I use xbrowse as
a pick list the vertical scroll bar is acting weird - I have to mouse over the scroll bar to get it to show correctly - there is no
down button on the bottom of the scroll when the dialog is created - when it does show I cannot move down using the bottom button - but can use
the down arrow to move - the top button on the scroll moves up though. If I click below the scroll cursor it moves down.
I use the same custom resource in my .res file that I use for all my other browses.
Any ideas appreciated.

Regards
Colin
Code (fw): Select all Collapse
this is how the function is called

nPick := aArrayPick('WIP',aData,{'Job','Client','Invoiced','Not Invoiced','Tag'},{35,155,66,66,25})
//-------------------------------------------------------------------------------------------//
function aArrayPick(cTitle,aShow,aHeaders,aCols)
local oDlg,oBtnArrSelect,oBtnArrCancel,oLbx,lExit := FALSE,nRow := 0

    DEFINE DIALOG oDlg RESOURCE 'aListDlg'  ;
           TITLE cTitle

    REDEFINE XBROWSE oLbx  ID 103 of oDlg   ;
    ARRAY aShow                             ;
    COLSIZES aCols                          ;
    HEADERS aHeaders                        ;
    AUTOCOLS LINES CELL

    oLbx:lVscroll := TRUE
    oLbx:nRowHeight := 25
    oLbx:bKeyChar := {|nKey| if(nKey == VK_RETURN,(nRow := oLbx:nArrayAt,lExit := TRUE,oDlg:end()),) }
    

   REDEFINE BUTTON oBtnArrSelect ID 101 OF oDlg ;
            ACTION(nRow := oLbx:nArrayAt,lExit := TRUE,oDlg:end())

   REDEFINE BUTTON oBtnArrCancel ID 102 OF oDlg ;
            ACTION(nRow := 0,lExit := TRUE,oDlg:end())

   ACTIVATE DIALOG oDlg CENTERED ;
            ON INIT (oLbx:GoTop(),oLbx:SetFocus());
            VALID(lExit)

return(nRow)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Vertical Scroll Bar xBrowse
Posted: Mon Jul 23, 2012 06:12 PM
1) Please make sure VSCROLL is enabled in the resource.
2) For most picklists the builtin xbrowser function/command comes in handy. The above purpose can be achieved by:

Code (fw): Select all Collapse
XBROWSER aData TITLE "WIP" ;
   SETUP ( oBrw:cHeaders := {'Job','Client','Invoiced','NotInvoiced','Tag'}, ;
           oBrw:nWidths  := {35,155,66,66,25} ) ;
   SELECT ( nPick := oBrw:KeyNo() )
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion