[wxPython] a comment for a TextCtrl like in excel? (Did someone used excel?? =)

Thx mike,

Your 're right, but i need no wxgrid. i have no table. I have a frame
filled with Listboxes, TextCtrl's, checkboxes, blabla...
i need this note function for a wxTextCtrl. If i use wxGrids i have to
write the hole code again. I needed 3 months to come to current point. The
hole layout is ready... no no, my chef kill me! Do you know, where i have
to change the TextCtrl?? Should I implement the note function in
wxWindow-class??
I won't learn C beside python and wxpython. It's too much. I'm lost :frowning: But i 'll search forward for another way to reach the solution...

hm, sorry: I just realized the MySQL connection via ODBC, it was python...

HUGE Thx, reen

René Freund
rene@meder.de

P.S. I'm a bad english writi'n german kid, sorry, just imagine the grammar!

i need this note function for a wxTextCtrl. If i use wxGrids i have to
write the hole code again. I needed 3 months to come to current point. The
hole layout is ready... no no, my chef kill me! Do you know, where i have
to change the TextCtrl?? Should I implement the note function in
wxWindow-class??

Maybe something like this will get you started:

class CommentTextCtrl(wxTextCtrl):
    def __init__(self, parent, ID, value="", pos=wxDefaultPosition,
                 size=wxDefaultSize, comment=""):
        wxTextCtrl.__init__(self, parent, ID, value, pos, size)
        self.comment = comment
        self.doDraw = false
        EVT_PAINT(self, self.OnPaint)
        EVT_LEFT_UP(self, self.OnCheckClick)
        EVT_IDLE(self, self.OnCheckDraw)

    def OnPaint(self, evt):
        # just set a flag so the drawing is done later after
        # wxTextCtrl is done
        self.doDraw = true
        evt.Skip()

    def OnCheckDraw(self, evt):
        if self.doDraw:
            self.doDraw = false
            dc = wxClientDC(self)
            ## Now draw your triangle hotspot in the corner using dc

    def OnCheckClick(self, evt):
        pos = evt.GetPosition()
        ## pseudocode
        if position is NOT in the hostspot area:
            evt.Skip()
            return
        else:
            win = PopupCommentWindow(self, self.comment)
            win.Show(true)

The PopupCommentWindow can probably be done as Mike suggested, or however
you like.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!