From 63501f5363485425c2dae5e75b5c3932e6d526ef Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 25 Jul 2011 11:03:38 -0400 Subject: [PATCH] add 'no-focus style to `editor-canvas%' original commit: f13a669d056358ac2b50e6a8a2907e40045593a6 --- collects/mred/private/mrcanvas.rkt | 3 ++- collects/mred/private/wxme/editor-canvas.rkt | 3 ++- collects/scribblings/gui/canvas-class.scrbl | 2 +- collects/scribblings/gui/editor-canvas-class.scrbl | 7 ++++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/collects/mred/private/mrcanvas.rkt b/collects/mred/private/mrcanvas.rkt index 9871b6bf..2e43a6de 100644 --- a/collects/mred/private/mrcanvas.rkt +++ b/collects/mred/private/mrcanvas.rkt @@ -258,7 +258,8 @@ (check-container-parent cwho parent) (check-instance cwho internal-editor<%> "text% or pasteboard%" #t editor) (check-style cwho #f '(hide-vscroll hide-hscroll no-vscroll no-hscroll auto-vscroll auto-hscroll - deleted control-border combo transparent no-border resize-corner) + deleted control-border combo transparent no-border resize-corner + no-focus) style) (check-gauge-integer cwho scrolls-per-page) (check-label-string/false cwho label) diff --git a/collects/mred/private/wxme/editor-canvas.rkt b/collects/mred/private/wxme/editor-canvas.rkt index 659c360e..d2cf51f0 100644 --- a/collects/mred/private/wxme/editor-canvas.rkt +++ b/collects/mred/private/wxme/editor-canvas.rkt @@ -215,7 +215,8 @@ '(no-autoclear)) (keep-style style 'control-border) (keep-style style 'combo) - (keep-style style 'resize-corner)) + (keep-style style 'resize-corner) + (keep-style style 'no-focus)) name gl-config) diff --git a/collects/scribblings/gui/canvas-class.scrbl b/collects/scribblings/gui/canvas-class.scrbl index bfca4ca6..790c26b1 100644 --- a/collects/scribblings/gui/canvas-class.scrbl +++ b/collects/scribblings/gui/canvas-class.scrbl @@ -64,7 +64,7 @@ The @racket[style] argument indicates one or more of the following styles: @racket['no-autoclear]} @item{@racket['no-focus] --- prevents the canvas from accepting the - keyboard focus when the canvas is clicked, or when the + keyboard focus when the canvas is clicked or when the @method[window<%> focus] method is called} @item{@racket['deleted] --- creates the canvas as initially hidden and without affecting diff --git a/collects/scribblings/gui/editor-canvas-class.scrbl b/collects/scribblings/gui/editor-canvas-class.scrbl index d1a420b8..51900728 100644 --- a/collects/scribblings/gui/editor-canvas-class.scrbl +++ b/collects/scribblings/gui/editor-canvas-class.scrbl @@ -14,7 +14,8 @@ An @racket[editor-canvas%] object manages and displays a 'no-hscroll 'no-vscroll 'hide-hscroll 'hide-vscroll 'auto-vscroll 'auto-hscroll - 'resize-corner 'deleted 'transparent)) null] + 'resize-corner 'no-focus 'deleted + 'transparent)) null] [scrolls-per-page (integer-in 1 10000) 100] [label (or/c label-string? false/c) #f] [wheel-step (or/c (integer-in 1 10000) false/c) 3] @@ -65,6 +66,10 @@ The @racket[style] list can contain the following flags: @item{@racket['resize-corner] --- leaves room for a resize control at the canvas's bottom right when only one scrollbar is visible} + @item{@racket['no-focus] --- prevents the canvas from accepting the + keyboard focus when the canvas is clicked or when the + @method[window<%> focus] method is called} + @item{@racket['deleted] --- creates the canvas as initially hidden and without affecting @racket[parent]'s geometry; the canvas can be made active later by calling @racket[parent]'s @method[area-container<%> add-child]