From 84f0e307dd08c84e37d77dea96bbc0acd28c1c9a Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 29 Apr 2010 17:28:44 -0500 Subject: [PATCH] adjusted the initial what-language-do-you-want dialog --- .../private/language-configuration.rkt | 66 ++++++++++--------- .../english-string-constants.rkt | 8 ++- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/collects/drscheme/private/language-configuration.rkt b/collects/drscheme/private/language-configuration.rkt index f0609d389f..675e260200 100644 --- a/collects/drscheme/private/language-configuration.rkt +++ b/collects/drscheme/private/language-configuration.rkt @@ -16,10 +16,9 @@ (define original-output (current-output-port)) (define (printfo . args) (apply fprintf original-output args)) - (define sc-use-language-in-source "Use the language declared in the source") - (define sc-choose-a-language "Choose a language") - (define sc-lang-in-source-discussion - "The #lang line at the start of a program declares its language. This is the default and preferred mode for DrRacket.") + (define sc-use-language-in-source (string-constant use-language-in-source)) + (define sc-choose-a-language (string-constant choose-a-language)) + (define sc-lang-in-source-discussion (string-constant lang-in-source-discussion)) (provide language-configuration@) @@ -1673,7 +1672,9 @@ (define dialog (new dialog% (parent drs-frame) (label (string-constant drscheme)))) - (define qa-panel (new vertical-pane% (parent dialog))) + (define top-hp (new horizontal-pane% [parent dialog])) + (define qa-panel (new vertical-panel% [style '(border)] (parent top-hp) (stretchable-width #f))) + (define racketeer-panel (new vertical-panel% [style '(border)] [parent top-hp] [alignment '(center center)] [stretchable-width #f])) (define button-panel (new horizontal-pane% (parent dialog) (stretchable-height #f) @@ -1688,8 +1689,7 @@ (define (main) (insert-text-pls) - (display-plt-schemer) - (display-standard-schemer) + (display-racketeer) (space-em-out) (fix-msg-sizes) (send dialog show #t)) @@ -1733,31 +1733,33 @@ [else (string<=? (cadr x) (cadr y))]))))) - (define (display-plt-schemer) - (question/answer (lambda (parent) - (new canvas-message% - (parent parent) - (label (string-constant racketeer-or-r6?)))) - (λ (panel2) - (new canvas-message% - (parent panel2) - (label "Use the language declared in the source code") - (color (send the-color-database find-color "blue")) - (callback (λ () (change-current-lang-to (λ (x) (is-a? x drracket:module-language:module-language<%>))))) - (font (get-font #:underlined #t)))) - (list "PLT-206-small.png" - "icons"))) - - (define (display-standard-schemer) - (question/answer (lambda (parent) - (new canvas-message% - (parent parent) - (label (string-constant looking-for-standard-scheme?)))) - (default-line2 - (string-constant pretty-big-scheme) - (list (string-constant legacy-languages) - (string-constant pretty-big-scheme))) - (list "r5rs.png" "icons"))) + (define plt-logo-shiny + (make-object bitmap% (build-path (collection-path "icons") + "plt-logo-red-shiny.png") + 'png/mask)) + + (define (display-racketeer) + (new canvas-message% + (parent racketeer-panel) + (label (string-constant racketeer?))) + (new canvas% + [parent racketeer-panel] + [stretchable-width #f] + [paint-callback + (λ (c dc) + (send dc set-scale 1/2 1/2) + (send dc draw-bitmap plt-logo-shiny 0 0 + 'solid (send the-color-database find-color "black") + (send plt-logo-shiny get-loaded-mask)))] + [style '(transparent)] + [min-width (floor (/ (send plt-logo-shiny get-width) 2))] + [min-height (floor (/ (send plt-logo-shiny get-height) 2))]) + (new canvas-message% + (parent racketeer-panel) + (label sc-use-language-in-source) + (color (send the-color-database find-color "blue")) + (callback (λ () (change-current-lang-to (λ (x) (is-a? x drracket:module-language:module-language<%>))))) + (font (get-font #:underlined #t)))) (define (display-text-pl lst) (let ([icon-lst (car lst)] diff --git a/collects/string-constants/english-string-constants.rkt b/collects/string-constants/english-string-constants.rkt index 68a7e5abc6..71b24dd75b 100644 --- a/collects/string-constants/english-string-constants.rkt +++ b/collects/string-constants/english-string-constants.rkt @@ -1060,6 +1060,12 @@ please adhere to these guidelines: (module-language-one-line-summary "Reads the #lang line to specify the actual language") (module-language-auto-text "Automatic #lang line") ;; shows up in the details section of the module language + ;; for the upper portion of the language dialog + (use-language-in-source "Use the language declared in the source") + (choose-a-language "Choose a language") + (lang-in-source-discussion + "The #lang line at the start of a program declares its language. This is the default and preferred mode for DrRacket.") + ;;; from the `not a language language' used initially in drscheme. (must-choose-language "DrRacket cannot process programs until you choose a programming language.") @@ -1072,7 +1078,7 @@ please adhere to these guidelines: (start-with-after "") (seasoned-plt-schemer? "Seasoned PLT Schemer?") - (racketeer-or-r6? "Racketeer or want to use R6RS?") + (racketeer? "Are you a Racketeer?") (looking-for-standard-scheme? "Looking for standard Scheme?") ; the three string constants are concatenated together and the middle