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

World: r3wp

[View] discuss view related issues

Robert
28-Dec-2005
[3515]
If I have:
view main-gui

forever [
 wait 0.1
]


How can I exit the forever loop if a user closes the program by ALT+F4 
or clicking the closing X on the window?
Henrik
28-Dec-2005
[3516]
Sorry, Robert. There is something I want to announce. :-)


http://hmkdesign.dk/list-test.png<--- a picture of the list view 
I'm building.


Currently about half done and quite usable at this time: It's resizable. 
Values are stored as blocks of blocks. All columns can be sorted. 
Input columns can be filtered so you can show only some columns. 
Columns can be freely reordered (but not in the GUI yet). One arbitrary 
column can be resized.

It has the normal range of series manipulation functions available 
in REBOL. There is also possibility for inline editing, by doubleclicking 
a line. Changed values are automatically stored in the list. All 
such operations are "bundled" in the list view VID code and you only 
need to provide whatever functions needed to store the list data 
in an external place. If a text entry is too wide, it'll be neatly 
cut with ellipsis (...).

Filtering function, to filter input by rows. Also has a scroll-to-selected-line 
function.

It's about as fast as the current LIST in VID, since it really is 
LIST with just a whole bunch of extra functions to make general list 
views easy. There are functions possible for clicking and double 
clicking and functions for retrieving rows and columns.


Current limitations: No mouse over indication (can't make it fast 
enough). Only one resizable column. No keyboard navigation. No horizontal 
scrolling. No scroll-wheel support. It doesn't integrate 100% with 
VID yet. I'm using some of my own widgets and bitmap graphics from 
a pretty big GUI library. Stripe look, font and coloring is locked. 
No standard settings yet for the list view.

All code is about 250 lines.


Planning: Reordering columns via drag'n'drop. Column resizing, if 
I can figure it out. Format the font object conditionally from list 
input (make this line bold if the age column is > 45 years, etc.). 
Grid drawing. Images in list rows. And if I can get around to it: 
Single cell in-line editing ala spreadsheets. :-)
Pekr
28-Dec-2005
[3517x2]
nice!
can be columns selected to be viewed/hidden, without altering data 
block? E.g. with Cyphre's version, if you want to remove some column, 
you have to remove it from the data block ...
Henrik
28-Dec-2005
[3519]
Yes, you can freely do that in runtime, although there is no method 
for doing that within the list. All viewing and filtering operations 
are non-destructive.
Pekr
28-Dec-2005
[3520]
Henrik - my suggestions - forget about column resizing etc. - that 
stuff may come later! I rarely use it for e.g. - what would I concetrate 
upon? Make the engine universal enough. Callbacks for double clicks, 
clicks, enter insert - simply - keyboard navigation is a must. Horizontal 
scrolling is a must. Make your engine to work with millions of lines 
of data - introduce clever caching - you can compute it - you know 
how large your grid canvas is, you can divide it by number of rows 
visible, number of columns visible. Make so called "caching window", 
having e.g. three screens of rows in the cache - once you move slider 
or press page-down several times, compute the number of presses, 
calculate new position, refill the cache, go for the display. That 
is kind of grid we did under windows 6 years ago - unbeatable ...
Henrik
28-Dec-2005
[3521]
columns have input and output description blocks. so if you have 
a dataset with [name height weight age sex] you can select to output 
[name age] and also rearrange that to [age name] and simply refresh 
the list. also adding and removing columns can be done on the fly.
Pekr
28-Dec-2005
[3522]
I prefer having grid with nice and open/extensible functionality, 
than with knowing it is based upon 'list or other style - make it 
from scratch, if necessary :-)
Robert
28-Dec-2005
[3523x2]
Henrik, NP solve the last question my self ;-))
And nice announcement. Be sure to integrate it into RebGUI as well.
Henrik
28-Dec-2005
[3525]
The caching stuff you mentioned is something I partially did for 
my old listview. Correctly the listview was very fast, but also very 
memory hungry, took a long time to initialize and the code was 5 
times bigger and a lot harder to maintain.


This one simply doesn't paint anything other than what is seen, so 
if you have a million rows, only 15 will be painted, if you have 
15 visible rows on screen. The backside to the LIST which this one 
is based on is that it uses iterated faces. This means that if I 
only do a small change to one face, it has to repaint the entire 
list view with all rows. That's why mouse over became too slow to 
be practically useful. I'm not sure yet how to fix this problem.
Robert
28-Dec-2005
[3526]
And please, add auto-filter functionality a la Excel to the columns. 
Very handy for most programs as it frees you from having to develop 
a query-dialect.
Henrik
28-Dec-2005
[3527]
robert, explain? The current filter function is a simple one which 
allows you to only show rows in which at least one cell contains 
a specific sequence of chars
Pekr
28-Dec-2005
[3528]
Henrik - auto function - you will add small icon to the header (like 
there is for sorting). It will be drop-down (combo?) style. You will 
fill-it-in with unique values for particular columns .... (in your 
example Gui tools, bug database, HVIT ...., selecting one will show 
only those related items) ...imo that is what Robert means here ....
Henrik
28-Dec-2005
[3529x3]
pekr, I could solve that by making the filter function column specific. 
currently it just searches all columns....
already in the bug database actually :-)
If I can make it 100% independent on my GUI library, I could try 
to make a release? It'll require about a days work though.
Robert
28-Dec-2005
[3532]
Yep, that's what I meant. Columnwise drop-down box with unique values. 
For example you can filter just all bugs that have high priority.
Henrik
28-Dec-2005
[3533]
that's doable once I get filtering to work on specific columns, yes....
Anton
28-Dec-2005
[3534x2]
Henrik, I advise building this style from FACE (ie. not an existing 
style, like LIST). Makes it less dependant on other code, more portable 
(ie. to RebGUI), and you will be forced to write your own pane function, 
which you will need to do anyway . :)

I based a lot of styles on existing styles, and this is a great way 
to learn, but I found as existing styles were changed (bugs fixed 
or ottherwise), my styles would break. Then it's a run-around to 
do a version-dependant fix for the problems.
Petr, no it isn't.
Henrik
28-Dec-2005
[3536]
anton, I'll see what I can do about it (would also learn a bit about 
iterated faces), but I'm focusing on getting things to work for now 
:-)
Anton
28-Dec-2005
[3537]
As you wish.
Henrik
29-Dec-2005
[3538]
If I were to create it purely derived from FACE, how do I add it 
as a style under VID?
Pekr
29-Dec-2005
[3539]
look at Cyphre's devcon presentation papers .... I think stylize/master 
is the way ...
Henrik
29-Dec-2005
[3540x3]
I found the set-style function, which could do the trick, but it's 
unfortunately not documented (grr)
just returns an error. might be a context problem, since it's internal
>> a: get-style 'button
>> set-style 'test a
>> view layout [test] ; displays a button

but it doesn't work on my own face...
Pekr
29-Dec-2005
[3543]
look at source of get-style ... it is only short-hand func to get 
style out of system/view/vid blabla path ... because - if you probe 
e.g. button in normal way, you will get nearly endless source output 
... hence get-style is handy ... imo
Henrik
29-Dec-2005
[3544]
it seems the face object in itself isn't enough... I need to make 
a face through a derived object from one of the standard styles instead. 
they contain a lot more information
Pekr
29-Dec-2005
[3545x4]
http://www.colellachiara.com/devcon05/cyphre.html
look at those slides - imo it is not so difficult to understand how 
you create your own styles ....
help make-face ....
or you just can start with 'blank-face instead?
Henrik
29-Dec-2005
[3549]
the presentation looks completely screwed up here...
Pekr
29-Dec-2005
[3550x2]
I just unzipped it, hit enter on .r file, and using View 1.3.2 I 
got nice, full-screen presentation ... you use right-arrow to move 
to next slide ...
worth looking at, really, at least for me ...
Henrik
29-Dec-2005
[3552x2]
oh... doesn't run under linux, it seems
because text is drawn with AGG
Pekr
29-Dec-2005
[3554]
that is bad then ... should be reported?
Henrik
29-Dec-2005
[3555]
well, it's a known limitation
Pekr
29-Dec-2005
[3556x3]
just a cut-off:
- nubunk definition:

stylize/master [
  my-style: face with [
     size: 100x100
     init: []
   ]
]

view layout [my-style "Hello world!"]
ah, I have shifted my hands on keyboard :-)) nubunk = minimal :-)
simply via stylize/master you get defined your custom style in global 
stylesheet, so you can use it in VID ...
Henrik
29-Dec-2005
[3559x2]
good one.. will experiment with that a bit. thanks
I merely didn't think the face object itself was usable. seems I 
need to write a lot of additional code
Rebolek
29-Dec-2005
[3561]
Pekr: NUBUNK is nice and has only 27 hits on Google. You should use 
it as some product name :))
Volker
29-Dec-2005
[3562x2]
I would start like Pekr suggested, but with a box. Thats the minimal 
do-nothing face.
Hmm, http://www.codeconscious.com/rebsite/vid-ancestry.rsays a box 
is an image.
Henrik
29-Dec-2005
[3564]
ok, I've been experimenting with it a bit, and I must say, it's harder 
than I thought. I think I'll give up on it for now. too many things 
don't fit together...