Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /leo/plugins/__wx_alt_gui.py

leo
Discussion topic

Back to topic list

CVS update: /leo/plugins/__wx_alt_gui.py

Author plumloco
Full name Robert Ledger
Date 2007-11-26 02:32:11 PST
Message User: plumloco
Date: 2007-11-26 02:32:11-0800
Log:
 minor fixes

File Changes:

Directory: /leo/plugins/
========================

File [changed]: __wx_alt_gui.py
Url: http://leo.tigris.or​g/source/browse/leo/​plugins/__wx_alt_gui​.py?r1=1.6&r2=1.​7
Delta lines: +67 -55
---------------------
--- __wx_alt_gui.py 2007-10-25 16:38:54-0800 1.6
+++ __wx_alt_gui.py 2007-11-26 02:32:07-0800 1.7
@@ -1,27 +1,35 @@
-
+# -*- coding: utf-8 -*-
 #@+leo-ver=4-thin
-#@+node:bob.2007091​0154126.2:@thin __wx_alt_gui.py
+#@+node:bob.2007112​4164707:@thin __wx_alt_gui.py
 #@@first
 
 """A plugin to use wxWidgets as Leo's gui.
 
-This plugin has multiple problems and is not recommended.
+This version of wxLeo is being developed by
+
+plumloco at hcoop dot net
 
-The problems are gradually being brought under control, and a fully
-functioning wxLeo is expected before the end of 2007
+WARNING:
+__wx_alt_gui is incomplete and all features are subject to continuous
+change. It should NOT be entrusted with anything important.
 
-From revision 60 the plugin is just about useable. Although it
-still needs a lot of work, all the major components are
-behaving more or less reasonably on window and linux. It should be
-possible, with care, to use it for real work.
+USE:
 
-This version of wxLeo is being developed by plumloco at hcoop dot net
+__wx_alt_gui.py should appear as the FIRST item in the list
+of enabled plugins.
 
+All other plugins, except those named below, should be dissabled.
+
+These plugins are compatible with __wx_alt_gui.py:
+ mod_scripting.py
+ rst3.py
+ UNL.py
+ hoist.py
 """
 
 import re
 
-__revision__ = re.sub(r'^\D+([\d\.]+)\D+$', r'\1', "$Revision: 1.6 $")
+__revision__ = re.sub(r'^\D+([\d\.]+)\D+$', r'\1', "$Revision: 1.7 $")
 
 __version__ = '0.2.%s'% __revision__
 
@@ -36,7 +44,7 @@
 # 0.7.1 EKR: Fixed blunder in init.
 # 0.7.2 EKR: Put a bad hack in redraw_partial_subtree.
 #
-# forked from __wx_gui py plumloco
+# # # forked from __wx_gui py plumloco
 #
 # 0.1 plumloco: replaced wx.Tree widget with custom tree widget
 #
@@ -186,11 +194,12 @@
 
             old = leoAtFile.atFile.ope​nFileForReading
 
- def myOpenFileForReading​(self,fileName,*args​, **kw):
- g.trace( fileName)
+ def wxOpenFileForReading​(self,fileName,*args​, **kw):
+ #g.trace( fileName)
                 old(self, fileName, *args, **kw)
+ wx.Yield()
 
- leoAtFile.atFile.ope​nFileForReading = myOpenFileForReading
+ leoAtFile.atFile.ope​nFileForReading = wxOpenFileForReading
         #@-node:bob.20070831​090830:<< over rides >>
         #@nl
 
@@ -246,7 +255,7 @@
         # )
         result = c.k.masterKeyHandler​(event,stroke=keysym​)
         if not result:
- g.trace('Skip()')
+ #g.trace('Skip()')
             event.Skip()
 #@-node:bob.20070910​165627:onGlobalChar
 #@+node:bob.20070910​192953:onRogueChar
@@ -902,7 +911,7 @@
             __pychecker__ = '--no-argsused' # insert not used.
 
 
- g.trace(g.callers(20))
+ #g.trace(g.callers(20))
 
             py = self.toStcIndex
 
@@ -3900,28 +3909,28 @@
             k = self ; c = k.c
 
 
- try:
- g.trace('=== eventwidget ===',event.widget)
- g.trace('=== stroke ===', stroke)
- #g.trace('callers:', g.callers())
- except:
- g.trace('no event!')
- pass
+ # try:
+ # g.trace('=== eventwidget ===',event.widget)
+ # g.trace('=== stroke ===', stroke)
+ # g.trace('callers:', g.callers())
+ # except:
+ # g.trace('no event!')
+ # pass
 
 
 
- g.trace('focus:', self.c.get_focus())
+ #g.trace('focus:', self.c.get_focus())
 
             if event:
                 w = event.widget
             else:
                 w = c.get_focus()
 
- print '\ttarget:', w
+ #print '\ttarget:', w
 
             name = c.widget_name(w)
 
- g.trace('NAME', name)
+ #g.trace('NAME', name)
 
 
 
@@ -3929,7 +3938,7 @@
 
                 #<< handle char for body
 
- g.trace('body')
+ #g.trace('body')
                 action = k.unboundKeyAction
                 if action in ('insert','overwrite'):
                     c.editCommands.selfI​nsertCommand(event,a​ction=action)
@@ -3968,7 +3977,7 @@
 
 
                 # c.onLogKey(event)
- g.trace('log')
+ #g.trace('log')
                 pass
 
                 #>>
@@ -3985,20 +3994,20 @@
 
                 keysym = g.app.gui.eventKeysym(event)
 
- g.trace('\tfind KEYSYM', keysym)
+ #g.trace('\tfind KEYSYM', keysym)
 
                 if keysym == 'Return':
- g.trace('\tFOUND RETURN')
+ #g.trace('\tFOUND RETURN')
                     w.leoParent.findNextCommand()
                     return 'break'
 
                 if keysym == 'Tab':
- g.trace('\tFOUND TAB')
+ #g.trace('\tFOUND TAB')
                     w.leoParent.toggleTe​xtWidgetFocus(w)
                     return 'break'
 
 
- g.trace('NO SPECIAL CHARS FOUND FOR FIND')
+ #g.trace('NO SPECIAL CHARS FOUND FOR FIND')
                 return None
 
                 #>>
@@ -4006,7 +4015,7 @@
             else:
                 # Allow wx to handle the event.
                 # ch = event and event.char ; g.trace('to wx:',name,repr(ch))
- g.trace('no default key handler')
+ #g.trace('no default key handler')
                 return None
         #@-node:bob.20070901​065753:handleDefault​Char
         #@+node:bob.20070830​134722:setLabel
@@ -4431,6 +4440,14 @@
             self.forceFullRecolorFlag = True
         #@nonl
         #@-node:bob.20070813​163332.244:wxBody.fo​rceFullRecolor
+ #@+node:bob.20071124​165701:select/unsele​ctLabel
+ def unselectLabel (self,w):
+ return
+
+
+ def selectLabel (self,w):
+ return
+ #@-node:bob.20071124​165701:select/unsele​ctLabel
         #@-others
     #@nonl
     #@-node:bob.20070813​163332.236:wxLeoBody​ class (leoBody)
@@ -4534,7 +4551,7 @@
             self.Bind(wx.EVT_NOT​EBOOK_PAGE_CHANGED, self.onPageChanged)
 
         def onPageChanged(self, event):
- g.trace()
+ #g.trace()
             sel = event.GetSelection()
             if sel < 0:
                 event.Skip()
@@ -5823,8 +5840,8 @@
             ch,label = self.createAccelLabel(keys)
 
             def wxMenuCallback (event,callback=callback):
- g.trace('\nevent',event)
- print
+ #g.trace('\nevent',event)
+ #print
                 callback() # All args were bound when the callback was created.
                 event.Skip()
 
@@ -5871,7 +5888,7 @@
             n1 may be less than, grater than or equal to n2.
             """
 
- g.es('delete_range: Not yet Implemented', color='red')
+ print 'delete_range: Not yet Implemented'
 
             if not menu:
                 # g.trace("no menu")
@@ -6239,24 +6256,21 @@
         #@+node:bob.20070813​163332.315:wxLog.put​ & putnl
         # All output to the log stream eventually comes here.
 
- def put(self, s, tabName='Log', **keys):
-
+ def put (self, s, color=None, tabName=None, **keys):
 
+ if tabName:
             self.selectTab(tabName)
 
+ try:
             w = self.logCtrl.widget
-
- if not w:
- g.alert('log.put, no widget!')
- print 's'
+ except:
+ w = None
+ g.alert('log.put, can\'t write to log widget!')
+ print 'log tabName:s'
                 print
                 return
 
- colour = keys.get('colour', '') or keys.get('color', '')
- g.trace('colour')
-
- if not colour:
- colour='black'
+ colour = color or keys.get('colour', '') or 'black'
 
             if w:
                 w.BeginTextColour(colour)
@@ -6272,9 +6286,7 @@
 
         def putnl (self, tabName=None):
 
- self.put ('\n', tabName='Log')
-
-
+ self.put ('\n', tabName=tabName)
         #@-node:bob.20070813​163332.315:wxLog.put​ & putnl
         #@+node:bob.20070907211310:Tab Popup Menu
         #@+node:bob.20070907​191759.3:onShowTabMe​nu
@@ -8996,5 +9008,5 @@
     #@-node:bob.20070813​173446.12:class OutlineCanvas
     #@-node:bob.20070902164500.1:== TREE WIDGETS ==
     #@-others
-#@-node:bob.2007091​0154126.2:@thin __wx_alt_gui.py
+#@-node:bob.2007112​4164707:@thin __wx_alt_gui.py
 #@-leo

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /leo/plugins/__wx_alt_gui.py plumloco Robert Ledger 2007-11-26 02:32:11 PST
Messages per page: