Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /newedit/src/mixins/, /newedit/src/modules/

newedit
Discussion topic

Back to topic list

CVS update: /newedit/src/mixins/, /newedit/src/modules/

Reply

Author limodou
Full name limodou
Date 2004-05-13 03:24:52 PDT
Message User: limodou
Date: 04/05/13 03:24:52

Modified:
 /newedit/src/mixins/
  EditorCtrl.py, OnModified.py, __init__.py
 /newedit/src/modules/
  FindReplaceDialog.py

Log:
 Issue number:
 Obtained from:
 Submitted by:
 Reviewed by:

File Changes:

Directory: /newedit/src/mixins/
===============================

File [changed]: EditorCtrl.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/E​ditorCtrl.py?r1=1.2​&r2=1.3
Delta lines: +15 -3
--------------------
--- EditorCtrl.py 13 May 2004 07:04:49 -0000 1.2
+++ EditorCtrl.py 13 May 2004 10:24:44 -0000 1.3
@@ -74,9 +74,16 @@
             self.AddPage(ctrl, os.path.basename(ctr​l.getFilename()))
             self.switch(ctrl)
 
- def switch(self, ctrl):
- index = self.getIndex(ctrl)
+ def switch(self, document):
+ index = self.getIndex(document)
+ if index != self.GetSelection():
         self.SetSelection(index)
+ else:
+ self.mainframe.document = document
+ self.document = document
+ self.showTitle(self.document)
+ self.document.SetSTCFocus(True)
+ self.callplugin('doc​umentchange', self)
 
     def getIndex(self, ctrl):
         return self.list.index(ctrl)
@@ -160,6 +167,11 @@
     win.editctrl.list.pop(index)
     if len(win.editctrl.list) == 0:
         win.editctrl.new()
+ else:
+ if index >= len(win.editctrl.list):
+ index = len(win.editctrl.list)-1
+ print win.editctrl.list[in​dex].filename, len(win.editctrl.list)
+ win.editctrl.switch(​win.editctrl.list[in​dex])
     return answer
 Mixin.setMixin('mainframe', 'CloseFile', CloseFile)
 

File [changed]: OnModified.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/O​nModified.py?r1=1.2​&r2=1.3
Delta lines: +6 -9
-------------------
--- OnModified.py 13 May 2004 07:04:49 -0000 1.2
+++ OnModified.py 13 May 2004 10:24:44 -0000 1.3
@@ -6,12 +6,9 @@
 Mixin.setPlugin('editor', 'init', init)
 
 def OnModified(win, event):
-# if (win.GetModify()):
-# win.editctrl.showTitle(win)
-# else:
-# win.SetSavePoint()
-# win.editctrl.showTitle(win)
-# import os.path
-# win.editctrl.SetPage​Text(win.editctrl.ge​tIndex(win), os.path.basename(win​.getFilename()))
- pass
+ if win.GetModify():
+ win.mainframe.SetTitle("%s - [%s *]" % (win.app.appname, win.getFilename()))
+ else:
+ win.SetSavePoint()
+ win.mainframe.SetTitle("%s - [%s]" % (win.app.appname, win.getFilename()))
 Mixin.setMixin('editor', 'OnModified', OnModified)
\ No newline at end of file

File [changed]: __init__.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/_​_init__.py?r1=1.2​&r2=1.3
Delta lines: +11 -10
---------------------
--- __init__.py 13 May 2004 07:04:49 -0000 1.2
+++ __init__.py 13 May 2004 10:24:44 -0000 1.3
@@ -1,17 +1,18 @@
 __all__ = [
     'Pref',
     'MainFrame',
- 'EditorCtrl',
- 'DefaultMenu',
- 'StatusBar',
     'MainSubFrame',
+ 'EditorCtrl',
     'Editor',
+ 'DefaultMenu',
+
+# 'ComEdit',
+# 'StatusBar',
     'OnModified',
- 'ComEdit',
- 'Toolbar',
- 'icon',
- 'RecentFile',
- 'Search',
- 'OnPosition',
- 'Lineending',
+# 'Toolbar',
+# 'icon',
+# 'RecentFile',
+# 'Search',
+# 'OnPosition',
+# 'Lineending',
 ]

Directory: /newedit/src/modules/
====================​============

File [changed]: FindReplaceDialog.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/modules/​FindReplaceDialog.py​?r1=1.2&r2=1.3
Delta lines: +4 -6
-------------------
--- FindReplaceDialog.py 13 May 2004 07:04:49 -0000 1.2
+++ FindReplaceDialog.py 13 May 2004 10:24:44 -0000 1.3
@@ -67,7 +67,9 @@
         pos = self.win.FindText(self.lastpos, 0, self.findtext, self.getFlags())
         if pos == -1: #not found
             if self.rewind:
+ print 'rewind'
                 pos = self.win.FindText(se​lf.win.GetLength(), self.lastpos, self.findtext, self.getFlags())
+ print 'dddd'
             if pos == -1:
                 wx.MessageDialog(self.win, "Cann't find the text [%s]" % self.findtext, "Find result", wx.OK).ShowModal()
                 return
@@ -484,17 +486,11 @@
             eolchar = '\r\n'
         else:
             eolchar = '\n'
-# if (len(text) > 0) and (len(text.splitlines()) == 0):
         if (len(text) > 0) and (text.count(eolchar) == 0):
             self.obj_ID_FINDTEXT​.SetValue(text)
             self.finder.findtext = text
- for c in text:
- print ord(c)
- print 4
         else:
             self.obj_ID_FINDTEXT​.SetValue(self.finde​r.findtext)
- print self.finder.findtext
- print 5
 
         for s in self.pref.findtexts:
             self.obj_ID_FINDTEXT.Append(s)
@@ -508,6 +504,8 @@
         self.finder.wholeword = self.obj_ID_WHOLEWOR​D.GetValue()
         self.finder.fromcursor = self.obj_ID_FROMCURS​OR.GetValue()
         self.finder.beginFin​d(self.obj_ID_DIRECT​ION.GetSelection())
+
+ self.obj_ID_FROMCURS​OR.SetValue(True)
 
     def addString(self, text):
         if self.pref.findtexts.count(text) > 0:




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@newe​dit.tigris.org
For additional commands, e-mail: cvs-help at newedit dot tigris dot org

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

Messages

Show all messages in topic

CVS update: /newedit/src/mixins/, /newedit/src/modules/ limodou limodou 2004-05-13 03:24:52 PDT
Messages per page: