forked from openlp/openlp
- Created basic GUI elements
- Deleted GUI elements superceded bzr-revno: 7
This commit is contained in:
parent
ba0539cb11
commit
4390a73a67
31
canvas.py
Normal file
31
canvas.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import wx
|
||||||
|
|
||||||
|
class Canvas(wx.Window):
|
||||||
|
|
||||||
|
def __init__(self, parent, *args, **kwargs):
|
||||||
|
|
||||||
|
wx.Window.__init__(self, parent, *args, **kwargs)
|
||||||
|
|
||||||
|
self.SetBackgroundColour(wx.Colour(150,150,150))
|
||||||
|
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||||
|
|
||||||
|
def OnPaint(self, event):
|
||||||
|
DC = wx.PaintDC(self)
|
||||||
|
if (self.GetSize().GetWidth()*3/4) > self.GetSize().GetHeight():
|
||||||
|
Height = self.GetSize().GetHeight()-40
|
||||||
|
Width = (Height*4)/3
|
||||||
|
|
||||||
|
x = (self.GetSize().GetWidth()-Width)/2
|
||||||
|
Rectangle = wx.Rect(x, 20, Width, Height)
|
||||||
|
else:
|
||||||
|
Width = self.GetSize().GetWidth()-40
|
||||||
|
Height = (Width*3)/4
|
||||||
|
|
||||||
|
y = (self.GetSize().GetHeight()-Height)/2
|
||||||
|
Rectangle = wx.Rect(20, y, Width, Height)
|
||||||
|
DC.SetBrush(wx.Brush(wx.Colour(0,0,0)))
|
||||||
|
DC.SetPen(wx.Pen(wx.Colour(255,255,255)))
|
||||||
|
|
||||||
|
if self.IsExposedRect(Rectangle):
|
||||||
|
DC.DrawRectangleRect(Rectangle)
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
"""
|
|
||||||
|
|
||||||
wx.Notebook that contains controls from each module
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
import wx
|
|
||||||
|
|
||||||
class Controller(wx.Notebook):
|
|
||||||
"wx.Notebook for modules"
|
|
||||||
|
|
||||||
def __init__(self, parent, *args, **kwargs):
|
|
||||||
"Notebook constructor"
|
|
||||||
|
|
||||||
wx.Notebook.__init__(self, parent, *args, **kwargs)
|
|
||||||
|
|
||||||
self.AddPage(wx.Panel(self), "foo module")
|
|
||||||
|
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80
|
|
65
controlpanel.py
Normal file
65
controlpanel.py
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
"""
|
||||||
|
|
||||||
|
The openlp.org Control Panel
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
import wx
|
||||||
|
|
||||||
|
import slidepanel
|
||||||
|
|
||||||
|
class ControlPanel(wx.Window):
|
||||||
|
|
||||||
|
Title = ""
|
||||||
|
Heading1 = ""
|
||||||
|
Heading2 = ""
|
||||||
|
Loaded = False;
|
||||||
|
|
||||||
|
def __init__(self, parent, title, *args, **kwargs):
|
||||||
|
|
||||||
|
wx.Window.__init__(self, parent, *args, **kwargs)
|
||||||
|
|
||||||
|
MainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
|
||||||
|
MainSizer.AddSpacer(60)
|
||||||
|
|
||||||
|
self.Title = title
|
||||||
|
|
||||||
|
self.SlidePanel = slidepanel.SlidePanel(self)
|
||||||
|
|
||||||
|
MainSizer.Add(self.SlidePanel, flag=wx.EXPAND)
|
||||||
|
|
||||||
|
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||||
|
self.Bind(wx.EVT_SIZE, self.OnSize)
|
||||||
|
|
||||||
|
self.SetSizer(MainSizer)
|
||||||
|
self.SetAutoLayout(True)
|
||||||
|
self.Layout()
|
||||||
|
|
||||||
|
def OnPaint(self, event):
|
||||||
|
|
||||||
|
DC = wx.PaintDC(self)
|
||||||
|
DC.SetFont(wx.Font(pointSize=16, family=wx.FONTFAMILY_MODERN, style=wx.FONTSTYLE_NORMAL, weight=wx.FONTWEIGHT_BOLD,underline=False,face="Tahoma"))
|
||||||
|
DC.DrawText(text=self.Title,x=(self.GetSize().GetWidth()-DC.GetTextExtent(self.Title)[0])/2,y=0)
|
||||||
|
|
||||||
|
y = DC.GetTextExtent(self.Title)[1]
|
||||||
|
DC.SetFont(wx.Font(pointSize=12, family=wx.FONTFAMILY_MODERN, style=wx.FONTSTYLE_NORMAL, weight=wx.FONTWEIGHT_BOLD,underline=False,face="Tahoma"))
|
||||||
|
DC.SetBrush(wx.Brush(wx.Colour(55,102,255)))
|
||||||
|
DC.SetPen(wx.Pen(wx.Colour(55,102,255)))
|
||||||
|
|
||||||
|
fontHeight = DC.GetTextExtent("by")[1]
|
||||||
|
DC.DrawRectangle(0,y,self.GetSize().GetWidth(),fontHeight);
|
||||||
|
DC.SetTextForeground(wx.Colour(255,255,255))
|
||||||
|
|
||||||
|
if self.Heading1 == "":
|
||||||
|
DC.DrawText("No media item loaded",5,y)
|
||||||
|
else:
|
||||||
|
DC.DrawText(self.Heading1,5,y)
|
||||||
|
|
||||||
|
DC.SetFont(wx.Font(pointSize=10, family=wx.FONTFAMILY_MODERN, style=wx.FONTSTYLE_NORMAL, weight=wx.FONTWEIGHT_NORMAL,underline=False,face="Tahoma"))
|
||||||
|
DC.DrawRectangle(0,fontHeight+y,self.GetSize().GetWidth(),fontHeight)
|
||||||
|
DC.DrawText(self.Heading2,5,fontHeight+y)
|
||||||
|
self.SlidePanel.Refresh()
|
||||||
|
|
||||||
|
def OnSize(self, event):
|
||||||
|
self.Layout()
|
37
leftpanel.py
37
leftpanel.py
@ -1,37 +0,0 @@
|
|||||||
"""
|
|
||||||
|
|
||||||
wx.Panel for operator interface
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
import wx
|
|
||||||
|
|
||||||
import oos
|
|
||||||
|
|
||||||
class LeftPanel(wx.Panel):
|
|
||||||
"Left half of operator interface"
|
|
||||||
|
|
||||||
def __init__(self, parent, *args, **kwargs):
|
|
||||||
"Panel constructor"
|
|
||||||
|
|
||||||
wx.Panel.__init__(self, parent, *args, **kwargs)
|
|
||||||
|
|
||||||
oospanel = oos.OrderOfService(self)
|
|
||||||
|
|
||||||
self.goblank = wx.RadioButton(self, label="Blank Screen",
|
|
||||||
style=wx.RB_GROUP)
|
|
||||||
self.golive = wx.RadioButton(self, label="Go Live")
|
|
||||||
|
|
||||||
blankersizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
||||||
blankersizer.AddStretchSpacer()
|
|
||||||
blankersizer.Add(self.goblank, 0, wx.RIGHT|wx.ALIGN_CENTER, 10)
|
|
||||||
blankersizer.Add(self.golive, 0, wx.ALIGN_CENTER)
|
|
||||||
blankersizer.AddStretchSpacer()
|
|
||||||
|
|
||||||
mainsizer = wx.BoxSizer(wx.VERTICAL)
|
|
||||||
mainsizer.Add(oospanel, 1, wx.GROW|wx.BOTTOM, 10)
|
|
||||||
mainsizer.Add(blankersizer, 0, wx.GROW)
|
|
||||||
|
|
||||||
self.SetSizer(mainsizer)
|
|
||||||
|
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80
|
|
105
mainframe.py
105
mainframe.py
@ -5,8 +5,8 @@ wx.Frame for the main OpenLP.org window
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import wx
|
import wx
|
||||||
|
import controlpanel
|
||||||
import mainpanel
|
import canvas
|
||||||
|
|
||||||
class MainFrame(wx.Frame):
|
class MainFrame(wx.Frame):
|
||||||
"Main OpenLP.org frame"
|
"Main OpenLP.org frame"
|
||||||
@ -20,67 +20,72 @@ class MainFrame(wx.Frame):
|
|||||||
|
|
||||||
FileMenu = wx.Menu()
|
FileMenu = wx.Menu()
|
||||||
|
|
||||||
item = FileMenu.Append(wx.ID_EXIT, text = "&Exit")
|
|
||||||
self.Bind(wx.EVT_MENU, self.OnQuit, item)
|
|
||||||
|
|
||||||
item = FileMenu.Append(wx.ID_ANY, text = "&Open")
|
|
||||||
self.Bind(wx.EVT_MENU, self.OnOpen, item)
|
|
||||||
|
|
||||||
item = FileMenu.Append(wx.ID_PREFERENCES, text = "&Preferences")
|
|
||||||
self.Bind(wx.EVT_MENU, self.OnPrefs, item)
|
|
||||||
|
|
||||||
MenuBar.Append(FileMenu, "&File")
|
MenuBar.Append(FileMenu, "&File")
|
||||||
|
|
||||||
HelpMenu = wx.Menu()
|
|
||||||
|
|
||||||
item = HelpMenu.Append(wx.ID_HELP, "OpenLP.org &Help")
|
|
||||||
self.Bind(wx.EVT_MENU, self.OnHelp, item)
|
|
||||||
|
|
||||||
# This gets put in the App menu on OS X
|
|
||||||
item = HelpMenu.Append(wx.ID_ABOUT, "&About")
|
|
||||||
self.Bind(wx.EVT_MENU, self.OnAbout, item)
|
|
||||||
|
|
||||||
MenuBar.Append(HelpMenu, "&Help")
|
|
||||||
|
|
||||||
self.SetMenuBar(MenuBar)
|
self.SetMenuBar(MenuBar)
|
||||||
|
|
||||||
self.Panel = mainpanel.MainPanel(self)
|
self.MainSplitter = wx.SplitterWindow(self, size=self.GetClientSize(), style=wx.SP_3D)
|
||||||
|
self.PreviewSplitter = wx.SplitterWindow(self.MainSplitter, size=self.MainSplitter.GetClientSize(), style=wx.SP_3D)
|
||||||
|
self.LiveSplitter = wx.SplitterWindow(self.MainSplitter, size=self.MainSplitter.GetClientSize(), style=wx.SP_3D)
|
||||||
|
LiveControlPanel = controlpanel.ControlPanel(self.LiveSplitter,title="Live")
|
||||||
|
PreviewControlPanel = controlpanel.ControlPanel(self.PreviewSplitter,title="Preview")
|
||||||
|
LiveCanvas = canvas.Canvas(self.LiveSplitter)
|
||||||
|
PreviewCanvas = canvas.Canvas(self.PreviewSplitter)
|
||||||
|
|
||||||
self.Fit()
|
self.MainSplitter.SplitVertically(self.PreviewSplitter, self.LiveSplitter)
|
||||||
|
self.LiveSplitter.SplitHorizontally(LiveControlPanel,LiveCanvas)
|
||||||
|
self.PreviewSplitter.SplitHorizontally(PreviewControlPanel,PreviewCanvas)
|
||||||
|
|
||||||
|
self.MainSplitter.SetMinimumPaneSize(200)
|
||||||
|
self.LiveSplitter.SetMinimumPaneSize(200)
|
||||||
|
self.PreviewSplitter.SetMinimumPaneSize(200)
|
||||||
|
|
||||||
def OnQuit(self,Event):
|
self.MainSplitter.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.MainSplitterOnChanged)
|
||||||
self.Destroy()
|
self.LiveSplitter.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.LiveSplitterOnChanged)
|
||||||
|
self.PreviewSplitter.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.PreviewSplitterOnChanged)
|
||||||
|
self.Bind(wx.EVT_SIZE, self.OnSize)
|
||||||
|
|
||||||
|
MainSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
|
||||||
def OnAbout(self, event):
|
MediaManagerFrame = wx.Panel(self, size=wx.Size(200,200))
|
||||||
dlg = wx.MessageDialog(self, "This is a small program to test\n"
|
OrderOfServiceFrame = wx.Panel(self, size=wx.Size(200,200))
|
||||||
"the use of menus on Mac, etc.\n",
|
|
||||||
"About Me", wx.OK | wx.ICON_INFORMATION)
|
|
||||||
dlg.ShowModal()
|
|
||||||
dlg.Destroy()
|
|
||||||
|
|
||||||
|
self.SetSizer(MainSizer)
|
||||||
|
|
||||||
def OnHelp(self, event):
|
MainSizer.Add(MediaManagerFrame, flag=wx.EXPAND)
|
||||||
dlg = wx.MessageDialog(self, "This would be help\n"
|
MainSizer.Add(self.MainSplitter, proportion=1, flag=wx.EXPAND)
|
||||||
"If there was any\n", "Test Help", wx.OK | wx.ICON_INFORMATION)
|
MainSizer.Add(OrderOfServiceFrame, flag=wx.EXPAND)
|
||||||
dlg.ShowModal()
|
|
||||||
dlg.Destroy()
|
|
||||||
|
|
||||||
|
self.CreateStatusBar(1)
|
||||||
|
self.SetStatusText("openlp.org")
|
||||||
|
|
||||||
def OnOpen(self, event):
|
MainSizer.SetSizeHints(self)
|
||||||
dlg = wx.MessageDialog(self, "This would be an open Dialog\n"
|
|
||||||
"If there was anything to open\n", "Open File",
|
|
||||||
wx.OK | wx.ICON_INFORMATION)
|
|
||||||
dlg.ShowModal()
|
|
||||||
dlg.Destroy()
|
|
||||||
|
|
||||||
|
self.SetAutoLayout(True)
|
||||||
|
|
||||||
def OnPrefs(self, event):
|
self.Layout()
|
||||||
dlg = wx.MessageDialog(self, "This would be an preferences Dialog\n"
|
|
||||||
"If there were any preferences to set.\n",
|
|
||||||
"Preferences", wx.OK | wx.ICON_INFORMATION)
|
|
||||||
dlg.ShowModal()
|
|
||||||
dlg.Destroy()
|
|
||||||
|
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80
|
def MainSplitterOnChanged(self,event):
|
||||||
|
self.MainSplitter.SetSashPosition(self.MainSplitter.GetClientSize().GetWidth()/2,True)
|
||||||
|
|
||||||
|
def LiveSplitterOnChanged(self,event):
|
||||||
|
|
||||||
|
WindowList = self.LiveSplitter.GetChildren()
|
||||||
|
|
||||||
|
for Node in WindowList:
|
||||||
|
Node.Refresh()
|
||||||
|
|
||||||
|
def PreviewSplitterOnChanged(self,event):
|
||||||
|
|
||||||
|
WindowList = self.PreviewSplitter.GetChildren()
|
||||||
|
|
||||||
|
for Node in WindowList:
|
||||||
|
Node.Refresh()
|
||||||
|
|
||||||
|
def OnSize(self,event):
|
||||||
|
|
||||||
|
self.Layout()
|
||||||
|
|
||||||
|
self.MainSplitterOnChanged(event)
|
||||||
|
self.LiveSplitterOnChanged(event)
|
||||||
|
self.PreviewSplitterOnChanged(event)
|
30
mainpanel.py
30
mainpanel.py
@ -1,30 +0,0 @@
|
|||||||
"""
|
|
||||||
|
|
||||||
wx.Panel for operator interface
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
import wx
|
|
||||||
|
|
||||||
import controller
|
|
||||||
import leftpanel
|
|
||||||
|
|
||||||
class MainPanel(wx.Panel):
|
|
||||||
"Operator interface"
|
|
||||||
|
|
||||||
def __init__(self, parent, *args, **kwargs):
|
|
||||||
"Panel constructor"
|
|
||||||
|
|
||||||
wx.Panel.__init__(self, parent, *args, **kwargs)
|
|
||||||
|
|
||||||
controlbook = controller.Controller(self, size=wx.Size(400,300))
|
|
||||||
leftside = leftpanel.LeftPanel(self)
|
|
||||||
|
|
||||||
sizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
||||||
sizer.Add(leftside, 0, wx.GROW|wx.TOP|wx.BOTTOM|wx.LEFT, 15)
|
|
||||||
sizer.Add(controlbook, 1, wx.GROW|wx.ALL, 15)
|
|
||||||
|
|
||||||
self.SetSizerAndFit(sizer)
|
|
||||||
sizer.SetSizeHints(parent)
|
|
||||||
|
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80
|
|
31
oos.py
31
oos.py
@ -1,31 +0,0 @@
|
|||||||
"""
|
|
||||||
|
|
||||||
Order of Service panel
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
# TODO: change this from a list box to our own custom widget to allow the
|
|
||||||
# traditional OpenLP OOS entry with an icon
|
|
||||||
|
|
||||||
import wx
|
|
||||||
|
|
||||||
class OrderOfService(wx.Panel):
|
|
||||||
"Order Of Service Panel"
|
|
||||||
|
|
||||||
def __init__(self, parent, *args, **kwargs):
|
|
||||||
"Panel constructor"
|
|
||||||
|
|
||||||
wx.Panel.__init__(self, parent, *args, **kwargs)
|
|
||||||
|
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
|
||||||
|
|
||||||
self.list = wx.ListBox(self, size=wx.Size(180, 250))
|
|
||||||
|
|
||||||
self.list.Append("foo")
|
|
||||||
|
|
||||||
sizer.Add(self.list, 1)
|
|
||||||
#sizer.Add(self.list, 1, wx.GROW)
|
|
||||||
|
|
||||||
self.SetSizer(sizer)
|
|
||||||
|
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80
|
|
@ -13,7 +13,7 @@ import mainframe
|
|||||||
|
|
||||||
class OpenLP(wx.PySimpleApp):
|
class OpenLP(wx.PySimpleApp):
|
||||||
def OnInit(self):
|
def OnInit(self):
|
||||||
frame = mainframe.MainFrame(None, title="OpenLP.org")
|
frame = mainframe.MainFrame(None, title="openlp.org")
|
||||||
frame.Show()
|
frame.Show()
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@ -33,10 +33,6 @@ class OpenLP(wx.PySimpleApp):
|
|||||||
"File Opened", wx.OK|wx.ICON_INFORMATION)
|
"File Opened", wx.OK|wx.ICON_INFORMATION)
|
||||||
|
|
||||||
|
|
||||||
def MacOpenFile(self, filename):
|
|
||||||
self.OpenFileMessage(filename)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = OpenLP()
|
app = OpenLP()
|
||||||
app.MainLoop()
|
app.MainLoop()
|
||||||
|
80
slide.py
Normal file
80
slide.py
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
import wx
|
||||||
|
|
||||||
|
class Slide(wx.Window):
|
||||||
|
|
||||||
|
SlideNum = 0
|
||||||
|
Selected = False
|
||||||
|
SlideText = ""
|
||||||
|
SlideType = ""
|
||||||
|
|
||||||
|
def __init__(self, parent, slideText, slideNum, slideType, *args, **kwargs):
|
||||||
|
wx.Window.__init__(self, parent, *args, **kwargs)
|
||||||
|
|
||||||
|
self.SlideText = slideText
|
||||||
|
self.SlideNum = slideNum
|
||||||
|
self.SlideType = slideType
|
||||||
|
|
||||||
|
self.Bind(wx.EVT_MOUSEDOWN, self.OnMouseDown)
|
||||||
|
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||||
|
|
||||||
|
def GetHeight(self):
|
||||||
|
DC = wx.ClientDC(self)
|
||||||
|
|
||||||
|
DC.SetFont(wx.Font(pointSize=8, family=wx.FONTFAMILY_MODERN, style=wx.FONTSTYLE_NORMAL, weight=wx.FONTWEIGHT_NORMAL,underline=False,face="Tahoma"))
|
||||||
|
FontHeight = DC.GetTextExtent("by")[1]
|
||||||
|
Tokenizer = wx.StringTokenizer(self.SlideText,"\n")
|
||||||
|
ArrayString = wx.ArrayString()
|
||||||
|
|
||||||
|
while Tokenizer.HasMoreTokens():
|
||||||
|
Token = Tokenizer.GetNextToken()
|
||||||
|
ArrayString.Add(Token)
|
||||||
|
|
||||||
|
return FontHeight*(ArrayString.Count()+1)
|
||||||
|
|
||||||
|
def GetIndex(self):
|
||||||
|
return self.SlideNum
|
||||||
|
|
||||||
|
def SetSelected(self):
|
||||||
|
if not self.Selected:
|
||||||
|
self.Selected = True
|
||||||
|
Refresh()
|
||||||
|
|
||||||
|
def DropSelected(self):
|
||||||
|
if self.Selected:
|
||||||
|
self.Selected = False
|
||||||
|
Refresh()
|
||||||
|
|
||||||
|
def OnPaint(self, event):
|
||||||
|
DC = wx.PaintDC(self)
|
||||||
|
DC.SetFont(wx.Font(pointSize=9, family=wx.FONTFAMILY_MODERN, style=wx.FONTSTYLE_NORMAL, weight=wx.FONTWEIGHT_NORMAL,underline=False,face="Tahoma"))
|
||||||
|
if self.Selected:
|
||||||
|
Colour = wx.Colour(0,26,102)
|
||||||
|
else:
|
||||||
|
Colour = wx.Colour(55,102,255)
|
||||||
|
DC.SetBrush(wx.Brush(Colour))
|
||||||
|
DC.SetPen(wx.Pen(Colour))
|
||||||
|
|
||||||
|
FontHeight = DC.GetTextExtent("by")[1]
|
||||||
|
DC.DrawRectangle(0,0,self.GetParent().GetSize().GetWidth(),FontHeight)
|
||||||
|
DC.SetTextForeground(wx.Colour(255,255,255))
|
||||||
|
DC.DrawText(self.SlideType,5,0)
|
||||||
|
|
||||||
|
Tokenizer = wx.StringTokenizer(self.SlideText,"\n")
|
||||||
|
ArrayString = wx.ArrayString()
|
||||||
|
|
||||||
|
while Tokenizer.HasMoreTokens():
|
||||||
|
Token = Tokenizer.GetNextToken()
|
||||||
|
ArrayString.Add(Token)
|
||||||
|
|
||||||
|
self.SetSize(wx.Size(self.GetParent().GetSize().GetWidth(),FontHeight*(ArrayString.Count()+1)))
|
||||||
|
DC.SetBrush(wx.Brush(wx.Colour(255,255,255)))
|
||||||
|
DC.SetPen(wx.Pen(wx.Colour(255,255,255)))
|
||||||
|
|
||||||
|
DC.DrawRectangle(0,FontHeight,self.GetSize().GetWidth(),self.GetSize().GetHeight()-FontHeight)
|
||||||
|
DC.SetTextForeGround(wx.Colour(0,0,0))
|
||||||
|
|
||||||
|
for i in range(0,ArrayString.Count()):
|
||||||
|
DC.DrawText(ArrayString.Item(i),5,(i+1)*FontHeight)
|
||||||
|
|
||||||
|
def OnMouseDown(self, event):
|
||||||
|
self.GetParent().SetSelected(self.SlideNum)
|
30
slidepanel.py
Normal file
30
slidepanel.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import wx
|
||||||
|
|
||||||
|
import slide
|
||||||
|
|
||||||
|
class SlidePanel(wx.Window):
|
||||||
|
|
||||||
|
SlideEnum = 1
|
||||||
|
NextY = 0
|
||||||
|
|
||||||
|
def __init__(self, parent, *args, **kwargs):
|
||||||
|
|
||||||
|
wx.Window.__init__(self, parent, *args, **kwargs)
|
||||||
|
|
||||||
|
def AddSlide(self, slideText, slideType):
|
||||||
|
slide = slide.Slide(self, pos=wx.Point(0,self.NextY+10), slideText=slideText, slideNum=self.SlideEnum, slideType=slideType)
|
||||||
|
self.SlideEnum = self.SlideEnum+1
|
||||||
|
self.NextY = self.NextY + slide.GetHeight()+10
|
||||||
|
self.SetVirtualSize(self.GetSize().GetWidth(),self.NextY)
|
||||||
|
self.SetScrollRate(1,1)
|
||||||
|
slide.Refresh()
|
||||||
|
|
||||||
|
def SetSelected(self, index):
|
||||||
|
WindowList = self.GetChildren()
|
||||||
|
|
||||||
|
for Node in WindowList:
|
||||||
|
Current = Node.GetData()
|
||||||
|
if Current.GetIndex() == index:
|
||||||
|
Current.SetSelected()
|
||||||
|
else:
|
||||||
|
Current.DropSelected()
|
Loading…
Reference in New Issue
Block a user