wxPython - implementing a scrollable view on a page similar to Visio or MS Word's print layout view
I want to be able to embedd a panel (with size A4, A5, A6 custom etc) in a scrollable a page with a drop-shaddow, similar to how visio or ms word displays.
I'm a bit of a beginner to开发者_运维知识库 python - been using it for 6 months full-time now. Ideas of how to do this or links to examples / tutorial would be welcome.
Thx
DM
This is the closest I've got. No drop shaddow but at least a scrollable panel that almost looks like a piece of paper.
import wx
from wx.lib.scrolledpanel import ScrolledPanel
app = wx.PySimpleApp()
frame = wx.Frame(None, id=wx.ID_ANY, name="Just one child", size=(100,100))
scrollablePanel = ScrolledPanel(parent=frame, id=wx.ID_ANY, name="scrolledPanel", style=wx.ALWAYS_SHOW_SB)
scrollablePanel.SetupScrolling()
scrollablePanel.SetBackgroundColour(wx.Colour(128,128,128))
innerPanel = wx.Panel(parent=scrollablePanel, id=wx.ID_ANY, name="innerPanel", size=(250,100), style=wx.SIMPLE_BORDER)
innerPanel.SetBackgroundColour(wx.Colour(255,255,255))
vSizer = wx.BoxSizer(wx.VERTICAL)
vSizer.Add(innerPanel, proportion=0, flag=wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, border=8)
hSizer = wx.BoxSizer(wx.HORIZONTAL)
hSizer.Add(vSizer, proportion=1, flag=wx.ALIGN_CENTER_VERTICAL)
scrollablePanel.SetSizer(hSizer)
frame.Show()
app.MainLoop()
Any ideas how to do the drop shaddow would be appreciated.
Thx
-- DM
精彩评论