![]() |
| ||
| Detecting changes in RichTextCtrl Hi there. I am using a RichTextCtrl on a window with a toolbar. The toolbar has a save button on it that is disabled by default when the application starts. I need this button to become enabled when the user changes something in the RichTextCtrl, but I'm having trouble working out how to detect such a change. I managed to create a KEY_DOWN event for the RichTextCtrl, but while that allowed me to enable the save button, it also prevented me from typing anything! Can anyone point me in the right direction please? regards Max |
| ||
| Re: Detecting changes in RichTextCtrl try using wx.EVT_TEXT and bind it to the Rich Text control. |
| ||
| Re: Detecting changes in RichTextCtrl Ah thanks Paul - That did it! I'm playing with the code now (at least until I have to do some more work!) and I want to pick up some key presses to activate various functions (Bold etc). Is this the right event to do this in, or is there a better way? Regards Max |
| ||
| Re: Detecting changes in RichTextCtrl I think the better way would just be to map CTRL+<character> to the items under an Edit menu. ie, File, Edit, Help |
| ||
| Re: Detecting changes in RichTextCtrl Hmm, thanks. I was hoping to avoid a menu since it wouldn't necessarily fit into what the window would be doing, but it might prove the easiest way to do this. Thanks for your help Regards Max |
| ||
| Re: Detecting changes in RichTextCtrl Are you trying to make a text editor? In my opinion, a text editor would most definitely benefit from a menu system. |
| ||
| Re: Detecting changes in RichTextCtrl Hmm. Text Editor. Well, sort of. I'm an author, and the program is called 'Author Tool'. It does incorporate a text editor, but the menu would be sort of superfluous - As a tool it is designed to speed up my writing, which means Keyboard shortcuts for pretty much everything that I might do while actually typing. I use a toolbar for navigation, character creation etc. I'm trying to re-write this program in Python, basically as a learning exercise - I have a copy that I use most days, written in Gambas. Regards Max |
| ||
| Re: Detecting changes in RichTextCtrl I guess what you could do is set up a menu with the CTRL+<Letter> shortcuts binded and then just keep it hidden. That way the bindings are taken care of but you don't have to see it... |
| ||
| Re: Detecting changes in RichTextCtrl Yes, I was thinking along those lines because it looks a lot simpler than setting up a large number of shortcuts for the rich text control. Thanks Max |
| All times are GMT -4. The time now is 2:56 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC