Graeme Geldenhuys schreef:
Hi,
Attached is a patch that implements two feature requests.
Auto select text in Object inspector when clicked
http://www.freepascal.org/mantis/view.php?id=8727
Auto select text in Object inspector when Enter is pressed
http://www.freepascal.org/mantis/view.php?id=8728
Patch needs to be applied from the root Lazarus directory.
------------------------------------------------------------------------
Index: ideintf/objectinspector.pp
===================================================================
--- ideintf/objectinspector.pp (revision 10971)
+++ ideintf/objectinspector.pp (working copy)
@@ -1639,7 +1639,12 @@
procedure TOICustomPropertyGrid.SetItemIndexAndFocus(NewItemIndex: integer);
begin
ItemIndex:=NewItemIndex;
- if FCurrentEdit<>nil then FCurrentEdit.SetFocus;
+ if FCurrentEdit<>nil then
+ begin
+ FCurrentEdit.SetFocus;
+ if (FCurrentEdit is TCustomEdit) then
+ TEdit(FCurrentEdit).SelectAll;
This doesn't look right, checking for TCustomEdit and then casting to TEdit.
+ end;
end;
function TOICustomPropertyGrid.CanEditRowValue: boolean;
@@ -1854,7 +1859,11 @@
Handled:=false;
VK_RETURN:
- SetRowValue;
+ begin
+ SetRowValue;
+ if (FCurrentEdit is TCustomEdit) then
+ TEdit(FCurrentEdit).SelectAll;
Same here.
+ end;
else
if Assigned(OnOIKeyDown) then
Vincent
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives