Opened 17 years ago
Closed 17 years ago
#1617 closed bug (fixed)
DeskCalc BS button only deletes Keyboard presses, not mouse
Reported by: | hai_cu_be | Owned by: | jackburton |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/DeskCalc | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Try doing the following in "Desk Calculator".
- Use the mouse and click button "1" then "2".
- Use keyboard and press "3" and then "4".
- Use mouse again and press button "5" then "6".
Now, Press the BS button, first once, see how it only erases the 3,4 from the keyboard presses. Now press again and it'll put it back again.
I'm pretty sure it should delete no matter if pressed through mouse or keyboard.
SEcondly, it erases BOTH the 3 and 4, instead of just deleting one at the time
Thirdly, I would consider using "Del" instead of BS, which really doesn't make sense.
I've put all these 3 together as the general status of the BS button is to rewrite the code for it completely I suppose.
Change History (9)
comment:1 by , 17 years ago
Owner: | changed from | to
---|
comment:2 by , 17 years ago
Status: | new → assigned |
---|
follow-up: 4 comment:3 by , 17 years ago
comment:4 by , 17 years ago
Replying to stippi:
Hi Stefano, thanks for picking this up. I investigated this one a bit the other day and it should have to do with Undo and the codepath for it. If you use TextView::Insert() directly, no Undo event is generated and this is the cause for the bug. I don't know if the original DeskCalc worked the same way as the current one, you probably need to make a test to find out if R5 TextView::Insert() generates an Undo step... if not, the problem is in DeskCalc, since BS just invokes Undo().
Yes, thank you, I already studied a bit the code. AFAIK, BTextView::Insert() doesn't generate an Undo step, so I think we should just replace the BTextView::Undo() call with an appropriate BTextView::Delete() call.
follow-up: 6 comment:5 by , 17 years ago
Though I like the feature of a "Undo last typing" better than the feature to delete the last character from the string. BS could be renamed then.
comment:6 by , 17 years ago
Replying to stippi:
Though I like the feature of a "Undo last typing" better than the feature to delete the last character from the string. BS could be renamed then.
You mean just like it works now, or also including in the undo the mouse-typed stuff ?
comment:7 by , 17 years ago
Yes, like it works now for stuff you typed, but also for stuff you entered via mouse.
comment:8 by , 17 years ago
Since BTextView only generate an Undo step for stuff entered via keyboard, and since extending its undo capabilities isn't that simple, I'll just "fix" the current problem. Feel free to open a new enhancement ticket for the other part, stippi.
Hi Stefano, thanks for picking this up. I investigated this one a bit the other day and it should have to do with Undo and the codepath for it. If you use TextView::Insert() directly, no Undo event is generated and this is the cause for the bug. I don't know if the original DeskCalc worked the same way as the current one, you probably need to make a test to find out if R5 TextView::Insert() generates an Undo step... if not, the problem is in DeskCalc, since BS just invokes Undo().