Hi All,
I am trying to learn about the stc.StyledTextCtrl, and I am looking at one of the source files in the demos package, styledtext2.py, or something like that.
The two lines:
self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN)
self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
the 2nd and 3rd arguments, I’ve searched everywhere in wx.stc, and I cannot find where they are defined.
I did find in stc.pyi, that the
STC_CMD_ZOOMOUT was set to 0
And the same for ZoomIn.
What gives?
Sorry for such a beginner question if it is. I am just trying to grasp this stc control.
Best,
the 2^nd and 3^rd arguments, I’ve searched everywhere in wx.stc, and I cannot find where they are defined.
I did find in stc.pyi, that the
STC_CMD_ZOOMOUT was set to 0
The most of these constants are defined in the _stc binary library, e.g. _stc.cp36-win32.pyd.
I've just tried on Windows with Python 3.6:
>>> import wx.stc
>>> wx.stc
<module 'wx.stc' from 'D:\\Python\\Python36\\lib\\site-packages\\wx\\stc.py'>
>>> wx.stc.STC_SCMOD_CTRL
2
The stc.pyi file is just there to help IDEs with code completion. Unfortunately the values listed there are not the correct ones but just 0.
The file will not be used by Python so the wrong values don't matter.
You probably need to look at the Scintilla documentation: Scintilla Documentation
Regards,
Dietmar
···
On 4/12/2018 6:37 AM, juanhernandez98@gmail.com wrote:
Did you look at the documentation? The source doesn’t have all the
answers.
The purpose of CmdKeyAssign is to assign functions to shortcut
keys. The first parameter gives the raw key code, the second
parameter gives the modifiers, and the third parameter says what
function to perform. So, the first line says that control-B should
trigger the zoom in function. The second line says that control-B
should trigger the zoom out function.
···
wrote:
juanhernandez98@gmail.com
I am trying to learn about the
stc.StyledTextCtrl, and I am looking at one of the source
files in the demos package, styledtext2.py, or something like
that.
The two lines:
self.CmdKeyAssign(ord(‘B’ ),
stc .STC_SCMOD_CTRL,
stc.STC_CMD_ZOOMIN)
self.CmdKeyAssign(ord(‘N’ ),
stc .STC_SCMOD_CTRL,
stc.STC_CMD_ZOOMOUT)
the 2nd and 3rd
arguments, I’ve searched everywhere in wx.stc, and I cannot
find where they are defined.
http://docs.wxwidgets.org/3.0/classwx_styled_text_ctrl.htm
-- Tim Roberts, Providenza & Boekelheide, Inc.
timr@probo.com