[vw7.4]LabelAndIcon platform correction neccessery?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[vw7.4]LabelAndIcon platform correction neccessery?

Milan Čermák
Hi all,
I found kind of wierdness in LabelAndIcon class. When displaying
LabelAndIcon instance, there is platform dependent offset correction in
method #verticalPlatformOffset. On Windows platform, the correction is
none. On all other platforms, the correction takes place. So far, so good.
As far as I tested it on Linux and Windows platforms, the correction
doesn't take place (the result was 0) or misplace the icon. I attached
my testing code and two screenshots.
"right.gif" picture shows correct placement of icon as it can be seen on
Windows or on Linux with correction commented out.
"wrong.gif" picture shows incorrect placement as seen on Linux when
correction took place.

I wonder on which platform the correction is neccessery. Can some one
test it on Mac, please?

Thanks,
--
Ing. Milan Čermák
programátor, analytik

[hidden email]

................................................................
e-FRACTAL, s.r.o. => e-business driven company
nám. Míru 15, Praha 2, http://www.e-fractal.cz
tel: 222 512 000, fax: 222 515 000
................................................................

<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks®, 7.4 of 5. prosinec 2005 on 13. červenec 2006 at 10:23:52</time-stamp>


<class>
<name>LabelAndIconTest</name>
<environment>Fractal</environment>
<super>UI.ApplicationModel</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>UIApplications-New</category>
<attributes>
<package>_runtime_additions_</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>Fractal.LabelAndIconTest class</class-id> <category>interface specs</category>

<body package="_runtime_additions_" selector="windowSpec">windowSpec
        "Tools.UIPainter new openOnClass: self andSelector: #windowSpec"

        &lt;resource: #canvas&gt;
        ^#(#{UI.FullSpec}
                #window:
                #(#{UI.WindowSpec}
                        #label: 'Unlabeled Canvas'
                        #bounds: #(#{Graphics.Rectangle} 1000 483 1200 683 ) )
                #component:
                #(#{UI.SpecCollection}
                        #collection: #(
                                #(#{UI.ActionButtonSpec}
                                        #layout: #(#{Graphics.LayoutFrame} -65 0.5 40 0 65 0.5 58 0 )
                                        #name: #ActionButton1
                                        #label: 'Action'
                                        #defaultable: true )
                                #(#{UI.ActionButtonSpec}
                                        #layout: #(#{Graphics.LayoutFrame} -65 0.5 70 0 65 0.5 110 0 )
                                        #name: #ActionButton2
                                        #label: 'Action'
                                        #defaultable: true ) ) ) )</body>
</methods>

<methods>
<class-id>Fractal.LabelAndIconTest class</class-id> <category>resources</category>

<body package="_runtime_additions_" selector="abort20x20">abort20x20
        "Tools.UIMaskEditor new openOnClass: self andSelector: #abort20x20"

        &lt;resource: #image&gt;
        ^CachedImage on: (Image extent: 9@12 depth: 2 bitsPerPixel: 2 palette: (Graphics.MappedPalette withColors: (#(#(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 0 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) ) collect: [:each | (each at: 1) value perform: (each at: 2) withArguments: (each at: 3)])) usingBits: #[2 160 0 0 42 170 0 0 42 170 0 0 170 42 128 0 170 42 128 0 144 1 128 0 144 1 128 0 170 42 128 0 170 42 128 0 42 170 0 0 42 170 0 0 2 160 0 0])</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>Fractal.LabelAndIconTest</class-id> <category>interface opening</category>

<body package="_runtime_additions_" selector="postBuildWith:">postBuildWith: aBuilder

        | label |
        super postBuildWith: aBuilder.
        label := (LabelAndIcon with: 'Top - ytong')
                                icon: self class abort20x20.
        (self widgetAt: #ActionButton1) label: label.

        label := (LabelAndIcon with: 'Top - ytong')
                                icon: (ToolbarIconLibrary visualFor: #alignLeft).
        (self widgetAt: #ActionButton2) label: label.
</body>
</methods>

</st-source>

right.gif (5K) Download Attachment
wrong.gif (5K) Download Attachment