From 9daca7a9e5c922dec9675107817b3deea8b8b1e9 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 6 Nov 2005 21:15:44 +0000 Subject: [PATCH] another tweak of not-a-language language guidance dialog svn: r1242 --- .../private/language-configuration.ss | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/collects/drscheme/private/language-configuration.ss b/collects/drscheme/private/language-configuration.ss index 5a143105f3..79902a1d53 100644 --- a/collects/drscheme/private/language-configuration.ss +++ b/collects/drscheme/private/language-configuration.ss @@ -1508,6 +1508,7 @@ (display-plt-schemer) (display-standard-schemer) (space-em-out) + (fix-button-sizes) (send dialog show #t)) (define (insert-red-message) @@ -1646,6 +1647,7 @@ (define (question/answer line1 lang icon-lst) (display-two-line-choice icon-lst + lang (λ (panel1 panel2) (line1 panel1) (new canvas-message% (parent panel2) (label (string-constant start-with-before))) @@ -1653,10 +1655,7 @@ (parent panel2) (label (car (last-pair lang))) (color (send the-color-database find-color "blue")) - (callback - (λ () - (send dialog show #f) - (change-current-lang-to lang))) + (callback (λ () (change-current-lang-to lang))) (font (get-font #:underlined #t)))))) ;; get-text-pls : path -> (listof (list* string string (listof string)) @@ -1686,26 +1685,36 @@ qs) '()))) - (define (display-two-line-choice icon-lst proc) + (define buttons '()) + (define (fix-button-sizes) + (let ([w (apply max (map (λ (x) (send x get-width)) buttons))]) + (for-each (λ (b) (send b min-width w)) + buttons))) + + (define (display-two-line-choice icon-lst lang proc) (let* ([hp (new horizontal-pane% (parent qa-panel) (alignment '(center top)) (stretchable-height #f))] - [icon (new message% - (label (make-object bitmap% - (build-path (apply collection-path (cdr icon-lst)) - (car icon-lst)) - 'unknown/mask)) - (parent hp))] + [button (new button% + (callback (lambda (x y) (change-current-lang-to lang))) + (label (make-object bitmap% + (build-path (apply collection-path (cdr icon-lst)) + (car icon-lst)) + 'unknown/mask)) + (parent hp))] [vp (new vertical-pane% (parent hp) (alignment '(left top)) (stretchable-height #f))]) + (set! buttons (cons button buttons)) (proc (new horizontal-pane% (parent vp)) (new horizontal-pane% (parent vp))))) ;; change-current-lang-to : (listof string) -> void + ;; closed the guidance dialog and opens the language dialog (define (change-current-lang-to lang-strings) + (send dialog show #f) (let ([lang (ormap (λ (x) (and (equal? lang-strings (send x get-language-position))