I wanted only to show, what things you can make with a plugin. I and Dan were of different opinions about the Col Display.
When the cursor is on the first column, I wanted it displayed: Col: 1, Dan Col:0
So I integrated an awkward solution (not directly exemplary): Redirect the output of SetStatusText
This is in my Mini-Plugin "Startup" : (I inserted '->' to show, where the tab should be; posting to forum destroys the formatting)
import wx from drpython import DrFrame
def Plugin(DrFrame):
->def SetStatusText(text, col): ->->if col == 1: ->->->#text.find ->->->ind1 = text.find ("Col: ") ->->->if ind1 > -1: ->->->->ind1 += len ("Col: "); ->->->->ind2 = text.find (" ", ind1) ->->->->nr = int (text [ind1:ind2]) + 1 ->->->->text = text [:ind1] + str (nr) + text[ind2:] ->->super(type(DrFrame), DrFrame).SetStatusText(text, col)
->def NewStatusText(text, col=0): ->->SetStatusText(text, col)
->setattr(DrFrame, 'SetStatusText', NewStatusText)
Nice, I like the method of showing indentation.
You do not need the line "from drpython import DrFrame" for this plugin.
Log in to post a comment.
I wanted only to show, what things you can make with a plugin.
I and Dan were of different opinions about the Col Display.
When the cursor is on the first column, I wanted it displayed: Col: 1, Dan Col:0
So I integrated an awkward solution (not directly exemplary):
Redirect the output of SetStatusText
This is in my Mini-Plugin "Startup" :
(I inserted '->' to show, where the tab should be; posting
to forum destroys the formatting)
import wx
from drpython import DrFrame
def Plugin(DrFrame):
->def SetStatusText(text, col):
->->if col == 1:
->->->#text.find
->->->ind1 = text.find ("Col: ")
->->->if ind1 > -1:
->->->->ind1 += len ("Col: ");
->->->->ind2 = text.find (" ", ind1)
->->->->nr = int (text [ind1:ind2]) + 1
->->->->text = text [:ind1] + str (nr) + text[ind2:]
->->super(type(DrFrame), DrFrame).SetStatusText(text, col)
->def NewStatusText(text, col=0):
->->SetStatusText(text, col)
->setattr(DrFrame, 'SetStatusText', NewStatusText)
Nice, I like the method of showing indentation.
You do not need the line
"from drpython import DrFrame"
for this plugin.