html forms a desktop app

Xbase++ 2.0 Build 554 or later
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: html forms a desktop app

#11 Post by rdonnay »

You can just add the SCROLLBARS clause to DCGETOPTIONS.
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: html forms a desktop app

#12 Post by bwolfsohn »

Roger,

I'm trying to create a scrolling dialog..

i've used

@ 10,10 DCDIALOG oOnlineProfile DRAWINGAREA oDrawingArea SIZE nWidth,nHeight-100 ;
SCROLLBARS XBP_SCROLLBAR_VERT NOTITLEBAR BORDER XBPDLG_NO_BORDER

dcgetoptions are:

DCGETOPTIONS SAYWIDTH nSayWidth SAYVCENTER TABSTOP NOCONFIRM ;
PIXEL ;
HILITEGETS GRA_CLR_RED ;
NOMINBUTTON ;
NOMAXBUTTON ;
NORESIZE ;
SAYFONT "10.Arial" ;
ROWSPACE 20 ;
NOESCAPEKEY ;
SCROLLBARS XBP_SCROLLBAR_VERT


A vertical scrollbar appears on the right, but the dialog does not respond to up/down arrow, or mouse..

even entering gets, when pressing enter to a get that is off the screen, the dialog does not scroll up...

What option am i missing here ??

I hope your thanksgiving was thanks-full..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

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

Re: html forms a desktop app

#13 Post by rdonnay »

So this is NOT a Windows window, but instead an HTML form in a web browser?

This is going in a different direction than how this thread started.
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: html forms a desktop app

#14 Post by bwolfsohn »

Roger, Here's a test mockup screenshot...

the gets continue out of sight...
Attachments
scrolldialog.jpg
scrolldialog.jpg (291.32 KiB) Viewed 15240 times
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

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

Re: html forms a desktop app

#15 Post by rdonnay »

So how do you want the scrolling to work?

Do you want a scrollbar?
Do you want the get to scroll up when the user goes past the last get?
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: html forms a desktop app

#16 Post by bwolfsohn »

i want the dialog to behave just like a form in a browser.. if you tab or down arrow or up arrow to something off screen, the dialog will adjust to bring it into view.

if you mouse wheel, the dialog should respond by scrolling.

etc..

i would think if html styling is going to be a featured attraction down the road, this would also naturally fit in with that..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

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

Re: html forms a desktop app

#17 Post by rdonnay »

XDEMO.EXE has a sample titled "Scrolling GETS" in Sample Group 1.

Code: Select all

#include dcdialog.ch
Function Main()

/* This example shows "Scrolling" @ DCSAY..GETs.  Moving the
   scrollbars will scroll the GETS in the window.  Moving to a
   GET which is outside the window area will scroll the GETS
   up or down.  Resizing the window will resize the GET area. */

 LOCAL GetList := {}, i, bFieldName, nCount := 1, oStatic, ;
       nVertOffset := 0, nHorizOffset := 0, oVertScroll, ;
       oHorizScroll, oDlg, oCurrGet, bGotFocus

 LOCAL aPopup := DC_GetPopupCaption( { '10.Marlett', 'u', 1 } )

 CLOSE ALL
 USE COLLECT NEW EXCL VIA DBFNTX
 bGotFocus := {|a,b,o|_XSample38_3(o,oStatic,@nVertOffset, ;
                      @nHorizOffset,oVertScroll,oHorizScroll), ;
                      oCurrGet:=o}

 @ 1,1 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX SIZE 50,8 ;
   OBJECT oStatic

 @ 1, 51.2 DCSCROLLBAR DATA nVertOffSet SIZE 3,8 ;
   TYPE XBPSCROLL_VERTICAL RANGE 0,FCount() ;
   AUTOTRACK ;
   OBJECT oVertScroll ;
   SCROLL { |a,x,o| nVertOffset := a[1]*20, ;
            _XSample38_2(oStatic,nVertOffSet,nHorizOffset) }

 @ 9.1, 1 DCSCROLLBAR DATA nHorizOffSet SIZE 50,1 ;
   TYPE XBPSCROLL_HORIZONTAL RANGE 0,200 ;
   AUTOTRACK ;
   OBJECT oHorizScroll ;
   SCROLL { |a,x,o| nHorizOffset := a[1], ;
           IIF( a[2]==XBPSB_ENDSCROLL, ;
                _XSample38_2(oStatic,nVertOffSet,nHorizOffset),nil)}

 FOR i := 1 TO FCount()
   IF Type(FieldName(i)) # 'M'
     bFieldName := _XSample38_1('COLLECT->'+FieldName(i))
     @ nCount,1 DCSAY FieldName(i) GET bFieldName ;
       SAYRIGHT ;
       SAYSIZE 15 ;
       SAYEVAL {|o|o:cargo[3]:=o:currentPos()} ;
       GETEVAL {|o|o:cargo[3]:=o:currentPos()} ;
       POPUP IIF(Type(FieldName(i))=='D',{|d|DC_Popdate(d,,,,,,2)},nil) ;
       PARENT oStatic ;
       GOTFOCUS bGotFocus
   ENDIF
   nCount++
 NEXT

 DCREAD GUI ;
   PARENT @oDlg ;
   TITLE 'Scrolling GETS Demo' ;
   FIT ;
   MODAL ;
   NOAUTORESTORE ;
   ADDBUTTONS ;
   EVAL { || oDlg:reSize := ;
         {||_XSample38_4(oDlg,oStatic,oVertScroll,oHorizScroll), ;
            Eval(bGotFocus,nil,nil,oCurrGet)}}

Sleep(100)

DC_GetPopupCaption(aPopup)

RETURN nil

/* ------------------- */

STATIC FUNCTION _XSample38_1( c )

RETURN {|x|IIF(x==nil,&(c),&(c):=x)}

/* ----------------------- */

STATIC FUNCTION _XSample38_2( oStatic, nVertOffset, nHorizOffset )

LOCAL aChildren := oStatic:ChildList(), i, aCargo, nRow, nCol

oStatic:lockUpdate(.t.)
FOR i := 1 TO LEN(aChildren)
  aCargo := aChildren[i]:cargo[3] // user cargo is always :cargo[3]
  nCol := aCargo[1]
  nRow := aCargo[2]
  aChildren[i]:setPos({nCol-nHorizOffset,nRow+nVertOffset})
NEXT
oStatic:lockUpdate(.f.)
oStatic:invalidateRect()

RETURN nil

/* ----------------------- */

STATIC FUNCTION _XSample38_3( oXbp, oStatic, nVertOffset, nHorizOffset, ;
                              oVertScroll, oHorizScroll )
IF Valtype(oXbp) = 'U'
  RETURN nil
ENDIF

DO WHILE oXbp:currentPos()[2] < 0
  nVertOffset += 20
  _XSample38_2( oStatic, nVertOffset, nHorizOffset )
ENDDO
DO WHILE oXbp:currentPos()[2] > oStatic:currentSize()[2]-20
  nVertOffset -= 20
  _XSample38_2( oStatic, nVertOffset, nHorizOffset )
ENDDO
oVertScroll:setData(nVertOffset)

RETURN nil

/* ----------------------- */

STATIC FUNCTION _XSample38_4( oDlg, oStatic, oVertScroll, oHorizScroll )

oStatic:setSize({oDlg:currentSize()[1]-50, ;
                 oDlg:currentSize()[2]-120})

oVertScroll:setPos({oStatic:currentSize()[1] + 12, ;
                    oVertScroll:currentPos()[2]})

oVertScroll:setSize({oVertScroll:currentSize()[1], ;
                     oStatic:currentSize()[2]})

oHorizScroll:setSize({oStatic:currentSize()[1], ;
                      oHorizScroll:currentSize()[2]})

RETURN nil

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

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: html forms a desktop app

#18 Post by Cliff Wiernik »

That example appears to work better and worse than the static scroll example in Sample Group 4. The scrolling gets does not appear to update the scroll bars relative position like the static scroll sample does, but the static scroll sample does not scroll the gets whereas the one in the sample group 1 does. Is it possible to scroll the gets when you are near the bottom of the viewing area, not just on the last visible one. That way you could see where you are on the screen as that next one or two items below the current position would be visible also.

I missed the sample in group 1 before, only saw the one in group 4 that did not appear to work as well.

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

Re: html forms a desktop app

#19 Post by rdonnay »

Is it possible to scroll the gets when you are near the bottom of the viewing area, not just on the last visible one. That way you could see where you are on the screen as that next one or two items below the current position would be visible also.
Change _XSample38_3 as shown below to give you the desired results.

Code: Select all

STATIC FUNCTION _XSample38_3( oXbp, oStatic, nVertOffset, nHorizOffset, ;
                              oVertScroll, oHorizScroll )
IF Valtype(oXbp) = 'U'
  RETURN nil
ENDIF

DO WHILE oXbp:currentPos()[2] < 40  <<<<<<<<<<<<<<<<<
  nVertOffset += 20
  _XSample38_2( oStatic, nVertOffset, nHorizOffset )
ENDDO
DO WHILE oXbp:currentPos()[2] > oStatic:currentSize()[2]-60  <<<<<<<<<<<<<<<
  nVertOffset -= 20
  _XSample38_2( oStatic, nVertOffset, nHorizOffset )
ENDDO
oVertScroll:setData(nVertOffset)

RETURN nil
If this would become a popular request, I may consider adding it as a feature to eXpress++ rather than just a sample.
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: html forms a desktop app

#20 Post by bwolfsohn »

this change does scroll when the get nears the bottom of the screen, but the scrollbars are still not functional... nor does the mousewheel have any affect..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

Post Reply