60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
(let ((lbl (iup:label (db:test-get-status testdat) #:expand "HORIZONTAL")))
(hash-table-set! widgets "teststatus"
(lambda (testdat)
(let ((newstatus (db:test-get-status testdat))
(oldstatus (iup:attribute lbl "TITLE")))
(if (not (equal? oldstatus newstatus))
(begin
(iup:attribute-set! lbl "FGCOLOR" (get-color-for-state-status (db:test-get-state testdat)
(db:test-get-status testdat)))
(iup:attribute-set! lbl "TITLE" (db:test-get-status testdat)))))))
lbl)
(store-label "testcomment"
(iup:label "TestComment "
#:expand "HORIZONTAL")
(lambda (testdat)
|
|
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
(let ((lbl (iup:label (db:test-get-status testdat) #:expand "HORIZONTAL")))
(hash-table-set! widgets "teststatus"
(lambda (testdat)
(let ((newstatus (db:test-get-status testdat))
(oldstatus (iup:attribute lbl "TITLE")))
(if (not (equal? oldstatus newstatus))
(begin
(iup:attribute-set! lbl "FGCOLOR" (common:get-color-for-state-status (db:test-get-state testdat)
(db:test-get-status testdat)))
(iup:attribute-set! lbl "TITLE" (db:test-get-status testdat)))))))
lbl)
(store-label "testcomment"
(iup:label "TestComment "
#:expand "HORIZONTAL")
(lambda (testdat)
|
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
;; use a global for setting the buttons colors
;; state status teststeps
(define *state-status* (vector #f #f #f))
(define (update-state-status-buttons testdat)
(let* ((state (db:test-get-state testdat))
(status (db:test-get-status testdat))
(color (get-color-for-state-status state status)))
((vector-ref *state-status* 0) state color)
((vector-ref *state-status* 1) status color)))
;;======================================================================
;; Set fields
;;======================================================================
(define (set-fields-panel test-id testdat)
|
|
|
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
;; use a global for setting the buttons colors
;; state status teststeps
(define *state-status* (vector #f #f #f))
(define (update-state-status-buttons testdat)
(let* ((state (db:test-get-state testdat))
(status (db:test-get-status testdat))
(color (common:get-color-for-state-status state status)))
((vector-ref *state-status* 0) state color)
((vector-ref *state-status* 1) status color)))
;;======================================================================
;; Set fields
;;======================================================================
(define (set-fields-panel test-id testdat)
|
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
(let* ((btns (map (lambda (status)
(let ((btn (iup:button status
#:expand "HORIZONTAL" #:size "50x" #:font "Courier New, -10"
#:action (lambda (x)
(open-run-close db:test-set-state-status-by-id #f test-id #f status #f)
(db:test-set-status! testdat status)))))
btn))
(list "PASS" "WARN" "FAIL" "CHECK" "n/a" "WAIVED"))))
(vector-set! *state-status* 1
(lambda (status color)
(for-each
(lambda (btn)
(let* ((name (iup:attribute btn "TITLE"))
(newcolor (if (equal? name status) color "192 192 192")))
(if (not (colors-similar? newcolor (iup:attribute btn "BGCOLOR")))
|
|
|
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
(let* ((btns (map (lambda (status)
(let ((btn (iup:button status
#:expand "HORIZONTAL" #:size "50x" #:font "Courier New, -10"
#:action (lambda (x)
(open-run-close db:test-set-state-status-by-id #f test-id #f status #f)
(db:test-set-status! testdat status)))))
btn))
(list "PASS" "WARN" "FAIL" "CHECK" "n/a" "WAIVED" "SKIP"))))
(vector-set! *state-status* 1
(lambda (status color)
(for-each
(lambda (btn)
(let* ((name (iup:attribute btn "TITLE"))
(newcolor (if (equal? name status) color "192 192 192")))
(if (not (colors-similar? newcolor (iup:attribute btn "BGCOLOR")))
|