1. Problem when putting a gridpanel inside a tabitem

When I put a gridpanel (one of the layoutpanels) inside a tabitem the 
gridpanel and its children won't show. Here's an example:

<EUCODE>

without warning
include gridpanl.ew
integer main, tabc, tab1, gridpanel, edit

main = create(Window, "There should be an edit control in the tabcontrol.", 0,
Default, Default, 0.8, 0.8, 0)
    tabc = create(TabControl, "", main, 0, 0, w32Edge, w32Edge, 0)
        tab1 = create(TabItem, "Test", tabc, 0, 0, 0, 0, 0)
            gridpanel = createEu(GridPanel, {tab1})
edit = create(EditText, "This should be visible", gridpanel, 0,
                0, 200, 23, 0)

setEu(gridpanel, "SuspendLayout", w32True)
    setEu(gridpanel, "Columns", {{-1}})
    setEu(gridpanel, "Rows", {{-1}})
    addEu(gridpanel, edit, {{1, 1}})
setEu(gridpanel, "SuspendLayout", w32False)

WinMain(main, Normal)

</EUCODE>

Regards, Alexander Toresson

Shhh! Be vewy quiet! I'm hunting wuntime ewwows!

new topic     » topic index » view message » categorize

2. Re: Problem when putting a gridpanel inside a tabitem

Alexander Toresson wrote:
> 
> When I put a gridpanel (one of the layoutpanels) inside a tabitem the 
> gridpanel and its children won't show. Here's an example:
> 
> }}}
<eucode>
> 
> without warning
> include gridpanl.ew
> integer main, tabc, tab1, gridpanel, edit
> 
> main = create(Window, "There should be an edit control in the tabcontrol.", 0,
> Default,
> Default, 0.8, 0.8, 0)
>     tabc = create(TabControl, "", main, 0, 0, w32Edge, w32Edge, 0)
>         tab1 = create(TabItem, "Test", tabc, 0, 0, 0, 0, 0)
>             gridpanel = createEu(GridPanel, {tab1})
>                 edit = create(EditText, "This should be visible", gridpanel,
>                 0, 0,
> 200, 23, 0)
> 
> setEu(gridpanel, "SuspendLayout", w32True)
>     setEu(gridpanel, "Columns", {{-1}})
>     setEu(gridpanel, "Rows", {{-1}})
>     addEu(gridpanel, edit, {{1, 1}})
> setEu(gridpanel, "SuspendLayout", w32False)
> 
> WinMain(main, Normal)
> 
> </eucode>
{{{


There are a few problems:
- setEu(gridPanel, "Columns", {{-1}}) should become ..., {-1})
- same for "Rows"
- the gridpanel doesn't automatically resize itself to fit its parent:
you'll have to resize it manually.
You could call stretchEuControl(gridpanel, w32True), which does this
automatically, but apparently it doesn't work with TabControls.
The way stretchEuControl works: it catches the w32Resize-event of the
parent, which means TabItem doesn't fire the w32Resize-event.

--
tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com
Euphoria Message Board: http://uboard.proboards32.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu