Width of vertical scrollbar in browse

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Width of vertical scrollbar in browse

#1 Post by skiman »

Hi,

What is the easiest way to change the width of the vertical scrollbar of a dcbrowse? I need a wider scrollbar to use on a touchscreen.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Width of vertical scrollbar in browse

#2 Post by rdonnay »

Chris -

I developed a touch-screen application for a customer.
In my earlier versions, I enlarged the browse scrollbars (as you requested).
We determined that scrollbars do not work well on touch screen apps.

I came up with a solution that I believe works much better.
Look at the below screen.
touchscreen.jpg
touchscreen.jpg (89.98 KiB) Viewed 9738 times
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Width of vertical scrollbar in browse

#3 Post by skiman »

Hi Roger,

I also have 4 buttons created with pageup/up/down/pagedown functions. But I thought that a scrollbar would be better.

Anyway, I have problems to define the exact position of my buttons. I placed them just at the right of my browse, but it seems as I can't get the correct position. I don't know if it is because I use the FIT clause of the browse. Using dcgui_col isn't working.
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Width of vertical scrollbar in browse

#4 Post by skiman »

Hi,

obrowse:drawingarea:currentSize()[1] and obrowse:currentSize()[1] gives me an error.
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Width of vertical scrollbar in browse

#5 Post by skiman »

Hi,

Using @ 0, 0 dcpushbuttonxp relative oBrowse ... isn't working. The button is at the left down corner of the browse?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Width of vertical scrollbar in browse

#6 Post by rdonnay »

I will write a small sample program that enlarges the scrollbars and also adds a set of buttons.

You can see a sample program for enlarging scrollbars in the eXpress++ samples.

Look at \exp19\samples\touchscr\scrollbar.prg

Code: Select all

#INCLUDE "dcdialog.CH"

PROC appsys
RETURN

* ------------

FUNCTION Main()

LOCAL GetList[0], GetOptions, oBrowse, aDir

aDir := Directory()

@ 5,10 DCBROWSE oBrowse DATA aDir SIZE 30,10 PRESENTATION DC_BrowPres() ;
   RESIZE DCGUI_RESIZE_RESIZEONLY

DCBROWSECOL ELEMENT 1 HEADER '1' WIDTH 10 PARENT oBrowse
DCBROWSECOL ELEMENT 2 HEADER '2' WIDTH 10 PARENT oBrowse
DCBROWSECOL ELEMENT 3 HEADER '3' WIDTH 10 PARENT oBrowse

@ 16,10 DCPUSHBUTTON CAPTION 'Adjust ScrollBar' SIZE 20,2 ;
   ACTION {||AdjustScrollBar(oBrowse)}

DCGETOPTIONS RESIZE

DCREAD GUI ;
  OPTIONS GetOptions ;
  EVAL {||AdjustScrollBar( oBrowse) }

RETURN nil

* ------------

FUNCTION AdjustScrollBar( oBrowse)

LOCAL i, aChildList

aChildList := oBrowse:childList()

oBrowse:xbpstatic:setSize({oBrowse:xbpstatic:currentSize()[1]+15, ;
                           oBrowse:xbpstatic:currentSize()[2]+15})

FOR i := 1 TO Len(aChildList)

  IF aChildList[i]:isDerivedFrom('XbpScrollBar') .AND. ;
      aChildList[i]:type == XBPSCROLL_VERTICAL

    aChildList[i]:setSize({30,aChildList[i]:currentSize()[2]})
    aChildList[i]:setPos({aChildList[i]:currentPos()[1],30})

  ELSEIF aChildList[i]:isDerivedFrom('XbpScrollBar') .AND. ;
      aChildList[i]:type == XBPSCROLL_HORIZONTAL

    aChildList[i]:setSize({aChildList[i]:currentSize()[1],30})

  ENDIF

NEXT

aChildList := oBrowse:xbpstatic:childList()

FOR i := 1 TO Len(aChildList)

  IF !aChildList[i]:isDerivedFrom('XbpScrollBar')

    aChildList[i]:setPos({aChildList[i]:currentPos()[1], ;
                          aChildList[i]:currentPos()[2]+15})

  ENDIF

NEXT

RETURN nil
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Width of vertical scrollbar in browse

#7 Post by skiman »

Hi Roger,

Thanks for the sample.
Best regards,

Chris.
www.aboservice.be

Post Reply