tsn-admin / wxpystc_docmap Goto Github PK
View Code? Open in Web Editor NEWDocument map (aka minimap) for wx.stc.StyledTextCtrl editor control
License: MIT License
Document map (aka minimap) for wx.stc.StyledTextCtrl editor control
License: MIT License
This:
line 165, in Motion pos = (self.dragStartPos[0], top_y + self.hotspot[1]) AttributeError: 'DocumentMap' object has no attribute 'dragStartPos'
For a first-pass at the code, I would like to say you have done a good job. :)
There are a few things that don't quite work as I would expect.
Dragging on the minimap and moving the mouse outside the minimap doesnt scroll properly like I've seen other implementations of a minimap do.(either dragging up or down the document)
This should be changed self.SetDoubleBuffered(True)
to
if not self.IsDoubleBuffered():
self.SetDoubleBuffered(True)
Robin states that some platforms are already DoubleBuffered by default, and doing it without a check would x4 or in otherwords make performance worse.
def SetTransparency(self, alpha=0x80):
img = self.bmp.ConvertToImage()
if not img.HasAlpha():
img.InitAlpha()
for x in range(img.Width):
for y in range(img.Height):
img.SetAlpha(x, y, alpha)
self.bmp = img.ConvertToBitmap()
would run faster as
def SetTransparency(self, alpha=0x80):
img = self.bmp.ConvertToImage()
if not img.HasAlpha():
img.InitAlpha()
width, height = img.Width, img.Height
SetAlpha = img.SetAlpha
[SetAlpha(x, y, alpha)
for y in range(height)
for x in range(width)]
self.bmp = img.ConvertToBitmap()
#INFO, Class with too many parameters: better design strategy?
, I personally will put all that stuff with the defaults in the class constructor, so it shows up when you request a calltip, but am not sure if that really should be written another way. I would assume most folks would only use 1 minimap, but I wouldnt rule out someone using it with dynamic sash or multisash type of setup.I think that's all I see at the moment. Thanks for spending the time to code this thing up! I always had it on my list of widgets to implement, but never seemed to get the time to code one up.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.