1034 |
1036 |
1035 ^Icon |
1037 ^Icon |
1036 constantNamed:#'UILayoutTool::AnyLayout imageFractY' |
1038 constantNamed:#'UILayoutTool::AnyLayout imageFractY' |
1037 ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A?''<PB@ PAB@BP@I@AB@HDA@H?''>@@X@A??<b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??????????<_>@?0A>@C0@O@A>@O<A?8??????????<b') ; yourself); yourself]! ! |
1039 ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A?''<PB@ PAB@BP@I@AB@HDA@H?''>@@X@A??<b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??????????<_>@?0A>@C0@O@A>@O<A?8??????????<b') ; yourself); yourself]! ! |
1038 |
1040 |
1039 !UILayoutTool::AlignmentOrigin class methodsFor:'help specs'! |
|
1040 |
|
1041 helpSpec |
|
1042 "This resource specification was automatically generated |
|
1043 by the UIHelpTool of ST/X." |
|
1044 |
|
1045 "Do not manually edit this!! If it is corrupted, |
|
1046 the UIHelpTool may not be able to read the specification." |
|
1047 |
|
1048 " |
|
1049 UIHelpTool openOnClass:UILayoutTool::AlignmentOrigin |
|
1050 " |
|
1051 |
|
1052 <resource: #help> |
|
1053 |
|
1054 ^super helpSpec addPairsFrom:#( |
|
1055 |
|
1056 #alignBottomCenter |
|
1057 'Aligns the selected widget bottomCenter to location.' |
|
1058 |
|
1059 #alignBottomLeft |
|
1060 'Aligns the selected widget bottomLeft to location.' |
|
1061 |
|
1062 #alignBottomRight |
|
1063 'Aligns the selected widget bottomRight to location.' |
|
1064 |
|
1065 #alignCenter |
|
1066 'Aligns the selected widget center to location.' |
|
1067 |
|
1068 #alignHorizontal |
|
1069 'Horizontal inset to the location point of the selected widget.' |
|
1070 |
|
1071 #alignLeftCenter |
|
1072 'Aligns the selected widget leftCenter to location.' |
|
1073 |
|
1074 #alignRightCenter |
|
1075 'Aligns the selected widget rightCenter to location.' |
|
1076 |
|
1077 #alignTopCenter |
|
1078 'Aligns the selected widget topCenter to location.' |
|
1079 |
|
1080 #alignTopLeft |
|
1081 'Aligns the selected widget topLeft to location.' |
|
1082 |
|
1083 #alignTopRight |
|
1084 'Aligns the selected widget topRight to location.' |
|
1085 |
|
1086 #alignVertical |
|
1087 'Vertical inset to the location point of the widget.' |
|
1088 |
|
1089 ) |
|
1090 ! ! |
|
1091 |
|
1092 !UILayoutTool::AlignmentOrigin class methodsFor:'interface specs'! |
|
1093 |
|
1094 windowSpec |
|
1095 "This resource specification was automatically generated |
|
1096 by the UIPainter of ST/X." |
|
1097 |
|
1098 "Do not manually edit this!! If it is corrupted, |
|
1099 the UIPainter may not be able to read the specification." |
|
1100 |
|
1101 " |
|
1102 UIPainter new openOnClass:UILayoutTool::AlignmentOrigin andSelector:#windowSpec |
|
1103 UILayoutTool::AlignmentOrigin new openInterface:#windowSpec |
|
1104 UILayoutTool::AlignmentOrigin open |
|
1105 " |
|
1106 |
|
1107 <resource: #canvas> |
|
1108 |
|
1109 ^ |
|
1110 #(#FullSpec |
|
1111 #name: #windowSpec |
|
1112 #window: |
|
1113 #(#WindowSpec |
|
1114 #label: 'UILayoutTool-AlignmentOrigin' |
|
1115 #name: 'UILayoutTool-AlignmentOrigin' |
|
1116 #min: #(#Point 10 10) |
|
1117 #max: #(#Point 1152 900) |
|
1118 #bounds: #(#Rectangle 42 231 447 438) |
|
1119 ) |
|
1120 #component: |
|
1121 #(#SpecCollection |
|
1122 #collection: #( |
|
1123 #(#UISubSpecification |
|
1124 #name: 'layoutOriginSpec' |
|
1125 #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 111 0) |
|
1126 #majorKey: #UILayoutTool |
|
1127 #minorKey: #layoutOriginSpec |
|
1128 ) |
|
1129 #(#FramedBoxSpec |
|
1130 #label: 'Alignment' |
|
1131 #name: 'FramedBox' |
|
1132 #layout: #(#LayoutFrame 1 0.0 113 0 0 1.0 208 0) |
|
1133 #labelPosition: #topLeft |
|
1134 #component: |
|
1135 #(#SpecCollection |
|
1136 #collection: #( |
|
1137 #(#LabelSpec |
|
1138 #label: 'Horizontal:' |
|
1139 #name: 'alignHLabel' |
|
1140 #layout: #(#AlignmentOrigin 88 0 17 0 1 0) |
|
1141 #adjust: #right |
|
1142 ) |
|
1143 #(#InputFieldSpec |
|
1144 #attributes: |
|
1145 #(#tabable |
|
1146 true |
|
1147 ) |
|
1148 #name: 'leftAlignmentFractionField' |
|
1149 #layout: #(#LayoutFrame 90 0 14 0 147 0 36 0) |
|
1150 #activeHelpKey: #alignHorizontal |
|
1151 #tabable: true |
|
1152 #model: #leftAlignmentFraction |
|
1153 #group: #inputGroup |
|
1154 #type: #numberOrNil |
|
1155 #acceptOnLostFocus: true |
|
1156 #acceptChannel: #acceptChannel |
|
1157 #modifiedChannel: #modifiedChannel |
|
1158 #acceptOnPointerLeave: false |
|
1159 ) |
|
1160 #(#LabelSpec |
|
1161 #label: 'Vertical:' |
|
1162 #name: 'alignVLabel' |
|
1163 #layout: #(#AlignmentOrigin 88 0 43 0 1 0) |
|
1164 #adjust: #right |
|
1165 ) |
|
1166 #(#InputFieldSpec |
|
1167 #attributes: |
|
1168 #(#tabable |
|
1169 true |
|
1170 ) |
|
1171 #name: 'topAlignmentFractionField' |
|
1172 #layout: #(#LayoutFrame 90 0 40 0 147 0 62 0) |
|
1173 #activeHelpKey: #alignVertical |
|
1174 #tabable: true |
|
1175 #model: #topAlignmentFraction |
|
1176 #group: #inputGroup |
|
1177 #type: #numberOrNil |
|
1178 #acceptOnLostFocus: true |
|
1179 #acceptChannel: #acceptChannel |
|
1180 #modifiedChannel: #modifiedChannel |
|
1181 #acceptOnPointerLeave: false |
|
1182 ) |
|
1183 #(#DividerSpec |
|
1184 #name: 'separator1' |
|
1185 #layout: #(#LayoutFrame 204 0 19 0 245 0 22 0) |
|
1186 ) |
|
1187 #(#DividerSpec |
|
1188 #name: 'separator2' |
|
1189 #layout: #(#LayoutFrame 204 0 55 0 245 0 58 0) |
|
1190 ) |
|
1191 #(#DividerSpec |
|
1192 #name: 'separator3' |
|
1193 #layout: #(#LayoutFrame 196 0 28 0 199 0 50 0) |
|
1194 #orientation: #vertical |
|
1195 ) |
|
1196 #(#DividerSpec |
|
1197 #name: 'separator4' |
|
1198 #layout: #(#LayoutFrame 250 0 28 0 253 0 50 0) |
|
1199 #orientation: #vertical |
|
1200 ) |
|
1201 #(#ActionButtonSpec |
|
1202 #attributes: |
|
1203 #(#tabable |
|
1204 true |
|
1205 ) |
|
1206 #name: 'alignTopLeft' |
|
1207 #layout: #(#LayoutFrame 190 0 14 0 204 0 28 0) |
|
1208 #activeHelpKey: #alignTopLeft |
|
1209 #tabable: true |
|
1210 #model: #alignTopLeft |
|
1211 ) |
|
1212 #(#ActionButtonSpec |
|
1213 #attributes: |
|
1214 #(#tabable |
|
1215 true |
|
1216 ) |
|
1217 #name: 'alignTopCenter' |
|
1218 #layout: #(#LayoutFrame 217 0 14 0 231 0 28 0) |
|
1219 #activeHelpKey: #alignTopCenter |
|
1220 #tabable: true |
|
1221 #model: #alignTopCenter |
|
1222 ) |
|
1223 #(#ActionButtonSpec |
|
1224 #attributes: |
|
1225 #(#tabable |
|
1226 true |
|
1227 ) |
|
1228 #name: 'alignTopRight' |
|
1229 #layout: #(#LayoutFrame 245 0 14 0 259 0 28 0) |
|
1230 #activeHelpKey: #alignTopRight |
|
1231 #tabable: true |
|
1232 #model: #alignTopRight |
|
1233 ) |
|
1234 #(#ActionButtonSpec |
|
1235 #attributes: |
|
1236 #(#tabable |
|
1237 true |
|
1238 ) |
|
1239 #name: 'alignLeftCenter' |
|
1240 #layout: #(#LayoutFrame 190 0 32 0 204 0 46 0) |
|
1241 #activeHelpKey: #alignLeftCenter |
|
1242 #tabable: true |
|
1243 #model: #alignLeftCenter |
|
1244 ) |
|
1245 #(#ActionButtonSpec |
|
1246 #attributes: |
|
1247 #(#tabable |
|
1248 true |
|
1249 ) |
|
1250 #name: 'alignCenter' |
|
1251 #layout: #(#LayoutFrame 217 0 32 0 231 0 46 0) |
|
1252 #activeHelpKey: #alignCenter |
|
1253 #tabable: true |
|
1254 #model: #alignCenter |
|
1255 ) |
|
1256 #(#ActionButtonSpec |
|
1257 #attributes: |
|
1258 #(#tabable |
|
1259 true |
|
1260 ) |
|
1261 #name: 'alignRightCenter' |
|
1262 #layout: #(#LayoutFrame 245 0 32 0 259 0 46 0) |
|
1263 #activeHelpKey: #alignRightCenter |
|
1264 #tabable: true |
|
1265 #model: #alignRightCenter |
|
1266 ) |
|
1267 #(#ActionButtonSpec |
|
1268 #attributes: |
|
1269 #(#tabable |
|
1270 true |
|
1271 ) |
|
1272 #name: 'alignBottomLeft' |
|
1273 #layout: #(#LayoutFrame 190 0 50 0 204 0 64 0) |
|
1274 #activeHelpKey: #alignBottomLeft |
|
1275 #tabable: true |
|
1276 #model: #alignBottomLeft |
|
1277 ) |
|
1278 #(#ActionButtonSpec |
|
1279 #attributes: |
|
1280 #(#tabable |
|
1281 true |
|
1282 ) |
|
1283 #name: 'alignBottomCenter' |
|
1284 #layout: #(#LayoutFrame 217 0 50 0 231 0 64 0) |
|
1285 #activeHelpKey: #alignBottomCenter |
|
1286 #tabable: true |
|
1287 #model: #alignBottomCenter |
|
1288 ) |
|
1289 #(#ActionButtonSpec |
|
1290 #attributes: |
|
1291 #(#tabable |
|
1292 true |
|
1293 ) |
|
1294 #name: 'alignBottomRight' |
|
1295 #layout: #(#LayoutFrame 245 0 50 0 259 0 64 0) |
|
1296 #activeHelpKey: #alignBottomRight |
|
1297 #tabable: true |
|
1298 #model: #alignBottomRight |
|
1299 ) |
|
1300 ) |
|
1301 |
|
1302 ) |
|
1303 ) |
|
1304 ) |
|
1305 |
|
1306 ) |
|
1307 ) |
|
1308 ! ! |
|
1309 |
|
1310 !UILayoutTool::AlignmentOrigin methodsFor:'accessing'! |
|
1311 |
|
1312 fetch:aView spec:aSpec |
|
1313 "fetch alignmentOrigin |
|
1314 " |
|
1315 |layout type |
|
1316 leftAlignmentFractionHolder topAlignmentFractionHolder |
|
1317 leftOffsetHolder leftFractionHolder topOffsetHolder topFractionHolder| |
|
1318 |
|
1319 type := UIPainterView layoutType:aView. |
|
1320 layout := aView geometryLayout. |
|
1321 |
|
1322 leftOffsetHolder := (self aspectFor:#leftOffset). |
|
1323 leftFractionHolder := (self aspectFor:#leftFraction). |
|
1324 topOffsetHolder := (self aspectFor:#topOffset). |
|
1325 topFractionHolder := (self aspectFor:#topFraction). |
|
1326 leftAlignmentFractionHolder := (self aspectFor:#leftAlignmentFraction). |
|
1327 topAlignmentFractionHolder := (self aspectFor:#topAlignmentFraction). |
|
1328 |
|
1329 layout isLayout ifTrue:[ |
|
1330 leftOffsetHolder value:(layout leftOffset). |
|
1331 leftFractionHolder value:(layout leftFraction). |
|
1332 topOffsetHolder value:(layout topOffset). |
|
1333 topFractionHolder value:(layout topFraction). |
|
1334 |
|
1335 type == #AlignmentOrigin ifTrue:[ |
|
1336 leftAlignmentFractionHolder value:(layout leftAlignmentFraction). |
|
1337 topAlignmentFractionHolder value:(layout topAlignmentFraction). |
|
1338 ^ self |
|
1339 ] |
|
1340 ] ifFalse:[ |
|
1341 layout := aView computeOrigin. |
|
1342 |
|
1343 leftOffsetHolder value:(layout x). |
|
1344 leftFractionHolder value:0. |
|
1345 topOffsetHolder value:(layout y). |
|
1346 topFractionHolder value:0. |
|
1347 ]. |
|
1348 leftAlignmentFractionHolder value:0. |
|
1349 topAlignmentFractionHolder value:0. |
|
1350 |
|
1351 |
|
1352 ! |
|
1353 |
|
1354 layout |
|
1355 "returns current layout as alignmentOrigin |
|
1356 " |
|
1357 |layout| |
|
1358 |
|
1359 layout := Smalltalk::AlignmentOrigin new. |
|
1360 |
|
1361 layout leftOffset:((self aspectFor:#leftOffset) value) ? 0. |
|
1362 layout topOffset:((self aspectFor:#topOffset) value) ? 0. |
|
1363 layout leftFraction:((self aspectFor:#leftFraction) value) ? 0. |
|
1364 layout topFraction:((self aspectFor:#topFraction) value) ? 0. |
|
1365 |
|
1366 layout leftAlignmentFraction:((self aspectFor:#leftAlignmentFraction) value) ? 0. |
|
1367 layout topAlignmentFraction:((self aspectFor:#topAlignmentFraction) value) ? 0. |
|
1368 |
|
1369 ^ layout |
|
1370 ! ! |
|
1371 |
|
1372 !UILayoutTool::AlignmentOrigin methodsFor:'alignment'! |
|
1373 |
|
1374 alignBottomCenter |
|
1375 self makeAlignLeft:0.5 top:1 |
|
1376 |
|
1377 |
|
1378 ! |
|
1379 |
|
1380 alignBottomLeft |
|
1381 self makeAlignLeft:0 top:1 |
|
1382 |
|
1383 |
|
1384 ! |
|
1385 |
|
1386 alignBottomRight |
|
1387 self makeAlignLeft:1 top:1 |
|
1388 |
|
1389 |
|
1390 ! |
|
1391 |
|
1392 alignCenter |
|
1393 self makeAlignLeft:0.5 top:0.5 |
|
1394 |
|
1395 |
|
1396 ! |
|
1397 |
|
1398 alignLeftCenter |
|
1399 self makeAlignLeft:0 top:0.5 |
|
1400 |
|
1401 |
|
1402 ! |
|
1403 |
|
1404 alignRightCenter |
|
1405 self makeAlignLeft:1 top:0.5 |
|
1406 |
|
1407 |
|
1408 ! |
|
1409 |
|
1410 alignTopCenter |
|
1411 self makeAlignLeft:0.5 top:0 |
|
1412 |
|
1413 |
|
1414 ! |
|
1415 |
|
1416 alignTopLeft |
|
1417 self makeAlignLeft:0 top:0 |
|
1418 |
|
1419 |
|
1420 ! |
|
1421 |
|
1422 alignTopRight |
|
1423 self makeAlignLeft:1 top:0 |
|
1424 |
|
1425 |
|
1426 ! |
|
1427 |
|
1428 makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction |
|
1429 |lAF tAF lO tO ext lAHolder tAHolder lOHolder tOHolder| |
|
1430 |
|
1431 lAF := (lAHolder := self aspectFor:#leftAlignmentFraction) value ? 0. |
|
1432 tAF := (tAHolder := self aspectFor:#topAlignmentFraction) value ? 0. |
|
1433 ext := (self aspectFor:#layoutView) computeExtent. |
|
1434 |
|
1435 lAHolder value:leftAlignmentFraction. |
|
1436 tAHolder value:topAlignmentFraction. |
|
1437 |
|
1438 lO := (lOHolder := self aspectFor:#leftOffset) value ? 0. |
|
1439 tO := (tOHolder := self aspectFor:#topOffset) value ? 0. |
|
1440 |
|
1441 lO := lO + (ext x * (leftAlignmentFraction - lAF)). |
|
1442 tO := tO + (ext y * (topAlignmentFraction - tAF)). |
|
1443 |
|
1444 lOHolder value:(lO rounded). |
|
1445 tOHolder value:(tO rounded). |
|
1446 |
|
1447 ! |
|
1448 |
|
1449 makeAlignTopRight |
|
1450 self makeAlignLeft:1 top:0 |
|
1451 |
|
1452 |
|
1453 ! ! |
|
1454 |
|
1455 !UILayoutTool::LayoutOrigin class methodsFor:'interface specs'! |
|
1456 |
|
1457 windowSpec |
|
1458 "This resource specification was automatically generated |
|
1459 by the UIPainter of ST/X." |
|
1460 |
|
1461 "Do not manually edit this!! If it is corrupted, |
|
1462 the UIPainter may not be able to read the specification." |
|
1463 |
|
1464 " |
|
1465 UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec |
|
1466 UILayoutTool::LayoutOrigin new openInterface:#windowSpec |
|
1467 UILayoutTool::LayoutOrigin open |
|
1468 " |
|
1469 |
|
1470 <resource: #canvas> |
|
1471 |
|
1472 ^ |
|
1473 |
|
1474 #(#FullSpec |
|
1475 #window: |
|
1476 #(#WindowSpec |
|
1477 #name: 'UILayoutTool-LayoutOrigin' |
|
1478 #layout: #(#LayoutFrame 290 0 420 0 647 0 565 0) |
|
1479 #label: 'UILayoutTool-LayoutOrigin' |
|
1480 #min: #(#Point 10 10) |
|
1481 #max: #(#Point 1152 900) |
|
1482 #bounds: #(#Rectangle 290 420 648 566) |
|
1483 #usePreferredExtent: false |
|
1484 ) |
|
1485 #component: |
|
1486 #(#SpecCollection |
|
1487 #collection: |
|
1488 #( |
|
1489 #(#UISubSpecification |
|
1490 #name: 'layoutOriginSpec' |
|
1491 #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 110 0) |
|
1492 #majorKey: #UILayoutTool |
|
1493 #minorKey: #layoutOriginSpec |
|
1494 ) |
|
1495 ) |
|
1496 ) |
|
1497 ) |
|
1498 ! ! |
|
1499 |
|
1500 !UILayoutTool::LayoutOrigin methodsFor:'accessing'! |
|
1501 |
|
1502 fetch:aView spec:aSpec |
|
1503 "fetch layoutOrigin |
|
1504 " |
|
1505 |layout| |
|
1506 |
|
1507 layout := UIPainterView asLayoutFrameFromView:aView. |
|
1508 |
|
1509 (self aspectFor:#leftOffset) value:(layout leftOffset). |
|
1510 (self aspectFor:#leftFraction) value:(layout leftFraction). |
|
1511 (self aspectFor:#topOffset) value:(layout topOffset). |
|
1512 (self aspectFor:#topFraction) value:(layout topFraction). |
|
1513 |
|
1514 |
|
1515 ! |
|
1516 |
|
1517 layout |
|
1518 "returns current layout as layoutOrigin |
|
1519 " |
|
1520 |layout| |
|
1521 |
|
1522 layout := Smalltalk::LayoutOrigin new. |
|
1523 |
|
1524 layout leftOffset:((self aspectFor:#leftOffset) value) ? 0. |
|
1525 layout topOffset:((self aspectFor:#topOffset) value) ? 0. |
|
1526 layout leftFraction:((self aspectFor:#leftFraction) value) ? 0. |
|
1527 layout topFraction:((self aspectFor:#topFraction) value) ? 0. |
|
1528 |
|
1529 ^ layout |
|
1530 |
|
1531 ! ! |
|
1532 |
|
1533 !UILayoutTool::LayoutFrame class methodsFor:'help specs'! |
1041 !UILayoutTool::LayoutFrame class methodsFor:'help specs'! |
1534 |
1042 |
1535 helpSpec |
1043 helpSpec |
1536 "This resource specification was automatically generated |
1044 "This resource specification was automatically generated |
1537 by the UIHelpTool of ST/X." |
1045 by the UIHelpTool of ST/X." |
1682 |
1202 |
1683 ^Icon |
1203 ^Icon |
1684 constantNamed:#'UILayoutTool::LayoutFrame setBottomRightQuarterIcon' |
1204 constantNamed:#'UILayoutTool::LayoutFrame setBottomRightQuarterIcon' |
1685 ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BH"H"@@@@@@HQDQH@@@@@@!!DQD @@@@@BDQDR@@@@@@HQDQH@@@@@@"H"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A @F@@X@A @F@@XG? _>A?8G? _>A?8G???<b') ; yourself); yourself]! |
1205 ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BH"H"@@@@@@HQDQH@@@@@@!!DQD @@@@@BDQDR@@@@@@HQDQH@@@@@@"H"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A @F@@X@A @F@@XG? _>A?8G? _>A?8G???<b') ; yourself); yourself]! |
1686 |
1206 |
|
1207 setHorizontalFixPartIcon |
|
1208 "This resource specification was automatically generated |
|
1209 by the ImageEditor of ST/X." |
|
1210 |
|
1211 "Do not manually edit this!! If it is corrupted, |
|
1212 the ImageEditor may not be able to read the specification." |
|
1213 |
|
1214 " |
|
1215 self setHorizontalFixPartIcon inspect |
|
1216 ImageEditor openOnClass:self andSelector:#setHorizontalFixPartIcon |
|
1217 " |
|
1218 |
|
1219 <resource: #image> |
|
1220 |
|
1221 ^Icon |
|
1222 constantNamed:#'UILayoutTool::LayoutFrame setHorizontalFixPartIcon' |
|
1223 ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1224 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"H"H@H"H"@BDQDP@QDQH@HQDQ@ADQD @"H"H@H"H"@@@@@@@@@@@@@@ |
|
1225 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A @F@@_???????????????8@A @F@@X@A??<b') ; yourself); yourself]! |
|
1226 |
|
1227 setLeftFixPartIcon |
|
1228 "This resource specification was automatically generated |
|
1229 by the ImageEditor of ST/X." |
|
1230 |
|
1231 "Do not manually edit this!! If it is corrupted, |
|
1232 the ImageEditor may not be able to read the specification." |
|
1233 |
|
1234 " |
|
1235 self setLeftFixPartIcon inspect |
|
1236 ImageEditor openOnClass:self andSelector:#setLeftFixPartIcon |
|
1237 " |
|
1238 |
|
1239 <resource: #image> |
|
1240 |
|
1241 ^Icon |
|
1242 constantNamed:#'UILayoutTool::LayoutFrame setLeftFixPartIcon' |
|
1243 ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1244 @@@@@@@@@@@BH"@@@@@@@@HQH@@@@@@@@!!D @@@@@@@BDR@@@@@@@@HQH@@@@@@@@!!D @@@@@@@@@@@@@@@@@@@@@@@@@@@@@!!D @@@@@@@BDR@@@@@@@@HQ |
|
1245 H@@@@@@@@!!D @@@@@@@BDR@@@@@@@@H"H@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???<@_0A?@G<@_0A?@G<@_0A?@G<@_0A?@G<@_0A??<b') ; yourself); yourself]! |
|
1246 |
1687 setLeftHalfIcon |
1247 setLeftHalfIcon |
1688 "This resource specification was automatically generated |
1248 "This resource specification was automatically generated |
1689 by the ImageEditor of ST/X." |
1249 by the ImageEditor of ST/X." |
1690 |
1250 |
1691 "Do not manually edit this!! If it is corrupted, |
1251 "Do not manually edit this!! If it is corrupted, |
2079 #value: #setTopFixPartFrame |
1679 #value: #setTopFixPartFrame |
2080 #activeHelpKey: #topFixPartLayout |
1680 #activeHelpKey: #topFixPartLayout |
2081 #labelImage: #(#ResourceRetriever nil #setTopFixPartIcon) |
1681 #labelImage: #(#ResourceRetriever nil #setTopFixPartIcon) |
2082 ) |
1682 ) |
2083 #(#MenuItem |
1683 #(#MenuItem |
|
1684 #label: 'setHorizontalFixPartFrame' |
|
1685 #translateLabel: true |
|
1686 #isButton: true |
|
1687 #nameKey: #setHorizontalFixPartFrame |
|
1688 #value: #setHorizontalFixPartFrame |
|
1689 #activeHelpKey: #horizontalFixPartLayout |
|
1690 #labelImage: #(#ResourceRetriever nil #setHorizontalFixPartIcon) |
|
1691 ) |
|
1692 #(#MenuItem |
2084 #label: 'setBottomFixPartFrame' |
1693 #label: 'setBottomFixPartFrame' |
2085 #translateLabel: true |
1694 #translateLabel: true |
2086 #isButton: true |
1695 #isButton: true |
2087 #nameKey: #setBottomFixPartFrame |
1696 #nameKey: #setBottomFixPartFrame |
2088 #value: #setBottomFixPartFrame |
1697 #value: #setBottomFixPartFrame |
2089 #activeHelpKey: #bottomFixPartLayout |
1698 #activeHelpKey: #bottomFixPartLayout |
2090 #labelImage: #(#ResourceRetriever nil #setBottomFixPartIcon) |
1699 #labelImage: #(#ResourceRetriever nil #setBottomFixPartIcon) |
2091 ) |
1700 ) |
|
1701 #(#MenuItem |
|
1702 #label: '' |
|
1703 ) |
|
1704 #(#MenuItem |
|
1705 #label: 'setLeftFixPartFrame' |
|
1706 #translateLabel: true |
|
1707 #isButton: true |
|
1708 #nameKey: #setLeftFixPartFrame |
|
1709 #value: #setLeftFixPartFrame |
|
1710 #activeHelpKey: #leftFixPartLayout |
|
1711 #labelImage: #(#ResourceRetriever nil #setLeftFixPartIcon) |
|
1712 ) |
|
1713 #(#MenuItem |
|
1714 #label: 'setVerticalFixPartFrame' |
|
1715 #translateLabel: true |
|
1716 #isButton: true |
|
1717 #nameKey: #setVerticalFixPartFrame |
|
1718 #value: #setVerticalFixPartFrame |
|
1719 #activeHelpKey: #verticalFixPartLayout |
|
1720 #labelImage: #(#ResourceRetriever nil #setVerticalFixPartIcon) |
|
1721 ) |
|
1722 #(#MenuItem |
|
1723 #label: 'setRightFixPartFrame' |
|
1724 #translateLabel: true |
|
1725 #isButton: true |
|
1726 #nameKey: #setRightFixPartFrame |
|
1727 #value: #setRightFixPartFrame |
|
1728 #activeHelpKey: #rightFixPartLayout |
|
1729 #labelImage: #(#ResourceRetriever nil #setRightFixPartIcon) |
|
1730 ) |
2092 ) nil |
1731 ) nil |
2093 nil |
1732 nil |
2094 ) |
1733 ) |
2095 ! ! |
1734 ! ! |
2096 |
1735 |
2222 self |
1885 self |
2223 setFrameLeft:0.5 offset:0 |
1886 setFrameLeft:0.5 offset:0 |
2224 right:1 offset:0 |
1887 right:1 offset:0 |
2225 top:0 offset:0 |
1888 top:0 offset:0 |
2226 bottom:0.5 offset:0 |
1889 bottom:0.5 offset:0 |
|
1890 ! |
|
1891 |
|
1892 setVerticalFixPartFrame |
|
1893 self |
|
1894 setFrameLeft:0.5 offset:-15 |
|
1895 right:0.5 offset:15 |
|
1896 top:0 offset:0 |
|
1897 bottom:1 offset:0 |
|
1898 ! ! |
|
1899 |
|
1900 !UILayoutTool::AlignmentOrigin class methodsFor:'help specs'! |
|
1901 |
|
1902 helpSpec |
|
1903 "This resource specification was automatically generated |
|
1904 by the UIHelpTool of ST/X." |
|
1905 |
|
1906 "Do not manually edit this!! If it is corrupted, |
|
1907 the UIHelpTool may not be able to read the specification." |
|
1908 |
|
1909 " |
|
1910 UIHelpTool openOnClass:UILayoutTool::AlignmentOrigin |
|
1911 " |
|
1912 |
|
1913 <resource: #help> |
|
1914 |
|
1915 ^super helpSpec addPairsFrom:#( |
|
1916 |
|
1917 #alignBottomCenter |
|
1918 'Aligns the selected widget bottomCenter to location.' |
|
1919 |
|
1920 #alignBottomLeft |
|
1921 'Aligns the selected widget bottomLeft to location.' |
|
1922 |
|
1923 #alignBottomRight |
|
1924 'Aligns the selected widget bottomRight to location.' |
|
1925 |
|
1926 #alignCenter |
|
1927 'Aligns the selected widget center to location.' |
|
1928 |
|
1929 #alignHorizontal |
|
1930 'Horizontal inset to the location point of the selected widget.' |
|
1931 |
|
1932 #alignLeftCenter |
|
1933 'Aligns the selected widget leftCenter to location.' |
|
1934 |
|
1935 #alignRightCenter |
|
1936 'Aligns the selected widget rightCenter to location.' |
|
1937 |
|
1938 #alignTopCenter |
|
1939 'Aligns the selected widget topCenter to location.' |
|
1940 |
|
1941 #alignTopLeft |
|
1942 'Aligns the selected widget topLeft to location.' |
|
1943 |
|
1944 #alignTopRight |
|
1945 'Aligns the selected widget topRight to location.' |
|
1946 |
|
1947 #alignVertical |
|
1948 'Vertical inset to the location point of the widget.' |
|
1949 |
|
1950 ) |
|
1951 ! ! |
|
1952 |
|
1953 !UILayoutTool::AlignmentOrigin class methodsFor:'interface specs'! |
|
1954 |
|
1955 windowSpec |
|
1956 "This resource specification was automatically generated |
|
1957 by the UIPainter of ST/X." |
|
1958 |
|
1959 "Do not manually edit this!! If it is corrupted, |
|
1960 the UIPainter may not be able to read the specification." |
|
1961 |
|
1962 " |
|
1963 UIPainter new openOnClass:UILayoutTool::AlignmentOrigin andSelector:#windowSpec |
|
1964 UILayoutTool::AlignmentOrigin new openInterface:#windowSpec |
|
1965 UILayoutTool::AlignmentOrigin open |
|
1966 " |
|
1967 |
|
1968 <resource: #canvas> |
|
1969 |
|
1970 ^ |
|
1971 #(#FullSpec |
|
1972 #name: #windowSpec |
|
1973 #window: |
|
1974 #(#WindowSpec |
|
1975 #label: 'UILayoutTool-AlignmentOrigin' |
|
1976 #name: 'UILayoutTool-AlignmentOrigin' |
|
1977 #min: #(#Point 10 10) |
|
1978 #max: #(#Point 1152 900) |
|
1979 #bounds: #(#Rectangle 42 231 447 438) |
|
1980 ) |
|
1981 #component: |
|
1982 #(#SpecCollection |
|
1983 #collection: #( |
|
1984 #(#UISubSpecification |
|
1985 #name: 'layoutOriginSpec' |
|
1986 #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 111 0) |
|
1987 #majorKey: #UILayoutTool |
|
1988 #minorKey: #layoutOriginSpec |
|
1989 ) |
|
1990 #(#FramedBoxSpec |
|
1991 #label: 'Alignment' |
|
1992 #name: 'FramedBox' |
|
1993 #layout: #(#LayoutFrame 1 0.0 113 0 0 1.0 208 0) |
|
1994 #labelPosition: #topLeft |
|
1995 #component: |
|
1996 #(#SpecCollection |
|
1997 #collection: #( |
|
1998 #(#LabelSpec |
|
1999 #label: 'Horizontal:' |
|
2000 #name: 'alignHLabel' |
|
2001 #layout: #(#AlignmentOrigin 88 0 17 0 1 0) |
|
2002 #adjust: #right |
|
2003 ) |
|
2004 #(#InputFieldSpec |
|
2005 #attributes: |
|
2006 #(#tabable |
|
2007 true |
|
2008 ) |
|
2009 #name: 'leftAlignmentFractionField' |
|
2010 #layout: #(#LayoutFrame 90 0 14 0 147 0 36 0) |
|
2011 #activeHelpKey: #alignHorizontal |
|
2012 #tabable: true |
|
2013 #model: #leftAlignmentFraction |
|
2014 #group: #inputGroup |
|
2015 #type: #numberOrNil |
|
2016 #acceptOnLostFocus: true |
|
2017 #acceptChannel: #acceptChannel |
|
2018 #modifiedChannel: #modifiedChannel |
|
2019 #acceptOnPointerLeave: false |
|
2020 ) |
|
2021 #(#LabelSpec |
|
2022 #label: 'Vertical:' |
|
2023 #name: 'alignVLabel' |
|
2024 #layout: #(#AlignmentOrigin 88 0 43 0 1 0) |
|
2025 #adjust: #right |
|
2026 ) |
|
2027 #(#InputFieldSpec |
|
2028 #attributes: |
|
2029 #(#tabable |
|
2030 true |
|
2031 ) |
|
2032 #name: 'topAlignmentFractionField' |
|
2033 #layout: #(#LayoutFrame 90 0 40 0 147 0 62 0) |
|
2034 #activeHelpKey: #alignVertical |
|
2035 #tabable: true |
|
2036 #model: #topAlignmentFraction |
|
2037 #group: #inputGroup |
|
2038 #type: #numberOrNil |
|
2039 #acceptOnLostFocus: true |
|
2040 #acceptChannel: #acceptChannel |
|
2041 #modifiedChannel: #modifiedChannel |
|
2042 #acceptOnPointerLeave: false |
|
2043 ) |
|
2044 #(#DividerSpec |
|
2045 #name: 'separator1' |
|
2046 #layout: #(#LayoutFrame 204 0 19 0 245 0 22 0) |
|
2047 ) |
|
2048 #(#DividerSpec |
|
2049 #name: 'separator2' |
|
2050 #layout: #(#LayoutFrame 204 0 55 0 245 0 58 0) |
|
2051 ) |
|
2052 #(#DividerSpec |
|
2053 #name: 'separator3' |
|
2054 #layout: #(#LayoutFrame 196 0 28 0 199 0 50 0) |
|
2055 #orientation: #vertical |
|
2056 ) |
|
2057 #(#DividerSpec |
|
2058 #name: 'separator4' |
|
2059 #layout: #(#LayoutFrame 250 0 28 0 253 0 50 0) |
|
2060 #orientation: #vertical |
|
2061 ) |
|
2062 #(#ActionButtonSpec |
|
2063 #attributes: |
|
2064 #(#tabable |
|
2065 true |
|
2066 ) |
|
2067 #name: 'alignTopLeft' |
|
2068 #layout: #(#LayoutFrame 190 0 14 0 204 0 28 0) |
|
2069 #activeHelpKey: #alignTopLeft |
|
2070 #tabable: true |
|
2071 #model: #alignTopLeft |
|
2072 ) |
|
2073 #(#ActionButtonSpec |
|
2074 #attributes: |
|
2075 #(#tabable |
|
2076 true |
|
2077 ) |
|
2078 #name: 'alignTopCenter' |
|
2079 #layout: #(#LayoutFrame 217 0 14 0 231 0 28 0) |
|
2080 #activeHelpKey: #alignTopCenter |
|
2081 #tabable: true |
|
2082 #model: #alignTopCenter |
|
2083 ) |
|
2084 #(#ActionButtonSpec |
|
2085 #attributes: |
|
2086 #(#tabable |
|
2087 true |
|
2088 ) |
|
2089 #name: 'alignTopRight' |
|
2090 #layout: #(#LayoutFrame 245 0 14 0 259 0 28 0) |
|
2091 #activeHelpKey: #alignTopRight |
|
2092 #tabable: true |
|
2093 #model: #alignTopRight |
|
2094 ) |
|
2095 #(#ActionButtonSpec |
|
2096 #attributes: |
|
2097 #(#tabable |
|
2098 true |
|
2099 ) |
|
2100 #name: 'alignLeftCenter' |
|
2101 #layout: #(#LayoutFrame 190 0 32 0 204 0 46 0) |
|
2102 #activeHelpKey: #alignLeftCenter |
|
2103 #tabable: true |
|
2104 #model: #alignLeftCenter |
|
2105 ) |
|
2106 #(#ActionButtonSpec |
|
2107 #attributes: |
|
2108 #(#tabable |
|
2109 true |
|
2110 ) |
|
2111 #name: 'alignCenter' |
|
2112 #layout: #(#LayoutFrame 217 0 32 0 231 0 46 0) |
|
2113 #activeHelpKey: #alignCenter |
|
2114 #tabable: true |
|
2115 #model: #alignCenter |
|
2116 ) |
|
2117 #(#ActionButtonSpec |
|
2118 #attributes: |
|
2119 #(#tabable |
|
2120 true |
|
2121 ) |
|
2122 #name: 'alignRightCenter' |
|
2123 #layout: #(#LayoutFrame 245 0 32 0 259 0 46 0) |
|
2124 #activeHelpKey: #alignRightCenter |
|
2125 #tabable: true |
|
2126 #model: #alignRightCenter |
|
2127 ) |
|
2128 #(#ActionButtonSpec |
|
2129 #attributes: |
|
2130 #(#tabable |
|
2131 true |
|
2132 ) |
|
2133 #name: 'alignBottomLeft' |
|
2134 #layout: #(#LayoutFrame 190 0 50 0 204 0 64 0) |
|
2135 #activeHelpKey: #alignBottomLeft |
|
2136 #tabable: true |
|
2137 #model: #alignBottomLeft |
|
2138 ) |
|
2139 #(#ActionButtonSpec |
|
2140 #attributes: |
|
2141 #(#tabable |
|
2142 true |
|
2143 ) |
|
2144 #name: 'alignBottomCenter' |
|
2145 #layout: #(#LayoutFrame 217 0 50 0 231 0 64 0) |
|
2146 #activeHelpKey: #alignBottomCenter |
|
2147 #tabable: true |
|
2148 #model: #alignBottomCenter |
|
2149 ) |
|
2150 #(#ActionButtonSpec |
|
2151 #attributes: |
|
2152 #(#tabable |
|
2153 true |
|
2154 ) |
|
2155 #name: 'alignBottomRight' |
|
2156 #layout: #(#LayoutFrame 245 0 50 0 259 0 64 0) |
|
2157 #activeHelpKey: #alignBottomRight |
|
2158 #tabable: true |
|
2159 #model: #alignBottomRight |
|
2160 ) |
|
2161 ) |
|
2162 |
|
2163 ) |
|
2164 ) |
|
2165 ) |
|
2166 |
|
2167 ) |
|
2168 ) |
|
2169 ! ! |
|
2170 |
|
2171 !UILayoutTool::AlignmentOrigin methodsFor:'accessing'! |
|
2172 |
|
2173 fetch:aView spec:aSpec |
|
2174 "fetch alignmentOrigin |
|
2175 " |
|
2176 |layout type |
|
2177 leftAlignmentFractionHolder topAlignmentFractionHolder |
|
2178 leftOffsetHolder leftFractionHolder topOffsetHolder topFractionHolder| |
|
2179 |
|
2180 type := UIPainterView layoutType:aView. |
|
2181 layout := aView geometryLayout. |
|
2182 |
|
2183 leftOffsetHolder := (self aspectFor:#leftOffset). |
|
2184 leftFractionHolder := (self aspectFor:#leftFraction). |
|
2185 topOffsetHolder := (self aspectFor:#topOffset). |
|
2186 topFractionHolder := (self aspectFor:#topFraction). |
|
2187 leftAlignmentFractionHolder := (self aspectFor:#leftAlignmentFraction). |
|
2188 topAlignmentFractionHolder := (self aspectFor:#topAlignmentFraction). |
|
2189 |
|
2190 layout isLayout ifTrue:[ |
|
2191 leftOffsetHolder value:(layout leftOffset). |
|
2192 leftFractionHolder value:(layout leftFraction). |
|
2193 topOffsetHolder value:(layout topOffset). |
|
2194 topFractionHolder value:(layout topFraction). |
|
2195 |
|
2196 type == #AlignmentOrigin ifTrue:[ |
|
2197 leftAlignmentFractionHolder value:(layout leftAlignmentFraction). |
|
2198 topAlignmentFractionHolder value:(layout topAlignmentFraction). |
|
2199 ^ self |
|
2200 ] |
|
2201 ] ifFalse:[ |
|
2202 layout := aView computeOrigin. |
|
2203 |
|
2204 leftOffsetHolder value:(layout x). |
|
2205 leftFractionHolder value:0. |
|
2206 topOffsetHolder value:(layout y). |
|
2207 topFractionHolder value:0. |
|
2208 ]. |
|
2209 leftAlignmentFractionHolder value:0. |
|
2210 topAlignmentFractionHolder value:0. |
|
2211 |
|
2212 |
|
2213 ! |
|
2214 |
|
2215 layout |
|
2216 "returns current layout as alignmentOrigin |
|
2217 " |
|
2218 |layout| |
|
2219 |
|
2220 layout := Smalltalk::AlignmentOrigin new. |
|
2221 |
|
2222 layout leftOffset:((self aspectFor:#leftOffset) value) ? 0. |
|
2223 layout topOffset:((self aspectFor:#topOffset) value) ? 0. |
|
2224 layout leftFraction:((self aspectFor:#leftFraction) value) ? 0. |
|
2225 layout topFraction:((self aspectFor:#topFraction) value) ? 0. |
|
2226 |
|
2227 layout leftAlignmentFraction:((self aspectFor:#leftAlignmentFraction) value) ? 0. |
|
2228 layout topAlignmentFraction:((self aspectFor:#topAlignmentFraction) value) ? 0. |
|
2229 |
|
2230 ^ layout |
|
2231 ! ! |
|
2232 |
|
2233 !UILayoutTool::AlignmentOrigin methodsFor:'alignment'! |
|
2234 |
|
2235 alignBottomCenter |
|
2236 self makeAlignLeft:0.5 top:1 |
|
2237 |
|
2238 |
|
2239 ! |
|
2240 |
|
2241 alignBottomLeft |
|
2242 self makeAlignLeft:0 top:1 |
|
2243 |
|
2244 |
|
2245 ! |
|
2246 |
|
2247 alignBottomRight |
|
2248 self makeAlignLeft:1 top:1 |
|
2249 |
|
2250 |
|
2251 ! |
|
2252 |
|
2253 alignCenter |
|
2254 self makeAlignLeft:0.5 top:0.5 |
|
2255 |
|
2256 |
|
2257 ! |
|
2258 |
|
2259 alignLeftCenter |
|
2260 self makeAlignLeft:0 top:0.5 |
|
2261 |
|
2262 |
|
2263 ! |
|
2264 |
|
2265 alignRightCenter |
|
2266 self makeAlignLeft:1 top:0.5 |
|
2267 |
|
2268 |
|
2269 ! |
|
2270 |
|
2271 alignTopCenter |
|
2272 self makeAlignLeft:0.5 top:0 |
|
2273 |
|
2274 |
|
2275 ! |
|
2276 |
|
2277 alignTopLeft |
|
2278 self makeAlignLeft:0 top:0 |
|
2279 |
|
2280 |
|
2281 ! |
|
2282 |
|
2283 alignTopRight |
|
2284 self makeAlignLeft:1 top:0 |
|
2285 |
|
2286 |
|
2287 ! |
|
2288 |
|
2289 makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction |
|
2290 |lAF tAF lO tO ext lAHolder tAHolder lOHolder tOHolder| |
|
2291 |
|
2292 lAF := (lAHolder := self aspectFor:#leftAlignmentFraction) value ? 0. |
|
2293 tAF := (tAHolder := self aspectFor:#topAlignmentFraction) value ? 0. |
|
2294 ext := (self aspectFor:#layoutView) computeExtent. |
|
2295 |
|
2296 lAHolder value:leftAlignmentFraction. |
|
2297 tAHolder value:topAlignmentFraction. |
|
2298 |
|
2299 lO := (lOHolder := self aspectFor:#leftOffset) value ? 0. |
|
2300 tO := (tOHolder := self aspectFor:#topOffset) value ? 0. |
|
2301 |
|
2302 lO := lO + (ext x * (leftAlignmentFraction - lAF)). |
|
2303 tO := tO + (ext y * (topAlignmentFraction - tAF)). |
|
2304 |
|
2305 lOHolder value:(lO rounded). |
|
2306 tOHolder value:(tO rounded). |
|
2307 |
|
2308 ! |
|
2309 |
|
2310 makeAlignTopRight |
|
2311 self makeAlignLeft:1 top:0 |
|
2312 |
|
2313 |
2227 ! ! |
2314 ! ! |
2228 |
2315 |
2229 !UILayoutTool::Point class methodsFor:'interface specs'! |
2316 !UILayoutTool::Point class methodsFor:'interface specs'! |
2230 |
2317 |
2231 windowSpec |
2318 windowSpec |
2289 layout |
2376 layout |
2290 "returns current layout as point |
2377 "returns current layout as point |
2291 " |
2378 " |
2292 ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0) |
2379 ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0) |
2293 y:(((self aspectFor:#topOffset) value) ? 0) |
2380 y:(((self aspectFor:#topOffset) value) ? 0) |
|
2381 |
|
2382 ! ! |
|
2383 |
|
2384 !UILayoutTool::Extent class methodsFor:'help specs'! |
|
2385 |
|
2386 helpSpec |
|
2387 "This resource specification was automatically generated |
|
2388 by the UIHelpTool of ST/X." |
|
2389 |
|
2390 "Do not manually edit this!! If it is corrupted, |
|
2391 the UIHelpTool may not be able to read the specification." |
|
2392 |
|
2393 " |
|
2394 UIHelpTool openOnClass:UILayoutTool::Extent |
|
2395 " |
|
2396 |
|
2397 <resource: #help> |
|
2398 |
|
2399 ^super helpSpec addPairsFrom:#( |
|
2400 |
|
2401 #hrzExtent |
|
2402 'Horizontal extent of the selected widget.' |
|
2403 |
|
2404 #vrtExtent |
|
2405 'Vertical extent of the selected widget.' |
|
2406 |
|
2407 ) |
|
2408 ! ! |
|
2409 |
|
2410 !UILayoutTool::Extent class methodsFor:'interface specs'! |
|
2411 |
|
2412 windowSpec |
|
2413 "This resource specification was automatically generated |
|
2414 by the UIPainter of ST/X." |
|
2415 |
|
2416 "Do not manually edit this!! If it is corrupted, |
|
2417 the UIPainter may not be able to read the specification." |
|
2418 |
|
2419 " |
|
2420 UIPainter new openOnClass:UILayoutTool::Extent andSelector:#windowSpec |
|
2421 UILayoutTool::Extent new openInterface:#windowSpec |
|
2422 UILayoutTool::Extent open |
|
2423 " |
|
2424 |
|
2425 <resource: #canvas> |
|
2426 |
|
2427 ^ |
|
2428 #(#FullSpec |
|
2429 #name: #windowSpec |
|
2430 #window: |
|
2431 #(#WindowSpec |
|
2432 #label: 'UILayoutTool-Extent' |
|
2433 #name: 'UILayoutTool-Extent' |
|
2434 #min: #(#Point 10 10) |
|
2435 #max: #(#Point 1152 900) |
|
2436 #bounds: #(#Rectangle 506 24 832 173) |
|
2437 ) |
|
2438 #component: |
|
2439 #(#SpecCollection |
|
2440 #collection: #( |
|
2441 #(#FramedBoxSpec |
|
2442 #label: 'Extent' |
|
2443 #name: 'FramedBox' |
|
2444 #layout: #(#LayoutFrame 0 0.0 6 0.0 0 1.0 137 0) |
|
2445 #labelPosition: #topLeft |
|
2446 #component: |
|
2447 #(#SpecCollection |
|
2448 #collection: #( |
|
2449 #(#LabelSpec |
|
2450 #label: 'Width:' |
|
2451 #name: 'labelWidth' |
|
2452 #layout: #(#AlignmentOrigin 89 0 24 0 1 0.5) |
|
2453 #adjust: #right |
|
2454 ) |
|
2455 #(#InputFieldSpec |
|
2456 #attributes: |
|
2457 #(#tabable |
|
2458 true |
|
2459 ) |
|
2460 #name: 'fieldLeftOffset' |
|
2461 #layout: #(#LayoutFrame 90 0 13 0 140 0 35 0) |
|
2462 #activeHelpKey: #hrzExtent |
|
2463 #enableChannel: #notUsingDefaultExtent |
|
2464 #tabable: true |
|
2465 #model: #leftOffset |
|
2466 #group: #inputGroup |
|
2467 #type: #numberOrNil |
|
2468 #acceptOnLostFocus: true |
|
2469 #acceptChannel: #acceptChannel |
|
2470 #modifiedChannel: #modifiedChannel |
|
2471 #acceptOnPointerLeave: false |
|
2472 ) |
|
2473 #(#LabelSpec |
|
2474 #label: 'Height:' |
|
2475 #name: 'labelHeight' |
|
2476 #layout: #(#AlignmentOrigin 89 0 49 0 1 0.5) |
|
2477 #adjust: #right |
|
2478 ) |
|
2479 #(#InputFieldSpec |
|
2480 #attributes: |
|
2481 #(#tabable |
|
2482 true |
|
2483 ) |
|
2484 #name: 'fieldRightOffset' |
|
2485 #layout: #(#LayoutFrame 90 0 38 0 140 0 60 0) |
|
2486 #activeHelpKey: #vrtExtent |
|
2487 #enableChannel: #notUsingDefaultExtent |
|
2488 #tabable: true |
|
2489 #model: #rightOffset |
|
2490 #group: #inputGroup |
|
2491 #type: #numberOrNil |
|
2492 #acceptOnLostFocus: true |
|
2493 #acceptChannel: #acceptChannel |
|
2494 #modifiedChannel: #modifiedChannel |
|
2495 #acceptOnPointerLeave: false |
|
2496 ) |
|
2497 #(#CheckBoxSpec |
|
2498 #attributes: |
|
2499 #(#tabable |
|
2500 true |
|
2501 ) |
|
2502 #label: 'Use Widgets Default Extent' |
|
2503 #name: 'useDefaultExtentCheckBox' |
|
2504 #layout: #(#Point 5 74) |
|
2505 #enableChannel: #defaultExtentEnabled |
|
2506 #tabable: true |
|
2507 #model: #useDefaultExtent |
|
2508 #translateLabel: true |
|
2509 ) |
|
2510 ) |
|
2511 |
|
2512 ) |
|
2513 ) |
|
2514 ) |
|
2515 |
|
2516 ) |
|
2517 ) |
|
2518 ! ! |
|
2519 |
|
2520 !UILayoutTool::Extent methodsFor:'accessing'! |
|
2521 |
|
2522 fetch:aView spec:aSpec |
|
2523 "fetch extent |
|
2524 " |
|
2525 |extent| |
|
2526 |
|
2527 extent := aView computeExtent. |
|
2528 |
|
2529 (self aspectFor:#leftOffset) value:(extent x). |
|
2530 (self aspectFor:#rightOffset) value:(extent y). |
|
2531 |
|
2532 (self aspectFor:#useDefaultExtent) value:aSpec useDefaultExtent |
|
2533 ! |
|
2534 |
|
2535 layout |
|
2536 "returns current extent |
|
2537 " |
|
2538 ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0) |
|
2539 y:(((self aspectFor:#rightOffset) value) ? 0) |
2294 |
2540 |
2295 ! ! |
2541 ! ! |
2296 |
2542 |
2297 !UILayoutTool::Rectangle class methodsFor:'interface specs'! |
2543 !UILayoutTool::Rectangle class methodsFor:'interface specs'! |
2298 |
2544 |
2416 bottom:(((self aspectFor:#bottomOffset) value) ? 0) |
2662 bottom:(((self aspectFor:#bottomOffset) value) ? 0) |
2417 |
2663 |
2418 |
2664 |
2419 ! ! |
2665 ! ! |
2420 |
2666 |
2421 !UILayoutTool::Extent class methodsFor:'help specs'! |
2667 !UILayoutTool::LayoutOrigin class methodsFor:'interface specs'! |
2422 |
|
2423 helpSpec |
|
2424 "This resource specification was automatically generated |
|
2425 by the UIHelpTool of ST/X." |
|
2426 |
|
2427 "Do not manually edit this!! If it is corrupted, |
|
2428 the UIHelpTool may not be able to read the specification." |
|
2429 |
|
2430 " |
|
2431 UIHelpTool openOnClass:UILayoutTool::Extent |
|
2432 " |
|
2433 |
|
2434 <resource: #help> |
|
2435 |
|
2436 ^super helpSpec addPairsFrom:#( |
|
2437 |
|
2438 #hrzExtent |
|
2439 'Horizontal extent of the selected widget.' |
|
2440 |
|
2441 #vrtExtent |
|
2442 'Vertical extent of the selected widget.' |
|
2443 |
|
2444 ) |
|
2445 ! ! |
|
2446 |
|
2447 !UILayoutTool::Extent class methodsFor:'interface specs'! |
|
2448 |
2668 |
2449 windowSpec |
2669 windowSpec |
2450 "This resource specification was automatically generated |
2670 "This resource specification was automatically generated |
2451 by the UIPainter of ST/X." |
2671 by the UIPainter of ST/X." |
2452 |
2672 |
2453 "Do not manually edit this!! If it is corrupted, |
2673 "Do not manually edit this!! If it is corrupted, |
2454 the UIPainter may not be able to read the specification." |
2674 the UIPainter may not be able to read the specification." |
2455 |
2675 |
2456 " |
2676 " |
2457 UIPainter new openOnClass:UILayoutTool::Extent andSelector:#windowSpec |
2677 UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec |
2458 UILayoutTool::Extent new openInterface:#windowSpec |
2678 UILayoutTool::LayoutOrigin new openInterface:#windowSpec |
2459 UILayoutTool::Extent open |
2679 UILayoutTool::LayoutOrigin open |
2460 " |
2680 " |
2461 |
2681 |
2462 <resource: #canvas> |
2682 <resource: #canvas> |
2463 |
2683 |
2464 ^ |
2684 ^ |
2465 #(#FullSpec |
2685 |
2466 #name: #windowSpec |
2686 #(#FullSpec |
2467 #window: |
2687 #window: |
2468 #(#WindowSpec |
2688 #(#WindowSpec |
2469 #label: 'UILayoutTool-Extent' |
2689 #name: 'UILayoutTool-LayoutOrigin' |
2470 #name: 'UILayoutTool-Extent' |
2690 #layout: #(#LayoutFrame 290 0 420 0 647 0 565 0) |
2471 #min: #(#Point 10 10) |
2691 #label: 'UILayoutTool-LayoutOrigin' |
2472 #max: #(#Point 1152 900) |
2692 #min: #(#Point 10 10) |
2473 #bounds: #(#Rectangle 506 24 832 173) |
2693 #max: #(#Point 1152 900) |
2474 ) |
2694 #bounds: #(#Rectangle 290 420 648 566) |
2475 #component: |
2695 #usePreferredExtent: false |
2476 #(#SpecCollection |
2696 ) |
2477 #collection: #( |
2697 #component: |
2478 #(#FramedBoxSpec |
2698 #(#SpecCollection |
2479 #label: 'Extent' |
2699 #collection: |
2480 #name: 'FramedBox' |
2700 #( |
2481 #layout: #(#LayoutFrame 0 0.0 6 0.0 0 1.0 137 0) |
2701 #(#UISubSpecification |
2482 #labelPosition: #topLeft |
2702 #name: 'layoutOriginSpec' |
2483 #component: |
2703 #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 110 0) |
2484 #(#SpecCollection |
2704 #majorKey: #UILayoutTool |
2485 #collection: #( |
2705 #minorKey: #layoutOriginSpec |
2486 #(#LabelSpec |
2706 ) |
2487 #label: 'Width:' |
|
2488 #name: 'labelWidth' |
|
2489 #layout: #(#AlignmentOrigin 89 0 24 0 1 0.5) |
|
2490 #adjust: #right |
|
2491 ) |
|
2492 #(#InputFieldSpec |
|
2493 #attributes: |
|
2494 #(#tabable |
|
2495 true |
|
2496 ) |
|
2497 #name: 'fieldLeftOffset' |
|
2498 #layout: #(#LayoutFrame 90 0 13 0 140 0 35 0) |
|
2499 #activeHelpKey: #hrzExtent |
|
2500 #enableChannel: #notUsingDefaultExtent |
|
2501 #tabable: true |
|
2502 #model: #leftOffset |
|
2503 #group: #inputGroup |
|
2504 #type: #numberOrNil |
|
2505 #acceptOnLostFocus: true |
|
2506 #acceptChannel: #acceptChannel |
|
2507 #modifiedChannel: #modifiedChannel |
|
2508 #acceptOnPointerLeave: false |
|
2509 ) |
|
2510 #(#LabelSpec |
|
2511 #label: 'Height:' |
|
2512 #name: 'labelHeight' |
|
2513 #layout: #(#AlignmentOrigin 89 0 49 0 1 0.5) |
|
2514 #adjust: #right |
|
2515 ) |
|
2516 #(#InputFieldSpec |
|
2517 #attributes: |
|
2518 #(#tabable |
|
2519 true |
|
2520 ) |
|
2521 #name: 'fieldRightOffset' |
|
2522 #layout: #(#LayoutFrame 90 0 38 0 140 0 60 0) |
|
2523 #activeHelpKey: #vrtExtent |
|
2524 #enableChannel: #notUsingDefaultExtent |
|
2525 #tabable: true |
|
2526 #model: #rightOffset |
|
2527 #group: #inputGroup |
|
2528 #type: #numberOrNil |
|
2529 #acceptOnLostFocus: true |
|
2530 #acceptChannel: #acceptChannel |
|
2531 #modifiedChannel: #modifiedChannel |
|
2532 #acceptOnPointerLeave: false |
|
2533 ) |
|
2534 #(#CheckBoxSpec |
|
2535 #attributes: |
|
2536 #(#tabable |
|
2537 true |
|
2538 ) |
|
2539 #label: 'Use Widgets Default Extent' |
|
2540 #name: 'useDefaultExtentCheckBox' |
|
2541 #layout: #(#Point 5 74) |
|
2542 #enableChannel: #defaultExtentEnabled |
|
2543 #tabable: true |
|
2544 #model: #useDefaultExtent |
|
2545 #translateLabel: true |
|
2546 ) |
|
2547 ) |
|
2548 |
|
2549 ) |
2707 ) |
2550 ) |
2708 ) |
2551 ) |
|
2552 |
|
2553 ) |
|
2554 ) |
2709 ) |
2555 ! ! |
2710 ! ! |
2556 |
2711 |
2557 !UILayoutTool::Extent methodsFor:'accessing'! |
2712 !UILayoutTool::LayoutOrigin methodsFor:'accessing'! |
2558 |
2713 |
2559 fetch:aView spec:aSpec |
2714 fetch:aView spec:aSpec |
2560 "fetch extent |
2715 "fetch layoutOrigin |
2561 " |
2716 " |
2562 |extent| |
2717 |layout| |
2563 |
2718 |
2564 extent := aView computeExtent. |
2719 layout := UIPainterView asLayoutFrameFromView:aView. |
2565 |
2720 |
2566 (self aspectFor:#leftOffset) value:(extent x). |
2721 (self aspectFor:#leftOffset) value:(layout leftOffset). |
2567 (self aspectFor:#rightOffset) value:(extent y). |
2722 (self aspectFor:#leftFraction) value:(layout leftFraction). |
2568 |
2723 (self aspectFor:#topOffset) value:(layout topOffset). |
2569 (self aspectFor:#useDefaultExtent) value:aSpec useDefaultExtent |
2724 (self aspectFor:#topFraction) value:(layout topFraction). |
|
2725 |
|
2726 |
2570 ! |
2727 ! |
2571 |
2728 |
2572 layout |
2729 layout |
2573 "returns current extent |
2730 "returns current layout as layoutOrigin |
2574 " |
2731 " |
2575 ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0) |
2732 |layout| |
2576 y:(((self aspectFor:#rightOffset) value) ? 0) |
2733 |
|
2734 layout := Smalltalk::LayoutOrigin new. |
|
2735 |
|
2736 layout leftOffset:((self aspectFor:#leftOffset) value) ? 0. |
|
2737 layout topOffset:((self aspectFor:#topOffset) value) ? 0. |
|
2738 layout leftFraction:((self aspectFor:#leftFraction) value) ? 0. |
|
2739 layout topFraction:((self aspectFor:#topFraction) value) ? 0. |
|
2740 |
|
2741 ^ layout |
2577 |
2742 |
2578 ! ! |
2743 ! ! |
2579 |
2744 |
2580 !UILayoutTool class methodsFor:'documentation'! |
2745 !UILayoutTool class methodsFor:'documentation'! |
2581 |
2746 |