4644 |
4644 |
4645 postOpenWith: aBuilder |
4645 postOpenWith: aBuilder |
4646 "spread the painter and gallery views on the screen" |
4646 "spread the painter and gallery views on the screen" |
4647 |
4647 |
4648 |myWindow canvasWindow canvasOrg galleryWindow |
4648 |myWindow canvasWindow canvasOrg galleryWindow |
4649 galleryOrg myOrg myCorner windowGroup| |
4649 galleryOrg windowGroup monitorBounds myViewRectangle| |
4650 |
4650 |
4651 super postOpenWith: aBuilder. |
4651 super postOpenWith:aBuilder. |
4652 |
4652 |
4653 windowGroup := self topApplication windowGroup. |
4653 windowGroup := self topApplication windowGroup. |
4654 windowGroup addPreEventHook:self. |
4654 windowGroup addPreEventHook:self. |
4655 |
4655 |
4656 treeView selection: #(1). |
4656 treeView selection: #(1). |
4662 Delay waitForSeconds:0.1. |
4662 Delay waitForSeconds:0.1. |
4663 ]. |
4663 ]. |
4664 |
4664 |
4665 galleryWindow := selectionPanel window. |
4665 galleryWindow := selectionPanel window. |
4666 |
4666 |
4667 myOrg := myWindow origin. |
|
4668 myCorner := myWindow corner. |
|
4669 |
|
4670 "/ try to lay out things non-overlapping |
4667 "/ try to lay out things non-overlapping |
4671 true |
|
4672 |
|
4673 "/ but only, if the window manager placed all windows |
4668 "/ but only, if the window manager placed all windows |
4674 "/ on top of each other |
4669 "/ on top of each other |
4675 "/ myOrg = canvasWindow origin |
4670 "/ make sure, that all the windows are on the same physical monitor |
4676 |
4671 monitorBounds := device monitorBoundsAt:self window origin. |
4677 ifTrue:[ |
4672 myViewRectangle := myWindow screenBounds. |
4678 |
4673 (myViewRectangle intersects:galleryWindow screenBounds) ifTrue:[ |
4679 canvasOrg := 10@20. |
4674 galleryOrg := (monitorBounds right - galleryWindow width - 20) |
4680 "/ myOrg := (device width - myWindow width - 20) @ 20. |
|
4681 galleryOrg := (device width - galleryWindow width - 20) |
|
4682 @ |
4675 @ |
4683 ((myWindow height + 20) min:(device height - galleryWindow height - 20)). |
4676 ((myWindow bottom + 20) min:(monitorBounds bottom - galleryWindow height - 20)). |
4684 myWindow origin:myOrg. |
4677 galleryWindow |
4685 |
4678 origin:galleryOrg; |
4686 canvasWindow origin:canvasOrg. |
4679 raise. |
4687 galleryWindow origin:galleryOrg. |
4680 ]. |
4688 |
4681 ((myViewRectangle intersects:canvasWindow screenBounds) |
4689 galleryWindow raise. |
4682 or:[galleryWindow screenBounds intersects:canvasWindow screenBounds])ifTrue:[ |
4690 canvasWindow raise. |
4683 canvasOrg := monitorBounds origin + (10@20). |
|
4684 canvasWindow |
|
4685 origin:canvasOrg; |
|
4686 raise. |
4691 ]. |
4687 ]. |
4692 |
4688 |
4693 self setupCanvasAndSelectionPanel. |
4689 self setupCanvasAndSelectionPanel. |
4694 |
4690 |
4695 "/ selectionPanel window waitUntilVisible. |
4691 "/ selectionPanel window waitUntilVisible. |
4696 "/ painterView window waitUntilVisible. |
4692 "/ painterView window waitUntilVisible. |
4697 "/ self window waitUntilVisible. |
4693 "/ self window waitUntilVisible. |
4698 [ Delay waitForSeconds:0.1. |
4694 [ |
4699 self window topView raise. |
4695 Delay waitForSeconds:0.1. |
|
4696 myWindow topView raise. |
4700 Delay waitForSeconds:0.25. |
4697 Delay waitForSeconds:0.25. |
4701 self window topView raise |
4698 myWindow topView raise |
4702 ] fork. |
4699 ] fork. |
4703 "Modified: / 13.7.1999 / 21:26:52 / cg" |
4700 "Modified: / 13.7.1999 / 21:26:52 / cg" |
4704 ! |
4701 ! |
4705 |
4702 |
4706 release |
4703 release |