Skip to content
Browse files

Add prop:false-or-string to default-values.ss.

Change some widget labels to false-or-string.
Change some widget number properties to false-or-number.
Remove some unneeded requires.
  • Loading branch information...
1 parent d24c313 commit a483e11a0b274beb4a1f0328fc09c6168c03940f @khardy khardy committed Oct 30, 2012
View
3 Changelog
@@ -4,6 +4,9 @@ Version 3.9
- changed: Scheme->racket
- changed: output to frame instead of to console
- fix: tab-panel crash and removed need for single-panel
+- added: add version to project file and check version on open
+- changed: modify label to false-or-string for some GUI widgets
+- changed: modify some number properties to false-or-number for some GUI widgets
Version 3.8
Laurent Orseau, 2012-02-04
View
9 default-values.ss
@@ -222,3 +222,12 @@
)
(λ(l)(and (first l) (second l)))
))
+
+(define/provide (prop:false-or-string v)
+ (prop:proc-unquoted
+ (prop:hgroup
+ (and v #t) ; this is no mistake (I want it to write #t)
+ (or v "")
+ )
+ (λ(l)(and (first l) (second l)))
+ ))
View
2 widgets/canvas/widget.ss
@@ -20,7 +20,7 @@
'no-focus 'deleted)
'())]
[paint-callback (prop:code (λ (canvas dc) (void)))]
- [label "Canvas"]
+ [label (prop:false-or-string "Canvas")]
[gl-config #f]
[enabled #t]
[vert-margin 2]
View
2 widgets/choice/widget.ss
@@ -14,7 +14,7 @@
[necessary '(label choices parent)] ; necessary properties
[options '(callback)]
( ; widget properties
- [label "Choice"]
+ [label (prop:false-or-string "Choice")]
[choices '("First" "Second")]
[callback (prop:code (lambda (choice control-event) (void)))]
[style (prop:proc
View
3 widgets/combo-field/widget.ss
@@ -4,7 +4,6 @@
"../../default-values.ss"
scheme/gui/base)
-
(make-plugin
[type 'combo-field]
[tooltip "Combo Field"]
@@ -14,7 +13,7 @@
[necessary '(label choices parent)] ; necessary properties
[options '(callback)]
( ; widget properties
- [label "Combo Field"]
+ [label (prop:false-or-string "Combo Field")]
[choices '("First" "Second")]
[callback (prop:code (lambda (combo-field control-event) (void)))]
[init-value "Text"]
View
3 widgets/dialog/widget.ss
@@ -1,10 +1,7 @@
#lang scheme
(require "../../mred-plugin.ss"
- "../../mred-id.ss"
- "../../controller.ss"
"../../default-values.ss"
- "../../toolbox-frame.ss"
"../project/preview.ss" ; needed for plugin% class... ; ???? WARNING: make-plugin??
"../frame/preview.ss"
scheme/gui/base)
View
6 widgets/editor-canvas/widget.ss
@@ -24,9 +24,9 @@
deleted transparent)
'()))]
[scrolls-per-page 100]
- [label "Editor-Canvas"]
- [wheel-step 3]
- [line-count (prop:false-or-number #f)]
+ [label (prop:false-or-string "Editor-Canvas")]
+ [wheel-step (prop:false-or-number 3)]
+ [line-count (prop:false-or-number #f)]
[horizontal-inset 5]
[vertical-inset 5]
[enabled #t]
View
2 widgets/frame/widget.ss
@@ -1,8 +1,6 @@
#lang scheme
(require "../../mred-plugin.ss"
- "../../mred-id.ss"
- "../../controller.ss"
"../../default-values.ss"
"preview.ss"
"../project/preview.ss" ; needed for plugin% class... ; ???? WARNING: make-plugin??
View
3 widgets/gauge/widget.ss
@@ -4,7 +4,6 @@
"../../default-values.ss"
scheme/gui/base)
-
(make-plugin
[type 'gauge]
[tooltip "Gauge"]
@@ -14,7 +13,7 @@
[necessary '(label parent range)] ; necessary properties
[options '(callback)]
( ; widget properties
- [label "Gauge"]
+ [label (prop:false-or-string "Gauge")]
[range 100]
; optional
[style (prop:proc
View
4 widgets/list-box/widget.ss
@@ -14,7 +14,7 @@
[necessary '(label choices parent)] ; necessary properties
[options '(callback)]
( ; widget properties
- [label "List Box"]
+ [label (prop:false-or-string "List Box")]
[choices '("First" "Second")]
[callback (prop:code (lambda (list-box control-event) (void)))]
[style (prop:proc
@@ -25,7 +25,7 @@
(prop:some-of '(deleted) '()))
(λ(l)(list* (first l) (second l) (third l))))]
[font (font-values)]
- [selection 0]
+ [selection (prop:false-or-number 0)]
[enabled #t]
[vert-margin 2]
[horiz-margin 2]
View
2 widgets/menu-item/widget.ss
@@ -18,7 +18,7 @@
[label "&Item"]
[callback (prop:code (lambda (item event) (void)))]
[shortcut (shortcut-values)]
- [help-string "Item"]
+ [help-string (prop:false-or-string "Item")]
[demand-callback (prop:code (lambda (item) (void)))]
[shortcut-prefix (prop:some-of '(alt cmd meta ctl shift option) dft-prefix)]
))
View
2 widgets/menu/widget.ss
@@ -14,6 +14,6 @@
[options '(demand-callback)]
( ; widget properties
[label "&Menu"]
- [help-string "Menu"]
+ [help-string (prop:false-or-string "Menu")]
[demand-callback (prop:code (lambda (m) (void)))]
))
View
4 widgets/project/widget.ss
@@ -1,9 +1,7 @@
#lang scheme
(require "../../mred-plugin.ss"
- "../../default-values.ss"
- "preview.ss"
- scheme/gui/base)
+ "preview.ss")
(make-plugin
[type 'project]
View
5 widgets/radio-box/widget.ss
@@ -4,7 +4,6 @@
"../../default-values.ss"
scheme/gui/base)
-
(make-plugin
[type 'radio-box]
[tooltip "Radio Box"]
@@ -14,7 +13,7 @@
[necessary '(label choices parent)] ; necessary properties
[options '(callback)]
( ; widget properties
- [label "Radio Box"]
+ [label (prop:false-or-string "Radio Box")]
[choices '("&First" "&Second")]
[callback (prop:code (lambda (radio-box control-event) (void)))]
[style (prop:proc
@@ -24,7 +23,7 @@
(prop:some-of '(deleted) '()))
(λ(l)(list* (first l) (second l) (third l))))]
[font (font-values)]
- [selection 0]
+ [selection (prop:false-or-number 0)]
[enabled #t]
[vert-margin 2]
[horiz-margin 2]
View
1 widgets/separator-menu-item/widget.ss
@@ -1,7 +1,6 @@
#lang scheme
(require "../../mred-plugin.ss"
- "../../default-values.ss"
scheme/gui/base)
(define dft-prefix (get-default-shortcut-prefix))
View
3 widgets/slider/widget.ss
@@ -4,7 +4,6 @@
"../../default-values.ss"
scheme/gui/base)
-
(make-plugin
[type 'slider]
[tooltip "Slider"]
@@ -14,7 +13,7 @@
[necessary '(label parent min-value max-value)] ; necessary properties
[options '(callback)]
( ; widget properties
- [label "Slider"]
+ [label (prop:false-or-string "Slider")]
[min-value 0]
[max-value 100]
[init-value 0]
View
5 widgets/tab-panel/widget.ss
@@ -4,9 +4,7 @@
"../../mreddesigner-misc.ss"
"../../default-values.ss"
"../../controller.ss"
- scheme/gui/base
- framework
- )
+ scheme/gui/base)
;;; TODO: deleting a tab-panel with children is buggy
;;; (some children are not "active children" for delete-child)
@@ -86,4 +84,3 @@
[stretchable-width #t]
[stretchable-height #t]
))
-
View
2 widgets/text-field/widget.ss
@@ -13,7 +13,7 @@
[necessary '(label parent)] ; necessary properties
[options '(callback)]
( ; widget properties
- [label "Text Field"]
+ [label (prop:false-or-string "Text Field")]
[callback (prop:code (lambda (text-field control-event) (void)))]
[init-value "Text"]
[style (prop:proc

0 comments on commit a483e11

Please sign in to comment.
Something went wrong with that request. Please try again.