r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Chris
17-Jul-2008
[7886x2]
You mean the script that turned Make-Doc documents into slide presentations?
That one was called %show.r and I think is likely available on an 
IOS server -- Developer?
Sunanda
17-Jul-2008
[7888x2]
There's a version packaged with Carl's devcon 2007 presentation:
http://www.rebol.com/article/0335.html
Chris
17-Jul-2008
[7890]
Wasn't there enhanced features in this version?
Sunanda
17-Jul-2008
[7891]
I think so .... I suspect Cark added all the features he needed to 
do the presentation he was writing that day :-)
Graham
17-Jul-2008
[7892x5]
Carl's latest causes a stack overflow for me
I think it was written by Sterling or Jeff
Pekr will know ... I'll wait for him to wake up!
found it .. http://www.cs.unm.edu/~whip/make-presentation.r
someone should snag it for the library
Pekr
17-Jul-2008
[7897x3]
presentation?
There are two things - the one comes from Jeff  Kreis, and is called 
presentation.r, size 11048 bytes, the other is Carl's slide show 
presenter from DevCon in France IIRC, called show07.r
both of those script run fine here ..
Chris
17-Jul-2008
[7900]
Ah, yes -- I turned that one into a VID style...
Graham
17-Jul-2008
[7901]
I ran show07 on the first script from Carl and after repeatedly using 
the down arrow, it came up with a stack error near the end of the 
presentation.
Janeks
21-Jul-2008
[7902]
I am unsure is it the View problem - my app is eating system resources. 
F.ex. when it is started in task manager it shows near 10mb memory 
use, but after a working day it shows around 70mb and comtinues to 
grow up.

I checked my variables, but it does not seems for me, that some of 
them are not releasing data. But probably I am wrong.
Are there some routine/trick how to trace/debug such situation?

My applications is doing some database checks and if finding certain 
data , then sending e-mail and/or sms.
Henrik
21-Jul-2008
[7903x2]
There are some bugs in View that causes leaks when using networking 
and GUI events at the same time. That's only a very rough description 
of the problem. There are more accurate descriptions of this problem 
in RAMBO.
I had a similar issue with a small database server GUI. It continually 
ate memory until it was at 500 MB. Then I rewrote the application 
to be /Core only and memory usage was as it should be (way below 
500 MB).
Graham
21-Jul-2008
[7905]
stats ?
amacleod
22-Jul-2008
[7906]
I'm trying to use Antons' Scroll-panel style but I'm having some 
trouble. 
Do you "do" the script or it it more involved? 

I tried to follow his style-gallery.r script but there is a lot going 
on in there and got lost. 
I see some kind of "include.r" script. perhaps that is needed?
Janeks
22-Jul-2008
[7907]
Are there workaround the problem with view memory leaks (when using 
networking and GUI events at the same time) ?
Henrik
22-Jul-2008
[7908]
not other than trying to avoid the specific cases that are in RAMBO. 
that might be hard, though.
Janeks
23-Jul-2008
[7909]
What I found was - RAMBO Ticket #3593.
Is it that case?

I have simple interfaces, that normaly is unviewed, but I have tray 
incon. And in background there is two database connections.
Henrik
23-Jul-2008
[7910]
Yes, that's the one. There are other leaks as well:


http://www.rebol.net/cgi-bin/rambo.r?sort=1&limit=1&cmd=Search&id=&pattern=leak
amacleod
24-Jul-2008
[7911]
I got scroll-panel working. I think it was some conflict with cypher's 
tree style which I was also using.
On a related topic...

Is there a way to scroll down teh panel programaticly. (ie: give 
a y axis location and have hte panel jump to that spot) like a link 
on  web page?

And since Cyper's tree widget does not work with Anton's scroll-panel, 
any other tree widget's around?
Graham
24-Jul-2008
[7912]
set the offset/y and then do a show
amacleod
24-Jul-2008
[7913]
Thanks. I played around with offset but I did not get it to work. 
Ill try again. 

Is there a way to find the offset for specific text in the panel? 
For example -so a search for a string and get back the location in 
the panel?
Graham
24-Jul-2008
[7914]
dont' think so
amacleod
31-Jul-2008
[7915]
Still working with Anton's Scroll-panel...

I found a way to "index" the text location in the scroll panel as 
I build the layout. But when I try to set the offset to a specific 
position in the scroll panel I offset the whole "face" and not a 
reposition of the scroller. 
Example- 
I set my_scroll_panel/offset/y: 200

I feel I should be setting the scroller's value but I can  not seem 
to figure out how...
amacleod
1-Aug-2008
[7916x2]
I got it to scroll to my index point but I acn't find the fuction 
to update the scroll bar.
Got it!
my-scroll-panel/access/set-scroll-offset my-scroll-panel 0x-100
After trying every combo!!!
Graham
2-Aug-2008
[7918]
was the accessor scroll-panel ever incorporated into any vid widget?
amacleod
4-Aug-2008
[7919]
I got Cypher's tree widget to work with Anton's scroll-panel...sort 
of. Problem was tree widget uses cypher's scroll-panel style which 
of course works diferently from Anton's. Now I'm forced to use both 
and the tree scroll-panel does not display sliders correctly. 

I'm going to either need to find a way for the tree list to use Anton's 
scroll-panel or add the extra functionality to cypher's scroll-panel 
style...or start from scratch.
amacleod
7-Aug-2008
[7920]
New problem with Anton's scroll-panel style. 

When I select text I loose mouse scroll-wheel use and Keyboard scroll 
functionality.


Altme does not have this problem. I guess it's inherent to the style.
Henrik
7-Aug-2008
[7921]
sounds like a focus problem
amacleod
7-Aug-2008
[7922x3]
Yes. I tried a feel/event function to trap the up event on the mouse 
and it restores my scroll functionality but I'm not able to highlight 
now!
Should I look to patch the style or place the fix somewhere in my 
code?
I'm able to re-focus the scroll panel within my "clip" function (to 
save the highlighted text) but if I just click in a text area or 
highlight and not save it using hte clip function I can not get scrolling 
back.
BrettH
8-Aug-2008
[7925]
I have a similar problem re: scrolling, and I've tried the suggstions 
by amacleod without success, here I've copied a modified version 
of cookbook-scroller in the hope someone can suggest a solution.Hi, 
I'm trying to write a data entry form with many fields, this form 
is longer than a typical
monitor viewing area.

Creating the form is easy, but I cannot work out how to scroll the 
whole form 'up/down'

when the user TAB's out of the last showing field bottom and display 
the 'hidden' fields.

Rebol actually does TAB to the next field and accepts data entry 
but you cannot see it
without manually moving the scroll slider.


How do I programmatically make the form 'move' up/down ? and sync 
the slider ?

 I've tried "all" the example code I can find and none seem to do 
 the trick :-)


In the attached (modified cookbook-scroller.r) program I've added 
a few fields to illustrate the

problem. My need is for rapid data entry and using the mouse is really 
not a option, The program accepts user data, user TABS to navigate 
to next field, form slides as necessary, upon last field, data is 
saved, form cleared, cursor placed at first field, data entry continues.

Thanks for any ideas.

;; ===============================
  rebol ["cookbook-scroller2.r"]
  sub-panel: layout [
        across origin 5
        style label text bold right 60
        backcolor tan
        h2 leaf "Scrolling Sub Panel" return
        label "Name:" f1: field return
        label "Email:" f2: field return
        label "Info:" f3: area wrap return
        label "Month:"
        l1: text-list data system/locale/months return
        label "Day:" s1: slider 200x20 return
        label
        button "Submit"
        button "Cancel" [quit]
    ]

    out: layout [
        across
        h3 "Panel Scrolling Example" return
        space 0
        p1: box 300x300 coal frame black
        s1: scroller 16x300 [scroll-panel-vert p1 s1]
        return
        s2: scroller 300x16 [scroll-panel-horz p1 s2]
        return
    ]

    p1/pane: sub-panel

    scroll-panel-vert: func [pnl bar][
        pnl/pane/offset/y: negate bar/data *
            (max 0 pnl/pane/size/y - pnl/size/y)
        show pnl
    ]

    scroll-panel-horz: func [pnl bar][
        pnl/pane/offset/x: negate bar/data *
            (max 0 pnl/pane/size/x - pnl/size/x)
        show pnl
    ]

    update-panel: func [pnl vbar hbar] [
        pnl/pane/offset: 0x0
        s1/data: s2/data: 0
        vbar/redrag pnl/size/y / pnl/pane/size/y
        hbar/redrag pnl/size/x / pnl/pane/size/x
        show [pnl vbar hbar]
    ]

    update-panel p1 s1 s2
    view out
;; ============
amacleod
8-Aug-2008
[7926x2]
You will need to know the offset value of each face you tab into. 
You will also need to detect which ace is currently focused. (Do 
not know how is is done).

If you know these two things you can set the offset and "show" the 
face to junp to that location.


Also, I do not know if all faces can be tabbed into such as your 
month list face..
If your just trying to avoid mouse use you can add keyboard control 
of scroll (page down, page up, arrow keys etc.)
BrettH
8-Aug-2008
[7928]
Thanks for your input.


 I removed the Month list type and replaced with  fields. Tab does 
 visit each one in turn, and accepts data enty even tho their not 
 visible. ( until you slide)

eg:
        label "Name:" f1: field return
         label "Email:" f2: field return
         label "Info:" f3: area wrap return
	 label "More info: " f4: field return
	 label "Even more ;" f5: field return


As for the  'offset' info you mention, thats probably the key to 
the problem, and like you I have NO idea how

to get this !!  I've tried various code ideas attached to the TAB 
field exit without success.


I'm not trying to avoid mouse use , I just want to program the data 
entry flow for user comfort, 
the user should still be able  to use the mouse as needed.


I think REBOL is a very interesting product but it does seem to have 
many 'holes' in fundemental GUI handling :-),

on the one hand it offers the very easy to make GUI interface tool, 
then stuffs up drop-down-lists, sliders, TAB control,
etc.
Graham
8-Aug-2008
[7929]
we are waiting for Vid 3.4
BrettH
8-Aug-2008
[7930]
I've been "waiting" for the "perfect development tool" since 1964 
!! :-)
BrettH
9-Aug-2008
[7931]
Solved !!! Took a bit of fiddling around, but now the form moves 
down thru the fields

as the user tabs out of a filed, and slides back to first field on 
tab out of last field.
Mouse positioning via scroll bar still working.

I left the trace print code in so you can observe its operation.


See the comments in teh code for the changes I made to cookbook-scroller.r

Now to try it with my own form.

;; ==============================================
rebol ["cookbook-scroller-2-1.r"
       author "Brett Hallett 2008 "
	comment  { 

    Modified  cookbook-scroller.r program  to code automatic scrolling 
    of fields on TAB,

    allows the form to have fields off the viewable page and automatically 
    scroll up/down 
	   as the user leaves a field using TAB.

    -- display field position on TAB -- eg:  print  [ "f1 "  f1/offset] 
     ( for testing only !)

    -- scroll-panel-vert func modified with extra parameter  ( a fields 
    y offset )

    -- compute offset value before calling scroll-panel-vert in out: 
    layout ( stops scroller aborting !)
	  }
	 ]

 sub-panel: layout [
        across origin 5
        style label text bold right 60
        backcolor tan
        h2 leaf "Scrolling Sub Panel" return

        label "Name:" f1: field [ print  [ "f1 "  f1/offset]        scroll-panel-vert 
        p1 s1 f1/offset/y ] return

        label "Email:" f2: field  [ print  ["f2 " f2/offset]          scroll-panel-vert 
        p1 s1 f2/offset/y ] return

        label "Info:" f3: area wrap [ print  ["f3 " f3/offset]     scroll-panel-vert 
        p1 s1 f3/offset/y ] return
	

  label "More info: " f4: field [ print  ["f4 " f4/offset]      scroll-panel-vert 
  p1 s1 f4/offset/y ] return

  label "Even more ;" f5: field [ print   ["f5 " f5/offset ]  scroll-panel-vert 
  p1 s1 f1/offset/y 
							print "write collected data"
							clear-fields sub-panel ] return

  ;; notice how the first field offset is used to set the scroll position 
  on last field exit
	 
        button "Submit" [ print "Press Submit "]
        button "Cancel" [ print "Quit" quit]
    ]

    out: layout [
    
        across
        h3 "Panel Scrolling Example" return
        space 0
        p1: box 300x300 coal frame black

        s1: scroller 16x300 [scroll-panel-vert p1 s1  ( s1/data * (max 0 
        p1/pane/size/y - p1/size/y)) ]
				;; compute offset value before calling scroll-panel-vert
        return
        s2: scroller 300x16 [scroll-panel-horz p1 s2]
        return

    ]

    p1/pane: sub-panel


;; scroll-panel-vert modified with extra parameter : fldoffset ( 
the y offset of the TAB'ded out of field )
      scroll-panel-vert: func [pnl bar fldoffset][
        pnl/pane/offset/y: negate fldoffset
	 print ["pnl-vert " pnl/pane/offset/y]
        show pnl

    ]

    scroll-panel-horz: func [pnl bar][

        pnl/pane/offset/x: negate bar/data * (max 0 pnl/pane/size/x - pnl/size/x)
        show pnl
    ]

    update-panel: func [pnl vbar hbar] [
        pnl/pane/offset: 0x0
        s1/data: s2/data: 0
        vbar/redrag pnl/size/y / pnl/pane/size/y
        hbar/redrag pnl/size/x / pnl/pane/size/x
        show [pnl vbar hbar]
    ]
   
    update-panel p1 s1  s2
     view out
Graham
10-Aug-2008
[7932]
Good start .. now to get back tabbing to work, and also prevent scrolling 
when the bottom of the form is visible!  :)
BrettH
11-Aug-2008
[7933]
Nitt Picker !!  But you right its a bit clunky at the moment, its 
only saving grace its that the data entry field remains in a static 
position !! :-)
BrettH
16-Aug-2008
[7934]
I had another look at the scroller problem, and I'm beginning to 
see that it really does not work !
eg:

 == the scroll bar does not 'follow' the offset in the pane even when 
 its new position is calculated and set

        == does not seem to be anyway to adjust the size of the moving bar 
        itself. Unable to find any documentation.

 == even with calculating the length of the (sliding) form against 
 its (viewable) panel length, 
           the offset 'action' for TAB 

           is not consistent in that the last form field is not always viewable 
           by the tab action 

           -- seems to be dependent upon the relationship between form length 
           and panel size which you can adjust manually 

              but thats hardly a useful solution. When you add a field the whole 
              scroller stops working. ( Flaky !)
        == pretty disapointing really.


Whats needed is a scroller that can be defined to operate with any 
pane and automatically following the field tabbing
in that pane without coding required. "Follow the source --Luke!"

Heres the latest code effort !

;;======================================================
rebol ["cookbook-scroller-2-11.r"
       author "Brett Hallett 2008 "
	comment  { 

    Modified  cookbook-scroller.r program  to code automatic scrolling 
    of fields on TAB,

    allows the form to have fields off the viewable page and automatically 
    scroll up/down 
	   as the user leaves a field using TAB.

    -- display field position on TAB -- eg:  print  [ "f1 "  f1/offset] 
     ( for testing only !)

    -- scroll-panel-vert func modified with extra parameter  ( fields 
    y offset )

    -- compute offset value before calling scroll-panel-vert in out: 
    layout
	   -- move trace to func print-pos for easier modification
	  }
	 ]

 sub-panel: layout [  size 300x350
        across origin 0
        style label text bold right 60
        backcolor green
        h2 leaf "Scrolling Sub Panel" return

        label "Name:" f1: field       [ print-pos   "f1 " f1/offset   scroll-panel-vert 
        p1 s1 f1/offset/y ] return

        label "Email:" f2: field        [ print-pos   "f2 " f2/offset   scroll-panel-vert 
        p1 s1 f2/offset/y ] return

        label "Info:" f3: area 199x115 wrap  [ print-pos  "f3 " f3/offset 
          scroll-panel-vert p1 s1 f3/offset/y ] return
	

  label "More info: " f4: field   [ print-pos   "f4 " f4/offset   scroll-panel-vert 
  p1 s1 f4/offset/y ] return

 ;;  label "More info: " f41: field   [ print-pos   "f41 " f41/offset 
   scroll-panel-vert p1 s1 f41/offset/y ] return

  ;;label "More info: " f42: field   [ print-pos   "f42 " f42/offset 
    scroll-panel-vert p1 s1 f42/offset/y ] return

  label "Last  ;" f5: field [ print-pos   "f5 " f5/offset   scroll-panel-vert 
  p1 s1 0 
							print "write collected data"
							clear-fields sub-panel ] return 

 ;; notice how the  offset of zero is used to set the scroll position 
 to top of form on last field exit
	below
	pad 5
	below
    ]

btn-panel: layout [
        across
	 button "Submit" [ print "Press Submit "]
        button "Cancel" [ print "Quit" quit]
	]
	
main-form: layout [
        across
        h3 "Panel Scrolling Example" return
        space 0
        p1: box 	  300x250 coal frame black

        s1: scroller 16x250 [scroll-panel-vert p1 s1  ( s1/data * (max 0 
        p1/pane/size/y - p1/size/y))  ]
				;; compute offset value before calling scroll-panel-vert
        return
	  p2: box 300x50

    ]
 
print-pos: func [ fld pos ] [ print ["print-pos: "  fld  pos]]


;; scroll-panel-vert modified with extra parameter : fldoffset ( 
the y offset of the TAB'ded out of field )

scroll-panel-vert: func [pnl bar fldoffset][
	
	;; print [ "slider:" ( (max 0 p1/pane/size/y - pnl/size/y))]

        if fldoffset < ( (max 0 p1/pane/size/y - pnl/size/y))  [ pnl/pane/offset/y: 
        negate fldoffset ]
	
	;; print ["pnl-vert " pnl/pane/offset/y  fldoffset]
        show pnl

    ]

update-panel: func [pnl vbar  pnl2] [
        pnl/pane/offset: 0x0
        s1/data:  0
        vbar/redrag pnl/size/y / pnl/pane/size/y
        pnl2/pane/offset: 0x0
        show [pnl vbar pnl2]
    ]
   
    p1/pane: sub-panel
    p2/pane: btn-panel
   
    update-panel p1 s1  p2
  
    view main-form

;; ==========================
Anton
18-Aug-2008
[7935]
Hi guys. 

amacleod, I see the scroll-panel problem, will look into it shortly.