commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8150 - trunk/gnue-forms/src/uidrivers/wx26


From: johannes
Subject: [gnue] r8150 - trunk/gnue-forms/src/uidrivers/wx26
Date: Mon, 6 Feb 2006 07:57:34 -0600 (CST)

Author: johannes
Date: 2006-02-06 07:57:33 -0600 (Mon, 06 Feb 2006)
New Revision: 8150

Added:
   trunk/gnue-forms/src/uidrivers/wx26/UISplashScreen.py
Modified:
   trunk/gnue-forms/src/uidrivers/wx26/UIdriver.py
Log:
Added implementation of a SplashScreen


Added: trunk/gnue-forms/src/uidrivers/wx26/UISplashScreen.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/UISplashScreen.py       2006-01-30 
12:50:29 UTC (rev 8149)
+++ trunk/gnue-forms/src/uidrivers/wx26/UISplashScreen.py       2006-02-06 
13:57:33 UTC (rev 8150)
@@ -0,0 +1,60 @@
+# GNU Enterprise Forms - wx 2.6 UI Driver - Splash Screen
+#
+# Copyright 2001-2006 Free Software Foundation
+#
+# This file is part of GNU Enterprise
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+import wx
+import os.path
+
+from gnue.common.apps import GConfig
+from gnue.forms import VERSION
+
+# =============================================================================
+# Implementation of a splash screen
+# =============================================================================
+
+class SplashScreen (wx.SplashScreen):
+
+  # ---------------------------------------------------------------------------
+  # Constructor
+  # ---------------------------------------------------------------------------
+
+  def __init__ (self):
+
+    iDir    = GConfig.getInstalledBase ('forms_images', 'common_images')
+    picture = gConfigForms ('splashScreenPNG')
+    if not os.path.isabs (picture):
+      picture = os.path.join (iDir, picture)
+
+    image = wx.Image (picture).ConvertToBitmap ()
+
+    size = image.GetSize () [1]
+
+    dc = wx.MemoryDC ()
+    dc.SelectObject (image)
+    dc.SetFont (wx.SystemSettings.GetFont (wx.SYS_DEFAULT_GUI_FONT))
+    dc.DrawText (u_('Version: %s') % VERSION, 24, size - 29)
+    dc.SelectObject (wx.NullBitmap)
+
+    wx.SplashScreen.__init__ (self, image,
+        wx.SPLASH_CENTRE_ON_SCREEN, 0, None)
+
+    wx.GetApp ().Yield ()


Property changes on: trunk/gnue-forms/src/uidrivers/wx26/UISplashScreen.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-forms/src/uidrivers/wx26/UIdriver.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/UIdriver.py     2006-01-30 12:50:29 UTC 
(rev 8149)
+++ trunk/gnue-forms/src/uidrivers/wx26/UIdriver.py     2006-02-06 13:57:33 UTC 
(rev 8150)
@@ -33,7 +33,7 @@
       _("This GNUe-Forms UI Driver requires at least wx 2.6.")
 
 from gnue.forms.uidrivers._commonGuiToolkit import UIdriver as commonToolkit
-from gnue.forms.uidrivers.wx26 import dialogs
+from gnue.forms.uidrivers.wx26 import dialogs, UISplashScreen
 
 
 # =============================================================================
@@ -83,7 +83,14 @@
     self.textWidth  = self.widgetWidth  = self.cellWidth
     self.textHeight = self.widgetHeight = self.cellHeight
 
+    if not self._disableSplash:
+      self.__splash = UISplashScreen.SplashScreen ()
+      self.__splash.Show ()
+    else:
+      self.__splash = None
 
+
+
   # ---------------------------------------------------------------------------
   # Get the widget sizes and the dimension of a form cell
   # ---------------------------------------------------------------------------
@@ -161,6 +168,9 @@
 
     assert gEnter (6)
 
+    if self.__splash is not None:
+      self.__splash.Close ()
+
     self.app.MainLoop ()
 
     assert gLeave (6)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]