[41d466f] | 1 | #!/usr/bin/env python |
---|
| 2 | ######################################################################## |
---|
| 3 | # |
---|
| 4 | # PDFgui by DANSE Diffraction group |
---|
| 5 | # Simon J. L. Billinge |
---|
| 6 | # (c) 2006 trustees of the Michigan State University. |
---|
| 7 | # All rights reserved. |
---|
| 8 | # |
---|
| 9 | # File coded by: Dmitriy Bryndin |
---|
| 10 | # |
---|
| 11 | # See AUTHORS.txt for a list of people who contributed. |
---|
| 12 | # See LICENSE.txt for license information. |
---|
| 13 | # |
---|
| 14 | # Modified by U. Tennessee for DANSE/SANS |
---|
| 15 | ######################################################################## |
---|
| 16 | |
---|
| 17 | # version |
---|
| 18 | __id__ = "$Id: aboutdialog.py 1193 2007-05-03 17:29:59Z dmitriy $" |
---|
| 19 | __revision__ = "$Revision: 1193 $" |
---|
| 20 | |
---|
| 21 | import wx |
---|
| 22 | import wx.lib.hyperlink |
---|
| 23 | import random |
---|
| 24 | import os.path |
---|
| 25 | import os |
---|
| 26 | try: |
---|
| 27 | # Try to find a local config |
---|
| 28 | import imp |
---|
| 29 | path = os.getcwd() |
---|
[278cc25] | 30 | if(os.path.isfile("%s/%s.py" % (path, 'local_config'))) or \ |
---|
| 31 | (os.path.isfile("%s/%s.pyc" % (path, 'local_config'))): |
---|
[32c0841] | 32 | fObj, path, descr = imp.find_module('local_config', [path]) |
---|
| 33 | config = imp.load_module('local_config', fObj, path, descr) |
---|
[278cc25] | 34 | else: |
---|
| 35 | # Try simply importing local_config |
---|
| 36 | import local_config as config |
---|
[41d466f] | 37 | except: |
---|
[278cc25] | 38 | # Didn't find local config, load the default |
---|
[41d466f] | 39 | import config |
---|
| 40 | |
---|
| 41 | def launchBrowser(url): |
---|
[d955bf19] | 42 | """ |
---|
| 43 | Launches browser and opens specified url |
---|
[41d466f] | 44 | |
---|
| 45 | In some cases may require BROWSER environment variable to be set up. |
---|
| 46 | |
---|
[d955bf19] | 47 | :param url: URL to open |
---|
| 48 | |
---|
| 49 | """ |
---|
[41d466f] | 50 | import webbrowser |
---|
| 51 | webbrowser.open(url) |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | class DialogAbout(wx.Dialog): |
---|
[d955bf19] | 55 | """ |
---|
| 56 | "About" Dialog |
---|
[41d466f] | 57 | |
---|
| 58 | Shows product name, current version, authors, and link to the product page. |
---|
| 59 | Current version is taken from version.py |
---|
[d955bf19] | 60 | |
---|
| 61 | """ |
---|
[41d466f] | 62 | |
---|
| 63 | def __init__(self, *args, **kwds): |
---|
| 64 | |
---|
| 65 | # begin wxGlade: DialogAbout.__init__ |
---|
| 66 | kwds["style"] = wx.DEFAULT_DIALOG_STYLE |
---|
| 67 | wx.Dialog.__init__(self, *args, **kwds) |
---|
| 68 | |
---|
| 69 | file_dir = os.path.dirname(__file__) |
---|
| 70 | |
---|
[32c0841] | 71 | # Mac doesn't display images with transparent background so well, |
---|
| 72 | # keep it for Windows |
---|
| 73 | image = file_dir + "/images/angles_flat.png" |
---|
[2bd9927] | 74 | |
---|
[41d466f] | 75 | if os.path.isfile(config._corner_image): |
---|
| 76 | image = config._corner_image |
---|
| 77 | |
---|
| 78 | if os.name == 'nt': |
---|
| 79 | self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image)) |
---|
| 80 | else: |
---|
| 81 | self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image)) |
---|
| 82 | |
---|
| 83 | self.label_title = wx.StaticText(self, -1, config.__appname__) |
---|
| 84 | self.label_version = wx.StaticText(self, -1, "") |
---|
| 85 | self.label_build = wx.StaticText(self, -1, "Build:") |
---|
| 86 | self.label_svnrevision = wx.StaticText(self, -1, "") |
---|
| 87 | self.label_copyright = wx.StaticText(self, -1, config._copyright) |
---|
| 88 | self.label_author = wx.StaticText(self, -1, "authors") |
---|
[32c0841] | 89 | self.hyperlink = wx.lib.hyperlink.HyperLinkCtrl(self, -1, |
---|
| 90 | config._homepage, |
---|
| 91 | URL=config._homepage) |
---|
| 92 | #self.hyperlink_license = wx.lib.hyperlink.HyperLinkCtrl(self, -1, |
---|
| 93 | #"Comments? Bugs? Requests?", URL=config._paper) |
---|
| 94 | self.hyperlink_license = wx.StaticText(self, -1, |
---|
| 95 | "Comments? Bugs? Requests?") |
---|
| 96 | self.hyperlink_paper = wx.lib.hyperlink.HyperLinkCtrl(self, -1, |
---|
| 97 | "Send us a ticket", |
---|
| 98 | URL=config._license) |
---|
| 99 | self.hyperlink_download = wx.lib.hyperlink.HyperLinkCtrl(self, -1, |
---|
| 100 | "Get the latest version", |
---|
| 101 | URL=config._download) |
---|
[41d466f] | 102 | self.static_line_1 = wx.StaticLine(self, -1) |
---|
[32c0841] | 103 | self.label_acknowledgement = wx.StaticText(self, -1, |
---|
| 104 | config._acknowledgement) |
---|
[41d466f] | 105 | self.static_line_2 = wx.StaticLine(self, -1) |
---|
[1452132] | 106 | self.bitmap_button_nist = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
| 107 | self.bitmap_button_umd = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
[e0f28e6] | 108 | self.bitmap_button_ornl = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
| 109 | #self.bitmap_button_sns = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
[657e52c] | 110 | #self.bitmap_button_nsf = wx.BitmapButton(self, -1, |
---|
| 111 | # wx.NullBitmap) |
---|
| 112 | #self.bitmap_button_danse = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
[41d466f] | 113 | self.bitmap_button_msu = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
[657e52c] | 114 | |
---|
| 115 | self.bitmap_button_isis = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
| 116 | self.bitmap_button_ess = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
| 117 | self.bitmap_button_ill = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
[e0f28e6] | 118 | self.bitmap_button_ansto = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
[49e000b] | 119 | self.bitmap_button_tudelft = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
[657e52c] | 120 | |
---|
[41d466f] | 121 | self.static_line_3 = wx.StaticLine(self, -1) |
---|
| 122 | self.button_OK = wx.Button(self, wx.ID_OK, "OK") |
---|
| 123 | |
---|
| 124 | self.__set_properties() |
---|
| 125 | self.__do_layout() |
---|
[1452132] | 126 | |
---|
| 127 | self.Bind(wx.EVT_BUTTON, self.onNistLogo, self.bitmap_button_nist) |
---|
| 128 | self.Bind(wx.EVT_BUTTON, self.onUmdLogo, self.bitmap_button_umd) |
---|
[e0f28e6] | 129 | #self.Bind(wx.EVT_BUTTON, self.onSnsLogo, self.bitmap_button_sns) |
---|
| 130 | self.Bind(wx.EVT_BUTTON, self.onOrnlLogo, self.bitmap_button_ornl) |
---|
[657e52c] | 131 | #self.Bind(wx.EVT_BUTTON, self.onNsfLogo, self.bitmap_button_nsf) |
---|
| 132 | #self.Bind(wx.EVT_BUTTON, self.onDanseLogo, self.bitmap_button_danse) |
---|
[41d466f] | 133 | self.Bind(wx.EVT_BUTTON, self.onUTLogo, self.bitmap_button_msu) |
---|
[657e52c] | 134 | self.Bind(wx.EVT_BUTTON, self.onIsisLogo, self.bitmap_button_isis) |
---|
| 135 | self.Bind(wx.EVT_BUTTON, self.onEssLogo, self.bitmap_button_ess) |
---|
| 136 | self.Bind(wx.EVT_BUTTON, self.onIllLogo, self.bitmap_button_ill) |
---|
[e0f28e6] | 137 | self.Bind(wx.EVT_BUTTON, self.onAnstoLogo, self.bitmap_button_ansto) |
---|
[49e000b] | 138 | self.Bind(wx.EVT_BUTTON, self.onTudelftLogo, self.bitmap_button_tudelft) |
---|
[41d466f] | 139 | # end wxGlade |
---|
| 140 | # fill in acknowledgements |
---|
[32c0841] | 141 | #self.text_ctrl_acknowledgement.SetValue(__acknowledgement__) |
---|
[41d466f] | 142 | # randomly shuffle authors' names |
---|
| 143 | random.shuffle(config._authors) |
---|
| 144 | strLabel = ", ".join(config._authors) |
---|
| 145 | |
---|
| 146 | # display version and svn revison numbers |
---|
| 147 | verwords = config.__version__.split('.') |
---|
| 148 | version = '.'.join(verwords[:-1]) |
---|
| 149 | revision = verwords[-1] |
---|
[3bc6090] | 150 | try: |
---|
| 151 | build_num = str(config.__build__) |
---|
| 152 | except: |
---|
| 153 | build_num = str(config.__version__) |
---|
[41d466f] | 154 | self.label_author.SetLabel(strLabel) |
---|
[1c97a3f] | 155 | self.label_version.SetLabel(config.__version__)#(version) |
---|
[3bc6090] | 156 | self.label_svnrevision.SetLabel(build_num) |
---|
[41d466f] | 157 | |
---|
| 158 | # set bitmaps for logo buttons |
---|
[1452132] | 159 | image = file_dir + "/images/nist_logo.png" |
---|
| 160 | if os.path.isfile(config._nist_logo): |
---|
| 161 | image = config._nist_logo |
---|
| 162 | logo = wx.Bitmap(image) |
---|
| 163 | self.bitmap_button_nist.SetBitmapLabel(logo) |
---|
| 164 | |
---|
| 165 | image = file_dir + "/images/umd_logo.png" |
---|
| 166 | if os.path.isfile(config._umd_logo): |
---|
| 167 | image = config._umd_logo |
---|
| 168 | logo = wx.Bitmap(image) |
---|
| 169 | self.bitmap_button_umd.SetBitmapLabel(logo) |
---|
| 170 | |
---|
[e0f28e6] | 171 | image = file_dir + "/images/ornl_logo.png" |
---|
| 172 | if os.path.isfile(config._ornl_logo): |
---|
| 173 | image = config._ornl_logo |
---|
| 174 | logo = wx.Bitmap(image) |
---|
| 175 | self.bitmap_button_ornl.SetBitmapLabel(logo) |
---|
| 176 | |
---|
| 177 | """ |
---|
[1452132] | 178 | image = file_dir + "/images/sns_logo.png" |
---|
| 179 | if os.path.isfile(config._sns_logo): |
---|
| 180 | image = config._sns_logo |
---|
| 181 | logo = wx.Bitmap(image) |
---|
| 182 | self.bitmap_button_sns.SetBitmapLabel(logo) |
---|
| 183 | |
---|
[32c0841] | 184 | image = file_dir + "/images/nsf_logo.png" |
---|
[41d466f] | 185 | if os.path.isfile(config._nsf_logo): |
---|
| 186 | image = config._nsf_logo |
---|
| 187 | logo = wx.Bitmap(image) |
---|
| 188 | self.bitmap_button_nsf.SetBitmapLabel(logo) |
---|
| 189 | |
---|
[32c0841] | 190 | image = file_dir + "/images/danse_logo.png" |
---|
[41d466f] | 191 | if os.path.isfile(config._danse_logo): |
---|
| 192 | image = config._danse_logo |
---|
| 193 | logo = wx.Bitmap(image) |
---|
| 194 | self.bitmap_button_danse.SetBitmapLabel(logo) |
---|
[657e52c] | 195 | """ |
---|
[32c0841] | 196 | image = file_dir + "/images/utlogo.gif" |
---|
[41d466f] | 197 | if os.path.isfile(config._inst_logo): |
---|
| 198 | image = config._inst_logo |
---|
| 199 | logo = wx.Bitmap(image) |
---|
| 200 | self.bitmap_button_msu.SetBitmapLabel(logo) |
---|
| 201 | |
---|
[657e52c] | 202 | image = file_dir + "/images/isis_logo.png" |
---|
| 203 | if os.path.isfile(config._isis_logo): |
---|
| 204 | image = config._isis_logo |
---|
| 205 | logo = wx.Bitmap(image) |
---|
| 206 | self.bitmap_button_isis.SetBitmapLabel(logo) |
---|
| 207 | |
---|
| 208 | image = file_dir + "/images/ess_logo.png" |
---|
| 209 | if os.path.isfile(config._ess_logo): |
---|
| 210 | image = config._ess_logo |
---|
| 211 | logo = wx.Bitmap(image) |
---|
| 212 | self.bitmap_button_ess.SetBitmapLabel(logo) |
---|
| 213 | |
---|
| 214 | image = file_dir + "/images/ill_logo.png" |
---|
| 215 | if os.path.isfile(config._ill_logo): |
---|
| 216 | image = config._ill_logo |
---|
| 217 | logo = wx.Bitmap(image) |
---|
| 218 | self.bitmap_button_ill.SetBitmapLabel(logo) |
---|
[e0f28e6] | 219 | |
---|
| 220 | image = file_dir + "/images/ansto_logo.png" |
---|
| 221 | if os.path.isfile(config._ansto_logo): |
---|
| 222 | image = config._ansto_logo |
---|
| 223 | logo = wx.Bitmap(image) |
---|
| 224 | self.bitmap_button_ansto.SetBitmapLabel(logo) |
---|
[49e000b] | 225 | |
---|
| 226 | image = file_dir + "/images/tudelft_logo.png" |
---|
| 227 | if os.path.isfile(config._tudelft_logo): |
---|
| 228 | image = config._tudelft_logo |
---|
| 229 | logo = wx.Bitmap(image) |
---|
| 230 | self.bitmap_button_tudelft.SetBitmapLabel(logo) |
---|
[657e52c] | 231 | |
---|
[41d466f] | 232 | # resize dialog window to fit version number nicely |
---|
[32c0841] | 233 | if wx.VERSION >= (2, 7, 2, 0): |
---|
[41d466f] | 234 | size = [self.GetEffectiveMinSize()[0], self.GetSize()[1]] |
---|
| 235 | else: |
---|
| 236 | size = [self.GetBestFittingSize()[0], self.GetSize()[1]] |
---|
| 237 | self.Fit() |
---|
| 238 | |
---|
| 239 | def __set_properties(self): |
---|
[d955bf19] | 240 | """ |
---|
| 241 | """ |
---|
[41d466f] | 242 | # begin wxGlade: DialogAbout.__set_properties |
---|
| 243 | self.SetTitle("About") |
---|
| 244 | self.SetSize((600, 595)) |
---|
[32c0841] | 245 | self.label_title.SetFont(wx.Font(26, wx.DEFAULT, wx.NORMAL, |
---|
| 246 | wx.BOLD, 0, "")) |
---|
| 247 | self.label_version.SetFont(wx.Font(26, wx.DEFAULT, wx.NORMAL, |
---|
| 248 | wx.NORMAL, 0, "")) |
---|
[41d466f] | 249 | self.hyperlink_paper.Enable(True) |
---|
[1452132] | 250 | self.bitmap_button_nist.SetSize(self.bitmap_button_nist.GetBestSize()) |
---|
| 251 | self.bitmap_button_umd.SetSize(self.bitmap_button_umd.GetBestSize()) |
---|
[e0f28e6] | 252 | self.bitmap_button_ornl.SetSize(self.bitmap_button_ornl.GetBestSize()) |
---|
| 253 | #self.bitmap_button_sns.SetSize(self.bitmap_button_sns.GetBestSize()) |
---|
[657e52c] | 254 | #self.bitmap_button_nsf.SetSize(self.bitmap_button_nsf.GetBestSize()) |
---|
| 255 | #self.bitmap_button_danse.SetSize(self.bitmap_button_danse.GetBestSize()) |
---|
[41d466f] | 256 | self.bitmap_button_msu.SetSize(self.bitmap_button_msu.GetBestSize()) |
---|
[657e52c] | 257 | self.bitmap_button_isis.SetSize(self.bitmap_button_isis.GetBestSize()) |
---|
| 258 | self.bitmap_button_ess.SetSize(self.bitmap_button_ess.GetBestSize()) |
---|
| 259 | self.bitmap_button_ill.SetSize(self.bitmap_button_ill.GetBestSize()) |
---|
[e0f28e6] | 260 | self.bitmap_button_ansto.SetSize(self.bitmap_button_ansto.GetBestSize()) |
---|
[49e000b] | 261 | self.bitmap_button_tudelft.SetSize(self.bitmap_button_tudelft.GetBestSize()) |
---|
[41d466f] | 262 | # end wxGlade |
---|
| 263 | |
---|
| 264 | def __do_layout(self): |
---|
[d955bf19] | 265 | """ |
---|
| 266 | """ |
---|
[41d466f] | 267 | # begin wxGlade: DialogAbout.__do_layout |
---|
| 268 | sizer_main = wx.BoxSizer(wx.VERTICAL) |
---|
| 269 | sizer_button = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 270 | sizer_logos = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 271 | sizer_header = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 272 | sizer_titles = wx.BoxSizer(wx.VERTICAL) |
---|
| 273 | sizer_build = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 274 | sizer_title = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 275 | sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND, 0) |
---|
[32c0841] | 276 | sizer_title.Add(self.label_title, 0, |
---|
| 277 | wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10) |
---|
[41d466f] | 278 | sizer_title.Add((20, 20), 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0) |
---|
[32c0841] | 279 | sizer_title.Add(self.label_version, 0, |
---|
| 280 | wx.RIGHT|wx.ALIGN_BOTTOM|wx.ADJUST_MINSIZE, 10) |
---|
[41d466f] | 281 | sizer_titles.Add(sizer_title, 0, wx.EXPAND, 0) |
---|
[32c0841] | 282 | sizer_build.Add(self.label_build, 0, |
---|
| 283 | wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) |
---|
[41d466f] | 284 | sizer_build.Add(self.label_svnrevision, 0, wx.ADJUST_MINSIZE, 0) |
---|
| 285 | sizer_titles.Add(sizer_build, 0, wx.TOP|wx.EXPAND, 5) |
---|
[32c0841] | 286 | sizer_titles.Add(self.label_copyright, 0, |
---|
| 287 | wx.LEFT|wx.RIGHT|wx.TOP|wx.ADJUST_MINSIZE, 10) |
---|
| 288 | sizer_titles.Add(self.label_author, 0, |
---|
| 289 | wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) |
---|
[41d466f] | 290 | sizer_titles.Add(self.hyperlink, 0, wx.LEFT|wx.RIGHT, 10) |
---|
| 291 | sizer_titles.Add((20, 20), 0, wx.ADJUST_MINSIZE, 0) |
---|
| 292 | sizer_titles.Add(self.hyperlink_license, 0, wx.LEFT|wx.RIGHT, 10) |
---|
| 293 | sizer_titles.Add(self.hyperlink_paper, 0, wx.LEFT|wx.RIGHT, 10) |
---|
| 294 | sizer_titles.Add((20, 20), 0, wx.ADJUST_MINSIZE, 0) |
---|
| 295 | sizer_titles.Add(self.hyperlink_download, 0, wx.LEFT|wx.RIGHT, 10) |
---|
| 296 | sizer_header.Add(sizer_titles, 0, wx.EXPAND, 0) |
---|
| 297 | sizer_main.Add(sizer_header, 0, wx.BOTTOM|wx.EXPAND, 3) |
---|
| 298 | sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0) |
---|
[32c0841] | 299 | sizer_main.Add(self.label_acknowledgement, 0, |
---|
| 300 | wx.LEFT|wx.TOP|wx.BOTTOM|wx.ADJUST_MINSIZE, 7) |
---|
[41d466f] | 301 | sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0) |
---|
[657e52c] | 302 | |
---|
| 303 | sizer_logos.Add(self.bitmap_button_msu, 0, |
---|
| 304 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 305 | #sizer_logos.Add(self.bitmap_button_danse, 0, |
---|
| 306 | # wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 307 | #sizer_logos.Add(self.bitmap_button_nsf, 0, |
---|
| 308 | # wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 309 | sizer_logos.Add(self.bitmap_button_umd, 0, |
---|
| 310 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 311 | sizer_logos.Add(self.bitmap_button_nist, 0, |
---|
| 312 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[e0f28e6] | 313 | #sizer_logos.Add(self.bitmap_button_sns, 0, |
---|
| 314 | # wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 315 | sizer_logos.Add(self.bitmap_button_ornl, 0, |
---|
[657e52c] | 316 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 317 | sizer_logos.Add(self.bitmap_button_isis, 0, |
---|
| 318 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 319 | sizer_logos.Add(self.bitmap_button_ess, 0, |
---|
[32c0841] | 320 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[657e52c] | 321 | sizer_logos.Add(self.bitmap_button_ill, 0, |
---|
| 322 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[e0f28e6] | 323 | sizer_logos.Add(self.bitmap_button_ansto, 0, |
---|
| 324 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[49e000b] | 325 | sizer_logos.Add(self.bitmap_button_tudelft, 0, |
---|
| 326 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[657e52c] | 327 | |
---|
| 328 | sizer_logos.Add((10, 50), 0, wx.ADJUST_MINSIZE, 0) |
---|
[41d466f] | 329 | sizer_main.Add(sizer_logos, 0, wx.EXPAND, 0) |
---|
| 330 | sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0) |
---|
[657e52c] | 331 | sizer_button.Add((20, 40), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) |
---|
[3c965fd] | 332 | sizer_button.Add(self.button_OK, 0, |
---|
[657e52c] | 333 | wx.RIGHT|wx.ADJUST_MINSIZE|wx.CENTER, 10) |
---|
[41d466f] | 334 | sizer_main.Add(sizer_button, 0, wx.EXPAND, 0) |
---|
| 335 | self.SetAutoLayout(True) |
---|
| 336 | self.SetSizer(sizer_main) |
---|
| 337 | self.Layout() |
---|
| 338 | self.Centre() |
---|
| 339 | # end wxGlade |
---|
| 340 | |
---|
[1452132] | 341 | def onNistLogo(self, event): |
---|
| 342 | """ |
---|
| 343 | """ |
---|
| 344 | # wxGlade: DialogAbout.<event_handler> |
---|
| 345 | launchBrowser(config._nist_url) |
---|
| 346 | event.Skip() |
---|
| 347 | |
---|
| 348 | def onUmdLogo(self, event): |
---|
| 349 | """ |
---|
| 350 | """ |
---|
| 351 | # wxGlade: DialogAbout.<event_handler> |
---|
| 352 | launchBrowser(config._umd_url) |
---|
| 353 | event.Skip() |
---|
| 354 | |
---|
[e0f28e6] | 355 | def onOrnlLogo(self, event): |
---|
| 356 | """ |
---|
| 357 | """ |
---|
| 358 | # wxGlade: DialogAbout.<event_handler> |
---|
| 359 | launchBrowser(config._ornl_url) |
---|
| 360 | event.Skip() |
---|
| 361 | |
---|
[1452132] | 362 | def onSnsLogo(self, event): |
---|
| 363 | """ |
---|
| 364 | """ |
---|
| 365 | # wxGlade: DialogAbout.<event_handler> |
---|
| 366 | launchBrowser(config._sns_url) |
---|
| 367 | event.Skip() |
---|
| 368 | |
---|
[d955bf19] | 369 | def onNsfLogo(self, event): |
---|
| 370 | """ |
---|
| 371 | """ |
---|
| 372 | # wxGlade: DialogAbout.<event_handler> |
---|
[41d466f] | 373 | launchBrowser(config._nsf_url) |
---|
| 374 | event.Skip() |
---|
| 375 | |
---|
[d955bf19] | 376 | def onDanseLogo(self, event): |
---|
| 377 | """ |
---|
| 378 | """ |
---|
| 379 | # wxGlade: DialogAbout.<event_handler> |
---|
[41d466f] | 380 | launchBrowser(config._danse_url) |
---|
| 381 | event.Skip() |
---|
| 382 | |
---|
[d955bf19] | 383 | def onUTLogo(self, event): |
---|
| 384 | """ |
---|
| 385 | """ |
---|
| 386 | # wxGlade: DialogAbout.<event_handler> |
---|
[41d466f] | 387 | launchBrowser(config._inst_url) |
---|
| 388 | event.Skip() |
---|
| 389 | |
---|
[657e52c] | 390 | def onIsisLogo(self, event): |
---|
| 391 | """ |
---|
| 392 | """ |
---|
| 393 | # wxGlade: DialogAbout.<event_handler> |
---|
| 394 | launchBrowser(config._isis_url) |
---|
| 395 | event.Skip() |
---|
| 396 | |
---|
| 397 | def onEssLogo(self, event): |
---|
| 398 | """ |
---|
| 399 | """ |
---|
| 400 | # wxGlade: DialogAbout.<event_handler> |
---|
| 401 | launchBrowser(config._ess_url) |
---|
| 402 | event.Skip() |
---|
| 403 | |
---|
| 404 | def onIllLogo(self, event): |
---|
| 405 | """ |
---|
| 406 | """ |
---|
| 407 | # wxGlade: DialogAbout.<event_handler> |
---|
| 408 | launchBrowser(config._ill_url) |
---|
| 409 | event.Skip() |
---|
| 410 | |
---|
[e0f28e6] | 411 | def onAnstoLogo(self, event): |
---|
| 412 | """ |
---|
| 413 | """ |
---|
| 414 | # wxGlade: DialogAbout.<event_handler> |
---|
| 415 | launchBrowser(config._ansto_url) |
---|
| 416 | event.Skip() |
---|
| 417 | |
---|
[49e000b] | 418 | def onTudelftLogo(self, event): |
---|
| 419 | """ |
---|
| 420 | """ |
---|
| 421 | # wxGlade: DialogAbout.<event_handler> |
---|
| 422 | launchBrowser(config._tudelft_url) |
---|
| 423 | event.Skip() |
---|
| 424 | |
---|
[41d466f] | 425 | # end of class DialogAbout |
---|
| 426 | |
---|
| 427 | ##### testing code ############################################################ |
---|
| 428 | class MyApp(wx.App): |
---|
[32c0841] | 429 | """ |
---|
| 430 | """ |
---|
[41d466f] | 431 | def OnInit(self): |
---|
[32c0841] | 432 | """ |
---|
| 433 | """ |
---|
[41d466f] | 434 | wx.InitAllImageHandlers() |
---|
| 435 | dialog = DialogAbout(None, -1, "") |
---|
| 436 | self.SetTopWindow(dialog) |
---|
| 437 | dialog.ShowModal() |
---|
| 438 | dialog.Destroy() |
---|
| 439 | return 1 |
---|
| 440 | |
---|
| 441 | # end of class MyApp |
---|
| 442 | |
---|
| 443 | if __name__ == "__main__": |
---|
| 444 | app = MyApp(0) |
---|
| 445 | app.MainLoop() |
---|
| 446 | |
---|
| 447 | ##### end of testing code ##################################################### |
---|