RichTextCtrl - Delete key not working?

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

RichTextCtrl - Delete key not working?

 
0
  #1
Feb 15th, 2009
Hi, I have written a nice little editor using the RichTextCtrl, and so far everything is working fine, however, for some reason the delete key does not work as expected.

If I select something and hit delete then the selection is removed, but if I click anywhere in the text and hit delete, the text remains unchanged (Instead of being 'sucked' into the cursor).

Anyone have any ideas?

Cheers

Max
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 908
Reputation: Paul Thompson has a spectacular aura about Paul Thompson has a spectacular aura about 
Solved Threads: 145
Sponsor
Paul Thompson's Avatar
Paul Thompson Paul Thompson is offline Offline
previously paulthom12345

Re: RichTextCtrl - Delete key not working?

 
0
  #2
Feb 15th, 2009
Yeah i got the same issue when i did a program using a richtextctrl.
I fixed it by binding the delete key to an event where i called something along the lines of
  1. self.text.SetSelection(self.text.GetCursor()[0],self.text.GetCursor()[1]+1)
  2. self.text.DeleteSelection()

I remember having to bind it to a wx.EVT_KEY_DOWN event because i could not find one for DELETE specifically so then i just checked in the method to see if it was the delete key and then if it was the method continued to run.
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

Re: RichTextCtrl - Delete key not working?

 
0
  #3
Feb 16th, 2009
Hey Paul, thanks.

But it didn't work. I already bind to EVT_RICHTEXT_CHARACTER (Delete doesn't work with or without it), but no matter which event I use, the delete key is not doing anything, and that includes firing these events.

I also found and tried the EVT_RICHTEXT_DELETE, which picks up backspace quite nicely, but again, the Delete key doesn't even fire the event. Using EVT_KEY_DOWN works for everything on the keyboard except the delete key, and thats right up to the point where the Delete key doesn't fire the event!

And yes, the Delete key is fine!

And here's the really weird thing: If I make sure that NumLock is in the right place, the Del key on the keypad works exactly as its supposed to!

I just don't know where to go with this next, and I'm at the point of giving up and using the keypad Del key instead, as much as it annoys me to do so.

Got any ideas?

Max
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 908
Reputation: Paul Thompson has a spectacular aura about Paul Thompson has a spectacular aura about 
Solved Threads: 145
Sponsor
Paul Thompson's Avatar
Paul Thompson Paul Thompson is offline Offline
previously paulthom12345

Re: RichTextCtrl - Delete key not working?

 
0
  #4
Feb 16th, 2009
Well my next and last step would be to go to the wxpython mailing list and see if anyone there can help, i find if there is ever a problem in wx that cannot be fixed, that the mailing list really does the trick.
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

Re: RichTextCtrl - Delete key not working?

 
0
  #5
Feb 16th, 2009
Cheers Paul, Ill have to do some more hunting about.

Max
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC