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

World: r3wp

[!RebGUI] A lightweight alternative to VID

Graham
23-Nov-2006
[5009]
make object! [
   code: 400
   type: 'math
   id: 'zero-divide
   arg1: none
   arg2: none
   arg3: none
   near: [pane/data: - para/scroll/y / (total - visible)]
   where: 'switch
]
Robert
26-Nov-2006
[5010]
Ashley, sent you our current RebGUI version with documentation.
Ashley
26-Nov-2006
[5011]
Thanks, I'll have a look at this next weekend.
Graham
27-Nov-2006
[5012x2]
Ashley, feasible to add a scroller to tab panels if the widgets inside 
are too large?
Pekr, is it time to release the grid that Cyphre did yet?
Pekr
27-Nov-2006
[5014]
yes, I will do, shortly. Now I will concentrate my free IT time to 
release it ...
Ashley
27-Nov-2006
[5015]
Graham, difficult. Not going to be a high priority for me anytime 
soon.
Louis
2-Dec-2006
[5016]
Would someone please give me an example of how to feed data from 
a sqlite db into a rebgui table?
Robert
2-Dec-2006
[5017x2]
a: sql/flat "select * from"
insert clear table/data a
table/redraw
The returned columns from SQLite must be the same layout as the table 
definition.
Ashley
2-Dec-2006
[5019]
connect/flat %test.db

display "Test" compose/only [

 table options ["Col" left 1.0] data (sql "select col from my_table")
]

do-events
Louis
3-Dec-2006
[5020x4]
Robert and Ashley, many thanks! I now have table displayed.
However, the new rows do not display when entered. I have to restart 
the script to see them.
I assume that table/redraw is needed to make them show up, but I 
can't get it to work.
By the way, very clear example, Ashley.
Robert
3-Dec-2006
[5024]
Ashley's example is a static one. The data is fetched only once when 
the compose happens. If you add my code to an action block of a button 
for example, the table is updated dynamically.
Jean-François
5-Dec-2006
[5025]
Guys, it would be great if you could submit this as code for the 
cookbook.

It would take a beginner like me months of part time reading and 
thinkering to come up with this.
Think of the "outside in" approach proposed by B.Meyer.
Graham
8-Dec-2006
[5026]
Ashley, I have a label inside a group-box which is inside three nested 
tab-panels.  Localisation is not changing the labels.
Ashley
8-Dec-2006
[5027]
Works here. Are you sure the label is not being set/changed dynamically? 
Which raises the interesting question of whether the show-text, data 
and title funcs should be "locale aware" ...
Graham
8-Dec-2006
[5028x4]
Yes, it is not being changed dynamically.
Must be my old distro that I am still using.
I'll do some tests with the latest.
but I do have some labels, buttons where the text is changed dynamically
Ashley
8-Dec-2006
[5032x2]
Localization code hasn't changed for a long time, so I doubt it's 
a build# problem.
The test I ran here was a single label in a group-box within a tab-panel 
within a tab-panel within a tab-panel.
Graham
8-Dec-2006
[5034x2]
which is what I have here.
I wonder if it's because I use ":" at the end of my labels
Ashley
8-Dec-2006
[5036]
That would be it. "Name:" <> "Name"
Graham
8-Dec-2006
[5037x3]
Hmm. Screws it up.
words: [
Occupation:
 "Occ:"
	"Bytes"			"Octets"
	"Cancel"		"Annuler"
Instead of "Occ:" the label is now showing "Bytes"
Ashley
8-Dec-2006
[5040]
Probably because you don't have a space between "Occupation:" and 
 "Occ:"
Graham
8-Dec-2006
[5041x5]
I do ..
one space and two tabs
just added those to be sure.
just tried it with other words . it causes the locale to skip the 
following word
for me anyway
Ashley
8-Dec-2006
[5046]
Reproduced it, very odd. Looking at it now ...


re dynamic translations. Reading Gabriele's comments in the chat 
group on his TRANSLATE func got me to thinking we could do something 
similar, as in:

	display "Test" [
		button "Old Text" [face/text: translate "New Text" show face]
	]


'translate would return a string translation if passed a string, 
otherwise a block of translated strings if passed a block.
Graham
8-Dec-2006
[5047x3]
why not just show-translate instead of show-text ?
or, show-text translate "sometext"
show-text widget translate "sometext"
Ashley
8-Dec-2006
[5050x2]
Yep, that's how it works The important point in the example I posted 
was not that it didn't use show-text, but that it is a func that 
is called to explicitly translate string(s) used by other function(s).
For your label problem, how many words are defined:

	...
	button [print length? ctx-rebgui/locale*/words]
Graham
8-Dec-2006
[5052x4]
Seems to me you might as well put the translate inside show-text
64
even !
hmm.  retract that ... regarding show-text
Ashley
8-Dec-2006
[5056]
hmm ... retract my being able to reproduce the problem. Change your 
locale.dat file to have the following:

words: [
	"AA:"	"A:"
	"BB:"	"B:"
]

and verify labels "AA:" and "BB:" are translated correctly.
Graham
8-Dec-2006
[5057]
AA: gives me BB:
Ashley
8-Dec-2006
[5058]
Really? Even with code as simple as:

	display "Test" [label "AA:"]


The code that does the translations is nothing more than a simple 
select, which you can run manually by adding a halt to your code 
and doing the following from the console:

	select ctx-rebgui/locale*/words "AA:"