ViewWithAcceptAndCancelBar.st
branchjv
changeset 15566 184cea584be5
parent 13609 8b400fde34ef
parent 15360 480e3544af43
child 16308 7c050515edb6
--- a/ViewWithAcceptAndCancelBar.st	Sun Jan 12 23:30:25 2014 +0000
+++ b/ViewWithAcceptAndCancelBar.st	Wed Apr 01 10:38:01 2015 +0100
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libtool' }"
 
+"{ NameSpace: Smalltalk }"
+
 SimpleView subclass:#ViewWithAcceptAndCancelBar
 	instanceVariableNames:'slaveView bar reallyModifiedHolder acceptAction cancelAction
 		compareAction'
@@ -88,7 +90,7 @@
     "set the holder which keeps track of the real modified state;
      the modified state of the view is set with every user-input,
      but cleared by the master (in order to trigger future modified events).
-     With ever modified change, the state of the reallyModified is updated"
+     With every modified change, the state of the reallyModified is updated"
 
     reallyModifiedHolder notNil ifTrue:[
         reallyModifiedHolder removeDependent:self.
@@ -195,8 +197,7 @@
     "
 !
 
-slaveView:aView
-    self add:aView.
+setSlaveView:aView
     slaveView := aView.
     aView origin:(0.0@0.0) corner:(1.0@1.0).
     aView modifiedChannel addDependent:self.
@@ -208,6 +209,19 @@
      v slaveView:CodeView new.
      v open
     "
+!
+
+slaveView:aView
+    self add:aView.
+    self setSlaveView:aView.
+
+    "
+     |v|
+
+     v := self new.
+     v slaveView:CodeView new.
+     v open
+    "
 ! !
 
 !ViewWithAcceptAndCancelBar::AcceptAndCancelBar methodsFor:'accessing'!
@@ -246,23 +260,39 @@
 !ViewWithAcceptAndCancelBar::AcceptAndCancelBar methodsFor:'initialization'!
 
 initialize
+    |acceptColor cancelColor compareColor|
+
     super initialize.
 
+    UserPreferences current useColorsForColorBlindness ifTrue:[
+        acceptColor := Color blue.
+    ] ifFalse:[
+        acceptColor := Color green.
+    ].
+    cancelColor := Color red.
+    compareColor := Color yellow.
+
     acceptButton := ButtonWithHelpText new.
     acceptButton origin:0.0 @ 0.0 corner:1.0@0.7.
-    acceptButton backgroundColor:Color green.
+    acceptButton backgroundColor:acceptColor.
+    acceptButton enteredBackgroundColor:acceptColor lightened.
+    acceptButton activeBackgroundColor:acceptColor darkened.
     acceptButton flyByHelpText:(resources string:'Accept').
     self add:acceptButton.
 
     cancelButton := ButtonWithHelpText new.
     cancelButton origin:0.0 @ 0.7 corner:1.0@0.9.
-    cancelButton backgroundColor:Color red.
+    cancelButton backgroundColor:cancelColor.
+    cancelButton enteredBackgroundColor:cancelColor lightened.
+    cancelButton activeBackgroundColor:cancelColor darkened.
     cancelButton flyByHelpText:(resources string:'Cancel').
     self add:cancelButton.
 
     compareButton := ButtonWithHelpText new.
     compareButton origin:0.0 @ 0.9 corner:1.0@1.0.
-    compareButton backgroundColor:Color yellow.
+    compareButton backgroundColor:compareColor.
+    compareButton enteredBackgroundColor:compareColor lightened lightened.
+    compareButton activeBackgroundColor:compareColor darkened.
     compareButton flyByHelpText:(resources string:'Compare against Original').
     compareButton label:'?'.
     self add:compareButton.
@@ -287,19 +317,10 @@
 !ViewWithAcceptAndCancelBar class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ViewWithAcceptAndCancelBar.st,v 1.12 2013-09-06 15:09:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ViewWithAcceptAndCancelBar.st,v 1.16 2015-02-23 10:03:06 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/ViewWithAcceptAndCancelBar.st,v 1.12 2013-09-06 15:09:05 cg Exp $'
-!
-
-version_HG
-
-    ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
-    ^ '$Id: ViewWithAcceptAndCancelBar.st 8059 2012-09-27 20:08:20Z vranyj1 $'
+    ^ '$Header: /cvs/stx/stx/libtool/ViewWithAcceptAndCancelBar.st,v 1.16 2015-02-23 10:03:06 cg Exp $'
 ! !