wxpTag, widgets, and vertical alignment

Hi all,

(im french : sorry for my english)

I'm playing now with wx.html. I have some widgets (panels) in the html page. Its
works except one thing :

i cant have a VERTICAL ALIGNMENT for my widgets. This is an exemple of my html
page :

<wxp module="Gadget" class="Panel1" width=300 height=300 valign=top>
    <param name="couleurFondPanel" value="#00CCFF">
</wxp>

<wxp module="Gadget" class="Panel2" width=200 height=200 valign=top>
    <param name="couleurFondPanel" value="#00CCFF">
</wxp>

<wxp module="Gadget" class="Panel3" width=250 height=500 valign=top>
    <param name="couleurFondPanel" value="#00CCFF">
</wxp>

my 3 widgets have differents sizes. And i want them to be with a "TOP ALIGNMENT"
on the same line... But that doesnt work. I always have a BOTTOM ALIGNMENT.

Would you have a solution for this problem ?

Thx for your help !!!

Ivan wrote:

Hi all,

(im french : sorry for my english)

I'm playing now with wx.html. I have some widgets (panels) in the html page. Its
works except one thing :

i cant have a VERTICAL ALIGNMENT for my widgets. This is an exemple of my html
page :

<wxp module="Gadget" class="Panel1" width=300 height=300 valign=top>
    <param name="couleurFondPanel" value="#00CCFF">
</wxp>

<wxp module="Gadget" class="Panel2" width=200 height=200 valign=top>
    <param name="couleurFondPanel" value="#00CCFF">
</wxp>

<wxp module="Gadget" class="Panel3" width=250 height=500 valign=top>
    <param name="couleurFondPanel" value="#00CCFF">
</wxp>

my 3 widgets have differents sizes. And i want them to be with a "TOP ALIGNMENT"
on the same line... But that doesnt work. I always have a BOTTOM ALIGNMENT.

Would you have a solution for this problem ?

Try putting the items in a table and use the valign attribute on the <td> tags.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thx for your answer Robin,

But a table isn't what i'm looking for because i want my widgets to move in the
html page when the frame is resized.

I've found another solution with SetAlignVer() :
    
    ...
    source = self.Source()
    self.SetPage(source)
    self.AlignWidgets(c = self.GetInternalRepresentation())

    def AlignWidgets(self, c):
        """ Aligns all elements in html page """
        while c:
            if isinstance(c, html.HtmlContainerCell):
                c.SetAlignVer(0)
                self.AlignWidgets(c.GetFirstChild())
            c = c.GetNext()
    
That works as i want. Except one thing :

When i re-load another page with the same code, THE ALIGNEMENT IS BAD until i
resize the frame.

So, is there a function to "refresh" the wx.html as "Layout()" or "Refresh"
(this 2 functions don't work) ???

I hope you understand a bit what I want to say.... :wink:

Ivan wrote:

Thx for your answer Robin,

But a table isn't what i'm looking for because i want my widgets to move in the
html page when the frame is resized.

I've found another solution with SetAlignVer() :
        ...
    source = self.Source()
    self.SetPage(source)
    self.AlignWidgets(c = self.GetInternalRepresentation())

    def AlignWidgets(self, c):
        """ Aligns all elements in html page """
        while c:
            if isinstance(c, html.HtmlContainerCell):
                c.SetAlignVer(0)
                self.AlignWidgets(c.GetFirstChild())
            c = c.GetNext()
    That works as i want. Except one thing :

When i re-load another page with the same code, THE ALIGNEMENT IS BAD until i
resize the frame.

So, is there a function to "refresh" the wx.html as "Layout()" or "Refresh"
(this 2 functions don't work) ???

Calling htmlWin.SendSizeEvent() might do the trick.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

That works perfectly. Thx a lot !