[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) |
---|
[1779e72] | 120 | self.bitmap_button_dls = wx.BitmapButton(self, -1, wx.NullBitmap) |
---|
[657e52c] | 121 | |
---|
[41d466f] | 122 | self.static_line_3 = wx.StaticLine(self, -1) |
---|
| 123 | self.button_OK = wx.Button(self, wx.ID_OK, "OK") |
---|
| 124 | |
---|
| 125 | self.__set_properties() |
---|
| 126 | self.__do_layout() |
---|
[1452132] | 127 | |
---|
| 128 | self.Bind(wx.EVT_BUTTON, self.onNistLogo, self.bitmap_button_nist) |
---|
| 129 | self.Bind(wx.EVT_BUTTON, self.onUmdLogo, self.bitmap_button_umd) |
---|
[e0f28e6] | 130 | #self.Bind(wx.EVT_BUTTON, self.onSnsLogo, self.bitmap_button_sns) |
---|
| 131 | self.Bind(wx.EVT_BUTTON, self.onOrnlLogo, self.bitmap_button_ornl) |
---|
[657e52c] | 132 | #self.Bind(wx.EVT_BUTTON, self.onNsfLogo, self.bitmap_button_nsf) |
---|
| 133 | #self.Bind(wx.EVT_BUTTON, self.onDanseLogo, self.bitmap_button_danse) |
---|
[41d466f] | 134 | self.Bind(wx.EVT_BUTTON, self.onUTLogo, self.bitmap_button_msu) |
---|
[657e52c] | 135 | self.Bind(wx.EVT_BUTTON, self.onIsisLogo, self.bitmap_button_isis) |
---|
| 136 | self.Bind(wx.EVT_BUTTON, self.onEssLogo, self.bitmap_button_ess) |
---|
| 137 | self.Bind(wx.EVT_BUTTON, self.onIllLogo, self.bitmap_button_ill) |
---|
[e0f28e6] | 138 | self.Bind(wx.EVT_BUTTON, self.onAnstoLogo, self.bitmap_button_ansto) |
---|
[49e000b] | 139 | self.Bind(wx.EVT_BUTTON, self.onTudelftLogo, self.bitmap_button_tudelft) |
---|
[1779e72] | 140 | self.Bind(wx.EVT_BUTTON, self.onDlsLogo, self.bitmap_button_dls) |
---|
[41d466f] | 141 | # end wxGlade |
---|
| 142 | # fill in acknowledgements |
---|
[32c0841] | 143 | #self.text_ctrl_acknowledgement.SetValue(__acknowledgement__) |
---|
[41d466f] | 144 | # randomly shuffle authors' names |
---|
| 145 | random.shuffle(config._authors) |
---|
| 146 | strLabel = ", ".join(config._authors) |
---|
| 147 | |
---|
| 148 | # display version and svn revison numbers |
---|
| 149 | verwords = config.__version__.split('.') |
---|
| 150 | version = '.'.join(verwords[:-1]) |
---|
| 151 | revision = verwords[-1] |
---|
[3bc6090] | 152 | try: |
---|
| 153 | build_num = str(config.__build__) |
---|
| 154 | except: |
---|
| 155 | build_num = str(config.__version__) |
---|
[41d466f] | 156 | self.label_author.SetLabel(strLabel) |
---|
[1c97a3f] | 157 | self.label_version.SetLabel(config.__version__)#(version) |
---|
[3bc6090] | 158 | self.label_svnrevision.SetLabel(build_num) |
---|
[41d466f] | 159 | |
---|
| 160 | # set bitmaps for logo buttons |
---|
[1452132] | 161 | image = file_dir + "/images/nist_logo.png" |
---|
| 162 | if os.path.isfile(config._nist_logo): |
---|
| 163 | image = config._nist_logo |
---|
| 164 | logo = wx.Bitmap(image) |
---|
| 165 | self.bitmap_button_nist.SetBitmapLabel(logo) |
---|
| 166 | |
---|
| 167 | image = file_dir + "/images/umd_logo.png" |
---|
| 168 | if os.path.isfile(config._umd_logo): |
---|
| 169 | image = config._umd_logo |
---|
| 170 | logo = wx.Bitmap(image) |
---|
| 171 | self.bitmap_button_umd.SetBitmapLabel(logo) |
---|
| 172 | |
---|
[e0f28e6] | 173 | image = file_dir + "/images/ornl_logo.png" |
---|
| 174 | if os.path.isfile(config._ornl_logo): |
---|
| 175 | image = config._ornl_logo |
---|
| 176 | logo = wx.Bitmap(image) |
---|
| 177 | self.bitmap_button_ornl.SetBitmapLabel(logo) |
---|
| 178 | |
---|
| 179 | """ |
---|
[1452132] | 180 | image = file_dir + "/images/sns_logo.png" |
---|
| 181 | if os.path.isfile(config._sns_logo): |
---|
| 182 | image = config._sns_logo |
---|
| 183 | logo = wx.Bitmap(image) |
---|
| 184 | self.bitmap_button_sns.SetBitmapLabel(logo) |
---|
| 185 | |
---|
[32c0841] | 186 | image = file_dir + "/images/nsf_logo.png" |
---|
[41d466f] | 187 | if os.path.isfile(config._nsf_logo): |
---|
| 188 | image = config._nsf_logo |
---|
| 189 | logo = wx.Bitmap(image) |
---|
| 190 | self.bitmap_button_nsf.SetBitmapLabel(logo) |
---|
| 191 | |
---|
[32c0841] | 192 | image = file_dir + "/images/danse_logo.png" |
---|
[41d466f] | 193 | if os.path.isfile(config._danse_logo): |
---|
| 194 | image = config._danse_logo |
---|
| 195 | logo = wx.Bitmap(image) |
---|
| 196 | self.bitmap_button_danse.SetBitmapLabel(logo) |
---|
[657e52c] | 197 | """ |
---|
[6aad2e8] | 198 | image = file_dir + "/images/utlogo.png" |
---|
[41d466f] | 199 | if os.path.isfile(config._inst_logo): |
---|
| 200 | image = config._inst_logo |
---|
| 201 | logo = wx.Bitmap(image) |
---|
| 202 | self.bitmap_button_msu.SetBitmapLabel(logo) |
---|
| 203 | |
---|
[657e52c] | 204 | image = file_dir + "/images/isis_logo.png" |
---|
| 205 | if os.path.isfile(config._isis_logo): |
---|
| 206 | image = config._isis_logo |
---|
| 207 | logo = wx.Bitmap(image) |
---|
| 208 | self.bitmap_button_isis.SetBitmapLabel(logo) |
---|
| 209 | |
---|
| 210 | image = file_dir + "/images/ess_logo.png" |
---|
| 211 | if os.path.isfile(config._ess_logo): |
---|
| 212 | image = config._ess_logo |
---|
| 213 | logo = wx.Bitmap(image) |
---|
| 214 | self.bitmap_button_ess.SetBitmapLabel(logo) |
---|
| 215 | |
---|
| 216 | image = file_dir + "/images/ill_logo.png" |
---|
| 217 | if os.path.isfile(config._ill_logo): |
---|
| 218 | image = config._ill_logo |
---|
| 219 | logo = wx.Bitmap(image) |
---|
| 220 | self.bitmap_button_ill.SetBitmapLabel(logo) |
---|
[e0f28e6] | 221 | |
---|
| 222 | image = file_dir + "/images/ansto_logo.png" |
---|
| 223 | if os.path.isfile(config._ansto_logo): |
---|
| 224 | image = config._ansto_logo |
---|
| 225 | logo = wx.Bitmap(image) |
---|
| 226 | self.bitmap_button_ansto.SetBitmapLabel(logo) |
---|
[49e000b] | 227 | |
---|
| 228 | image = file_dir + "/images/tudelft_logo.png" |
---|
| 229 | if os.path.isfile(config._tudelft_logo): |
---|
| 230 | image = config._tudelft_logo |
---|
| 231 | logo = wx.Bitmap(image) |
---|
| 232 | self.bitmap_button_tudelft.SetBitmapLabel(logo) |
---|
[1779e72] | 233 | |
---|
| 234 | image = file_dir + "/images/dls_logo.png" |
---|
| 235 | if os.path.isfile(config._dls_logo): |
---|
| 236 | image = config._dls_logo |
---|
| 237 | logo = wx.Bitmap(image) |
---|
| 238 | self.bitmap_button_dls.SetBitmapLabel(logo) |
---|
[657e52c] | 239 | |
---|
[41d466f] | 240 | # resize dialog window to fit version number nicely |
---|
[32c0841] | 241 | if wx.VERSION >= (2, 7, 2, 0): |
---|
[41d466f] | 242 | size = [self.GetEffectiveMinSize()[0], self.GetSize()[1]] |
---|
| 243 | else: |
---|
| 244 | size = [self.GetBestFittingSize()[0], self.GetSize()[1]] |
---|
| 245 | self.Fit() |
---|
| 246 | |
---|
| 247 | def __set_properties(self): |
---|
[d955bf19] | 248 | """ |
---|
| 249 | """ |
---|
[41d466f] | 250 | # begin wxGlade: DialogAbout.__set_properties |
---|
| 251 | self.SetTitle("About") |
---|
| 252 | self.SetSize((600, 595)) |
---|
[32c0841] | 253 | self.label_title.SetFont(wx.Font(26, wx.DEFAULT, wx.NORMAL, |
---|
| 254 | wx.BOLD, 0, "")) |
---|
| 255 | self.label_version.SetFont(wx.Font(26, wx.DEFAULT, wx.NORMAL, |
---|
| 256 | wx.NORMAL, 0, "")) |
---|
[41d466f] | 257 | self.hyperlink_paper.Enable(True) |
---|
[1452132] | 258 | self.bitmap_button_nist.SetSize(self.bitmap_button_nist.GetBestSize()) |
---|
| 259 | self.bitmap_button_umd.SetSize(self.bitmap_button_umd.GetBestSize()) |
---|
[e0f28e6] | 260 | self.bitmap_button_ornl.SetSize(self.bitmap_button_ornl.GetBestSize()) |
---|
| 261 | #self.bitmap_button_sns.SetSize(self.bitmap_button_sns.GetBestSize()) |
---|
[657e52c] | 262 | #self.bitmap_button_nsf.SetSize(self.bitmap_button_nsf.GetBestSize()) |
---|
| 263 | #self.bitmap_button_danse.SetSize(self.bitmap_button_danse.GetBestSize()) |
---|
[41d466f] | 264 | self.bitmap_button_msu.SetSize(self.bitmap_button_msu.GetBestSize()) |
---|
[657e52c] | 265 | self.bitmap_button_isis.SetSize(self.bitmap_button_isis.GetBestSize()) |
---|
| 266 | self.bitmap_button_ess.SetSize(self.bitmap_button_ess.GetBestSize()) |
---|
| 267 | self.bitmap_button_ill.SetSize(self.bitmap_button_ill.GetBestSize()) |
---|
[e0f28e6] | 268 | self.bitmap_button_ansto.SetSize(self.bitmap_button_ansto.GetBestSize()) |
---|
[49e000b] | 269 | self.bitmap_button_tudelft.SetSize(self.bitmap_button_tudelft.GetBestSize()) |
---|
[1779e72] | 270 | self.bitmap_button_dls.SetSize(self.bitmap_button_dls.GetBestSize()) |
---|
[41d466f] | 271 | # end wxGlade |
---|
| 272 | |
---|
| 273 | def __do_layout(self): |
---|
[d955bf19] | 274 | """ |
---|
| 275 | """ |
---|
[41d466f] | 276 | # begin wxGlade: DialogAbout.__do_layout |
---|
| 277 | sizer_main = wx.BoxSizer(wx.VERTICAL) |
---|
| 278 | sizer_button = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 279 | sizer_logos = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 280 | sizer_header = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 281 | sizer_titles = wx.BoxSizer(wx.VERTICAL) |
---|
| 282 | sizer_build = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 283 | sizer_title = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 284 | sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND, 0) |
---|
[32c0841] | 285 | sizer_title.Add(self.label_title, 0, |
---|
| 286 | wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10) |
---|
[41d466f] | 287 | sizer_title.Add((20, 20), 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0) |
---|
[32c0841] | 288 | sizer_title.Add(self.label_version, 0, |
---|
| 289 | wx.RIGHT|wx.ALIGN_BOTTOM|wx.ADJUST_MINSIZE, 10) |
---|
[41d466f] | 290 | sizer_titles.Add(sizer_title, 0, wx.EXPAND, 0) |
---|
[32c0841] | 291 | sizer_build.Add(self.label_build, 0, |
---|
| 292 | wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) |
---|
[41d466f] | 293 | sizer_build.Add(self.label_svnrevision, 0, wx.ADJUST_MINSIZE, 0) |
---|
| 294 | sizer_titles.Add(sizer_build, 0, wx.TOP|wx.EXPAND, 5) |
---|
[32c0841] | 295 | sizer_titles.Add(self.label_copyright, 0, |
---|
| 296 | wx.LEFT|wx.RIGHT|wx.TOP|wx.ADJUST_MINSIZE, 10) |
---|
| 297 | sizer_titles.Add(self.label_author, 0, |
---|
| 298 | wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) |
---|
[41d466f] | 299 | sizer_titles.Add(self.hyperlink, 0, wx.LEFT|wx.RIGHT, 10) |
---|
| 300 | sizer_titles.Add((20, 20), 0, wx.ADJUST_MINSIZE, 0) |
---|
| 301 | sizer_titles.Add(self.hyperlink_license, 0, wx.LEFT|wx.RIGHT, 10) |
---|
| 302 | sizer_titles.Add(self.hyperlink_paper, 0, wx.LEFT|wx.RIGHT, 10) |
---|
| 303 | sizer_titles.Add((20, 20), 0, wx.ADJUST_MINSIZE, 0) |
---|
| 304 | sizer_titles.Add(self.hyperlink_download, 0, wx.LEFT|wx.RIGHT, 10) |
---|
| 305 | sizer_header.Add(sizer_titles, 0, wx.EXPAND, 0) |
---|
| 306 | sizer_main.Add(sizer_header, 0, wx.BOTTOM|wx.EXPAND, 3) |
---|
| 307 | sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0) |
---|
[32c0841] | 308 | sizer_main.Add(self.label_acknowledgement, 0, |
---|
| 309 | wx.LEFT|wx.TOP|wx.BOTTOM|wx.ADJUST_MINSIZE, 7) |
---|
[41d466f] | 310 | sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0) |
---|
[657e52c] | 311 | |
---|
| 312 | sizer_logos.Add(self.bitmap_button_msu, 0, |
---|
| 313 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 314 | #sizer_logos.Add(self.bitmap_button_danse, 0, |
---|
| 315 | # wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 316 | #sizer_logos.Add(self.bitmap_button_nsf, 0, |
---|
| 317 | # wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 318 | sizer_logos.Add(self.bitmap_button_umd, 0, |
---|
| 319 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 320 | sizer_logos.Add(self.bitmap_button_nist, 0, |
---|
| 321 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[e0f28e6] | 322 | #sizer_logos.Add(self.bitmap_button_sns, 0, |
---|
| 323 | # wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 324 | sizer_logos.Add(self.bitmap_button_ornl, 0, |
---|
[657e52c] | 325 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 326 | sizer_logos.Add(self.bitmap_button_isis, 0, |
---|
| 327 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
| 328 | sizer_logos.Add(self.bitmap_button_ess, 0, |
---|
[32c0841] | 329 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[657e52c] | 330 | sizer_logos.Add(self.bitmap_button_ill, 0, |
---|
| 331 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[e0f28e6] | 332 | sizer_logos.Add(self.bitmap_button_ansto, 0, |
---|
| 333 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[49e000b] | 334 | sizer_logos.Add(self.bitmap_button_tudelft, 0, |
---|
| 335 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[1779e72] | 336 | sizer_logos.Add(self.bitmap_button_dls, 0, |
---|
| 337 | wx.LEFT|wx.ADJUST_MINSIZE, 2) |
---|
[657e52c] | 338 | |
---|
| 339 | sizer_logos.Add((10, 50), 0, wx.ADJUST_MINSIZE, 0) |
---|
[41d466f] | 340 | sizer_main.Add(sizer_logos, 0, wx.EXPAND, 0) |
---|
| 341 | sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0) |
---|
[657e52c] | 342 | sizer_button.Add((20, 40), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) |
---|
[3c965fd] | 343 | sizer_button.Add(self.button_OK, 0, |
---|
[657e52c] | 344 | wx.RIGHT|wx.ADJUST_MINSIZE|wx.CENTER, 10) |
---|
[41d466f] | 345 | sizer_main.Add(sizer_button, 0, wx.EXPAND, 0) |
---|
| 346 | self.SetAutoLayout(True) |
---|
| 347 | self.SetSizer(sizer_main) |
---|
| 348 | self.Layout() |
---|
| 349 | self.Centre() |
---|
| 350 | # end wxGlade |
---|
| 351 | |
---|
[1452132] | 352 | def onNistLogo(self, event): |
---|
| 353 | """ |
---|
| 354 | """ |
---|
| 355 | # wxGlade: DialogAbout.<event_handler> |
---|
| 356 | launchBrowser(config._nist_url) |
---|
| 357 | event.Skip() |
---|
| 358 | |
---|
| 359 | def onUmdLogo(self, event): |
---|
| 360 | """ |
---|
| 361 | """ |
---|
| 362 | # wxGlade: DialogAbout.<event_handler> |
---|
| 363 | launchBrowser(config._umd_url) |
---|
| 364 | event.Skip() |
---|
| 365 | |
---|
[e0f28e6] | 366 | def onOrnlLogo(self, event): |
---|
| 367 | """ |
---|
| 368 | """ |
---|
| 369 | # wxGlade: DialogAbout.<event_handler> |
---|
| 370 | launchBrowser(config._ornl_url) |
---|
| 371 | event.Skip() |
---|
| 372 | |
---|
[1452132] | 373 | def onSnsLogo(self, event): |
---|
| 374 | """ |
---|
| 375 | """ |
---|
| 376 | # wxGlade: DialogAbout.<event_handler> |
---|
| 377 | launchBrowser(config._sns_url) |
---|
| 378 | event.Skip() |
---|
| 379 | |
---|
[d955bf19] | 380 | def onNsfLogo(self, event): |
---|
| 381 | """ |
---|
| 382 | """ |
---|
| 383 | # wxGlade: DialogAbout.<event_handler> |
---|
[41d466f] | 384 | launchBrowser(config._nsf_url) |
---|
| 385 | event.Skip() |
---|
| 386 | |
---|
[d955bf19] | 387 | def onDanseLogo(self, event): |
---|
| 388 | """ |
---|
| 389 | """ |
---|
| 390 | # wxGlade: DialogAbout.<event_handler> |
---|
[41d466f] | 391 | launchBrowser(config._danse_url) |
---|
| 392 | event.Skip() |
---|
| 393 | |
---|
[d955bf19] | 394 | def onUTLogo(self, event): |
---|
| 395 | """ |
---|
| 396 | """ |
---|
| 397 | # wxGlade: DialogAbout.<event_handler> |
---|
[41d466f] | 398 | launchBrowser(config._inst_url) |
---|
| 399 | event.Skip() |
---|
| 400 | |
---|
[657e52c] | 401 | def onIsisLogo(self, event): |
---|
| 402 | """ |
---|
| 403 | """ |
---|
| 404 | # wxGlade: DialogAbout.<event_handler> |
---|
| 405 | launchBrowser(config._isis_url) |
---|
| 406 | event.Skip() |
---|
| 407 | |
---|
| 408 | def onEssLogo(self, event): |
---|
| 409 | """ |
---|
| 410 | """ |
---|
| 411 | # wxGlade: DialogAbout.<event_handler> |
---|
| 412 | launchBrowser(config._ess_url) |
---|
| 413 | event.Skip() |
---|
| 414 | |
---|
| 415 | def onIllLogo(self, event): |
---|
| 416 | """ |
---|
| 417 | """ |
---|
| 418 | # wxGlade: DialogAbout.<event_handler> |
---|
| 419 | launchBrowser(config._ill_url) |
---|
| 420 | event.Skip() |
---|
| 421 | |
---|
[e0f28e6] | 422 | def onAnstoLogo(self, event): |
---|
| 423 | """ |
---|
| 424 | """ |
---|
| 425 | # wxGlade: DialogAbout.<event_handler> |
---|
| 426 | launchBrowser(config._ansto_url) |
---|
| 427 | event.Skip() |
---|
| 428 | |
---|
[49e000b] | 429 | def onTudelftLogo(self, event): |
---|
| 430 | """ |
---|
| 431 | """ |
---|
| 432 | # wxGlade: DialogAbout.<event_handler> |
---|
| 433 | launchBrowser(config._tudelft_url) |
---|
| 434 | event.Skip() |
---|
| 435 | |
---|
[1779e72] | 436 | def onDlsLogo(self, event): |
---|
| 437 | """ |
---|
| 438 | """ |
---|
| 439 | # wxGlade: DialogAbout.<event_handler> |
---|
| 440 | launchBrowser(config._dls_url) |
---|
| 441 | event.Skip() |
---|
| 442 | |
---|
[41d466f] | 443 | # end of class DialogAbout |
---|
| 444 | |
---|
| 445 | ##### testing code ############################################################ |
---|
| 446 | class MyApp(wx.App): |
---|
[32c0841] | 447 | """ |
---|
| 448 | """ |
---|
[41d466f] | 449 | def OnInit(self): |
---|
[32c0841] | 450 | """ |
---|
| 451 | """ |
---|
[41d466f] | 452 | wx.InitAllImageHandlers() |
---|
| 453 | dialog = DialogAbout(None, -1, "") |
---|
| 454 | self.SetTopWindow(dialog) |
---|
| 455 | dialog.ShowModal() |
---|
| 456 | dialog.Destroy() |
---|
| 457 | return 1 |
---|
| 458 | |
---|
| 459 | # end of class MyApp |
---|
| 460 | |
---|
| 461 | if __name__ == "__main__": |
---|
| 462 | app = MyApp(0) |
---|
| 463 | app.MainLoop() |
---|
| 464 | |
---|
| 465 | ##### end of testing code ##################################################### |
---|