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

World: r3wp

[View] discuss view related issues

Micha
5-May-2005
[959x2]
sortuj: [  items:  sort/compare  items func [a b ][(pick a n) < pick 
b n]
            save %data.txt items          
            show lay              ]


dodaj: [a: to-url tx/text 

        items: append array/initial 1 reduce [ a  [] [] [] ] items 
        show lay  ]


p:  [    field 200  field 100  field  100  field 100  field 100 return]


add: func [ /local coll] [ coll: get in  layout/offset/origin p  
0x0 1x1 'pane
                           insert tail sub-panel/pane coll  ]

sub-panel: layout [space 2x2
        across 
        origin 1x1
        ; style label text bold right 60
        backcolor blue

       field 200  field 100  field  100  field 100  field 100 return

       field 200  field 100  field  100  field 100  field 100 return 


          ]


lay: layout [

    origin 5x5
    space 1x0
              
 across

   txt 20 "url"    tx: field  270 txt 30 "add" [do dodaj] txt 100 center 
   "sprawdz" [] 
 return
        
 across
h3 200 center red "www" [n: 1  do sortuj   ] 
h3 100 center red "ip"[n: 2 do sortuj ] 
h3 100 center red "nazwa" [n: 3  do sortuj ]
h3 100 center red "kraj" [n: 4 do sortuj]
h3 100 center red "agent" [n: 5  do sortuj ]
 return
        space 0
        panel: box  610x400 blue
        s1: scroller 16x400 [scroll-panel-vert panel s1]
        return
        s2: scroller 300x16 [scroll-panel-horz panel s2]
        return
        button "halt" [halt]
    ]

    panel/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
        hbar/redrag pnl/size/x / pnl/pane/size/x
        vbar/redrag pnl/size/y / pnl/pane/size/y
        
        show [pnl vbar hbar]
    ]

    update-panel panel s1 s2
    view/new lay

do-events
how to add columny ?
eFishAnt
6-May-2005
[961]
Doc's Win95 demo (in Demo's folder of ViewTop breaks on layout/trace, 
looks like build is involved, but the file is %win95.zip ... on some 
recent /Views, didn't test all the way back to where it works, but 
has anyone fixed or know much about it?
Henrik
6-May-2005
[962]
is there a quick way to set a maximum length of text in a field and 
automatically unfocus and move to the nexst field in the tab order? 
E.g. day, month and year fields with limits 2, 2 and 4 and automatically 
jump to the next field
Izkata
6-May-2005
[963x4]
I know of a way, but I wouldn't call it quick - override the engage 
func. for a field and take advantage of the 'parent-face var in the 
object... I'll start a quick example if you want to see it
Uggh sorry I can't think right now..
Okay, here's an example - I don't yet know much about styles, so 
there's certainly a better way out there...
Jumplength: 3

stylize/master [
   JumpField: field with [
      make multi [
         integer: func [face blk][]
      ]
   ] feel [
      engage: func [face b c][ 
         if b = 'down [show face focus face]
         if b = 'key [
            if char? c/key [
               switch/default c/key [
                  #"^H" [
                     remove back tail face/text
                  ]
                  #"^M" []

                  #"^-" [focus first next find face/parent-face/pane face]
               ][
                  if none? face/text [face/text: copy {}]
                  append face/text c/key
                  if JumpLength <= length? face/text [
                     unfocus face
                     TMP: next find face/parent-face/pane face
                     error? try [

                        while [all [TMP/1/style <> 'JumpField  not empty? TMP]][TMP: next 
                        TMP]

                        if TMP/1/style = 'JumpField [clear TMP/1/text show TMP/1 focus TMP/1]
                     ]
                  ]
               ]
               system/view/caret: tail face/text
               show face
            ]
         ]
      ]
   ]
]

view center-face layout [
   across
   text {Length of 3:}
   JumpField
   return
   text {Length of 3:}
   JumpField {Already Here!}
]
Henrik
6-May-2005
[967x2]
it's a bit buggy... when I select a field and start typing something 
when it already has a length > 3, the first character I write is 
printed and it jumps to the other field
this is definitely something that should be a whole lot easier to 
work with...
Izkata
7-May-2005
[969]
As I said, I'm still new to styles - hopefully someone with more 
experience will come along and do something better...
Henrik
7-May-2005
[970]
nice try though :-)
Izkata
7-May-2005
[971]
Thank you  =^)


And I like the idea, maybe if I have spare time I'll attempt a bit 
better one....
Izkata
8-May-2005
[972]
do decompress #{
789C8D55518FD3300C7E8549FC07F374F070EAB8099D34DD98400221748813E2
ADEA432E73D7686952A5E9EDCAB4FF8E93766DB766E3FC5227CE673BF6E7F4F7
D72FBFEE214E2693D2D652FCC52867A54503F104007E5479F14DA05CCD21751F
D80A9B352692BC9256CC21671B6CF4CE4252922F42558A439C328EF02837C9C0
4E82C668B3046B6A38369088140A26C89A0A535A076EDC44ADDFC36E12000A65
718D01ACC112ED7FC04DD412B956AB51D87EFB62DC11BA0D7C0E3E581D54FF4D
2045945D7150ADD9FAA4A8C093187A3865F1080BB85AE9AD82984B64067C0616
9F2D9499DEFA25A49A57A55793317883A70D210BCF18DD8C4763A36B36F18267
D10A53463C8077565F97D608B56E00EFC70892DDAB7D709FC460AE9FE8768C6F
C03221FB3B04CE8F5AE17CBFD93B52070CAFC9D0DEDED340B9C2A482DAE26314
CCA0B2D7ADAEF0B4466DC850DE5424A5152E07058F3B750E5C1735ECF6A1A458
51E021018FF3550B87E8F904770B90C4099B1D850C57B4527DCBC327FEFC7C98
BFA81A61F8A561EE649B0989103349A4A678D187C8BD3A08779FE0AA7B6B80CA
6801F3C2D64B975592C47D6E6E7DD63D9567E8753174DA0E4363EFA7C1AFDB71
F0FA19EFA1ED312D467351D35B9A474F02B711A75A120D2ED3B99BD097BD0F13
7AB79D73E0D42634BE512059ADAB96088C1B5D964EF357DEDD7BBE804EE166BE
3F7AE1E1C62D29C5CAA8D0F9D9E9F919EC3E4B836C55C37734F8767F197FDBE3
9B5FC92D7C9C4E9F6753282A53489C24FF00F407B8428B060000
}  ;I feel like saving space today...   =^þ
shadwolf
8-May-2005
[973]
you can save even more space by switching to binary 64bits ;)
Izkata
8-May-2005
[974x2]
Ah.. I forgot about that lol
Looks wacky, but it works well!   =^)
Janeks
8-May-2005
[976]
Does somebody face with the plugin problem that I got!? I tried to 
setup an Rebol script as a Plugin in webpage, but got message Cannot 
run ...script name.r. Then to be shure that all is o'k I just copied 
an example (web page and Rebol script) from www.rebol.com and put 
on my localhost web server. All of those examples works fine on my 
IE6 and WinXP.  But when I tried the same example on my localhost 
web server I got the same message. Of course I changed parameter 
LaunchURL to point to the same (copied) script on my localhost. What 
is a diffrerence in environments that I don't know and how to solve 
this problem?
Claude
8-May-2005
[977]
rebview1210231.exe is out on http://www.rebol.net/builds/031/
shadwolf
8-May-2005
[978]
fantastic ;)
Allen
8-May-2005
[979]
FYI: Baseline releases for REBOL/View 1.3 project development only. 
Contains back-merged 2.5.58 changes (async kernel w/o async). Fixes 
a few dozen bugs. Includes new GC methods.
shadwolf
8-May-2005
[980x3]
sure but GC is still problematic maybe it could be interresting to 
rethink this part ... :)
Type "desktop" to start desktop.
WARNING: CALL function enabled in this version.
To see most recent beta changes, type: changes?
>> fun: func [/local i ][print i for i 1 10 1 [] print i ]
>> fun fun
none
none
none
none
>> stat
** Script Error: stat has no value
** Near: stat
>> stats
== 3769230
>> recycle
>> stats
== 2937954
>>
in this VM there is nothing or near nothing done and yet we get a 
lot of memory used for nothing ...
Anton
8-May-2005
[983x2]
You should recycle first.
and keep recycling until it is stable.
shadwolf
8-May-2005
[985]
yes but why I have 800 Ko used for a ingle function with a local 
var called twice
Anton
8-May-2005
[986]
I see 2.4 kb used.
Ashley
8-May-2005
[987]
We should not have to worry about how and when recycle works. It 
should just work.
Anton
8-May-2005
[988x3]
I agree, mainly.
shadwolf, see this:
>> fun: func [/local i ][print i for i 1 10 1 [] print i ]
>> stats
== 3792829
>> recycle
>> stats
== 2944354
>> recycle
>> stats
== 2944354
>> fun fun
none
none
none
none
>> stats
== 2945682
>> recycle
>> stats
== 2944450
>> recycle
>> stats
== 2944450
>> 2945682 - 2944450
== 1232
That's not too much is it ?
shadwolf
8-May-2005
[991]
3792829 -  2944354 that's mutch ;)
Anton
8-May-2005
[992]
Well, maybe rebol just needs to do a recycle at the end of its startup.
shadwolf
8-May-2005
[993x4]
Type "desktop" to start desktop.
WARNING: CALL function enabled in this version.
To see most recent beta changes, type: changes?
>> stats/frames
== [1536 1401 135 135 12522]
>>
with nothing else done
Type "desktop" to start desktop.
WARNING: CALL function enabled in this version.
To see most recent beta changes, type: changes?
>> recycle
>> stats/frames
== [1536 1121 415 415 11396]
I don't know exactly what means those values
Ashley
8-May-2005
[997]
Knowing some simple memory management techniques that assist recycle 
is useful, such as:

	my-big-binary-image: none
	unset 'my-big-object

 feel: my-feel	; instead of make .. where common code can be shared
	...
Henrik
8-May-2005
[998]
hmm.. under linux the internal version stops when I start it up after 
initial messages. It doesn't display a prompt...
Ashley
8-May-2005
[999]
>> help stats
USAGE:
    STATS /pools /types /series /frames /recycle /evals /clear

DESCRIPTION:
     System statistics.  Default is to return total memory used.
     STATS is a native value.

REFINEMENTS:

     /pools -- Returns: width units free-units units-per-alloc segments 
     mem-in-use
     /types -- Returns: Datatype count

     /series -- Returns: total blocks strings other avail free expansions
     /frames -- Returns: total used unused free values-total

     /recycle -- Returns: count series-total series-last frames-total 
     frames-last ballast
     /evals -- Returns: values functions blocks
     /clear -- Clears the evals counters
shadwolf
8-May-2005
[1000]
Ashley I know  this but that's not explain what means all the numbers 
in the recycle/frames result
Ashley
8-May-2005
[1001]
That's one for Carl I think.
Anton
8-May-2005
[1002]
I think a "frame" is an internal interpreter structure or object.
shadwolf
8-May-2005
[1003]
but in fact the GC is problematic I would prefer a dealloc/realloc 
each time a ": " is found by the REBOL  code parse engine ;)
Anton
8-May-2005
[1004]
I think that would be very slow.
shadwolf
8-May-2005
[1005]
instead of having frames not related to a rebol word and  still allocated 
in memory until the GC decides to do he's job ;)
Anton
8-May-2005
[1006]
But I also admit my opinion is probably useless until I've studied 
and tested various garbage collection schemes.
shadwolf
8-May-2005
[1007]
Slow ?  slower than what letting the memory as this for sure  !!!!
Anton
8-May-2005
[1008]
that's right - slower.