diff --git a/devel/scheme/gui/scheme-gui-dialogs.en.tm b/devel/scheme/gui/scheme-gui-dialogs.en.tm index 3aace68..f1d7f67 100644 --- a/devel/scheme/gui/scheme-gui-dialogs.en.tm +++ b/devel/scheme/gui/scheme-gui-dialogs.en.tm @@ -1,4 +1,4 @@ - + @@ -147,7 +147,7 @@ Note that our second dialog, is just a copy of with an extra line at the end. We could have spared us the - keytrokes in this way: + keystrokes in this way: <\session|scheme|default> <\unfolded-io|Scheme] > @@ -182,4 +182,7 @@ Foundation; with no Invariant\nSections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of\nthe license is included in the section entitled "GNU Free Documentation License".> - \ No newline at end of file + + + +> \ No newline at end of file diff --git a/devel/scheme/gui/scheme-gui-intro.en.tm b/devel/scheme/gui/scheme-gui-intro.en.tm index 513aba5..d24fbec 100644 --- a/devel/scheme/gui/scheme-gui-intro.en.tm +++ b/devel/scheme/gui/scheme-gui-intro.en.tm @@ -1,4 +1,4 @@ - + @@ -150,6 +150,10 @@ + From here you can go on reading ``'' or see the sample widgets in + . + team.> + + + +<\body> + + + , and + > + + <\explain> + + )> + <|explain> + Builds a combo box which will execute whenever the user + makes a choice. The may be given in any length + unit. + + <\session|scheme|default> + <\unfolded-io|Scheme] > + (tm-widget (test-enum) + + \ \ (enum (display* "First " answer "\\n") + + \ \ \ \ \ \ \ \ '("gnu" "gnat" "zebra") + + \ \ \ \ \ \ \ \ "zebra" "10em"))) + <|unfolded-io> + \; + + + <\input|Scheme] > + (show test-enum) + + + + + <\explain> + + )> + <|explain> + Builds a list of items which will execute whenever the user + makes a choice. is a list, a value. + Contrary to , all items are displayed simultaneously. If one + desires scrollbars, the widget must be enclosed in a + container. The width of the widget may be set using a + widget. + + <\session|scheme|default> + <\unfolded-io|Scheme] > + (tm-widget (test-choice) + + \ \ (resize "200px" "50px" + + \ \ \ \ (scrollable + + \ \ \ \ \ \ (choice (display* answer "\\n") + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ '("First" "Second" "Third" "Fourth" + "Fifth" "Sixth") + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ "Third")))) + <|unfolded-io> + \; + + + <\input|Scheme] > + (show test-choice) + + + + + <\explain> + + )> + <|explain> + Builds a list of items which will execute whenever the user + makes a choice. Several items may be selected at the same time. Both + and are hence lists. Contrary to + , all items are displayed simultaneously. If one desires + scrollbars, the widget must be enclosed in a container. + The width of the widget may be set using a widget. + + <\session|scheme|default> + <\unfolded-io|Scheme] > + (tm-widget (test-choices) + + \ \ (resize "200px" "100px" + + \ \ \ \ (scrollable + + \ \ \ \ \ \ (choices (display* answer "\\n") + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ '("A" "B" "C" "D" "E" "F" "G" "H" "I" + "J" "K" "L") + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ '("B" "D" "F" "H" "J" "L"))))) + <|unfolded-io> + \; + + + <\input|Scheme] > + (show test-choices) + + + + + > + + <\explain> + )> + <|explain> + The provides a graphical representation of a + tree (not a tree!). This may be part of a + document or any other tree. The first node in won't be + displayed. All other nodes may have attributes called + which will determine the textual representation of the node, whether it + has some icon next to it and which one, etc. These attributes are simply + children of the nodes in at predefined positions given by + the data roles specification in the argument . This + is a list of identifiers for each tree label present in the data. For + instance, with the following data roles specification: + + <\scm-code> + (list + + \ \ (library \ \ \ DisplayRole DecorationRole UserRole:1) + + \ \ (collection DisplayRole UserRole:1)) + + + we use the data: + + <\scm-code> + (root + + \ \ (library "My bibliography" "icon.xpm" 12345 + + \ \ \ \ (collection "Cool stuff" 001) + + \ \ \ \ (collection "Things to read" 002) + + \ \ \ \ (collection "Current work" 003 + + \ \ \ \ \ \ (collection "Forever current" 004) + + \ \ \ \ \ \ (collection "Read me" 005)))) + + + Notice that the node won't be displayed by the + and needs no data roles. Here is used + to store database ids but it can be anything else. The supported data + roles are: + + <\verbatim-code> + <\code> + DisplayRole \ \ \ \ \ \ \ ; a string to be displayed + + EditRole \ \ \ \ \ \ \ \ \ \ ; a string valid for an editable + representation + + ToolTipRole \ \ \ \ \ \ \ ; a small tooltip to display when the mouse + hovers over + + StatusTipRole \ \ \ \ \ ; for the status bar (if present and + supported) + + DecorationRole \ \ \ \ ; file name of an icon to use (in + $TEXMACS_PIXMAP_PATH) + + CommandRole \ \ \ \ \ \ \ ; command to be executed when the user + (double?) clicks + + UserRole:\number\ \ ; left to user definition + + + + It is possible to omit the data role specification. By default the widget + will use the tree label's string representation as , + , and . For the + it will try to load pixmaps named + in . + + For an example see in . + + + + + We build on the previous example: + + <\session|scheme|default> + <\input|Scheme] > + (define t + + \ \ (stree-\tree + + \ \ \ '(root + + \ \ \ \ \ (library "My bibliography" "icon.xpm" 12345 + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ (collection "Cool stuff" 001) + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ (collection "Things to read" 002) + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ (collection "Current work" 003 + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (collection + "Forever current" 004) + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (collection "Read + me" 005)))))) + + + <\input|Scheme] > + (define dd + + \ \ (stree-\tree + + \ \ \ '(list (library DisplayRole DecorationRole UserRole:1) + + \ \ \ \ \ \ \ \ \ \ (collection DisplayRole UserRole:1)))) + + + <\unfolded-io|Scheme] > + (tm-widget (widget-library) + + \ \ (resize ("150px" "400px" "9000px") ("300px" "600px" "9000px") + + \ \ \ \ (vertical + + \ \ \ \ \ \ (bold (text "Testing tree-view")) + + \ \ \ \ \ \ === + + \ \ \ \ \ \ (tree-view t dd)))) + <|unfolded-io> + \; + + + <\input|Scheme] > + (top-window widget-library "Tree View") + + + + + + We can even use the as argument to . + Changes in the buffer will show up immediately in the widget. In this + example we use the default data role specification. + + <\warning> + As of this writing (31 Dec. 2013) the implementation is sloppy + and forces a full reloading of the data model for each + of the . The slowdown is already noticeable with documents of a + few pages like this one. Additionally, the current selection in the + widget is lost after each modification to the buffer (fixing this + requires writing a fully fledged and probably an + intermediate copy of the data). + + + <\session|scheme|default> + <\unfolded-io|Scheme] > + (tm-widget (widget-buffer) + + \ \ (resize ("150px" "400px" "9000px") ("300px" "600px" "9000px") + + \ \ \ \ (vertical + + \ \ \ \ \ \ (bold (text "Testing tree-view")) + + \ \ \ \ \ \ === + + \ \ \ \ \ \ (tree-view (buffer-tree) (stree-\tree '(dummy)))))) + <|unfolded-io> + \; + + + <\input|Scheme] > + (top-window widget-buffer "Tree View") + + + + + + If your has the side tools enabled, you can try this: + + <\session|scheme|default> + <\unfolded-io|Scheme] > + (tm-widget (texmacs-side-tools) + + \ \ (vertical + + \ \ \ \ (hlist (glue #t #f 15 0) (text "Document tree:") (glue #t #f 15 + 0)) + + \ \ \ \ --- + + \ \ \ \ (tree-view (buffer-tree) (stree-\tree '(unused))))) + <|unfolded-io> + \; + + + + team.> + + + + + +> \ No newline at end of file diff --git a/devel/scheme/gui/scheme-gui.en.tm b/devel/scheme/gui/scheme-gui.en.tm index 8d6a158..d005e7c 100644 --- a/devel/scheme/gui/scheme-gui.en.tm +++ b/devel/scheme/gui/scheme-gui.en.tm @@ -1,4 +1,4 @@ - + @@ -25,6 +25,8 @@ + +