diff --git a/demo/SVGImage.py b/demo/SVGImage.py new file mode 100644 index 00000000..7ab5b5db --- /dev/null +++ b/demo/SVGImage.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python + +import os +import glob +import wx +from wx.svg import SVGimage + +#---------------------------------------------------------------------- + +class SVGBitmapDisplay(wx.Panel): + """ + A simple panel containing a static box and a rasterized SVG image + """ + def __init__(self, parent, bmp_size, *args, **kw): + wx.Panel.__init__(self, parent, *args, **kw) + self.bmp_size = wx.Size(*bmp_size) + self.statbmp = wx.StaticBitmap(self, bitmap=wx.Bitmap(*self.bmp_size)) + label='{}x{}'.format(self.bmp_size.width, self.bmp_size.height) + sbox = wx.StaticBoxSizer(wx.VERTICAL, self, label) + sbox.Add(self.statbmp) + self.SetSizer(sbox) + + + def UpdateSVG(self, svg_filename): + img = SVGimage.CreateFromFile(svg_filename) + bmp = img.ConvertToScaledBitmap(self.bmp_size, self) + self.statbmp.SetBitmap(bmp) + #print(bmp.GetSize()) + + +#---------------------------------------------------------------------- + +class TestPanel(wx.Panel): + def __init__(self, parent, log): + self.log = log + wx.Panel.__init__(self, parent, -1) + + self.listbox = wx.ListBox(self, style=wx.LB_SINGLE, size=(250, -1)) + self.listbox.AppendItems(glob.glob(os.path.join('data', '*.svg'))) + + self.updateables = [] + rightSizer = wx.BoxSizer(wx.VERTICAL) + topRowSizer = wx.BoxSizer(wx.HORIZONTAL) + + # Add a few smallish bitmaps in a row + for d in [32, 64, 128]: + sbd = SVGBitmapDisplay(self, (d,d)) + self.updateables.append(sbd) + topRowSizer.Add(sbd, wx.SizerFlags().Border().Top()) + + rightSizer.Add(topRowSizer) + + # and add another, larger one below that row + sbd = SVGBitmapDisplay(self, (256,256)) + self.updateables.append(sbd) + rightSizer.Add(sbd) + + self.Sizer = wx.BoxSizer(wx.HORIZONTAL) + self.Sizer.Add(self.listbox, wx.SizerFlags(1).Border(wx.ALL, 10).Expand()) + self.Sizer.Add(rightSizer, wx.SizerFlags(2).Border(wx.RIGHT|wx.BOTTOM|wx.TOP, 10).Expand()) + + self.Bind(wx.EVT_LISTBOX, self.OnSelectItem) + self.listbox.SetSelection(0) + + # Load the first SVG in the list into the static bitmaps + self.UpdateAll(self.listbox.GetString(0)) + + + def OnSelectItem(self, evt): + filename = self.listbox.GetStringSelection() + self.UpdateAll(filename) + + + def UpdateAll(self, svg_filename): + for item in self.updateables: + item.UpdateSVG(svg_filename) + self.Layout() + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = TestPanel(nb, log) + return win + +#---------------------------------------------------------------------- + + + +overview = """ +

SVGImage

+ +The wx.svg.SVGimage class provides the ability to load, parse and render +Scalable Vector Graphics (SVG) files. The advantage of SVG files is that +they can be used to create bitmaps of any size without loss of quality. + + +""" + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) + diff --git a/demo/data/0-tiger.svg b/demo/data/0-tiger.svg new file mode 100644 index 00000000..fccf60f2 --- /dev/null +++ b/demo/data/0-tiger.svg @@ -0,0 +1,725 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/data/accessories-calculator.svg b/demo/data/accessories-calculator.svg new file mode 100644 index 00000000..88cf76a9 --- /dev/null +++ b/demo/data/accessories-calculator.svg @@ -0,0 +1,636 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Calculator + + + Jakub Steiner + + + + + + + + + + + calc + calculator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/accessories-text-editor.svg b/demo/data/accessories-text-editor.svg new file mode 100644 index 00000000..70621f01 --- /dev/null +++ b/demo/data/accessories-text-editor.svg @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Text Editor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/applications-internet.svg b/demo/data/applications-internet.svg new file mode 100644 index 00000000..ebe3c60b --- /dev/null +++ b/demo/data/applications-internet.svg @@ -0,0 +1,623 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Internet Category + + + Jakub Steiner + + + + + Tuomas Kuosmanen + + + + http://jimmac.musichall.cz + + + internet + tools + applications + category + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/desktop-accessibility.svg b/demo/data/desktop-accessibility.svg new file mode 100644 index 00000000..9977314b --- /dev/null +++ b/demo/data/desktop-accessibility.svg @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Accessibility + + + accessibility + assist + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/desktop-keyboard-shortcuts.svg b/demo/data/desktop-keyboard-shortcuts.svg new file mode 100644 index 00000000..6caf205d --- /dev/null +++ b/demo/data/desktop-keyboard-shortcuts.svg @@ -0,0 +1,839 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Character Map + + + key + map + character + accessory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/desktop-locale.svg b/demo/data/desktop-locale.svg new file mode 100644 index 00000000..2e71f18a --- /dev/null +++ b/demo/data/desktop-locale.svg @@ -0,0 +1,878 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Locale Preferences + + + locale preferences + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/desktop-remote-desktop.svg b/demo/data/desktop-remote-desktop.svg new file mode 100644 index 00000000..848e8922 --- /dev/null +++ b/demo/data/desktop-remote-desktop.svg @@ -0,0 +1,1479 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Remote Desktop + + + Jakub Steiner + + + + + Tuomas Kuosmanen + + + + http://jimmac.musichall.cz + + + vnc + remote + desktop + control + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/desktop-theme.svg b/demo/data/desktop-theme.svg new file mode 100644 index 00000000..45ed886e --- /dev/null +++ b/demo/data/desktop-theme.svg @@ -0,0 +1,882 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Themes + + + skin + color + theme + customize + flavor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/desktop-wallpaper.svg b/demo/data/desktop-wallpaper.svg new file mode 100644 index 00000000..0f94fbd1 --- /dev/null +++ b/demo/data/desktop-wallpaper.svg @@ -0,0 +1,747 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Wallpaper + + + + Jakub Steiner + + + + + wallpaper + background + + + + http://jimmac.musichall.cz/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/internet-group-chat.svg b/demo/data/internet-group-chat.svg new file mode 100644 index 00000000..8e8945ec --- /dev/null +++ b/demo/data/internet-group-chat.svg @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Group Chat + + + Jakub Steiner + + + + + + + + + + + group + chat + IRC + internet + network + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/internet-mail.svg b/demo/data/internet-mail.svg new file mode 100644 index 00000000..8d5ea8cd --- /dev/null +++ b/demo/data/internet-mail.svg @@ -0,0 +1,440 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Mail + + + Jakub Steiner + + + + + Andreas Nilsson + + + + + + mail + e-mail + MUA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/office-calendar.svg b/demo/data/office-calendar.svg new file mode 100644 index 00000000..d9f9281d --- /dev/null +++ b/demo/data/office-calendar.svg @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Calendar + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + calendar + date + time + cal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/system-session.svg b/demo/data/system-session.svg new file mode 100644 index 00000000..27954bce --- /dev/null +++ b/demo/data/system-session.svg @@ -0,0 +1,510 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Preferences Session + + + session + restart + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/system-users.svg b/demo/data/system-users.svg new file mode 100644 index 00000000..7d628b86 --- /dev/null +++ b/demo/data/system-users.svg @@ -0,0 +1,539 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + People + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + users + people + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/test-opacity.svg b/demo/data/test-opacity.svg new file mode 100644 index 00000000..4b55e182 --- /dev/null +++ b/demo/data/test-opacity.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/demo/data/utilities-system-monitor.svg b/demo/data/utilities-system-monitor.svg new file mode 100644 index 00000000..8f4b9462 --- /dev/null +++ b/demo/data/utilities-system-monitor.svg @@ -0,0 +1,435 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + System Monitor + 2005-10-10 + + + Andreas Nilsson + + + + + system + monitor + performance + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/data/utilities-terminal.svg b/demo/data/utilities-terminal.svg new file mode 100644 index 00000000..995fb90b --- /dev/null +++ b/demo/data/utilities-terminal.svg @@ -0,0 +1,500 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Terminal + 2005-10-15 + + + Andreas Nilsson + + + + + terminal + emulator + term + command line + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/demodata.py b/demo/demodata.py index 652245cf..cd20b1b1 100644 --- a/demo/demodata.py +++ b/demo/demodata.py @@ -44,6 +44,7 @@ _treeList = [ 'TreeListCtrl', 'NotificationMessage', 'AddPrivateFont', + 'SVGImage', ]), # managed windows == things with a (optional) caption you can close @@ -254,6 +255,7 @@ _treeList = [ 'Img2PyArtProvider', 'Mask', 'RawBitmapAccess', + 'SVGImage', 'Throbber', ]), @@ -288,6 +290,7 @@ _treeList = [ 'ShapedWindow', 'Sound', 'StandardPaths', + 'SVGImage', 'SystemSettings', 'ToolTip', 'UIActionSimulator',