StandardSystemView.st
changeset 6073 2983eb433ed6
parent 6071 536027b2080b
child 6079 e0678a4293b1
equal deleted inserted replaced
6072:69ba59e3fe6d 6073:2983eb433ed6
   543 	ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[2]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@E@@@@AP@D@@V@D@@APF@@@FF@@@AV@@@@&@@@@%P@@@$F@@@T@X@@T@I@@T@@P@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 0 204 51 0 112 0]; yourself]
   543 	ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[2]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@E@@@@AP@D@@V@D@@APF@@@FF@@@AV@@@@&@@@@%P@@@$F@@@T@X@@T@I@@T@@P@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 0 204 51 0 112 0]; yourself]
   544 ! !
   544 ! !
   545 
   545 
   546 !StandardSystemView class methodsFor:'startup'!
   546 !StandardSystemView class methodsFor:'startup'!
   547 
   547 
       
   548 cancelAutoRaise
       
   549     "cancel any schedule autoraise action"
       
   550 
       
   551     |b|
       
   552 
       
   553     (b := TimedRaiseAction) notNil ifTrue:[
       
   554         TimedRaiseAction := nil.
       
   555         Processor removeTimeoutWithID:b.
       
   556     ].
       
   557 !
       
   558 
   548 start
   559 start
   549     "create, realize the view - this topview and all its subviews will
   560     "create, realize the view - this topview and all its subviews will
   550      run as a separate process with its own windowGroup.
   561      run as a separate process with its own windowGroup.
   551      This method exists for backward compatibility - use open."
   562      This method exists for backward compatibility - use open."
   552 
   563 
  1003     "called with a delay by the focusIn code, iff the userPref setting is active.
  1014     "called with a delay by the focusIn code, iff the userPref setting is active.
  1004      Some (a small number only) may want to prevent autoraise in certain situations
  1015      Some (a small number only) may want to prevent autoraise in certain situations
  1005      - for example, if one view is controlling another. These get a chance to redefine this
  1016      - for example, if one view is controlling another. These get a chance to redefine this
  1006      method"
  1017      method"
  1007 
  1018 
  1008     |app|
  1019     |wg app|
  1009 
  1020 
  1010     "/ not, if my windowGroup is in a modal or popup action
  1021     "/ not, if my windowGroup is in a modal or popup action
  1011     (self windowGroup notNil
  1022     ((wg := self windowGroup) notNil
  1012     and:[ self windowGroup mainGroup isInModalLoop not
  1023     and:[ wg isInModalLoop not
  1013     and:[ self isModal not ]]) ifTrue:[
  1024     and:[ wg mainGroup isInModalLoop not
  1014         "/ if I have an application, let it decide
  1025     and:[ self isModal not ]]]) ifTrue:[
  1015         (app := self application) notNil ifTrue:[
  1026         self sensor anyButtonPressed ifFalse:[
  1016             app autoRaise:self
  1027             "/ if I have an application, let it decide
  1017         ] ifFalse:[
  1028             (app := self application) notNil ifTrue:[
  1018             self raise.
  1029                 app autoRaise:self
  1019         ].
  1030             ] ifFalse:[
       
  1031                 self raise.
       
  1032             ].
       
  1033         ]
  1020     ]
  1034     ]
  1021 !
  1035 !
  1022 
  1036 
  1023 focusIn
  1037 focusIn
  1024     "the view got the keyboard focus (via the window manager).
  1038     "the view got the keyboard focus (via the window manager).
  1059         ].
  1073         ].
  1060 
  1074 
  1061         "/ optionally bring the window to the front after some delay.
  1075         "/ optionally bring the window to the front after some delay.
  1062         "/ but not, if my windowGroup is in a modal or popup action
  1076         "/ but not, if my windowGroup is in a modal or popup action
  1063         (ms := UserPreferences current autoRaiseOnFocusInDelay) notNil ifTrue:[
  1077         (ms := UserPreferences current autoRaiseOnFocusInDelay) notNil ifTrue:[
  1064             (self windowGroup notNil
  1078             self scheduleAutoRaiseAfter:ms
  1065             and:[ self windowGroup mainGroup isInModalLoop not
       
  1066             and:[ self isModal not ]]) ifTrue:[
       
  1067                 TimedRaiseAction notNil ifTrue:[
       
  1068                     Processor removeTimeoutWithID:TimedRaiseAction.
       
  1069                 ].
       
  1070                 TimedRaiseAction := Processor 
       
  1071                                         addTimedBlock:
       
  1072                                             [   TimedRaiseAction := nil.
       
  1073                                                 self sensor 
       
  1074                                                     pushUserEvent: #autoRaise 
       
  1075                                                     for: self 
       
  1076                                             ]
       
  1077                                         afterMilliseconds:ms.
       
  1078             ]                         
       
  1079         ].
  1079         ].
  1080     ].
  1080     ].
  1081     super focusIn
  1081     super focusIn
  1082 
  1082 
  1083     "Modified: / 20-01-2011 / 20:51:20 / cg"
  1083     "Modified: / 20-01-2011 / 20:51:20 / cg"
  1096 	]
  1096 	]
  1097     ].
  1097     ].
  1098     super focusOut
  1098     super focusOut
  1099 
  1099 
  1100     "Modified: 25.2.1997 / 23:19:46 / cg"
  1100     "Modified: 25.2.1997 / 23:19:46 / cg"
       
  1101 !
       
  1102 
       
  1103 scheduleAutoRaiseAfter:ms
       
  1104     "bring the window to the front after some delay.
       
  1105      but not, if my windowGroup is in a modal or popup action"
       
  1106 
       
  1107     |wg actionID|
       
  1108 
       
  1109     ((wg := self windowGroup) notNil
       
  1110     and:[ wg isInModalLoop not
       
  1111     and:[ wg mainGroup isInModalLoop not
       
  1112     and:[ self isModal not ]]]) ifTrue:[
       
  1113         TimedRaiseAction notNil ifTrue:[
       
  1114             Processor removeTimeoutWithID:TimedRaiseAction.
       
  1115         ].
       
  1116         TimedRaiseAction := actionID := Processor 
       
  1117                                 addTimedBlock:
       
  1118                                     [
       
  1119                                         TimedRaiseAction == actionID ifTrue:[
       
  1120                                             TimedRaiseAction := nil.
       
  1121                                             self sensor 
       
  1122                                                 pushUserEvent: #autoRaise 
       
  1123                                                 for: self 
       
  1124                                         ].     
       
  1125                                     ]
       
  1126                                 afterMilliseconds:ms.
       
  1127     ]                         
  1101 !
  1128 !
  1102 
  1129 
  1103 showActivity:someMessage
  1130 showActivity:someMessage
  1104     "some activityNotification shalt be communicated to
  1131     "some activityNotification shalt be communicated to
  1105      the user. Forward it to my application (if any).
  1132      the user. Forward it to my application (if any).
  1638 ! !
  1665 ! !
  1639 
  1666 
  1640 !StandardSystemView class methodsFor:'documentation'!
  1667 !StandardSystemView class methodsFor:'documentation'!
  1641 
  1668 
  1642 version
  1669 version
  1643     ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.206 2013-05-29 17:25:46 cg Exp $'
  1670     ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.207 2013-05-29 17:40:57 cg Exp $'
  1644 !
  1671 !
  1645 
  1672 
  1646 version_CVS
  1673 version_CVS
  1647     ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.206 2013-05-29 17:25:46 cg Exp $'
  1674     ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.207 2013-05-29 17:40:57 cg Exp $'
  1648 ! !
  1675 ! !
  1649 
  1676 
  1650 
  1677 
  1651 StandardSystemView initialize!
  1678 StandardSystemView initialize!