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

World: r3wp

[!RebGUI] A lightweight alternative to VID

Anton
11-May-2007
[6442]
Alright, I don't need your strings :)
Robert
11-May-2007
[6443]
Yes, it can. That's why I need the IDs to be data independent.
Anton
11-May-2007
[6444x3]
Right.
Robert, looking at drop-list.r, it appears to me (*if* you can guarantee 
unique strings in your data) that you can maintain the selected id 
externally using the on-click action.
or does that become annoying in your app ? I imagine it would become 
annoying if you had more than, say, four drop-lists in your app.
Robert
11-May-2007
[6447]
Yes, not the perfect solution. I want to keep IDs and Strings together.
Anton
11-May-2007
[6448x9]
This is something that potentially affects many list-type gadgets/widgets.
You want to be able to connect the widget to your original data, 
without expecting it in any format, but also provide the widget with 
a function which maps the desired cells from each row into the form 
the widget likes (for its "view" of the data).
(As possible with the original VID list style.)
But I think you're right, the fastest thing to do is derive your 
own drop-list widget.
Can the data change while the drop-list is open ? ie. you click the 
down arrow to open the list, then some other asynchronous event in 
your program changes the data and asks the drop-down to refresh itself. 
(This is pretty extreme, but, just in case.)
Ok, so DROP-LIST calls CHOOSE, passing it DATA.
Then CHOOSE makes a popup FACE-ITERATOR, linking it to DATA.

The FACE-ITERATOR's PANE function just assumes the data is one item 
per row. (Or shows each complete row of the data.)
Robert, I have it working. I derived 
	drop-list.r -> drop-list-Anton.r     3 lines changed and 1 added
and 
	choose.r -> choose-Anton.r     1 line changed
Official CHOOSE probably doesn't want to be modified, but you could 
just add the modified CHOOSE function into the drop-list.
I will post it privately to you unless anyone else is interested.
Ashley
11-May-2007
[6457]
Another way of achieving the same effect is to simply populate %locale.dat 
with the required language/domain specific substitutions and let 
layout do its thing. e.g.:

	words: [
		"AAA" "My-AAA"
		"BBB" "My-BBB"
	]

then:

	drop-list data ["AAA" "BBB"]


I just don't see how changing radio-group and drop-list [only] solves 
anything. What about text-list, table, drop-list or any other widget 
that display's a value or values?
Anton
11-May-2007
[6458]
Well, it would solve Robert's immediate need from real life.
But it does beg for a more general solution.
Maybe each iterating face can have an optional map function.
Robert
12-May-2007
[6459x2]
Ashley, for tables I have always a hidden column with a record ID. 
This ID is used through all the program.


For drop-lists I "store" the text of drop-list/picked at the moment. 
Hence if you have several languages, at one time you store the DE 
version at an other one the EN version. So, one solution is, I have 
to translate to the "master" language that's used in the database.


But what if syntex changes? Than I have to update all old entries. 
Using IDs frees me from this but adds an other level of indirection. 
The common way would be to normalize my database model and use other 
tables to get IDs, and than store those etc. IMO that's the way to 
make apps complex and slow.
We have added a more "spophisticated" I18N system to RebGUI, that 
can handle not only strings in layout but at all places in the program.
Ashley
12-May-2007
[6461]
If that's the case, then aren't ID's a moot point? (i.e. the issue 
you seem to have is internationalization, not ID's).
Robert
12-May-2007
[6462x2]
It's two things: position and text independend (which solve I18N 
as well) storage.
Fonts: I want to get some text / labels in "Arial Narrow" on the 
screen. How do I do this? I tried but don't know what I need to do.
Pekr
12-May-2007
[6464x4]
Robert - what is your level of multilang apps? Only data, or also 
UI?
I am not e.g. sure I would use native RebGUI localisation, because 
it goes from messages, UI elements, to of course data. And as for 
data, you have to establish the concept yourself.
e.g. you have a list-box for fruits: ["apples" "bananas" "cherries"] 
.... that can't be sufficient in any way - it could be, if those 
"texts" could serve you as index to some localisation table:

langs: [cz "Cesky" us "English" de "German"]
fruits: ["apples" "bananas" "cherries"]

trans: [ ;table-id (name), lang, key, translation
fruits  [
    cz  [
       "apples" "jablka"
       "bananas" "banany"
       "cherries"  "tresne"
    ]
 ]
] 

select trans/fruits/cz "apples"

just an example (not practical one :-)
but above would mean, that every translation for all tables would 
be in one 'trans table - not sure it is practical. Another model 
- simply have langs table, as in above example:

langs: [cz "Cesky" us "English" de "German"]
fruits: [
1 uk "apples"
1 cz "apples"
2 uk "bananas"
2 cz "banany"
3 uk "cherries"
3 cz "tresne"
]

select * from fruits where language = 'cz'


That is more practical - simply use one more key - that of your default 
or selected (preferred) language ...


In some sense, you don't need IDs, but I prefer to have one- it depends 
what kind of databases you use. But - it is surely nearly INSANE 
to use text, which can eventually change, as a key value (e.g. because 
of typo and later need to change that text)
Ashley
12-May-2007
[6468]
want to get some text / labels in 
Arial Narrow""

	text "Some Narrow Text" font [name: "Arial Narrow"]

assuming you're on WIndows and that font is available of course.
Robert
13-May-2007
[6469x2]
I18N: We have written an own I18N system, that can handle all UI 
aspects dynamically. Table columns, drop-list data etc. Works very 
well. And it can be used not only inside GUI stuff but through the 
whole code.
For example you just specify the "master-language" drop-list data, 
provide a translation and it will change on the fly.
Pekr
13-May-2007
[6471x2]
what is that cryptic l18N word?
If I need to translate UI, drop-list elemetns plus whole data, I 
refuse to use external system for it - it belongs into tables with 
other data, at least if it concerns data itself. UI elements can 
be in catalogues, no problem here. But - whatever works for particular 
usage case is ok ...
Robert
13-May-2007
[6473]
I18N = internationalization
btiffin
15-May-2007
[6474]
There are screenshots of a RebGUI and RebDB app posted at
http://peoplecards.ca/rebol/vidpics
Louis
15-May-2007
[6475]
Nice work, Brian.
btiffin
15-May-2007
[6476]
Thanks.  This is posted more to support Ashley, and show off RebGUI. 
 I'm a big fan of
RebGUI.  :)
Maxim
15-May-2007
[6477x3]
that's just cause you never tried glayout  ;-)
<joke>
brian: looks like a large app!
btiffin
15-May-2007
[6480x2]
About 600k of sources, 5 meg total with satelite maps.
I've started playing with Glayout.  In prep for usage docs... :)
Maxim
15-May-2007
[6482x2]
600k sources!
with SDK code? or rebgui and other public includes?
btiffin
15-May-2007
[6484x2]
public includes...A few REBOL games etc...
All with DO.  Didn't have the SDK when I wrote it.
Maxim
15-May-2007
[6486]
games?
btiffin
15-May-2007
[6487x2]
Links to rebsites...planetary defender, etc, that ended up in the 
cache...
I didn't show the spreadsheet screen shot.  I noticed it had some 
real $ amounts shown.
Maxim
15-May-2007
[6489]
not sure I grasp what you mean by the cache... you mean the rebol 
sandbox is 600k ?
btiffin
15-May-2007
[6490]
No from DO-THRU
Maxim
15-May-2007
[6491]
yes exactly.