44 privateIn:UILayoutTool |
44 privateIn:UILayoutTool |
45 ! |
45 ! |
46 |
46 |
47 UILayoutTool::AnyLayout subclass:#LayoutFrame |
47 UILayoutTool::AnyLayout subclass:#LayoutFrame |
48 instanceVariableNames:'' |
48 instanceVariableNames:'' |
49 classVariableNames:'' |
49 classVariableNames:'DefaultFixPartHeight' |
50 poolDictionaries:'' |
50 poolDictionaries:'' |
51 privateIn:UILayoutTool |
51 privateIn:UILayoutTool |
52 ! |
52 ! |
53 |
53 |
54 UILayoutTool::AnyLayout subclass:#LayoutOrigin |
54 UILayoutTool::AnyLayout subclass:#LayoutOrigin |
536 layoutView := aView. |
536 layoutView := aView. |
537 layoutSpec := aSpec. |
537 layoutSpec := aSpec. |
538 |
538 |
539 (self aspectFor:#defaultExtentEnabled) value:(aSpec class == WindowSpec) not. |
539 (self aspectFor:#defaultExtentEnabled) value:(aSpec class == WindowSpec) not. |
540 |
540 |
541 aTypeOrNil notNil ifTrue:[ |
541 aTypeOrNil notNil ifTrue:[ |
542 self class slices findFirst:[:e| |
542 self class slices findFirst:[:e| |
543 e last == aTypeOrNil ifTrue:[name := e first. true] |
543 e last == aTypeOrNil ifTrue:[name := e first. true] |
544 ]. |
544 ]. |
545 list := Array with:name |
545 list := Array with:name with: 'Frame'. |
546 ] ifFalse:[ |
546 ] ifFalse:[ |
547 (type := UIPainterView layoutType:layoutView) notNil ifTrue:[ |
547 (type := UIPainterView layoutType:layoutView) notNil ifTrue:[ |
548 self class slices findFirst:[:e| |
548 self class slices findFirst:[:e| |
549 e last == type ifTrue:[name := e first. true] |
549 e last == type ifTrue:[name := e first. true] |
550 ]. |
550 ]. |
551 list := tabList. |
551 list := tabList. |
552 |
552 type == #Extent ifTrue:[ |
553 type == #Extent ifTrue:[ |
|
554 aView superView specClass isLayoutContainer ifTrue:[ |
553 aView superView specClass isLayoutContainer ifTrue:[ |
555 list := Array with:name |
554 list := Array with:name |
556 ] ifFalse:[ |
555 ] ifFalse:[ |
557 list := list copyWith:name |
556 list := list copyWith:name |
558 ] |
557 ] |
1562 ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0) |
1561 ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0) |
1563 y:(((self aspectFor:#rightOffset) value) ? 0) |
1562 y:(((self aspectFor:#rightOffset) value) ? 0) |
1564 |
1563 |
1565 ! ! |
1564 ! ! |
1566 |
1565 |
|
1566 !UILayoutTool::LayoutFrame class methodsFor:'defaults'! |
|
1567 |
|
1568 defaultFixPartHeight |
|
1569 ^ DefaultFixPartHeight ? 30 |
|
1570 ! ! |
|
1571 |
1567 !UILayoutTool::LayoutFrame class methodsFor:'help specs'! |
1572 !UILayoutTool::LayoutFrame class methodsFor:'help specs'! |
1568 |
1573 |
1569 helpSpec |
1574 helpSpec |
1570 "This resource specification was automatically generated |
1575 "This resource specification was automatically generated |
1571 by the UIHelpTool of ST/X." |
1576 by the UIHelpTool of ST/X." |
2425 ) |
2446 ) |
2426 ) |
2447 ) |
2427 nil |
2448 nil |
2428 nil |
2449 nil |
2429 ) |
2450 ) |
|
2451 ! |
|
2452 |
|
2453 commonFrameLayoutsMenu3 |
|
2454 "This resource specification was automatically generated |
|
2455 by the MenuEditor of ST/X." |
|
2456 |
|
2457 "Do not manually edit this!! If it is corrupted, |
|
2458 the MenuEditor may not be able to read the specification." |
|
2459 |
|
2460 " |
|
2461 MenuEditor new openOnClass:UILayoutTool::LayoutFrame andSelector:#commonFrameLayoutsMenu2 |
|
2462 (Menu new fromLiteralArrayEncoding:(UILayoutTool::LayoutFrame commonFrameLayoutsMenu2)) startUp |
|
2463 " |
|
2464 |
|
2465 <resource: #menu> |
|
2466 |
|
2467 ^ |
|
2468 #(#Menu |
|
2469 #( |
|
2470 #(#MenuItem |
|
2471 #label: 'setScreenFrame' |
|
2472 #translateLabel: true |
|
2473 #isButton: true |
|
2474 #nameKey: #setScreenFrame |
|
2475 #value: #setScreenFrame |
|
2476 #activeHelpKey: #screenFrameLayout |
|
2477 #enabled: true |
|
2478 #labelImage: #(#ResourceRetriever #'UILayoutTool::LayoutFrame' #setScreenIcon) |
|
2479 ) |
|
2480 ) |
|
2481 nil |
|
2482 nil |
|
2483 ) |
2430 ! ! |
2484 ! ! |
2431 |
2485 |
2432 !UILayoutTool::LayoutFrame methodsFor:'accessing'! |
2486 !UILayoutTool::LayoutFrame methodsFor:'accessing'! |
2433 |
2487 |
2434 fetch:aView spec:aSpec |
2488 fetch:aView spec:aSpec |
|
2489 |
2435 |layout| |
2490 |layout| |
2436 |
2491 |
2437 layout := UIPainterView asLayoutFrameFromView:aView. |
2492 aSpec class == WindowSpec ifTrue:[ |
2438 |
2493 (layout := aSpec layout) isNil ifTrue:[ |
|
2494 layout := aSpec bounds asLayout. |
|
2495 ] |
|
2496 ] ifFalse: [ |
|
2497 layout := UIPainterView asLayoutFrameFromView:aView. |
|
2498 ]. |
2439 (self aspectFor:#leftOffset) value:(layout leftOffset). |
2499 (self aspectFor:#leftOffset) value:(layout leftOffset). |
2440 (self aspectFor:#leftFraction) value:(layout leftFraction). |
2500 (self aspectFor:#leftFraction) value:(layout leftFraction). |
2441 (self aspectFor:#topOffset) value:(layout topOffset). |
2501 (self aspectFor:#topOffset) value:(layout topOffset). |
2442 (self aspectFor:#topFraction) value:(layout topFraction). |
2502 (self aspectFor:#topFraction) value:(layout topFraction). |
2443 (self aspectFor:#rightOffset) value:(layout rightOffset). |
2503 (self aspectFor:#rightOffset) value:(layout rightOffset). |
2471 |
2531 |
2472 setBigBottomFixPartFrame |
2532 setBigBottomFixPartFrame |
2473 self |
2533 self |
2474 setFrameLeft:0 offset:0 |
2534 setFrameLeft:0 offset:0 |
2475 right:1 offset:0 |
2535 right:1 offset:0 |
2476 top:0 offset:30 |
2536 top:0 offset:(self class defaultFixPartHeight) |
2477 bottom:1 offset:0 |
2537 bottom:1 offset:0 |
2478 ! |
2538 ! |
2479 |
2539 |
2480 setBigHorizontalFixPartFrame |
2540 setBigHorizontalFixPartFrame |
2481 self |
2541 self |
2482 setFrameLeft:0 offset:0 |
2542 setFrameLeft:0 offset:0 |
2483 right:1 offset:0 |
2543 right:1 offset:0 |
2484 top:0 offset:30 |
2544 top:0 offset:(self class defaultFixPartHeight) |
2485 bottom:1 offset:-30 |
2545 bottom:1 offset:(self class defaultFixPartHeight negated) |
2486 ! |
2546 ! |
2487 |
2547 |
2488 setBigTopFixPartFrame |
2548 setBigTopFixPartFrame |
2489 self |
2549 self |
2490 setFrameLeft:0 offset:0 |
2550 setFrameLeft:0 offset:0 |
2491 right:1 offset:0 |
2551 right:1 offset:0 |
2492 top:0 offset:0 |
2552 top:0 offset:0 |
2493 bottom:1 offset:-30 |
2553 bottom:1 offset:(self class defaultFixPartHeight negated) |
2494 ! |
2554 ! |
2495 |
2555 |
2496 setBottomFixPartFrame |
2556 setBottomFixPartFrame |
2497 self |
2557 self |
2498 setFrameLeft:0 offset:0 |
2558 setFrameLeft:0 offset:0 |
2499 right:1 offset:0 |
2559 right:1 offset:0 |
2500 top:1 offset:-30 |
2560 top:1 offset:(self class defaultFixPartHeight negated) |
2501 bottom:1 offset:0 |
2561 bottom:1 offset:0 |
2502 ! |
2562 ! |
2503 |
2563 |
2504 setBottomHalfFrame |
2564 setBottomHalfFrame |
2505 self |
2565 self |