diff --git a/collects/scribblings/gui/button-class.scrbl b/collects/scribblings/gui/button-class.scrbl index 7c7b4c0a39..4521325c75 100644 --- a/collects/scribblings/gui/button-class.scrbl +++ b/collects/scribblings/gui/button-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/button}} + @defclass/title[button% object% (control<%>)]{ Whenever a button is clicked by the user, the button's callback diff --git a/collects/scribblings/gui/check-box-class.scrbl b/collects/scribblings/gui/check-box-class.scrbl index 620d8f92a7..d4cb8ecfe4 100644 --- a/collects/scribblings/gui/check-box-class.scrbl +++ b/collects/scribblings/gui/check-box-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/check-box}} + @defclass/title[check-box% object% (control<%>)]{ A check box is a labeled box which is either checked or unchecked. diff --git a/collects/scribblings/gui/choice-class.scrbl b/collects/scribblings/gui/choice-class.scrbl index 5042809f7c..a09d1c4975 100644 --- a/collects/scribblings/gui/choice-class.scrbl +++ b/collects/scribblings/gui/choice-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/choice}} + @defclass/title[choice% object% (list-control<%>)]{ A choice item allows the user to select one string item from a pop-up diff --git a/collects/scribblings/gui/combo-field-class.scrbl b/collects/scribblings/gui/combo-field-class.scrbl index db087ce8da..31a8dd7b6d 100644 --- a/collects/scribblings/gui/combo-field-class.scrbl +++ b/collects/scribblings/gui/combo-field-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/combo-field}} + @defclass/title[combo-field% text-field% ()]{ A @racket[combo-field%] object is a @racket[text-field%] diff --git a/collects/scribblings/gui/editor-canvas-class.scrbl b/collects/scribblings/gui/editor-canvas-class.scrbl index 807d478d46..c3631babdc 100644 --- a/collects/scribblings/gui/editor-canvas-class.scrbl +++ b/collects/scribblings/gui/editor-canvas-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/editor-canvas}} + @defclass/title[editor-canvas% object% (canvas<%>)]{ An @racket[editor-canvas%] object manages and displays a diff --git a/collects/scribblings/gui/gauge-class.scrbl b/collects/scribblings/gui/gauge-class.scrbl index da5c6bb74e..823442087c 100644 --- a/collects/scribblings/gui/gauge-class.scrbl +++ b/collects/scribblings/gui/gauge-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/gauge}} + @defclass/title[gauge% object% (control<%>)]{ A gauge is a horizontal or vertical bar for displaying the output diff --git a/collects/scribblings/gui/group-box-panel-class.scrbl b/collects/scribblings/gui/group-box-panel-class.scrbl index 3d5104c206..f1640fcc43 100644 --- a/collects/scribblings/gui/group-box-panel-class.scrbl +++ b/collects/scribblings/gui/group-box-panel-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/group-box-panel}} + @defclass/title[group-box-panel% vertical-panel% ()]{ A group-box panel arranges its subwindows in a single column, but also diff --git a/collects/scribblings/gui/gui.scrbl b/collects/scribblings/gui/gui.scrbl index b4403274eb..43ec381ebc 100644 --- a/collects/scribblings/gui/gui.scrbl +++ b/collects/scribblings/gui/gui.scrbl @@ -41,6 +41,7 @@ Both parts of the toolbox rely extensively on the @;------------------------------------------------------------------------ @include-section["win-overview.scrbl"] +@include-section["widget-gallery.scrbl"] @include-section["win-classes.scrbl"] @include-section["win-funcs.scrbl"] @include-section["editor-overview.scrbl"] diff --git a/collects/scribblings/gui/image/button.png b/collects/scribblings/gui/image/button.png new file mode 100644 index 0000000000..23536d9e14 Binary files /dev/null and b/collects/scribblings/gui/image/button.png differ diff --git a/collects/scribblings/gui/image/check-box.png b/collects/scribblings/gui/image/check-box.png new file mode 100644 index 0000000000..3c562d9ce7 Binary files /dev/null and b/collects/scribblings/gui/image/check-box.png differ diff --git a/collects/scribblings/gui/image/choice.png b/collects/scribblings/gui/image/choice.png new file mode 100644 index 0000000000..5adaf95bbb Binary files /dev/null and b/collects/scribblings/gui/image/choice.png differ diff --git a/collects/scribblings/gui/image/combo-field.png b/collects/scribblings/gui/image/combo-field.png new file mode 100644 index 0000000000..df02e1a17f Binary files /dev/null and b/collects/scribblings/gui/image/combo-field.png differ diff --git a/collects/scribblings/gui/image/editor-canvas.png b/collects/scribblings/gui/image/editor-canvas.png new file mode 100644 index 0000000000..470a489fd0 Binary files /dev/null and b/collects/scribblings/gui/image/editor-canvas.png differ diff --git a/collects/scribblings/gui/image/gauge.png b/collects/scribblings/gui/image/gauge.png new file mode 100644 index 0000000000..e06fb76cd3 Binary files /dev/null and b/collects/scribblings/gui/image/gauge.png differ diff --git a/collects/scribblings/gui/image/group-box-panel.png b/collects/scribblings/gui/image/group-box-panel.png new file mode 100644 index 0000000000..a697b02328 Binary files /dev/null and b/collects/scribblings/gui/image/group-box-panel.png differ diff --git a/collects/scribblings/gui/image/list-box.png b/collects/scribblings/gui/image/list-box.png new file mode 100644 index 0000000000..21f5ade09d Binary files /dev/null and b/collects/scribblings/gui/image/list-box.png differ diff --git a/collects/scribblings/gui/image/menu-bar.png b/collects/scribblings/gui/image/menu-bar.png new file mode 100644 index 0000000000..46d89ef256 Binary files /dev/null and b/collects/scribblings/gui/image/menu-bar.png differ diff --git a/collects/scribblings/gui/image/message.png b/collects/scribblings/gui/image/message.png new file mode 100644 index 0000000000..96cf89097e Binary files /dev/null and b/collects/scribblings/gui/image/message.png differ diff --git a/collects/scribblings/gui/image/panel.png b/collects/scribblings/gui/image/panel.png new file mode 100644 index 0000000000..539f37c539 Binary files /dev/null and b/collects/scribblings/gui/image/panel.png differ diff --git a/collects/scribblings/gui/image/radio-box.png b/collects/scribblings/gui/image/radio-box.png new file mode 100644 index 0000000000..06e5bedf20 Binary files /dev/null and b/collects/scribblings/gui/image/radio-box.png differ diff --git a/collects/scribblings/gui/image/slider.png b/collects/scribblings/gui/image/slider.png new file mode 100644 index 0000000000..ff431e14d9 Binary files /dev/null and b/collects/scribblings/gui/image/slider.png differ diff --git a/collects/scribblings/gui/image/tab-panel.png b/collects/scribblings/gui/image/tab-panel.png new file mode 100644 index 0000000000..679316cb94 Binary files /dev/null and b/collects/scribblings/gui/image/tab-panel.png differ diff --git a/collects/scribblings/gui/image/text-field.png b/collects/scribblings/gui/image/text-field.png new file mode 100644 index 0000000000..28a49cd80a Binary files /dev/null and b/collects/scribblings/gui/image/text-field.png differ diff --git a/collects/scribblings/gui/list-box-class.scrbl b/collects/scribblings/gui/list-box-class.scrbl index c9b430cc8d..7506d8598e 100644 --- a/collects/scribblings/gui/list-box-class.scrbl +++ b/collects/scribblings/gui/list-box-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/list-box}} + @(define lbnumnote @elem{List box rows are indexed from @racket[0].}) @(define lbcnumnote @elem{List box rows and columns are indexed from @racket[0].}) diff --git a/collects/scribblings/gui/menu-bar-class.scrbl b/collects/scribblings/gui/menu-bar-class.scrbl index a0aea5185c..66a420ee04 100644 --- a/collects/scribblings/gui/menu-bar-class.scrbl +++ b/collects/scribblings/gui/menu-bar-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/menu-bar}} + @defclass/title[menu-bar% object% (menu-item-container<%>)]{ A @racket[menu-bar%] object is created for a particular diff --git a/collects/scribblings/gui/message-class.scrbl b/collects/scribblings/gui/message-class.scrbl index db33c2513a..38263fa797 100644 --- a/collects/scribblings/gui/message-class.scrbl +++ b/collects/scribblings/gui/message-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/message}} + @defclass/title[message% object% (control<%>)]{ A message control is a static line of text or a static bitmap. The diff --git a/collects/scribblings/gui/panel-class.scrbl b/collects/scribblings/gui/panel-class.scrbl index 015f51224d..069a020733 100644 --- a/collects/scribblings/gui/panel-class.scrbl +++ b/collects/scribblings/gui/panel-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/panel}} + @defclass/title[panel% object% (area-container-window<%> subwindow<%>)]{ A panel is a both a container and a containee window. It serves mainly diff --git a/collects/scribblings/gui/radio-box-class.scrbl b/collects/scribblings/gui/radio-box-class.scrbl index 8557e22b24..3ab6167a1c 100644 --- a/collects/scribblings/gui/radio-box-class.scrbl +++ b/collects/scribblings/gui/radio-box-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/radio-box}} + @defclass/title[radio-box% object% (control<%>)]{ diff --git a/collects/scribblings/gui/slider-class.scrbl b/collects/scribblings/gui/slider-class.scrbl index 3c48cef6ba..7e9c5368c5 100644 --- a/collects/scribblings/gui/slider-class.scrbl +++ b/collects/scribblings/gui/slider-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/slider}} + @defclass/title[slider% object% (control<%>)]{ A @racket[slider] object is a panel item with a handle that the user can diff --git a/collects/scribblings/gui/tab-panel-class.scrbl b/collects/scribblings/gui/tab-panel-class.scrbl index 40d486e03b..4b6106783a 100644 --- a/collects/scribblings/gui/tab-panel-class.scrbl +++ b/collects/scribblings/gui/tab-panel-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/tab-panel}} + @defclass/title[tab-panel% vertical-panel% ()]{ A tab panel arranges its subwindows in a single column, but also diff --git a/collects/scribblings/gui/text-field-class.scrbl b/collects/scribblings/gui/text-field-class.scrbl index e9e7d1d2a9..00bd859049 100644 --- a/collects/scribblings/gui/text-field-class.scrbl +++ b/collects/scribblings/gui/text-field-class.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require "common.rkt") +@centered{@image[#:suffixes @list[".png"]]{image/text-field}} + @defclass/title[text-field% object% (control<%>)]{ A @racket[text-field%] object is an editable text field with an diff --git a/collects/scribblings/gui/widget-gallery.rkt b/collects/scribblings/gui/widget-gallery.rkt new file mode 100644 index 0000000000..8c38419664 --- /dev/null +++ b/collects/scribblings/gui/widget-gallery.rkt @@ -0,0 +1,18 @@ +(module widget scheme/base + (require racket/string + "common.rkt") + + (provide showcase-widget) + + (define-syntax showcase-widget + (syntax-rules () + ((_ widget code ...) + (begin + (racketlink widget + (image #:suffixes + (list ".png") + (string-append "image/" + (string-trim (symbol->string 'widget) + "%" + #:left? #f)))) + (racketblock code ...)))))) diff --git a/collects/scribblings/gui/widget-gallery.scrbl b/collects/scribblings/gui/widget-gallery.scrbl new file mode 100644 index 0000000000..37c35ae496 --- /dev/null +++ b/collects/scribblings/gui/widget-gallery.scrbl @@ -0,0 +1,136 @@ +#lang scribble/doc +@(require "common.rkt" + "widget-gallery.rkt") + +@title[#:style '(toc quiet)]{Widget Gallery} + +This section gives an overview of the main widgets available in the Racket Graphical Interface Toolkit and each image points to its full documentation. + +@(showcase-widget button% +(define button (new button% + (parent panel) + (label "Button"))) +) + +@(showcase-widget check-box% +(define check-box (new check-box% + (parent panel) + (label "Check Box") + (value #t))) +) + +@(showcase-widget choice% +(define choice (new choice% + (label "Choice") + (parent panel) + (choices (list "Item 0")))) +) + +@(showcase-widget combo-field% +(define combo-field (new combo-field% + (label "Combo") + (parent panel) + (choices (list "Field")) + (init-value "Field"))) +) + +@(showcase-widget editor-canvas% +(define editor-canvas (new editor-canvas% + (parent panel) + (label "Editor Canvas"))) +(define text (new text%)) +(send text insert "Editor Canvas") +(send editor-canvas set-editor text) +) + + +@(showcase-widget gauge% +(define gauge (new gauge% + (label "Gauge") + (parent panel) + (range 100))) +(send gauge set-value 42) +) + +@(showcase-widget group-box-panel% +(define group-box-panel (new group-box-panel% + (parent panel) + (label "Group Box Panel"))) +) + +@(showcase-widget list-box% +(define list-box (new list-box% + (label "List Box") + (parent (new horizontal-panel% + (parent panel) + (style (list 'border)))) + (choices (list "Item 0" + "Item 1" + "Item 2")) + (style (list 'single + 'column-headers)) + (columns (list "First Column")))) +) + +@(showcase-widget menu-bar% +(define menu-bar (new menu-bar% + (parent frame))) +(new menu% + (label "&File") + (parent menu-bar)) +(new menu% + (label "&Edit") + (parent menu-bar)) +(new menu% + (label "&Help") + (parent menu-bar)) +) + +@(showcase-widget message% +(define message (new message% + (parent panel) + (label "Message"))) +) + +@(showcase-widget panel% +(define a-panel (new panel% + (parent panel) + (style (list 'border)))) +(new message% + (parent a-panel) + (label "Panel")) +) + + +@(showcase-widget radio-box% +(define radio-box (new radio-box% + (label "Radio Box") + (parent panel) + (choices (list "Button 0" + "Button 1" + "Button 2")))) +) + +@(showcase-widget slider% +(define slider (new slider% + (label "Slider") + (parent panel) + (min-value 0) + (max-value 100) + (init-value 42))) +) + +@(showcase-widget tab-panel% +(define tab-panel (new tab-panel% + (parent panel) + (choices (list "Tab 0" + "Tab 1" + "Tab 2")))) +) + +@(showcase-widget text-field% +(define text-field (new text-field% + (label "Text") + (parent panel) + (init-value "Field"))) +)