2 # -*- coding: UTF-8 -*-
5 # graphical user interface for pdf2swf
7 # Part of the swftools package.
9 # Copyright (c) 2008,2009 Matthias Kramm <kramm@quiss.org>
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
25 from __future__ import division
29 from lib.wordwrap import wordwrap
31 from gui.options import Quality, ViewerBook
34 class ProgressDialog(wx.ProgressDialog):
35 def __init__(self, title, message, maximum=100, parent=None,
36 style=wx.PD_AUTO_HIDE|wx.PD_APP_MODAL):
37 wx.ProgressDialog.__init__(self, title, message, maximum=maximum,
38 parent=parent, style=style)
40 class OptionsDialog(wx.Dialog):
41 def __init__(self, parent):
42 wx.Dialog.__init__(self, parent)
44 app_name = wx.GetApp().GetAppName()
45 self.SetTitle(u"%s options" % app_name)
48 self.__quality = Quality(p)
49 self.__viewers = ViewerBook(p)
50 p.AddPage(self.__quality, u"Quality")
51 p.AddPage(self.__viewers, u"Viewer")
53 sizer = wx.BoxSizer(wx.VERTICAL)
54 btnsizer = wx.StdDialogButtonSizer()
56 btn = wx.Button(self, wx.ID_OK)
58 btnsizer.AddButton(btn)
62 sizer.Add(p, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
63 sizer.Add(btnsizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
68 def __get_quality(self):
70 quality_panel = property(__get_quality)
72 def __get_viewers(self):
74 viewers_panel = property(__get_viewers)
76 def __get_quality_options(self):
77 return self.__quality.options
78 quality = property(__get_quality_options)
80 def __get_viewers_options(self):
81 return self.__viewers.options
82 viewers = property(__get_viewers_options)
85 from gui.info import InfoList
86 class InfoDialog(wx.Dialog):
87 def __init__(self, parent):
88 wx.Dialog.__init__(self, parent,
89 style=wx.DEFAULT_DIALOG_STYLE
93 app_name = wx.GetApp().GetAppName()
94 self.SetTitle(u"Document info - %s" % app_name)
96 self.info = InfoList(self)
98 sizer = wx.BoxSizer(wx.VERTICAL)
99 sizer.Add(self.info, 1, wx.EXPAND, 0)
102 btnsizer = wx.BoxSizer(wx.HORIZONTAL)
104 btn = wx.Button(self, wx.ID_OK)
106 #self.SetAffirmativeId(wx.ID_CLOSE)
108 sizer.Add(btnsizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
114 def __init__(self, parent):
115 appname = wx.GetApp().GetAppName()
117 copyright = (u"Copyright (c) 2008,2009,2010\n"
118 u"Matthias Kramm <kramm@quiss.org>")
119 description = u"A graphical user interface for pdf2swf"
120 developers = (u"Developers:\nMatthias Kramm <kramm@quiss.org>\n"
121 u"Ricardo Pedroso <rmdpedroso@gmail.com>")
124 message = ("%(appname)s %(version)s\n\n"
125 "%(description)s\n\n"
127 "%(copyright)s" % locals())
128 caption = "About %s" % appname
130 #wx.MessageBox(message, caption)
132 wx.MessageDialog(parent, message, caption, style=wx.OK | wx.CENTRE).ShowModal()