View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005178 | JEDI VCL | 00 JVCL Components | public | 2010-02-24 08:34 | 2011-06-10 16:09 |
Reporter | TheRoadrunner | Assigned To | AHUser | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.38 | ||||
Target Version | Fixed in Version | 3.40 | |||
Summary | 0005178: TJvCustomEditorBase.ClearSelection does not clear, just deselects | ||||
Description | Using a TJVHLEditor wired up with a TJvEditDelete action does not work when text is seleceted and 'Delete' is pressed. | ||||
Additional Information | procedure TJvCustomEditorBase.ClearSelection; begin SetUnSelected; end; should be changed to: procedure TJvCustomEditorBase.ClearSelection; begin DeleteSelected; end; | ||||
Tags | No tags attached. | ||||
|
I'm sorry, but clearing the selection is just meant to unselect everything, not delete the selected text. |
|
I'm sorry too, but you are wrong. Look at the implementation of TCustomEdit or look at the docs: Description Use ClearSelection to delete the selected text from the edit control. If no text is selected, ClearSelection does nothing. If all of the text is selected, ClearSelection clears all text, like the Clear method. Note: Calling ClearSelection does the same thing as sending the edit control a WM_CLEAR message. Otherwise, it wouldn't be the logic handler of the TJvEditDelete action, would it? |
|
Hum, bugger. This is bad naming of procedures then |
|
Yes, I see what you mean now, there is name confusion and TJvEditDelete.ExecuteTarget should be implemented as: procedure TJvEditDelete.ExecuteTarget(Target: TObject); var Intf: IStandardEditActions; begin if Supports(Target, IStandardEditActions, Intf) then Intf.Delete // NOT ClearSelection else if Target is TCustomEdit then GetEditControl(Target).ClearSelection; end; |
|
The right solution might be to rename IStandardEditActions.ClearSelection to IStandardEditActions.Deselect and IStandardEditActions.Delete to IStandardEditActions.ClearSelection but I can't overlook the consequences |
2010-02-24 13:06
|
JvEditor.html (12,403 bytes) |
2010-02-24 13:06
|
JVEditorCommon.html (21,319 bytes) |
2010-02-24 13:07
|
JvStdEditActions.html (12,241 bytes) |
|
Hi obones, I don't meen to spam you, but let me present, what I think is the "right" solution. I have attached my Guiffy diff reports on the three affected files. I'm well aware that writers of TJvCustomEditor descendants have to handle the renaming of ClearSelection to Deselect. The change form Delete to ClearSelection is handled in the binding of the interface to the TJvCustomEditorBase class, so it should require no handling. Kind regards Søren |
|
This is now fixed. The IStandardEditActions.Delete method is gone (it was a relict from copying the IFixedPopupIntf interface) and the IStandardEditActions.ClearSelection method is redirected to TJvEditorCommon.DeleteSelected. The old TJvEditorCommon.ClearSelection is renamed to Deselect. |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-02-24 08:34 | TheRoadrunner | New Issue | |
2010-02-24 09:57 | obones | Note Added: 0017208 | |
2010-02-24 09:57 | obones | Status | new => feedback |
2010-02-24 10:02 | TheRoadrunner | Note Added: 0017209 | |
2010-02-24 10:20 | obones | Note Added: 0017210 | |
2010-02-24 10:20 | obones | Status | feedback => confirmed |
2010-02-24 10:38 | TheRoadrunner | Note Added: 0017211 | |
2010-02-24 10:43 | TheRoadrunner | Note Added: 0017212 | |
2010-02-24 13:06 | TheRoadrunner | File Added: JvEditor.html | |
2010-02-24 13:06 | TheRoadrunner | File Added: JVEditorCommon.html | |
2010-02-24 13:07 | TheRoadrunner | File Added: JvStdEditActions.html | |
2010-02-24 13:11 | TheRoadrunner | Note Added: 0017213 | |
2010-02-24 18:34 | AHUser | Note Added: 0017215 | |
2010-02-24 18:34 | AHUser | Status | confirmed => resolved |
2010-02-24 18:34 | AHUser | Fixed in Version | => Daily / SVN |
2010-02-24 18:34 | AHUser | Resolution | open => fixed |
2010-02-24 18:34 | AHUser | Assigned To | => AHUser |
2011-06-10 16:09 | obones | Fixed in Version | Daily / SVN => 3.40 |