[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7936 - in trunk/gnue-forms/src/uidrivers/gtk2: . widgets/form
From: |
johannes |
Subject: |
[gnue] r7936 - in trunk/gnue-forms/src/uidrivers/gtk2: . widgets/form |
Date: |
Wed, 28 Sep 2005 12:35:27 -0500 (CDT) |
Author: johannes
Date: 2005-09-21 04:04:24 -0500 (Wed, 21 Sep 2005)
New Revision: 7936
Modified:
trunk/gnue-forms/src/uidrivers/gtk2/MenuBar.py
trunk/gnue-forms/src/uidrivers/gtk2/SplashScreen.py
trunk/gnue-forms/src/uidrivers/gtk2/UIdriver.py
trunk/gnue-forms/src/uidrivers/gtk2/widgets/form/widget.py
Log:
Fixed display and selection of menu items, cleaned up splash screen
Modified: trunk/gnue-forms/src/uidrivers/gtk2/MenuBar.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/MenuBar.py 2005-09-21 09:02:17 UTC
(rev 7935)
+++ trunk/gnue-forms/src/uidrivers/gtk2/MenuBar.py 2005-09-21 09:04:24 UTC
(rev 7936)
@@ -22,7 +22,6 @@
# $Id$
import gtk
-import string
from gnue.forms.uidrivers._commonGuiToolkit.MenuBar import MenuBar as Base
@@ -56,9 +55,7 @@
# ---------------------------------------------------------------------------
def correctLabel (self, label):
- # TODO: remove decode step, when gettext translations are send
- # in unicode instead of local encoding
- return string.replace (label, '&', '_')
+ return label.replace ('&', '_')
# ---------------------------------------------------------------------------
# Add a (sub)menu
@@ -127,7 +124,7 @@
def _selectHandler (self, menuItem, userAction):
self.container._setStatusBar (userAction.description, None, None, None,
- None, None, None)
+ None, None, None, procMsg = False)
# ---------------------------------------------------------------------------
@@ -136,7 +133,8 @@
def _deselectHandler (self, menuItem, userAction):
- self.container._setStatusBar ('', None, None, None, None, None, None)
+ self.container._setStatusBar ('', None, None, None, None, None, None,
+ procMsg = False)
# ---------------------------------------------------------------------------
Modified: trunk/gnue-forms/src/uidrivers/gtk2/SplashScreen.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/SplashScreen.py 2005-09-21 09:02:17 UTC
(rev 7935)
+++ trunk/gnue-forms/src/uidrivers/gtk2/SplashScreen.py 2005-09-21 09:04:24 UTC
(rev 7936)
@@ -1,6 +1,9 @@
+# GNU Enterprise Forms - GTK UI Driver - Splash screen
#
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 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
@@ -16,80 +19,72 @@
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# SplashScreen.py
-#
-# DESCRIPTION:
-# A GTK2 based splash screen
-#
-# NOTES:
-#
+# $Id$
-import os.path
import gtk
import gobject
+import os.path
+
from gnue.common.apps import GConfig
-from gnue.forms import VERSION
-class UISplashScreen(gtk.Window):
- # is there a default gtk2 splashscreen to inherit?
- def __init__(self):
- images_dir = GConfig.getInstalledBase('forms_images','common_images') + '/'
- if os.path.isabs(gConfigForms('splashScreenPNG')):
- bitmapFile=gConfigForms('splashScreenPNG')
- else:
- bitmapFile=images_dir+gConfigForms('splashScreenPNG')
+# =============================================================================
+# A splash screen window
+# =============================================================================
-
- gtk.Window.__init__(self, True)
+class UISplashScreen (gtk.Window):
+
+ # ---------------------------------------------------------------------------
+ # Constructor
+ # ---------------------------------------------------------------------------
+
+ def __init__ (self):
+
+ gtk.Window.__init__ (self, True)
+
# not the best, but working decision
- self.connect('destroy', lambda win: self.hide())
- self.set_resizable(True)
- self.resize(525,200)
- self.set_modal(1)
- self.set_position(1) # for center
- img = gtk.Image()
- img.set_from_file(images_dir + gConfigForms('splashScreenPNG'))
- box=gtk.VBox()
- self.add(box)
- box.add(img)
- box.add(gtk.Label('GNU Enterprise'))
- box.add(gtk.Label("Protected by GNU General Public Licence 2.0"))
- # use drawingarea instead, see:
- #
http://www.moeraki.com/pygtktutorial/pygtk2tutorial/sec-DrawingMethods.html
- # Make the splash text print white
- #self.SetForegroundColour(wxColour(0xFF, 0xFF, 0xFF))
- #self.SetFont(wxFont(20,wxSWISS,wxNORMAL,wxBOLD))
+ self.set_resizable (True)
+ self.resize (525, 200)
+ self.set_modal (1)
+ self.set_position (1) # for center
- #text = _("GNU Enterprise Forms")
- #twidth,theight = self.GetTextExtent(text)
- #wxStaticText(parent=self, id=-1, label=str(text),
- #
size=wxSize(swidth,theight),pos=wxPoint(1,1),style=wxALIGN_CENTRE)
+ images_dir = GConfig.getInstalledBase ('forms_images', 'common_images')
- #self.SetFont(wxFont(10,wxSWISS,wxNORMAL,wxBOLD))
-
- #text = _("Version %s") % VERSION
- #twidth,theight = self.GetTextExtent(text)
- #wxStaticText(parent=self, id=-1, label=str(text),
- # size=wxSize(swidth,theight),
pos=wxPoint(1,25),style=wxALIGN_CENTRE)
+ if os.path.isabs (gConfigForms ('splashScreenPNG')):
+ bitmapFile = gConfigForms ('splashScreenPNG')
+ else:
+ bitmapFile = os.path.join (images_dir, gConfigForms ('splashScreenPNG'))
- #text = "(c)2000-2002 Free Software Foundation"
- #twidth,theight = self.GetTextExtent(text)
- #wxStaticText(self, -1, str(text),
- # wxPoint(1,50),wxSize(swidth,theight),wxALIGN_CENTRE)
+ img = gtk.Image ()
+ img.set_from_file (bitmapFile)
+ box = gtk.VBox ()
+ self.add (box)
+ box.add (img)
+ box.add (gtk.Label ('GNU Enterprise'))
+ box.add (gtk.Label ("Protected by GNU General Public Licence 2.0"))
- #text = _("Protected by GNU General Public Licence 2.0")
- #wxStaticText(self, -1, str(text),
- #
wxPoint(1,sheight-(theight+10)),wxSize(swidth-5,theight),wxALIGN_RIGHT)
- #self.CenterOnScreen()
+ # ---------------------------------------------------------------------------
+ # Show the window
+ # ---------------------------------------------------------------------------
- def Show(self):
- gobject.timeout_add(1500,lambda splash: splash.destroy(),self)
- self.show_all()
- self.show_now()
+ def Show (self):
+ """
+ Show the splash screen window and add a timeout of 1.5 seconds.
+ """
- def onCloseSplash(self):
- pass
+ gobject.timeout_add (1500, self.Destroy)
+ self.show_all ()
+ self.show_now ()
+
+
+ # ---------------------------------------------------------------------------
+ # Destroy (and hide) the window
+ # ---------------------------------------------------------------------------
+
+ def Destroy (self):
+ """
+ Destroy (and hide) the splash screen. This function get's called
+ automatically 1.5 seconds after Show () has been called.
+ """
+
+ self.destroy ()
Property changes on: trunk/gnue-forms/src/uidrivers/gtk2/SplashScreen.py
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: trunk/gnue-forms/src/uidrivers/gtk2/UIdriver.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/UIdriver.py 2005-09-21 09:02:17 UTC
(rev 7935)
+++ trunk/gnue-forms/src/uidrivers/gtk2/UIdriver.py 2005-09-21 09:04:24 UTC
(rev 7936)
@@ -115,7 +115,6 @@
if not self._disableSplash:
self.splash = UISplashScreen ()
self.splash.Show ()
- gobject.timeout_add (1500, lambda splash: splash.destroy (), self.splash)
self.font = APPFONT
Modified: trunk/gnue-forms/src/uidrivers/gtk2/widgets/form/widget.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/widgets/form/widget.py 2005-09-21
09:02:17 UTC (rev 7935)
+++ trunk/gnue-forms/src/uidrivers/gtk2/widgets/form/widget.py 2005-09-21
09:04:24 UTC (rev 7936)
@@ -189,7 +189,7 @@
# ---------------------------------------------------------------------------
def _setStatusBar (self, tip, statusValue, insertValue, currentRecord,
- maxRecord, currentPage, maxPage):
+ maxRecord, currentPage, maxPage, procMsg = True):
if not hasattr (self, 'statusBar1'):
return
@@ -217,7 +217,8 @@
text = string.strip ("%s/%s" % (currentPage, maxPage))
self.statusBar5.push (context, self._makeSafe (text))
- self._uiDriver.processMessages ()
+ if procMsg:
+ self._uiDriver.processMessages ()
# ---------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7936 - in trunk/gnue-forms/src/uidrivers/gtk2: . widgets/form,
johannes <=