47 |
47 |
48 In ST/X, StandardSystemViews were subclassed for special views |
48 In ST/X, StandardSystemViews were subclassed for special views |
49 in the past (for example: FileBrowser, ChangesBrowser etc.). |
49 in the past (for example: FileBrowser, ChangesBrowser etc.). |
50 Although this worked, it may lead to the following |
50 Although this worked, it may lead to the following |
51 problems and inconveniences: |
51 problems and inconveniences: |
52 - applications inherit a big number of methods through the |
52 - applications inherit a big number of methods through the |
53 SimpleView->View->TopView->StandardSystemView hierarchy. |
53 SimpleView->View->TopView->StandardSystemView hierarchy. |
54 There is quite a danger that by accident, some method gets |
54 There is quite a danger that by accident, some method gets |
55 redefined which is required by one of those classes. |
55 redefined which is required by one of those classes. |
56 (typical candidates are: terminate, destroy, open ...) |
56 (typical candidates are: terminate, destroy, open ...) |
57 This may lead to strange effects, which may not be obvious to |
57 This may lead to strange effects, which may not be obvious to |
58 non experts ... |
58 non experts ... |
59 |
59 |
60 - applications with multiple topViews are difficult to implement |
60 - applications with multiple topViews are difficult to implement |
61 and manage. |
61 and manage. |
62 |
62 |
63 - use of a windowBuilder is difficult. |
63 - use of a windowBuilder is difficult. |
64 |
64 |
65 For all those reasons, we HIGHLY recommend to NOT define applications |
65 For all those reasons, we HIGHLY recommend to NOT define applications |
66 as subclasses of StandardSystemView, but instead base them on |
66 as subclasses of StandardSystemView, but instead base them on |
67 ApplicationModel, and reference the topView(s) as instance variables of |
67 ApplicationModel, and reference the topView(s) as instance variables of |
68 if (if at all). |
68 if (if at all). |
69 |
69 |
70 [instance variables:] |
70 [instance variables:] |
71 label <String> the label in the windows title |
71 label <String> the label in the windows title |
72 |
72 |
73 icon <Form> the icon |
73 icon <Form> the icon |
74 [ignored if the display does not |
74 [ignored if the display does not |
75 support icons] |
75 support icons] |
76 |
76 |
77 iconView <View> an optional icon-view (for animated icons) |
77 iconView <View> an optional icon-view (for animated icons) |
78 [ignored if the display does not |
78 [ignored if the display does not |
79 supports this] |
79 supports this] |
80 |
80 |
81 iconLabel <String> the label in the icon |
81 iconLabel <String> the label in the icon |
82 [ignored if the display does not |
82 [ignored if the display does not |
83 support label-tabs with icons] |
83 support label-tabs with icons] |
84 |
84 |
85 minExtent <Point> the minimum size |
85 minExtent <Point> the minimum size |
86 No limit, if nil |
86 No limit, if nil |
87 [the window manager may have its own |
87 [the window manager may have its own |
88 limit; typically some small area] |
88 limit; typically some small area] |
89 |
89 |
90 maxExtent <Point> the maximum size |
90 maxExtent <Point> the maximum size |
91 No limit, if nil. |
91 No limit, if nil. |
92 [the window manager may have its own |
92 [the window manager may have its own |
93 limit; typically the screen size] |
93 limit; typically the screen size] |
94 |
94 |
95 sizeFixed <Boolean> prevents the view from resizing itself |
95 sizeFixed <Boolean> prevents the view from resizing itself |
96 (especially to freeze a dialogs size) |
96 (especially to freeze a dialogs size) |
97 |
97 |
98 application <AppModel> if nonNil, thats the application |
98 application <AppModel> if nonNil, thats the application |
99 Many requests (such as open/close etc. |
99 Many requests (such as open/close etc. |
100 are forwarded to it, if present. |
100 are forwarded to it, if present. |
101 |
101 |
102 |
102 |
103 |
103 |
104 [class variables:] |
104 [class variables:] |
105 |
105 |
106 DefaultIcon <Form> cached default icon |
106 DefaultIcon <Form> cached default icon |
107 |
107 |
108 TakeFocusWhenMapped <Boolean> if true, views grab the keyboard |
108 TakeFocusWhenMapped <Boolean> if true, views grab the keyboard |
109 focus (convenient with some stupid |
109 focus (convenient with some stupid |
110 windowManagers) |
110 windowManagers) |
111 |
111 |
112 IncludeHostNameInLabel <Boolean> if true, the windows title shall |
112 IncludeHostNameInLabel <Boolean> if true, the windows title shall |
113 include the hostname. |
113 include the hostname. |
114 (convenient if you have many remote |
114 (convenient if you have many remote |
115 views open simultaneously) |
115 views open simultaneously) |
|
116 |
|
117 NewHostNameInLabelFormat <Boolean> if true, the hostname is appended |
|
118 after a '@'-character. |
|
119 If false, its prepended with a colon. |
|
120 The first is better with window managers |
|
121 which cut of the tail of the window |
|
122 title for the icon-bar (i.e. fvwm95) |
|
123 |
116 |
124 |
117 [author:] |
125 [author:] |
118 Claus Gittinger |
126 Claus Gittinger |
119 |
127 |
120 [see also:] |
128 [see also:] |
121 WindowGroup |
129 WindowGroup |
122 ApplicationModel |
130 ApplicationModel |
123 " |
131 " |
124 ! |
132 ! |
125 |
133 |
126 examples |
134 examples |
127 " |
135 " |
720 "define the views name in the windows title area. |
739 "define the views name in the windows title area. |
721 If IncludeHostNameInLabel is true, prepend the hostname |
740 If IncludeHostNameInLabel is true, prepend the hostname |
722 (you will appreciate this, if you are working on multiple |
741 (you will appreciate this, if you are working on multiple |
723 machines simultaneously - as I do ...)" |
742 machines simultaneously - as I do ...)" |
724 |
743 |
725 |l| |
744 |l hostName| |
726 |
745 |
727 aString ~= label ifTrue:[ |
746 aString ~= label ifTrue:[ |
728 label := aString. |
747 label := aString. |
729 drawableId notNil ifTrue: [ |
748 drawableId notNil ifTrue: [ |
730 IncludeHostNameInLabel == true ifTrue:[ |
749 IncludeHostNameInLabel == true ifTrue:[ |
731 l := OperatingSystem getHostName , ': ' , aString. |
750 hostName := OperatingSystem getHostName. |
732 ] ifFalse:[ |
751 NewHostNameInLabelFormat == true ifTrue:[ |
733 l := aString |
752 l := aString , '@' , hostName |
734 ]. |
753 ] ifFalse:[ |
735 device setWindowName:l in:drawableId. |
754 l := hostName , ': ' , aString. |
736 " |
755 ] |
737 unbuffered - to make it visible right NOW |
756 ] ifFalse:[ |
738 " |
757 l := aString |
739 device flush. |
758 ]. |
740 ] |
759 device setWindowName:l in:drawableId. |
|
760 " |
|
761 unbuffered - to make it visible right NOW |
|
762 " |
|
763 device flush. |
|
764 ] |
741 ] |
765 ] |
742 |
766 |
743 "Created: 8.9.1995 / 19:37:06 / claus" |
767 "Created: 8.9.1995 / 19:37:06 / claus" |
744 "Modified: 8.9.1995 / 19:39:18 / claus" |
768 "Modified: 8.9.1995 / 19:39:18 / claus" |
745 "Modified: 24.4.1996 / 09:09:17 / cg" |
769 "Modified: 20.8.1997 / 14:18:01 / cg" |
746 ! |
770 ! |
747 |
771 |
748 label:labelString iconLabel:iconLabelString |
772 label:labelString iconLabel:iconLabelString |
749 "set both the label and the iconLabel" |
773 "set both the label and the iconLabel" |
750 |
774 |
1236 ! |
1260 ! |
1237 |
1261 |
1238 physicalCreate |
1262 physicalCreate |
1239 "common code for create & recreate" |
1263 "common code for create & recreate" |
1240 |
1264 |
1241 |l icn icnMask org listener ret| |
1265 |hostName l icn icnMask org listener ret| |
1242 |
1266 |
1243 IncludeHostNameInLabel == true ifTrue:[ |
1267 IncludeHostNameInLabel == true ifTrue:[ |
1244 l := OperatingSystem getHostName , ': ' , label. |
1268 hostName := OperatingSystem getHostName. |
|
1269 NewHostNameInLabelFormat == true ifTrue:[ |
|
1270 l := label , '@' , hostName |
|
1271 ] ifFalse:[ |
|
1272 l := hostName , ': ' , label. |
|
1273 ] |
1245 ] ifFalse:[ |
1274 ] ifFalse:[ |
1246 l := label |
1275 l := label |
1247 ]. |
1276 ]. |
1248 |
1277 |
1249 icon notNil ifTrue:[ |
1278 icon notNil ifTrue:[ |
1250 icn := self convertedIcon:icon. |
1279 icn := self convertedIcon:icon. |
1251 (icnMask := icon mask) notNil ifTrue:[ |
1280 (icnMask := icon mask) notNil ifTrue:[ |
1252 icnMask := self convertedIconMask:icnMask |
1281 icnMask := self convertedIconMask:icnMask |
1253 ] |
1282 ] |
1254 ]. |
1283 ]. |
1255 |
1284 |
1256 org := left @ top. |
1285 org := left @ top. |
1257 |
1286 |
1258 "/ if there is a global eventListener, |
1287 "/ if there is a global eventListener, |
1305 "/ (bitGravity notNil "and:[bitGravity ~~ #NorthWest]") ifTrue:[ |
1334 "/ (bitGravity notNil "and:[bitGravity ~~ #NorthWest]") ifTrue:[ |
1306 "/ device setBitGravity:bitGravity in:drawableId |
1335 "/ device setBitGravity:bitGravity in:drawableId |
1307 "/ ]. |
1336 "/ ]. |
1308 |
1337 |
1309 borderShape notNil ifTrue:[ |
1338 borderShape notNil ifTrue:[ |
1310 device setWindowBorderShape:(borderShape id) in:drawableId |
1339 device setWindowBorderShape:(borderShape id) in:drawableId |
1311 ]. |
1340 ]. |
1312 viewShape notNil ifTrue:[ |
1341 viewShape notNil ifTrue:[ |
1313 device setWindowShape:(viewShape id) in:drawableId |
1342 device setWindowShape:(viewShape id) in:drawableId |
1314 ]. |
1343 ]. |
1315 (backed notNil and:[backed ~~ false]) ifTrue:[ |
1344 (backed notNil and:[backed ~~ false]) ifTrue:[ |
1316 device setBackingStore:backed in:drawableId |
1345 device setBackingStore:backed in:drawableId |
1317 ]. |
1346 ]. |
1318 saveUnder ifTrue:[ |
1347 saveUnder ifTrue:[ |
1319 device setSaveUnder:true in:drawableId |
1348 device setSaveUnder:true in:drawableId |
1320 ]. |
1349 ]. |
1321 device setWindowClass:('Stx', self className) name:name in:drawableId. |
1350 device setWindowClass:('Stx', self className) name:name in:drawableId. |
1322 |
1351 |
1323 "Modified: 14.6.1996 / 17:14:25 / stefan" |
1352 "Modified: 14.6.1996 / 17:14:25 / stefan" |
1324 "Modified: 7.4.1997 / 11:38:22 / cg" |
1353 "Modified: 20.8.1997 / 14:18:59 / cg" |
1325 ! |
1354 ! |
1326 |
1355 |
1327 postRealize |
1356 postRealize |
1328 "postRealize actions - tell the application (if any)." |
1357 "postRealize actions - tell the application (if any)." |
1329 |
1358 |