Python wx.CAP_BUTT Examples
The following are 3
code examples of wx.CAP_BUTT().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: GraphicCommons.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
def DrawHighlightment(self, dc): scalex, scaley = dc.GetUserScale() dc.SetUserScale(1, 1) pen = MiterPen(HIGHLIGHTCOLOR, 2 * scalex + 5) pen.SetCap(wx.CAP_BUTT) dc.SetPen(pen) dc.SetBrush(wx.Brush(HIGHLIGHTCOLOR)) dc.SetLogicalFunction(wx.AND) parent_pos = self.ParentBlock.GetPosition() xstart = parent_pos[0] + self.Pos.x ystart = parent_pos[1] + self.Pos.y if self.Direction[0] < 0: xstart += 1 if self.Direction[1] < 0: ystart += 1 xend = xstart + CONNECTOR_SIZE * self.Direction[0] yend = ystart + CONNECTOR_SIZE * self.Direction[1] dc.DrawLine(round((xstart + self.Direction[0]) * scalex), round((ystart + self.Direction[1]) * scaley), round(xend * scalex), round(yend * scaley)) dc.SetLogicalFunction(wx.COPY) dc.SetUserScale(scalex, scaley) # Adds an highlight to the connector
Example #2
Source File: OLVPrinter.py From bookhub with MIT License | 5 votes |
def SetGridPen(self, pen): """ Set the pen used to draw a grid in this format """ self.gridPen = pen if self.gridPen: # Other styles don't produce nice joins self.gridPen.SetCap(wx.CAP_BUTT) self.gridPen.SetJoin(wx.JOIN_MITER)
Example #3
Source File: ListCtrlPrinter.py From bookhub with MIT License | 5 votes |
def SetGridPen(self, pen): """ Set the pen used to draw a grid in this format """ self.gridPen = pen if self.gridPen: # Other styles don't produce nice joins self.gridPen.SetCap(wx.CAP_BUTT) self.gridPen.SetJoin(wx.JOIN_MITER)