Login | Register
My pages Projects Community openCollabNet

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

newedit
Discussion topic

Back to topic list

CVS update: /newedit/src/modules/

Reply

Author limodou
Full name limodou
Date 2004-05-10 22:12:46 PDT
Message User: limodou
Date: 04/05/10 22:12:46

Modified:
 /newedit/src/modules/
  Editor.py, EditorCtrl.py, MainSubFrame.py, OnModified.py

Log:
 Issue number:
 Obtained from:
 Submitted by:
 Reviewed by:
 Adjust Editor style

File Changes:

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

File [changed]: Editor.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/modules/​Editor.py?r1=1.2​&r2=1.3
Delta lines: +27 -0
--------------------
--- Editor.py 10 May 2004 14:17:03 -0000 1.2
+++ Editor.py 11 May 2004 05:12:42 -0000 1.3
@@ -25,8 +25,35 @@
         #make popup menu
         self.popmenu = makemenu.makepopmenu(self, self.popmenulist)
 
+ #editor style
+ self.SetMargins(0,0) #set left and right outer margins to 0 width
+ self.setLineNumberMargin()
+
+ self.SetMarginWidth(1, 16) #margin 1 for symbols, 16 px wide
+ self.SetMarginType(1, wx.stc.STC_MARGIN_SYMBOL)
+
+ #Setup a margin to hold fold markers
+ self.SetMarginType(2, wx.stc.STC_MARGIN_SYMBOL) #margin 2 for symbols
+ self.SetMarginMask(2, wx.stc.STC_MASK_FOLDERS) #set up mask for folding symbols
+ self.SetMarginSensitive(2, True) #this one needs to be mouse-aware
+ self.SetMarginWidth(2, 16) #set margin 2 16 px wide
+
+ #define folding markers
+ self.MarkerDefine(wx​.stc.STC_MARKNUM_FOL​DEREND, wx.stc.STC_MARK_BOXP​LUSCONNECTED, "white", "black")
+ self.MarkerDefine(wx​.stc.STC_MARKNUM_FOL​DEROPENMID, wx.stc.STC_MARK_BOXM​INUSCONNECTED, "white", "black")
+ self.MarkerDefine(wx​.stc.STC_MARKNUM_FOL​DERMIDTAIL, wx.stc.STC_MARK_TCORNER, "white", "black")
+ self.MarkerDefine(wx​.stc.STC_MARKNUM_FOL​DERTAIL, wx.stc.STC_MARK_LCORNER, "white", "black")
+ self.MarkerDefine(wx​.stc.STC_MARKNUM_FOL​DERSUB, wx.stc.STC_MARK_VLINE, "white", "black")
+ self.MarkerDefine(wx​.stc.STC_MARKNUM_FOL​DER, wx.stc.STC_MARK_BOXPLUS, "white", "black")
+ self.MarkerDefine(wx​.stc.STC_MARKNUM_FOL​DEROPEN, wx.stc.STC_MARK_BOXMINUS, "white", "black")
+
         #INTERFACE: editor,setevent,win
         self.callplugin('init', self)
+
+ def setLineNumberMargin(self):
+ lines = self.GetLineCount() #get # of lines, ensure text is loaded first!
+ width = self.TextWidth(wx.st​c.STC_STYLE_LINENUMB​ER, str(9999)+' ')
+ self.SetMarginWidth(0, width)
 
     def reset(self, filename):
         self.filename = filename

File [changed]: EditorCtrl.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/modules/​EditorCtrl.py?r1=1.2​&r2=1.3
Delta lines: +3 -2
-------------------
--- EditorCtrl.py 10 May 2004 14:17:03 -0000 1.2
+++ EditorCtrl.py 11 May 2004 05:12:42 -0000 1.3
@@ -115,7 +115,7 @@
             self.mainframe.OnFil​eSaveAs(event)
 
 def neweditctrl(win):
- win.notebook = EditCtrl(win, wx.NB_FIXEDWIDTH)
+ win.notebook = EditCtrl(win, 0)
 Mixin.setPlugin('mainsubframe', 'init', neweditctrl)
 
 def OnFileNew(win, event):
@@ -146,7 +146,8 @@
 def CloseFile(win, ctrl):
     answer = wx.ID_YES
     if (ctrl.GetModify()):
- d = wx.MessageDialog(win, "Would you like to save %s ?" % win.document.getFilename(), "DrPython", wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
+ d = wx.MessageDialog(win, "Would you like to save %s ?" % win.document.getFilename(),
+ "DrPython", wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
         answer = d.ShowModal()
         d.Destroy()
         if (answer == wx.ID_YES):

File [changed]: MainSubFrame.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/modules/​MainSubFrame.py?r1=1​.1&r2=1.2
Delta lines: +9 -9
-------------------
--- MainSubFrame.py 8 May 2004 14:25:28 -0000 1.1
+++ MainSubFrame.py 11 May 2004 05:12:42 -0000 1.2
@@ -1,31 +1,31 @@
 import Mixin
-from wx import *
+import wx
 
-class MainSubFrame(SashLayoutWindow, Mixin.Mixin):
+class MainSubFrame(wx.Sash​LayoutWindow, Mixin.Mixin):
 
     __mixinname__ = 'mainsubframe'
 
     def __init__(self, parent, size, orient, align, sash, sashvisible=True):
         self.initmixin()
 
- SashLayoutWindow.__init__(self, parent, -1, DefaultPosition, Size(10, 10), style = NO_BORDER|SW_3D)
+ wx.SashLayoutWindow.​__init__(self, parent, -1, wx.DefaultPosition, wx.Size(10, 10), style = wx.NO_BORDER|wx.SW_3D)
         self.parent = parent
         self.parent.mainsubframe = self
         self.id = self.GetId()
 
- EVT_SASH_DRAGGED(self.parent, self.id, self.parent.OnSashDrag)
- EVT_SIZE(self.parent, self.parent.OnSize)
+ wx.EVT_SASH_DRAGGED(​self.parent, self.id, self.parent.OnSashDrag)
+ wx.EVT_SIZE(self.parent, self.parent.OnSize)
 
         self.SetDefaultSize(size)
         self.SetOrientation(orient)
         self.SetAlignment(align)
- self.SetBackgroundCo​lour(Colour(0, 0, 0))
+ self.SetBackgroundCo​lour(wx.Colour(0, 0, 0))
         self.SetSashVisible(sash, sashvisible)
 
         self.callplugin('init', self)
 
 def OnSashDrag(self, event):
- if event.GetDragStatus() == SASH_STATUS_OUT_OF_RANGE:
+ if event.GetDragStatus() == wx.SASH_STATUS_OUT_OF_RANGE:
         return
 
     eID = event.GetId()
@@ -36,7 +36,7 @@
 
 def OnSize(self, event):
     self.callplugin('ons​ize_plugin', self, event)
- LayoutAlgorithm().La​youtWindow(self, self.mainsubframe)
+ wx.LayoutAlgorithm()​.LayoutWindow(self, self.mainsubframe)
 Mixin.setMixin('mainframe', 'OnSize', OnSize)
 
 def onsashdrag_plugin(win, event):
@@ -50,5 +50,5 @@
 Mixin.setPlugin('mainframe', 'onsize_plugin', onsize_plugin)
 
 def newsubmainframe(parent):
- return MainSubFrame(parent, Size(10, 10), LAYOUT_HORIZONTAL, LAYOUT_TOP, SASH_BOTTOM, False)
+ return MainSubFrame(parent, wx.Size(10, 10), wx.LAYOUT_HORIZONTAL, wx.LAYOUT_TOP, wx.SASH_BOTTOM, False)
 Mixin.setPlugin('mainframe', 'init', newsubmainframe)

File [changed]: OnModified.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/modules/​OnModified.py?r1=1.1​&r2=1.2
Delta lines: +3 -0
-------------------
--- OnModified.py 8 May 2004 14:25:28 -0000 1.1
+++ OnModified.py 11 May 2004 05:12:42 -0000 1.2
@@ -13,4 +13,7 @@
     else:
         win.SetSavePoint()
         win.editctrl.showTitle(win)
+
+ self.setLineNumberMargin()
+
 Mixin.setMixin('editor', 'OnModified', OnModified)




--------------------​--------------------​--------------------​---------
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/modules/ limodou limodou 2004-05-10 22:12:46 PDT
Messages per page: