Java example boxes: omit cue text from save-and-loaded or cut-and-paste boxes
svn: r1850
This commit is contained in:
parent
9e6f6a67b0
commit
f81cf986b5
|
@ -324,6 +324,10 @@ _cue-text%_ is (cue-text-mixin text%)
|
||||||
color : string = "gray"
|
color : string = "gray"
|
||||||
behavior : (listof (symbols 'on-focus 'on-char)) = '(on-focus)
|
behavior : (listof (symbols 'on-focus 'on-char)) = '(on-focus)
|
||||||
|
|
||||||
|
> (send a-cue-text clear-cue-text)
|
||||||
|
|
||||||
|
Clears the cue text, if it's still present.
|
||||||
|
|
||||||
============================================================
|
============================================================
|
||||||
|
|
||||||
The following functions are useful for working with snips
|
The following functions are useful for working with snips
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
#;(-> void)
|
#;(-> void)
|
||||||
;; Clears the cue-text if it's still there.
|
;; Clears the cue-text if it's still there.
|
||||||
(define (clear-cue-text)
|
(define/public (clear-cue-text)
|
||||||
(when first-focus?
|
(when first-focus?
|
||||||
(set! first-focus? false)
|
(set! first-focus? false)
|
||||||
(erase)
|
(erase)
|
||||||
|
|
|
@ -163,13 +163,13 @@
|
||||||
((drscheme:unit:get-program-editor-mixin)
|
((drscheme:unit:get-program-editor-mixin)
|
||||||
(editor:keymap-mixin text:basic%))))]
|
(editor:keymap-mixin text:basic%))))]
|
||||||
[type (new (single-line-text-mixin program-editor%)
|
[type (new (single-line-text-mixin program-editor%)
|
||||||
(cue-text (string-constant profjBoxes-type))
|
(cue-text (if copy-constructor "" (string-constant profjBoxes-type)))
|
||||||
(behavior '(on-char)))]
|
(behavior '(on-char)))]
|
||||||
[name (new (single-line-text-mixin program-editor%)
|
[name (new (single-line-text-mixin program-editor%)
|
||||||
(cue-text (string-constant profjBoxes-name))
|
(cue-text (if copy-constructor "" (string-constant profjBoxes-name)))
|
||||||
(behavior '(on-char)))]
|
(behavior '(on-char)))]
|
||||||
[value (new program-editor%
|
[value (new program-editor%
|
||||||
(cue-text (string-constant profjBoxes-value))
|
(cue-text (if copy-constructor "" (string-constant profjBoxes-value)))
|
||||||
(behavior '(on-char)))])
|
(behavior '(on-char)))])
|
||||||
|
|
||||||
#;(-> (is-a?/c text%))
|
#;(-> (is-a?/c text%))
|
||||||
|
@ -190,9 +190,13 @@
|
||||||
#;((is-a?/c editor-stream-out%) . -> . void?)
|
#;((is-a?/c editor-stream-out%) . -> . void?)
|
||||||
;; Read the state of the example in from file
|
;; Read the state of the example in from file
|
||||||
(define/public (read-from-file f)
|
(define/public (read-from-file f)
|
||||||
(send type read-from-file f)
|
(for-each (lambda (t)
|
||||||
(send name read-from-file f)
|
(send* t
|
||||||
(send value read-from-file f))
|
(begin-edit-sequence)
|
||||||
|
(clear-cue-text)
|
||||||
|
(read-from-file f)
|
||||||
|
(end-edit-sequence)))
|
||||||
|
(list type name value)))
|
||||||
|
|
||||||
(super-new)
|
(super-new)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user