On 09/17/2013 05:24 AM, Ed Leafe wrote:
On Sep 16, 2013, at 10:37 PM, Paul McNett <p...@ulmcnett.com> wrote:

The different platforms are different in this regard. Try panel.BackColor = 
None.
Alternatively, why not add a gradient to the panel? You can use:

self.gradient = self.drawGradient(orientation="v", color1="grey", 
color2="white")

to create a gradient on the form's main panel. Note that depending on the 
platform, the gradient may be redrawn on top of the controls, so you'll have to 
add a bunch of refresh() calls in those cases to make the controls re-appear on 
top of the gradient.

You can make the panel transparent by setting its Transparency=0, but 
everything contained by it will also be transparent, and that would make for a 
difficult-to-use UI.

-- Ed Leafe




Thanks for the info guys.

I was able to get the gradient working for the form's main panel (see code below). But of course as I attempted to add dPanels I got mixed results. Normally I create sections on the form (i.e. address section, a grid section, etc..) to help with the layout and the sections actually help me with code reuse. I couldn't find a way to get any of the panels to allow transparency. To simulate the transparency I was able to use a gradient background on the panels. I got close but it had to match exactly or it looked funny. But then the issue of resizing the form exasperated the problem of the background color mis-match. I considered using a dynamic way to set the color using the 'onPaint' method - changing the colors as needed and matching the parent. I haven't completed my coding for that experiment and don't know if it's possible. I am a little concerned with the performance hit but that remains to be seen.

I was able to determine that the dBorderSizer works - that is it provided the transparency. It also helped with the layout. But of course it's not a complete replacement for a panel.

It also occurred to me that I could use a combination of the dBorderSizer on panels with gradient backgrounds and have the panels slide in and out. It would be similar to the UI/UX on tablets and phones. I know this would work because years ago Larry Long wrote a routine that allowed panels to appear and disappear. However, Larry's routine did not slide - there was no animation of the panel sliding. But I think it can be done. As time allows I'll try combining of these routines and add a little animation.


def onPaint(self, evt):
  #trying to simulate the MS windows gradient background
        dc = wx.PaintDC(self)
        x = 0
        y = 0
        w, h = self.GetSize()
dc.GradientFillLinear((x, y, w, h), 'light blue',wx.Color(0, 100, 254), 1)


Johnf



_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/523866ce.1070...@jfcomputer.com

Reply via email to