UIPainter.st
changeset 1193 ada18c876301
parent 1192 f3f5c92930c9
child 1194 651885033545
equal deleted inserted replaced
1192:f3f5c92930c9 1193:ada18c876301
  2431 !
  2431 !
  2432 
  2432 
  2433 raiseUIView:aView
  2433 raiseUIView:aView
  2434     "raise the view which is an application or top view"
  2434     "raise the view which is an application or top view"
  2435 
  2435 
  2436     aView map.
  2436     aView remap.
  2437     aView bePartner.
  2437     aView bePartner.
  2438 !
  2438 !
  2439 
  2439 
  2440 resourceMessage: aString
  2440 resourceMessage: aString
  2441     "reads the specClass and the specSelector by evaluating aString"
  2441     "reads the specClass and the specSelector by evaluating aString"
  2793 !
  2793 !
  2794 
  2794 
  2795 openInterface:aSymbol
  2795 openInterface:aSymbol
  2796     "opens the interface on the selector aSymbol"
  2796     "opens the interface on the selector aSymbol"
  2797 
  2797 
  2798     |cls painterView painter topView|
  2798     |cls painterView painter topView galleryWindow|
  2799 
  2799 
  2800     modified := false.
  2800     modified := false.
  2801 
  2801 
  2802     aspects := IdentityDictionary new.
  2802     aspects := IdentityDictionary new.
  2803 
  2803 
  2847 
  2847 
  2848     "/ the selectionPanel ...
  2848     "/ the selectionPanel ...
  2849 
  2849 
  2850     selectionPanel := UISelectionPanel new.
  2850     selectionPanel := UISelectionPanel new.
  2851     selectionPanel allButOpenInterface:#windowSpec.
  2851     selectionPanel allButOpenInterface:#windowSpec.
  2852     selectionPanel window openInGroup:(topView windowGroup).
  2852     (galleryWindow := selectionPanel window) openInGroup:(topView windowGroup).
  2853     selectionPanel openWindow.
  2853     selectionPanel openWindow.
  2854     selectionPanel masterApplication:self.
  2854     selectionPanel masterApplication:self.
  2855 
  2855 
  2856     topView iconLabel:'GUI Painter'.
  2856     topView iconLabel:'GUI Painter'.
  2857     topView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2857     topView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2859     painterView iconLabel:'GUI Canvas'.
  2859     painterView iconLabel:'GUI Canvas'.
  2860     painterView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2860     painterView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2861 
  2861 
  2862     topView bePartner.
  2862     topView bePartner.
  2863     painterView bePartner.
  2863     painterView bePartner.
  2864     selectionPanel window bePartner.
  2864     galleryWindow bePartner.
  2865 
  2865 
  2866     selectionPanel window iconLabel:'GUI Gallery'.
  2866     galleryWindow iconLabel:'GUI Gallery'.
  2867     selectionPanel window icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2867     galleryWindow icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100).
  2868 
  2868 
  2869     painterView topView raise.
  2869     painterView topView raise.
  2870 
  2870 
  2871 !
  2871 !
  2872 
  2872 
  2948     galleryWindow := selectionPanel window.
  2948     galleryWindow := selectionPanel window.
  2949 
  2949 
  2950     myOrg := myWindow origin.
  2950     myOrg := myWindow origin.
  2951     myCorner := myWindow corner.
  2951     myCorner := myWindow corner.
  2952 
  2952 
  2953     myCorner x + canvasWindow width <= device width ifTrue:[
  2953     (myCorner x + canvasWindow width + 20) <= device width ifTrue:[
  2954         canvasOrg := (myCorner x + canvasWindow width) @ myOrg y.
  2954         canvasOrg := (myCorner x + canvasWindow width) @ (myOrg y).
  2955     ] ifFalse:[
  2955     ] ifFalse:[
  2956         canvasOrg := 0@0.
  2956         canvasOrg := 0@0.
  2957         myOrg := (device width - myWindow width - 20) @ 0.
  2957         myOrg := (device width - myWindow width - 20) @ 0.
  2958         myWindow origin:myOrg.
  2958         myWindow origin:myOrg.
  2959     ].
  2959     ].
  2960 
  2960 
       
  2961     canvasWindow origin:canvasOrg.
       
  2962 
  2961     galleryWindow raise.
  2963     galleryWindow raise.
  2962     canvasWindow raise.
  2964     canvasWindow raise.
  2963     canvasWindow origin:canvasOrg.
       
  2964 
  2965 
  2965     galleryWindow 
  2966     galleryWindow 
  2966         origin:((myOrg corner:myCorner) topCenter x - (galleryWindow width // 2)) rounded
  2967         origin:((myOrg corner:myCorner) topCenter x - (galleryWindow width // 2)) rounded
  2967                @
  2968                @
  2968                (device height - galleryWindow height - 20).
  2969                (device height - galleryWindow height - 20).