View Issue Details

IDProjectCategoryView StatusLast Update
0038326Lazarus CCRrxpublic2021-05-13 09:14
ReporterBambang Pranoto Assigned ToLagunov Aleksey  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSubuntu 
Summary0038326: TRxDBCurrEdit ignores the ReadOnly property.
DescriptionTRxDBCurrEdit ignores the ReadOnly property.
Steps To Reproduce1. Download the attached project
2. Compile and run the demo
3. Click the button to set the readonly property of the TRxDBCurrEdit readonly to true
4. You can still edit the value eventhough it is readonly
TagsNo tags attached.
Widgetset
Attached Files

Activities

Bambang Pranoto

2021-01-07 02:42

reporter  

Bambang Pranoto

2021-01-07 06:34

reporter   ~0128136

Attached is my fix.
rxdbcurredit_honour_readonly.diff (1,254 bytes)   
--- rxdbcurredit_original.pas	2021-01-07 11:43:28.361189000 +0700
+++ rxdbcurredit.pas	2021-01-07 12:18:09.811847009 +0700
@@ -192,20 +192,30 @@
 procedure TRxDBCurrEdit.KeyDown(var Key: Word; Shift: TShiftState);
 begin
   inherited KeyDown(Key, Shift);
-  if Key=VK_ESCAPE then
-  begin
-    //cancel out of editing by reset on esc
-    FDataLink.Reset;
-    SelectAll;
-    Key := VK_UNKNOWN;
+  if Self.FDataLink.Editing then begin
+
+    if Key=VK_ESCAPE then
+    begin
+      //cancel out of editing by reset on esc
+
+      FDataLink.Reset;
+      SelectAll;
+      Key := VK_UNKNOWN;
+
+    end
+    else
+    if (Key<>VK_UNKNOWN) then
+    begin
+      //make sure we call edit to ensure the datset is in edit,
+      //this is for where the datasource is in autoedit, so we aren't
+      //read only even though the dataset isn't realy in edit
+      FDataLink.Edit;
+    end;
   end
-  else
-  if (Key<>VK_UNKNOWN) then
-  begin
-    //make sure we call edit to ensure the datset is in edit,
-    //this is for where the datasource is in autoedit, so we aren't
-    //read only even though the dataset isn't realy in edit
-    FDataLink.Edit;
+  else begin
+    if Key <> VK_TAB then begin
+      Key := VK_UNKNOWN;
+    end;
   end;
 end;
 

Lagunov Aleksey

2021-05-12 16:00

developer   ~0130828

tnx
see revision 8029.

Bambang Pranoto

2021-05-13 09:14

reporter   ~0130844

Thank you.

Issue History

Date Modified Username Field Change
2021-01-07 02:42 Bambang Pranoto New Issue
2021-01-07 02:42 Bambang Pranoto Status new => assigned
2021-01-07 02:42 Bambang Pranoto Assigned To => Lagunov Aleksey
2021-01-07 02:42 Bambang Pranoto File Added: rxdbcurredit_ignores_readonly.zip
2021-01-07 06:34 Bambang Pranoto Note Added: 0128136
2021-01-07 06:34 Bambang Pranoto File Added: rxdbcurredit_honour_readonly.diff
2021-05-12 16:00 Lagunov Aleksey Status assigned => resolved
2021-05-12 16:00 Lagunov Aleksey Resolution open => fixed
2021-05-12 16:00 Lagunov Aleksey Note Added: 0130828
2021-05-13 09:14 Bambang Pranoto Status resolved => closed
2021-05-13 09:14 Bambang Pranoto Note Added: 0130844