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

World: r3wp

[View] discuss view related issues

Graham
7-Nov-2005
[3126x2]
what's the freebie oracle like?
Louis, I would add a refinement to the refresh function, which refers 
to a face.  And on that refinement, copy the data to the other face.
ICarii
7-Nov-2005
[3128]
dunno.. use 10g Enterprise at work... now if only view had some fast 
professional looking widgets to act as a front end.. :(
Louis
7-Nov-2005
[3129]
Graham, this sentence can have two meanings: "I wouldn't use the 
style and just stick the function in the action block and do the 
copy there." Would you please reword it?
Graham
7-Nov-2005
[3130x4]
perhaps that won't work.
Anyway, I don't use styles myself ... too lazy.
Anyway, ICarii's solution doesn't catch tabs ( you can add that ), 
and also clicking to get out of the field.
now that we have rebcode, are we going to see your editor reborn?
Louis
7-Nov-2005
[3134]
I think styles are necessary in this case.  I have two colums of 
field (a debit column and a credit column). As data is entered into 
a column it has to be added to a total field at the bottom.
Graham
7-Nov-2005
[3135]
Was it Terakahi or flounder or something...s
Louis
7-Nov-2005
[3136x2]
ICarii and Graham, I need an example. I don't know much about view.
ICarii, please replace "...." with the rest of what you had in mind.
DideC
8-Nov-2005
[3138x2]
As Graham Point out, its not good to use 'style facet because you 
can have several faces of the same style.

What you want is to "link" style together : this is the role of the 
'related facet.
You usually use it with check/radio/toggle to group them.
To specifie a group, you use the 'of keyword in VID :

 View layout [radio of 'one radio of 'one radio of 'two radio of 'two 
 radio of 'two]
So just change your refesh function to test the face/related facet 
instead of style.

This way you can have some fileds in the 'debit group and others 
in the 'credit group
Louis
8-Nov-2005
[3140]
DideC, thanks. I'll do some studying and see if I can figure out 
what you mean. Problem is that I haven't been getting to do much 
programming during this past year, and I have forgotten much of what 
litte I knew.  :>(
james_nak
8-Nov-2005
[3141]
When scaling an image, other than using the "effect: [aspect]", are 
there other controls for the anti-aliasing?
Henrik
8-Nov-2005
[3142]
AA scaling currently only works with DRAW, afaik
james_nak
8-Nov-2005
[3143]
Thanks. Now I need to check out Draw.
DideC
8-Nov-2005
[3144x2]
Louis: an example of what I say. I hope its what you need:
refresh: has [amount credit debit][
    debit: credit: 0
    foreach face out/pane [
        if find [credit debit] face/related [ ; only money fields
            amount: any [attempt [to-money face/text] $0.00]

            if any [amount <> $0.00  not empty? face/text] [face/text: form amount]
            if face/related = 'credit [credit: credit + amount]
            if face/related = 'debit [debit: debit + amount]
        ]
    ]
    total-debits/text: form debit
    total-credits/text: form credit
    show out
]

view out: layout [
	style c-field field [refresh] of 'credit
	style d-field c-field of 'debit
	style lab text 200 bold
	across
	lab "Credit" lab "Debit" return
	c-field d-field return
	c-field d-field return
	c-field d-field return
	lab "Total credit" lab "Total debit" return
	total-credits: field total-debits: field
]
james_nak
8-Nov-2005
[3146]
Henrik, the answer was to use Draw as it really accomplishes what 
I originally wanted.
 Thanks.
Louis
8-Nov-2005
[3147]
DideC, many many thanks.  I try that and let you know how it works. 
 It may be a day or so, however, as I am traveling in a motorhome, 
and don't always have internet access.  Again thanks!
james_nak
9-Nov-2005
[3148]
Has anyone run into a problem with "save" as in save/png where it 
sometimes doesn't want to overwrite a file? THe old file contents 
(in this case an image) is still there.
Geomol
9-Nov-2005
[3149]
James, I sometime have problems with cache, I think. Try closing 
your rebol window and then look at the saved file. Sometime I reboot 
my machine to be 100% sure. At most times, I have no problem, so 
I haven't investigated it.
Anton
9-Nov-2005
[3150]
Henrik, can you show us the code (or a cut down demo) of your list 
?
Henrik
9-Nov-2005
[3151x2]
I threw the code out. It's been replaced by the standard LIST function 
in layout
it was way too memory hungry and the code was about 800 lines. it 
also took about 25 lines to initialize one list.
Geomol
9-Nov-2005
[3153x2]
That's the spirit! Only use the past to learn from. If use've made 
bad decisions, change them the second you realize, they're wrong. 
Cut the crap and throw out the garbage.
We're real rebels! ;-)
Or as Carl put it in the "Tech News" group on the 19-Sep: 

I say: Push forward and ignore the noise, recruit newbies, use the 
great ideas, dump the rest.
Anton
9-Nov-2005
[3155]
Gosh. Was the old code an attempt at direct pane programming ? Is 
the standard LIST performing ok ?
Henrik
9-Nov-2005
[3156x3]
The standard list has a few problems, notably in that you are forced 
to update the entire listview, when you want to refresh a single 
entry. That makes it slow for mouseovers.


The old code was much faster at scrolling and doing mouse overs as 
I could have full control over which part of the list I wanted to 
show, but everything was done manually, but it was not direct pane 
programming.
but the standard list is very elegantly done and allows you to have 
a simple iteration function. It's a bit too simple, but then again 
I can't find proper docs on doing LIST with SUPPLY
(but I seem to be using the word 'but' a lot)
james_nak
10-Nov-2005
[3159]
All, FYI, I found out my "save" problem was not setting my words 
to "[]" before a load. SAving was working...the viewing was not! 
When will I remember that little thing about Rebol.
Henrik
11-Nov-2005
[3160]
I'm trying to make a button behave like a text field, but I can't 
make it work.


view layout [b: button "Hello" with [flags: [field input return text]]]

what's missing?
Volker
11-Nov-2005
[3161]
the right feel?
Henrik
11-Nov-2005
[3162]
could be...
Geomol
11-Nov-2005
[3163]
Try:
layout [f: field "Hello"]
probe f/feel
Henrik
11-Nov-2005
[3164]
volker, geomol, thanks! it was correct
Graham
14-Nov-2005
[3165x2]
I've been playing around with Frank's paint.r in the library.  I 
implemented a free hand draw tool but found that a simple line or 
circle takes about 32k of draw instructions :(
I wonder if there's a more efficient way to do this than combining 
lots of line draws together?
Ashley
14-Nov-2005
[3167]
It's a simple problem of polling frequency. Try changing the code 
so that a new point is not placed unless it is more than (say) 4x4 
away from the previous point.
Anton
14-Nov-2005
[3168x3]
I see. I noticed also that the DRAW function adds
	PEN pen-col FILL-PEN fill-col LINE start offset
for every new point, when what is necessary is only new offsets.
I suggest to add an OLD-TYPE variable, and put something like this 
in the DRAW function:
	either all [type = 'free-hand type <> old-type][
		; add all the initialising stuff (PEN FILL-PEN, LINE start)
	][
		; otherwise compose in nothing
	]
So when you change from circle to free-hand, DRAW adds the initialising 
draw commands, but after that, just adds an offset.

Ooops, I should have checked for type = old-type so we can add the 
single offset. Anyway, you get the idea. Just move that condition 
inside the either true block.
Henrik
15-Nov-2005
[3171]
hmm... how do I set the default entry in a CHOICE at layout time? 
I wanted to do something like this:

view layout [choice "1" "2" "3" with [data: next face/data]]
RobertDumond
15-Nov-2005
[3172x4]
hallo, alls... i have a question regarding view events...  i am testing 
using the following code, which creates two text fields, one of which 
only accepts numerical input...
view/new layout [
    the-field: field feel [
        engage: func [face action event] [
        	if action = 'key [
			if all [ greater? (to-integer event/key) 47
				 lesser? (to-integer event/key) 58 ] [
				 append face/text event/key 
				 show face 
			]
		]    
        ]
    ]
    new-field: field
]
focus the-field
do-events
first question, is how can i get the first text field to accept mouse 
click events?  how then do i get it to recognize the tab key to switch 
focus to the next field?
also, can i update the position of the text curser in the number 
field so that it is the current position being typed at? (bad wording, 
i know... )