RealyUniqueName / StablexUI

UI engine for Haxe OpenFL designed to give as much freedom as possible in customizing UI
http://ui.stablex.ru/doc
Other
337 stars 80 forks source link

[bug] 2 Scroll in 2 different Tabs crash #128

Open julsam opened 10 years ago

julsam commented 10 years ago

Hi, I have a problem with the Scroll component.

When I put a Scroll component in a TabPage, everything is working as expected. But when I put an other Scroll in the second TabPage, it crashes with this error (this is not the exact error message as I translated it in english):

ArgumentError: Error #2004: One of the parameters is not valid.
    at flash.display::Graphics/drawRect()
    at ru.stablex.ui.skins::Rect/draw()[C:\HaxeToolkit\haxe\lib\stablexui\1,0,17\ru\stablex\ui\skins\Rect.hx:64]
    at ru.stablex.ui.skins::Paint/draw()[C:\HaxeToolkit\haxe\lib\stablexui\1,0,17\ru\stablex\ui\skins\Paint.hx:27]
    at ru.stablex.ui.skins::Skin/apply()[C:\HaxeToolkit\haxe\lib\stablexui\1,0,17\ru\stablex\ui\skins\Skin.hx:34]
    at ru.stablex.ui.widgets::Widget/applySkin()[C:\HaxeToolkit\haxe\lib\stablexui\1,0,17\ru\stablex\ui\widgets\Widget.hx:215]
    at ru.stablex.ui::UIBuilder$/skinQueue()[C:\HaxeToolkit\haxe\lib\stablexui\1,0,17\ru\stablex\ui\UIBuilder.hx:970]

I also tried putting the 2 scrolls in the same tabpage and it's working...

Here is my xml file if you want to try :

<?xml version="1.0" encoding="UTF-8"?>

<VBox w="800" h="600" childPadding="20">
    <TabStack name="'tabs'" padding="10" widthPt="100" h="225" wrap="true" tabBar-paddingLeft="20" tabBar-childPadding="5" skin:Paint-color="0xffffff">
        <TabPage
            title-padding = "5"
            title-text    = "'First tab'"
            title-highlightFormat-color = "0xffffff"
            title-highlightFormat-bold  = "true"
            title-highlightOnSelect     = "true"
            skin:Paint-color="0xe93b40"
            title-skin:Paint-color="0xe93b40"
        >
            <Scroll
                widthPt = "100"
                heightPt = "100"
                skin:Paint-color = "0xAAAAAA"
                skin:Paint-border = "4"
                vBar-slider-skin:Paint-color="0x002200"
                vBar-skin:Paint-color="0x777777"
                hBar-visible = "false"
            >
                <VBox widthPt="100" childPadding="20">
                    <Button text="'Lorem ipsum'" />
                    <Text text="'Hello world!'"/>
                    <Button text="'Lorem ipsum'" />
                    <Text text="'Hello world!'"/>
                    <Button text="'Lorem ipsum'" />
                    <Text text="'Hello world!'"/>
                </VBox>
            </Scroll>
        </TabPage>

        <TabPage
            name          = "'second'"
            skin:Paint-color="0x302f2d"
            title-padding = "5"
            title-text    = "'Second tab'"
            title-highlightFormat-color = "0xFF0000"
            title-highlightFormat-bold  = "true"
            title-highlightOnSelect     = "true"
        >   
            <Scroll
                widthPt = "100"
                heightPt = "100"
                skin:Paint-color = "0xAAAAAA"
                skin:Paint-border = "4"
                vBar-slider-skin:Paint-color="0x002200"
                vBar-skin:Paint-color="0x777777"
                hBar-visible = "false"
            >
                <HBox widthPt="100" childPadding="20">
                    <Text text="'The answer is 42'"/>
                    <Button text="'Lorem ipsum'" />
                    <Text text="'The answer is 42'"/>
                    <Button text="'Lorem ipsum'" />
                    <Text text="'The answer is 42'"/>
                    <Button text="'Lorem ipsum'" />
                </HBox>
            </Scroll>
        </TabPage>
    </TabStack>
</VBox>
RealyUniqueName commented 10 years ago

I'm sorry for being silent for a while. I have realy hard times atm.

What target are you trying to compile for? Which versions of openfl libs do uou use?

julsam commented 10 years ago

It was the flash target with openfl 1.3.0 and stablexui 1.0.17