View Issue Details

IDProjectCategoryView StatusLast Update
0026825LazarusDatabase Componentspublic2014-10-13 14:18
ReporterBigChimpAssigned ToBigChimp 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx64 (with x86 compiler)OSWindowsOS VersionWindows 7
Product Version1.3 (SVN)Product Build46441 
Target VersionFixed in Version1.3 (SVN) 
Summary0026825: [Patch] SQL editor: add button Copy as constant
DescriptionPatch adds a button to call copy as constant (same as right-click in sql text, copy as constant).

Added an icon to context menu and button, copied from
components\ideintf\images\laz_copy.png
Tagspatch
Fixed in Revision46545
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • sqlconst.diff (5,240 bytes)
    Index: components/sqldb/sqlstringspropertyeditordlg.lfm
    ===================================================================
    --- components/sqldb/sqlstringspropertyeditordlg.lfm	(revision 46441)
    +++ components/sqldb/sqlstringspropertyeditordlg.lfm	(working copy)
    @@ -85,6 +85,16 @@
           ParentShowHint = False
           ShowHint = True
         end
    +    object TBConst: TToolButton
    +      Left = 118
    +      Hint = 'Create string constant'
    +      Top = 2
    +      Caption = 'TBConst'
    +      ImageIndex = 5
    +      OnClick = TBConstClick
    +      ParentShowHint = False
    +      ShowHint = True
    +    end
       end
       object PageControl: TPageControl
         Left = 0
    @@ -520,6 +530,7 @@
                 ShiftMask = [ssShift, ssAlt, ssCtrl]
                 Command = emcMouseLink
               end>
    +        MouseTextActions = <>
             MouseSelActions = <        
               item
                 ClickDir = cdDown
    @@ -749,7 +760,7 @@
         left = 408
         top = 152
         Bitmap = {
    -      4C69050000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    +      4C69060000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
           FF00FFFFFF00EAC39DFFE6BF96FFE4BB92FFE4BB92FFD1A06CF5D09E6DF6CC96
           5FDAC479427EB2673C09FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
           FF00FFFFFF00E5BE96FFFFFFFEFFFDF3E9FFFDF3EAFFFCF2E8FFFAEFE3FFFAF2
    @@ -909,7 +920,39 @@
           FF00008B9C13008D9EE24FC3D2FD5BD3E1FF30B5C6FA0890A1F6008D9FA9008B
           9C14FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
           FF00FFFFFF00008B9C1F008C9DED008D9EEC008D9E9E008B9C21FFFFFF00FFFF
    -      FF00FFFFFF00FFFFFF00FFFFFF00
    +      FF00FFFFFF00FFFFFF00FFFFFF00C77947AACC8655CECC8857DECB8856DBCC88
    +      56DBCB8757DBCA8350D0C479426EB2673C08FFFFFF00FFFFFF00FFFFFF00FFFF
    +      FF00FFFFFF00FFFFFF00FFFFFF00CA8554D0FFFFFFDBFDF3E9DEFDF3EADEFCF2
    +      E8DEFAEFE3DEFAF2E7DEEABB88DECF85559CB4693D0AFFFFFF00FFFFFF00FFFF
    +      FF00FFFFFF00FFFFFF00FFFFFF00CB8656DAFEF5EDDEFCDEC5DEFBE0C7DEF9DC
    +      C2DEF5D3B4DEFEF9F3DEFAE2C4DEECC193DEC37D4880FFFFFF00FFFFFF00FFFF
    +      FF00FFFFFF00FFFFFF00FFFFFF00CB8655DBFEF6F0DEFCE2CDDEFCE3CDDEFADF
    +      C8DEF7D9BCDEF5E9DDDEFAF3EBDEFBF8F3DECD9565DCFFFFFF00FFFFFF00FFFF
    +      FF00FFFFFF00FFFFFF00FFFFFF00CB8655DBFEF7F1DEFCE5D2DEFCE4D1DEFBE2
    +      CCDEF9DDC4DEEAC39DFFE6BF96FFE4BB92FFE4BB92FFD1A06CF5D09E6DF6CC96
    +      5FDAC479427EB2673C09FFFFFF00CB8654DBFFF7F2DEFEE7D5DEFEE7D5DEFDE5
    +      D1DEFAE0CADEE5BE96FFFFFFFEFFFDF3E9FFFDF3EAFFFCF2E8FFFAEFE3FFFAF2
    +      E7FFEABB88FFCF8555B3B4693D0CCB8553DBFFF7F0DEFFE7D5DEFDE7D6DEFDE6
    +      D4DEFCE4D0DEE4BB93FFFEF5EDFFFCDEC5FFFBE0C7FFF9DCC2FFF5D3B4FFFEF9
    +      F3FFFAE2C4FFECC193FFC37D4893CA8452DBFFF7F1DEFFE9D9DEFFEADBDEFFE9
    +      D9DEFFE7D7DEE4BB92FFFEF6F0FFFCE2CDFFFCE3CDFFFADFC8FFF7D9BCFFF5E9
    +      DDFFFAF3EBFFFBF8F3FFCA8353FECC8352DBFBF5EEDEFFE9D9DEFFEADBDEFFE9
    +      D9DEFFE7D7DEE4BB92FFFEF7F1FFFCE5D2FFFCE4D1FFFBE2CCFFF9DDC4FFF6D7
    +      BBFFF3D1AFFFFAEFE4FFCC8758FECF8253DEEFF1E7DEFFE9D9DEFFEADBDEFFE9
    +      D9DEFFE7D7DEE4BB91FFFFF7F2FFFEE7D5FFFEE7D5FFFDE5D1FFFAE0CAFFF9DE
    +      C4FFF7D9BCFFFDF2E7FFCC8757FEC87C4ED3FCF3ECDEFAF1E8DEFAF0E7DEFBF1
    +      E9DEFBF2EADEE4BA91FFFFF7F0FFFFE7D5FFFDE7D6FFFDE6D4FFFCE4D0FFFBE3
    +      CBFFFADCC2FFFEF3E8FFCC8656FEC7794AB9C8794BCEC87545DDC77545D4C875
    +      45D4C77545D4CA8452FFFFF7F1FFFFE9D9FFFFEADBFFFFE9D9FFFFE7D7FFFFE5
    +      D2FFFFE2CBFFFFF7F1FFCB8555FEFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    +      FF00FFFFFF00CC8352FBFBF5EEFFFFE9D9FFFFEADBFFFFE9D9FFFFE7D7FFFFE5
    +      D2FFFFE2CBFFFBF6EFFFCC8355FEFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    +      FF00FFFFFF00CF8253FFEFF1E7FFFFE9D9FFFFEADBFFFFE9D9FFFFE7D7FFFFE5
    +      D2FFFFE2CBFFEFF2E8FFCE8156FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    +      FF00FFFFFF00C77949EDFCF3ECFFFAF1E8FFFAF0E7FFFBF1E9FFFBF2EAFFFBF2
    +      EAFFFBF2EBFFFDF4EEFFCA8054F9FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    +      FF00FFFFFF00C57342C1C67545E6C87545FEC77545F3C87545F3C77545F3C775
    +      45F3C87546F4C57444E8CA7F53F1
         }
       end
       object PMSQL: TPopupMenu
    @@ -1000,6 +1043,7 @@
         end
         object MICreateConstant: TMenuItem
           Caption = 'Create string constant'
    +      ImageIndex = 5
           OnClick = MICreateConstantClick
         end
         object MIMeta: TMenuItem
    Index: components/sqldb/sqlstringspropertyeditordlg.pas
    ===================================================================
    --- components/sqldb/sqlstringspropertyeditordlg.pas	(revision 46441)
    +++ components/sqldb/sqlstringspropertyeditordlg.pas	(working copy)
    @@ -41,6 +41,7 @@
         SQLQuery: TSQLQuery;
         MetaTabSheet: TTabSheet;
         SQLMeta: TSQLQuery;
    +    TBConst: TToolButton;
         ToolBar: TToolBar;
         OpenToolButton: TToolButton;
         SaveToolButton: TToolButton;
    @@ -59,6 +60,7 @@
         procedure SQLEditorMouseDown(Sender: TObject; Button: TMouseButton;
           {%H-}Shift: TShiftState; X, Y: Integer);
         procedure TBCheckClick(Sender: TObject);
    +    procedure TBConstClick(Sender: TObject);
       private
         { private declarations }
         FMetaFromSynedit: Boolean;
    @@ -361,6 +363,11 @@
       CheckSQLSyntax(SQLEditor.Lines);
     end;
     
    +procedure TSQLStringsPropertyEditorDlg.TBConstClick(Sender: TObject);
    +begin
    +  CreateConstant;
    +end;
    +
     procedure TSQLStringsPropertyEditorDlg.CheckSQLSyntax(SQL: TStrings);
     Var
       S : TStream;
    
    sqlconst.diff (5,240 bytes)

Activities

Reinier Olislagers

2014-10-06 13:36

developer  

sqlconst.diff (5,240 bytes)
Index: components/sqldb/sqlstringspropertyeditordlg.lfm
===================================================================
--- components/sqldb/sqlstringspropertyeditordlg.lfm	(revision 46441)
+++ components/sqldb/sqlstringspropertyeditordlg.lfm	(working copy)
@@ -85,6 +85,16 @@
       ParentShowHint = False
       ShowHint = True
     end
+    object TBConst: TToolButton
+      Left = 118
+      Hint = 'Create string constant'
+      Top = 2
+      Caption = 'TBConst'
+      ImageIndex = 5
+      OnClick = TBConstClick
+      ParentShowHint = False
+      ShowHint = True
+    end
   end
   object PageControl: TPageControl
     Left = 0
@@ -520,6 +530,7 @@
             ShiftMask = [ssShift, ssAlt, ssCtrl]
             Command = emcMouseLink
           end>
+        MouseTextActions = <>
         MouseSelActions = <        
           item
             ClickDir = cdDown
@@ -749,7 +760,7 @@
     left = 408
     top = 152
     Bitmap = {
-      4C69050000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      4C69060000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
       FF00FFFFFF00EAC39DFFE6BF96FFE4BB92FFE4BB92FFD1A06CF5D09E6DF6CC96
       5FDAC479427EB2673C09FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
       FF00FFFFFF00E5BE96FFFFFFFEFFFDF3E9FFFDF3EAFFFCF2E8FFFAEFE3FFFAF2
@@ -909,7 +920,39 @@
       FF00008B9C13008D9EE24FC3D2FD5BD3E1FF30B5C6FA0890A1F6008D9FA9008B
       9C14FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
       FF00FFFFFF00008B9C1F008C9DED008D9EEC008D9E9E008B9C21FFFFFF00FFFF
-      FF00FFFFFF00FFFFFF00FFFFFF00
+      FF00FFFFFF00FFFFFF00FFFFFF00C77947AACC8655CECC8857DECB8856DBCC88
+      56DBCB8757DBCA8350D0C479426EB2673C08FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00CA8554D0FFFFFFDBFDF3E9DEFDF3EADEFCF2
+      E8DEFAEFE3DEFAF2E7DEEABB88DECF85559CB4693D0AFFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00CB8656DAFEF5EDDEFCDEC5DEFBE0C7DEF9DC
+      C2DEF5D3B4DEFEF9F3DEFAE2C4DEECC193DEC37D4880FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00CB8655DBFEF6F0DEFCE2CDDEFCE3CDDEFADF
+      C8DEF7D9BCDEF5E9DDDEFAF3EBDEFBF8F3DECD9565DCFFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00FFFFFF00FFFFFF00CB8655DBFEF7F1DEFCE5D2DEFCE4D1DEFBE2
+      CCDEF9DDC4DEEAC39DFFE6BF96FFE4BB92FFE4BB92FFD1A06CF5D09E6DF6CC96
+      5FDAC479427EB2673C09FFFFFF00CB8654DBFFF7F2DEFEE7D5DEFEE7D5DEFDE5
+      D1DEFAE0CADEE5BE96FFFFFFFEFFFDF3E9FFFDF3EAFFFCF2E8FFFAEFE3FFFAF2
+      E7FFEABB88FFCF8555B3B4693D0CCB8553DBFFF7F0DEFFE7D5DEFDE7D6DEFDE6
+      D4DEFCE4D0DEE4BB93FFFEF5EDFFFCDEC5FFFBE0C7FFF9DCC2FFF5D3B4FFFEF9
+      F3FFFAE2C4FFECC193FFC37D4893CA8452DBFFF7F1DEFFE9D9DEFFEADBDEFFE9
+      D9DEFFE7D7DEE4BB92FFFEF6F0FFFCE2CDFFFCE3CDFFFADFC8FFF7D9BCFFF5E9
+      DDFFFAF3EBFFFBF8F3FFCA8353FECC8352DBFBF5EEDEFFE9D9DEFFEADBDEFFE9
+      D9DEFFE7D7DEE4BB92FFFEF7F1FFFCE5D2FFFCE4D1FFFBE2CCFFF9DDC4FFF6D7
+      BBFFF3D1AFFFFAEFE4FFCC8758FECF8253DEEFF1E7DEFFE9D9DEFFEADBDEFFE9
+      D9DEFFE7D7DEE4BB91FFFFF7F2FFFEE7D5FFFEE7D5FFFDE5D1FFFAE0CAFFF9DE
+      C4FFF7D9BCFFFDF2E7FFCC8757FEC87C4ED3FCF3ECDEFAF1E8DEFAF0E7DEFBF1
+      E9DEFBF2EADEE4BA91FFFFF7F0FFFFE7D5FFFDE7D6FFFDE6D4FFFCE4D0FFFBE3
+      CBFFFADCC2FFFEF3E8FFCC8656FEC7794AB9C8794BCEC87545DDC77545D4C875
+      45D4C77545D4CA8452FFFFF7F1FFFFE9D9FFFFEADBFFFFE9D9FFFFE7D7FFFFE5
+      D2FFFFE2CBFFFFF7F1FFCB8555FEFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00CC8352FBFBF5EEFFFFE9D9FFFFEADBFFFFE9D9FFFFE7D7FFFFE5
+      D2FFFFE2CBFFFBF6EFFFCC8355FEFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00CF8253FFEFF1E7FFFFE9D9FFFFEADBFFFFE9D9FFFFE7D7FFFFE5
+      D2FFFFE2CBFFEFF2E8FFCE8156FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00C77949EDFCF3ECFFFAF1E8FFFAF0E7FFFBF1E9FFFBF2EAFFFBF2
+      EAFFFBF2EBFFFDF4EEFFCA8054F9FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
+      FF00FFFFFF00C57342C1C67545E6C87545FEC77545F3C87545F3C77545F3C775
+      45F3C87546F4C57444E8CA7F53F1
     }
   end
   object PMSQL: TPopupMenu
@@ -1000,6 +1043,7 @@
     end
     object MICreateConstant: TMenuItem
       Caption = 'Create string constant'
+      ImageIndex = 5
       OnClick = MICreateConstantClick
     end
     object MIMeta: TMenuItem
Index: components/sqldb/sqlstringspropertyeditordlg.pas
===================================================================
--- components/sqldb/sqlstringspropertyeditordlg.pas	(revision 46441)
+++ components/sqldb/sqlstringspropertyeditordlg.pas	(working copy)
@@ -41,6 +41,7 @@
     SQLQuery: TSQLQuery;
     MetaTabSheet: TTabSheet;
     SQLMeta: TSQLQuery;
+    TBConst: TToolButton;
     ToolBar: TToolBar;
     OpenToolButton: TToolButton;
     SaveToolButton: TToolButton;
@@ -59,6 +60,7 @@
     procedure SQLEditorMouseDown(Sender: TObject; Button: TMouseButton;
       {%H-}Shift: TShiftState; X, Y: Integer);
     procedure TBCheckClick(Sender: TObject);
+    procedure TBConstClick(Sender: TObject);
   private
     { private declarations }
     FMetaFromSynedit: Boolean;
@@ -361,6 +363,11 @@
   CheckSQLSyntax(SQLEditor.Lines);
 end;
 
+procedure TSQLStringsPropertyEditorDlg.TBConstClick(Sender: TObject);
+begin
+  CreateConstant;
+end;
+
 procedure TSQLStringsPropertyEditorDlg.CheckSQLSyntax(SQL: TStrings);
 Var
   S : TStream;
sqlconst.diff (5,240 bytes)

Reinier Olislagers

2014-10-06 13:37

developer   ~0078019

Updated description to indicate patch ready for committing if ok.

LacaK

2014-10-09 07:17

developer   ~0078092

Last edited: 2014-10-09 20:28

View 2 revisions

off-topic: but would it be possible to add to context menu (right click) of TSQLQuery item: "SQL" or "Edit SQL" which will open SQL editor (same as clicking on "..." in Object inspector on property TSQLQuery.SQL)

Juha Manninen

2014-10-12 01:10

developer   ~0078168

Reinier, you have now commit access, don't you?

Reinier Olislagers

2014-10-13 14:14

developer   ~0078190

@LacaK: undoubtedly it's possible but haven't looked at how this should be done (and it's not a priority for me). please open a new ticket; thanks.

@Juha: yes I have commit access but don't want to thread on other's (Jesus') toes. Anyway, seeing there's no negative feedback I'll commit; it can always be reverted.

Issue History

Date Modified Username Field Change
2014-10-06 12:05 Reinier Olislagers New Issue
2014-10-06 12:05 Reinier Olislagers File Added: sqlconst.diff
2014-10-06 12:05 Reinier Olislagers Tag Attached: patch
2014-10-06 13:36 Reinier Olislagers File Deleted: sqlconst.diff
2014-10-06 13:36 Reinier Olislagers File Added: sqlconst.diff
2014-10-06 13:37 Reinier Olislagers Note Added: 0078019
2014-10-06 13:37 Reinier Olislagers Description Updated View Revisions
2014-10-09 07:17 LacaK Note Added: 0078092
2014-10-09 20:28 LacaK Note Edited: 0078092 View Revisions
2014-10-12 01:09 Juha Manninen Assigned To => Reinier Olislagers
2014-10-12 01:09 Juha Manninen Status new => assigned
2014-10-12 01:10 Juha Manninen Note Added: 0078168
2014-10-13 14:14 Reinier Olislagers Note Added: 0078190
2014-10-13 14:18 Reinier Olislagers Fixed in Revision => 46545
2014-10-13 14:18 Reinier Olislagers Status assigned => resolved
2014-10-13 14:18 Reinier Olislagers Fixed in Version => 1.3 (SVN)
2014-10-13 14:18 Reinier Olislagers Resolution open => fixed
2014-10-13 14:18 Reinier Olislagers Status resolved => closed