Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Style sheet problem + "OnChange" behavior - how to implement?

 [1/4] from: geza67:freestart:hu at: 7-Jul-2001 19:08


Hello REBOLers! I would like to globally change the appearance of my panels in a layout, but fiddling around with styles does not work. The following code snippet causes although no error, the expected visual "enhancements" :-) of the 'mypanel style simply do not show up: Are panels exempt from redefinition unlike "smaller", non-container-like facets i.e. buttons or fields ? sty: stylize [ mypanel: panel [ backdrop: water edge: [effect: 'bevel] origin: 1x1 ] ] main: layout [ styles sty across mypanel 150x150 [ across label "hello" field ] mypanel 200x100 [ text-list data [ "One" "Two" "Three" ] ] ] view main ---- My other problem is: I have several input facets of different types (fields, text lists, choosers) in a form. How could a global "on-change" event handler be implemented to collect the results from the form elements in case values of the facets were modified ? Thank you for your reactions! Cheers, Geza P.S. I feel really intimidated that such a gorgeous language like REBOL has such an insufficient documentation. Although the "heavy-loaded" CORE.PDF elucidated many aspects of core language constructs, serious GUI building is still a pain in lack of a coherent, sufficiently deep, exploratory textbook (alias VIEW.PDF :-)) ) ... or am I expecting too much yet in the dawn of a new programming era ? :-)

 [2/4] from: brett:codeconscious at: 8-Jul-2001 13:21


Hi Geza, Sorry can't help you with panel for the moment, but...
> My other problem is: I have several input facets of different types
(fields, text
> lists, choosers) in a form. How could a global "on-change" event handler
be
> implemented to collect the results from the form elements in case values
of
> the facets were modified ?
To check for changes you could write some code that checks each of the fields using a loop or whatever. Alternatively you could set a flag whenever some data is changed in each of the fields actions blocks. Then you just check the "dirty face" flag. The trick then is to capture the case that someone has made a change in the field but it has not been flagged by the action block code. do http://www.codeconscious.com/rebsite/vid-notes.r For a description and examples. But don't take everything there as gospel... I'm still learning this stuff too. :) Brett.

 [3/4] from: dockimbel:free at: 8-Jul-2001 10:53


Hi Geza, You are confusing VID keywords and facets: 'backdrop and 'origin are part of the VID keywords so they have no meanings in a face context. When 'mypanel is created in the stylesheet, these 2 words are just added in the face context (no errors to signal) but without any visible effect for the face. Here's my version : sty: stylize [ mypanel: panel water edge [effect: 'bevel] ] main: layout [ styles sty across mypanel 150x150 [ origin 1x1 across label "hello" field ] mypanel 200x100 [ origin 1x1 text-list data [ "One" "Two" "Three" ] ] ] view main You could also write the stylesheet using the 'with keyword : sty: stylize [ mypanel: panel with [ color: water edge: [effect: 'bevel] ] ] Last thing: in order to see your bevel effect, you have to set the 'size of your edge (which is by default 0x0). For example : sty: stylize [ mypanel: panel water edge [effect: 'bevel size: 2x2 color: water] ] HTH, DocKimbel. Geza wrote:

 [4/4] from: geza67:freestart:hu at: 8-Jul-2001 18:34


Hello Nenad,
> You could also write the stylesheet using the 'with keyword :
Thank you! It worked flawlessly.
> Last thing: in order to see your bevel effect, you have to set the 'size of your edge (which is by default 0x0).
Logical but NOT the kind of trivial ... - I would have assumingly slipped on that if you don't mention! Thanx, again Geza mailto:[geza67--freestart--hu]