wx.stc definitions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

wx.stc definitions

juanhernandez98

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,

 

 

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wx.stc definitions

Dietmar Schwertberger-2
On 4/12/2018 6:37 AM, [hidden email] wrote:

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

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: https://www.scintilla.org/ScintillaDoc.html


Regards,

Dietmar


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wx.stc definitions

Tim Roberts
In reply to this post by juanhernandez98
 

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.


Did you look at the documentation?  The source doesn't have all the answers.
    http://docs.wxwidgets.org/3.0/classwx_styled_text_ctrl.htm

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.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.