Comments on: Quick Way to List VID GUI Styles
Sometimes I regret not publishing an R2 GUI hints web page or blog... to help teach beginners. There are many useful tricks, but they aren't usually that obvious.
Here's one to remember. It displays all predefined R2 face styles and their descriptions:
foreach [name obj] system/view/vid/vid-styles [
print [name "-" obj/doc/info]
face - base face style
blank-face - empty style (transparent, minimized)
IMAGE - base style for images
BACKDROP - image scaled to fill pane
BACKTILE - image tiled to fill pane
BOX - shortcut for image
BAR - horizontal separator
SENSOR - transparent sensor area
KEY - keyboard action
BASE-TEXT - base text style
VTEXT - video text (light on dark)
TEXT - document text
BODY - document text
TXT - document text
BANNER - video text title
VH1 - video text heading
VH2 - video text heading
VH3 - video text heading
VH4 - video text heading
LABEL - label for dark background
VLAB - label for dark forms, right aligned
LBL - label for light background
LAB - label for light forms, right aligned
TITLE - document title
H1 - document heading
H2 - document heading
H3 - document heading
H4 - document heading
H5 - document heading
TT - typewriter text (monospaced)
CODE - source code text (monospaced)
BUTTON - rectangular, rendered buttons
CHECK - rectangular, rendered buttons
CHECK-MARK - transparent sensor area
RADIO - transparent sensor area
CHECK-LINE - base text style
RADIO-LINE - base text style
LED - rectangular, rendered buttons
ARROW - rectangular, rendered buttons
TOGGLE - rectangular, rendered buttons
ROTARY - rectangular, rendered buttons
CHOICE - rectangular, rendered buttons
DROP-DOWN - document text
ICON - base face style
FIELD - base face style
INFO - base face style
AREA - base face style
SLIDER - base face style
SCROLLER - base face style
PROGRESS - base style for images
PANEL - base style for images
LIST - base style for images
TEXT-LIST - document text
ANIM - base style for images
BTN - base face style
BTN-ENTER - base face style
BTN-CANCEL - base face style
BTN-HELP - base face style
LOGO-BAR - base style for images
TOG - base face style
GUI for R3?
This is R2.
Yes, but when will there be a GUI for R3? :)
Thanks. Have followed REBOL for years and didn't know about a few of them. But, how is LIST a base style for images? I thought it something more for text.
The list of styles is unsorted and it brings to mind the unsorted returns from typing HELP. For example,
"help a-button", where a-button is a button. (?)
The return is unsorted - which can lead to a tedious peck thru the list to find something. If the return from HELP a-button were sorted, it would be easier to find the item of interest.
R2 is great. If R3 is the perfection of R2, it stands to reason that like all constructions, trying to make something perfect will take some time.
Impressive, there was always something amiss with R2s GUI documents.
In R3 the documentation needs to be crystal clear, as anyone new to scripting tends to think of what they want in GUI terms rather than in terms of functions.
Seeing the complete R2 list of GUI controls does set a good first impression if something similar was up front for R3.
Here's corresponding R3 GUI code:
foreach [name obj] guie/styles [print [name "-" obj/about]]
The trouble with styles in R3 is, that it list many styles you would not probably want to see, as a user, or as a designer using some IDE, which should offer you list of styles.
A good example is the 'table. There are related styles as 'table-cell, 'table-row, 'table-header
I think, that we definitely need something better. We should either allow some tags, which would mark only "main" style, or even better:
Let's have guie/widgets list, which would group styles belonging to one widget:
guie/widgets: [table [table-row table-cell table-header]]
OTOH we would have to somehow keep in mind, that some styles are derived from other ones (dependency), so I leave it for gurus to bring us some system which makes sense ...
-pekr- I very much agree with you, too much information is a disaster, grouping really helps to put a lot of information in an understandable form.
Thank you. Keep them coming. "Hint Monday."
I miss the COBOL-style reference manual where every possible combination of words is laid out with explanations.
Pekr (I've already responded and you know what I wrote on AltME, so just posting so others can see.)
The R3 GUI already has a well defined list of tags, that, even though it's not written in stone yet, are used for different purposes in the GUI.
One of these is defining the role of each style, either as part of other styles or as a combination of other styles. This extends also to which styles are intended for end-users and which are internal.
Other tags describe a current mode, such as if the face in focus or if it's disabled.
Other tags again describe the nature of the face, whether it's an indicator or one that can be altered by a user, either with text or by clicking it with the mouse.
Also there are a variety of functions to find styles by tags (or any other specs) and to set and get tags in a face.
A dependency map is not easy to define as this can vary from style to style in ways that cannot be predicted by a style builder person or by the GUI system itself.
A style tree can be created at definition time inside STYLIZE, but it depends if we really want that overhead in a production app.
Post a Comment:
You can post a comment here. Keep it on-topic.