wxStyledTextCtrl and sql syntax highlightning

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pierre_py

    #1

    wxStyledTextCtrl and sql syntax highlightning

    Hi.
    I use wxPy version 2.4.2 for Python 2.3.

    Now I wanted to use the wxStyledTextCtr l for viewing (editing) of sql
    code.

    I have the following:
    self.__m_styled _text_ctrl = wxPython.stc.wx StyledTextCtrl(
    self, wx.NewId(),
    style=wxPython. wx.wxNO_FULL_RE PAINT_ON_RESIZE )
    self.__m_styled _text_ctrl.SetL exer(wxPython.s tc.wxSTC_LEX_SQ L)
    self.__m_styled _text_ctrl.SetP roperty("fold", "1")
    self.__m_styled _text_ctrl.SetM argins(0,0)
    self.__m_styled _text_ctrl.SetK eyWords(0, SQL_KEYWORDS)

    Where sql_keywords is string with space separated sql keywords.

    When i add text to the ctrl i don't get the right highlightning.

    What do i do wrong and what else do i have to specify?

    thx in advance

  • jean-michel bain-cornu

    #2
    Re: wxStyledTextCtr l and sql syntax highlightning

    > I have the following:[color=blue]
    > self.__m_styled _text_ctrl = wxPython.stc.wx StyledTextCtrl(
    > self, wx.NewId(),
    > style=wxPython. wx.wxNO_FULL_RE PAINT_ON_RESIZE )
    > self.__m_styled _text_ctrl.SetL exer(wxPython.s tc.wxSTC_LEX_SQ L)
    > self.__m_styled _text_ctrl.SetP roperty("fold", "1")
    > self.__m_styled _text_ctrl.SetM argins(0,0)
    > self.__m_styled _text_ctrl.SetK eyWords(0, SQL_KEYWORDS)[/color]
    Hi Pierre,
    I'd like to do some tests with your stuff, but I'd appreciate to have a
    working sample. Would you like to post it ?
    Regards,
    jm

    Comment

    • pierre_py

      #3
      Re: wxStyledTextCtr l and sql syntax highlightning

      Hi.

      Thanks it works now .. i must reset the default styles with
      StyleClearAll and then set the styles apropriate again.

      Is there a way that the keyword list isn't case sensitive, as sql
      isn't.

      reg,
      Pierre

      jean-michel bain-cornu wrote:[color=blue][color=green]
      > > I have the following:
      > > self.__m_styled _text_ctrl = wxPython.stc.wx StyledTextCtrl(
      > > self, wx.NewId(),
      > > style=wxPython. wx.wxNO_FULL_RE PAINT_ON_RESIZE )
      > > self.__m_styled _text_ctrl.SetL exer(wxPython.s tc.wxSTC_LEX_SQ L)
      > > self.__m_styled _text_ctrl.SetP roperty("fold", "1")
      > > self.__m_styled _text_ctrl.SetM argins(0,0)
      > > self.__m_styled _text_ctrl.SetK eyWords(0, SQL_KEYWORDS)[/color]
      > Hi Pierre,
      > I'd like to do some tests with your stuff, but I'd appreciate to have a
      > working sample. Would you like to post it ?
      > Regards,
      > jm[/color]

      Comment

      Working...