From b62450b6ecf67fc9d32ba7ec12d6b0eca05513f9 Mon Sep 17 00:00:00 2001 From: "PC1\\PTyTb" Date: Thu, 7 Aug 2025 18:14:03 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20records=20=D0=BF=D0=BE=D1=87=D1=82=D0=B8?= =?UTF-8?q?=20=D0=B4=D0=BE=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=B2=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D0=B4=D0=BA=D1=83=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=B4=D1=8B,=20=D0=BE=D1=81=D1=82=D0=B0=D0=BB=D0=BE=D1=81?= =?UTF-8?q?=D1=8C=20=D0=BB=D0=B8=D1=88=D1=8C=20=D0=B3=D1=80=D1=83=D0=BF?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D1=8B=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TTW_Bot_app.dpr | 4 +- TTW_Bot_app.dproj | 10 + fCommands.fmx | 507 ++++++++++++---------------------------------- fCommands.pas | 228 +++++++++++++++------ fContruct.fmx | 167 +++++++++++++++ fContruct.pas | 83 ++++++++ fSimpleGrid.fmx | 90 ++++++++ fSimpleGrid.pas | 143 +++++++++++++ uDataBase.pas | 86 ++++++-- uGeneral.fmx | 416 +++++++++++++++++-------------------- uGeneral.pas | 18 +- uRecords.pas | 9 +- 12 files changed, 1082 insertions(+), 679 deletions(-) create mode 100644 fContruct.fmx create mode 100644 fContruct.pas create mode 100644 fSimpleGrid.fmx create mode 100644 fSimpleGrid.pas diff --git a/TTW_Bot_app.dpr b/TTW_Bot_app.dpr index c615e52..496f20f 100644 --- a/TTW_Bot_app.dpr +++ b/TTW_Bot_app.dpr @@ -22,7 +22,9 @@ uses uAPIDA in 'uAPIDA.pas', uShowText in 'uShowText.pas' {fShowText}, uWSDA in 'uWSDA.pas', - uQ in 'uQ.pas' {frmQ}; + uQ in 'uQ.pas' {frmQ}, + fSimpleGrid in 'fSimpleGrid.pas' {frSimpleGrid: TFrame}, + fContruct in 'fContruct.pas' {frContruct: TFrame}; {$R *.res} diff --git a/TTW_Bot_app.dproj b/TTW_Bot_app.dproj index da350aa..fd245cd 100644 --- a/TTW_Bot_app.dproj +++ b/TTW_Bot_app.dproj @@ -377,6 +377,16 @@
frmQ
fmx + +
frSimpleGrid
+ fmx + TFrame +
+ +
frContruct
+ fmx + TFrame +
Base diff --git a/fCommands.fmx b/fCommands.fmx index 5220c92..281a747 100644 --- a/fCommands.fmx +++ b/fCommands.fmx @@ -1,19 +1,20 @@ object frCommands: TfrCommands - Size.Width = 1052.000000000000000000 - Size.Height = 719.000000000000000000 + Size.Width = 973.000000000000000000 + Size.Height = 705.000000000000000000 Size.PlatformDefault = False object sgCommands: TStringGrid CanFocus = True ClipChildren = True Position.X = 5.000000000000000000 Position.Y = 8.000000000000000000 - Size.Width = 606.000000000000000000 + Size.Width = 540.000000000000000000 Size.Height = 193.000000000000000000 Size.PlatformDefault = False TabOrder = 5 RowCount = 0 Options = [ColumnResize, ColumnMove, ColLines, RowLines, Tabs, Header, HeaderClick, AutoDisplacement] - Viewport.Width = 602.000000000000000000 + OnCellClick = sgCommandsCellClick + Viewport.Width = 536.000000000000000000 Viewport.Height = 168.000000000000000000 object scCommand: TStringColumn Header = #1050#1086#1084#1072#1085#1076#1072 @@ -23,7 +24,7 @@ object frCommands: TfrCommands object scResponse: TStringColumn Header = #1054#1090#1074#1077#1090 HeaderSettings.TextSettings.WordWrap = False - Size.Width = 446.000000000000000000 + Size.Width = 380.000000000000000000 end end object GroupBox1: TGroupBox @@ -31,168 +32,60 @@ object frCommands: TfrCommands Padding.Top = 20.000000000000000000 Padding.Right = 5.000000000000000000 Padding.Bottom = 5.000000000000000000 - Position.X = 619.000000000000000000 + Position.X = 544.000000000000000000 Position.Y = 8.000000000000000000 - Size.Width = 395.000000000000000000 + Size.Width = 410.000000000000000000 Size.Height = 442.000000000000000000 Size.PlatformDefault = False Text = #1050#1086#1085#1089#1090#1088#1091#1082#1090#1086#1088' '#1086#1090#1074#1077#1090#1072 TabOrder = 0 - object Label12: TLabel - Position.X = 9.000000000000000000 - Position.Y = 24.000000000000000000 - TextSettings.Trimming = None - Text = #1050#1086#1084#1072#1085#1076#1072 - TabOrder = 38 - end - object edtCommand: TEdit - Touch.InteractiveGestures = [LongTap, DoubleTap] - TabOrder = 39 - Position.X = 9.000000000000000000 - Position.Y = 49.000000000000000000 - Size.Width = 208.000000000000000000 - Size.Height = 22.000000000000000000 + inline frContruct1: TfrContruct + Align = Client + Size.Width = 400.000000000000000000 + Size.Height = 417.000000000000000000 Size.PlatformDefault = False - end - object mResponse: TMemo - Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] - DataDetectorTypes = [] - TextSettings.WordWrap = True - Position.X = 9.000000000000000000 - Position.Y = 104.000000000000000000 - Size.Width = 376.000000000000000000 - Size.Height = 177.000000000000000000 - Size.PlatformDefault = False - TabOrder = 40 - Viewport.Width = 372.000000000000000000 - Viewport.Height = 173.000000000000000000 - end - object Label14: TLabel - Position.X = 9.000000000000000000 - Position.Y = 79.000000000000000000 - TextSettings.Trimming = None - Text = #1054#1090#1074#1077#1090 - TabOrder = 41 - end - object GroupBox7: TGroupBox - Padding.Left = 5.000000000000000000 - Padding.Top = 20.000000000000000000 - Padding.Right = 5.000000000000000000 - Padding.Bottom = 5.000000000000000000 - Position.X = 9.000000000000000000 - Position.Y = 283.000000000000000000 - Size.Width = 376.000000000000000000 - Size.Height = 120.000000000000000000 - Size.PlatformDefault = False - Text = #1042#1089#1090#1072#1074#1082#1080 - TabOrder = 42 - object btnAddUserName: TButton - Position.X = 9.000000000000000000 - Position.Y = 24.000000000000000000 - Size.Width = 94.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 38 - Text = #1054#1073#1088#1072#1097#1077#1085#1080#1077 - TextSettings.Trimming = None + inherited mResponse: TMemo + Viewport.Width = 388.000000000000000000 + Viewport.Height = 157.000000000000000000 end - object btnGetDateFollow: TButton - Position.X = 111.000000000000000000 - Position.Y = 24.000000000000000000 - TabOrder = 39 - Text = 'Follow' - TextSettings.Trimming = None + inherited GroupBox7: TGroupBox + inherited btnAddUserName: TButton + TabOrder = 38 + end + inherited btnGetDateFollow: TButton + TabOrder = 39 + end + inherited btnGetAgeAccaunt: TButton + TabOrder = 40 + end + inherited btnCounterAddtoText: TButton + TabOrder = 41 + end + inherited cbCounterName: TComboBox + TabOrder = 42 + end + inherited btnGPT: TButton + TabOrder = 43 + end + inherited btnRandomUserName: TButton + TabOrder = 44 + end + inherited btnGetChannelStat: TButton + TabOrder = 45 + end + inherited btnAIPic: TButton + TabOrder = 46 + end end - object btnGetAgeAccaunt: TButton - Position.X = 199.000000000000000000 - Position.Y = 24.000000000000000000 - TabOrder = 40 - Text = 'Age' - TextSettings.Trimming = None + inherited btnAddCommand: TButton + OnClick = frContruct1btnAddCommandClick end - object btnCounterAddtoText: TButton - Position.X = 9.000000000000000000 - Position.Y = 54.000000000000000000 - Size.Width = 94.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 41 - Text = #1057#1095#1077#1090#1095#1080#1082 - TextSettings.Trimming = None + inherited btnEditCommand: TButton + OnClick = frContruct1btnEditCommandClick end - object cbCounterName: TComboBox - Position.X = 111.000000000000000000 - Position.Y = 54.000000000000000000 - Size.Width = 168.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 42 + inherited btnRmCommand: TButton + OnClick = frContruct1btnRmCommandClick end - object btnGPT: TButton - Position.X = 287.000000000000000000 - Position.Y = 24.000000000000000000 - TabOrder = 43 - Text = #1053#1077#1081#1088#1086#1085#1082#1072 - TextSettings.Trimming = None - end - object btnRandomUserName: TButton - Position.X = 9.000000000000000000 - Position.Y = 84.000000000000000000 - Size.Width = 168.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 44 - Text = #1056#1072#1085#1076#1086#1084#1085#1099#1081' '#1087#1086#1083#1100#1079#1086#1074#1072#1090#1077#1083#1100 - TextSettings.Trimming = None - end - object btnGetChannelStat: TButton - Position.X = 185.000000000000000000 - Position.Y = 84.000000000000000000 - Size.Width = 122.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 45 - Text = #1057#1090#1072#1090#1080#1089#1090#1080#1082#1072' '#1082#1072#1085#1072#1083#1072 - TextSettings.Trimming = None - end - object btnAIPic: TButton - Position.X = 287.000000000000000000 - Position.Y = 54.000000000000000000 - TabOrder = 46 - Text = #1050#1072#1088#1090#1080#1085#1082#1072 - TextSettings.Trimming = None - end - end - object btnAddCommand: TButton - Position.X = 9.000000000000000000 - Position.Y = 411.000000000000000000 - TabOrder = 43 - Text = #1044#1086#1073#1072#1074#1080#1090#1100 - TextSettings.Trimming = None - end - object btnEditCommand: TButton - Position.X = 97.000000000000000000 - Position.Y = 411.000000000000000000 - TabOrder = 44 - Text = #1048#1079#1084#1077#1085#1080#1090#1100 - TextSettings.Trimming = None - end - object btnRmCommand: TButton - Position.X = 185.000000000000000000 - Position.Y = 411.000000000000000000 - TabOrder = 45 - Text = #1059#1076#1072#1083#1080#1090#1100 - TextSettings.Trimming = None - end - object cbTextToSpeech: TCheckBox - Position.X = 168.000000000000000000 - Position.Y = 16.000000000000000000 - Size.Width = 217.000000000000000000 - Size.Height = 19.000000000000000000 - Size.PlatformDefault = False - TabOrder = 46 - Text = #1054#1079#1074#1091#1095#1080#1074#1072#1090#1100' '#1089#1086#1086#1073#1097#1077#1085#1080#1103' '#1087#1086#1089#1083#1077' "!!!"' - Visible = False end end object GroupBox9: TGroupBox @@ -202,7 +95,7 @@ object frCommands: TfrCommands Padding.Bottom = 5.000000000000000000 Position.X = 191.000000000000000000 Position.Y = 209.000000000000000000 - Size.Width = 412.000000000000000000 + Size.Width = 354.000000000000000000 Size.Height = 241.000000000000000000 Size.PlatformDefault = False Text = #1056#1072#1085#1076#1086#1084#1085#1099#1077' '#1075#1088#1091#1087#1087#1099' '#1086#1090#1074#1077#1090#1086#1074 @@ -227,7 +120,7 @@ object frCommands: TfrCommands object lbRandomRespons: TListBox Position.X = 127.000000000000000000 Position.Y = 49.000000000000000000 - Size.Width = 274.000000000000000000 + Size.Width = 218.000000000000000000 Size.Height = 120.000000000000000000 Size.PlatformDefault = False TabOrder = 13 @@ -238,7 +131,7 @@ object frCommands: TfrCommands DefaultItemStyles.GroupFooterStyle = '' Left = 335 Top = 315 - Viewport.Width = 270.000000000000000000 + Viewport.Width = 214.000000000000000000 Viewport.Height = 116.000000000000000000 end object edtRandomGroup: TEdit @@ -258,7 +151,7 @@ object frCommands: TfrCommands TabOrder = 14 Position.X = 127.000000000000000000 Position.Y = 177.000000000000000000 - Size.Width = 274.000000000000000000 + Size.Width = 218.000000000000000000 Size.Height = 21.000000000000000000 Size.PlatformDefault = False Left = 335 @@ -282,7 +175,7 @@ object frCommands: TfrCommands TextSettings.Trimming = None end object btnRmGroup: TButton - Position.X = 263.000000000000000000 + Position.X = 207.000000000000000000 Position.Y = 206.000000000000000000 Size.Width = 138.000000000000000000 Size.Height = 22.000000000000000000 @@ -306,7 +199,7 @@ object frCommands: TfrCommands Position.Y = 24.000000000000000000 TextSettings.Trimming = None Text = #1042#1072#1088#1080#1072#1085#1090#1099' '#1086#1090#1074#1077#1090#1072 - TabOrder = 43 + TabOrder = 44 end end object GroupBox8: TGroupBox @@ -360,7 +253,7 @@ object frCommands: TfrCommands object btnRandAdd: TButton Position.X = 9.000000000000000000 Position.Y = 205.000000000000000000 - TabOrder = 33 + TabOrder = 32 Text = #1044#1086#1073#1072#1074#1080#1090#1100 TextSettings.Trimming = None OnClick = btnRandAddClick @@ -371,7 +264,7 @@ object frCommands: TfrCommands Size.Width = 70.000000000000000000 Size.Height = 22.000000000000000000 Size.PlatformDefault = False - TabOrder = 34 + TabOrder = 33 Text = #1059#1076#1072#1083#1080#1090#1100 TextSettings.Trimming = None OnClick = btnRandDelClick @@ -387,6 +280,7 @@ object frCommands: TfrCommands TabOrder = 36 RowCount = 0 Options = [ColumnResize, ColumnMove, ColLines, RowLines, Tabs, Header, HeaderClick, AutoDisplacement] + OnCellDblClick = sgRandomIntCellDblClick Viewport.Width = 153.000000000000000000 Viewport.Height = 119.000000000000000000 object scRIntName: TStringColumn @@ -407,171 +301,74 @@ object frCommands: TfrCommands end end object GroupBox11: TGroupBox + Padding.Left = 10.000000000000000000 + Padding.Top = 20.000000000000000000 + Padding.Right = 10.000000000000000000 + Padding.Bottom = 10.000000000000000000 Position.X = 8.000000000000000000 Position.Y = 458.000000000000000000 - Size.Width = 361.000000000000000000 + Size.Width = 313.000000000000000000 Size.Height = 240.000000000000000000 Size.PlatformDefault = False Text = #1047#1074#1091#1082 TabOrder = 4 - object btnSoundAdd: TButton - Position.X = 8.000000000000000000 - Position.Y = 211.000000000000000000 - TabOrder = 38 - Text = #1044#1086#1073#1072#1074#1080#1090#1100 - TextSettings.Trimming = None - end - object btnSoundDel: TButton - Position.X = 96.000000000000000000 - Position.Y = 211.000000000000000000 - Size.Width = 70.000000000000000000 - Size.Height = 22.000000000000000000 + inline frsgSounds: TfrSimpleGrid + Align = Client + Hint = '||' + Size.Width = 293.000000000000000000 + Size.Height = 210.000000000000000000 Size.PlatformDefault = False - TabOrder = 39 - Text = #1059#1076#1072#1083#1080#1090#1100 - TextSettings.Trimming = None - end - object edtSoundName: TEdit - Touch.InteractiveGestures = [LongTap, DoubleTap] - TabOrder = 40 - Position.X = 8.000000000000000000 - Position.Y = 181.000000000000000000 - Size.Width = 106.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - end - object edtSoundFileName: TEdit - Touch.InteractiveGestures = [LongTap, DoubleTap] - TabOrder = 41 - Position.X = 122.000000000000000000 - Position.Y = 180.000000000000000000 - Size.Width = 196.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - end - object btnSoundOpen: TButton - Position.X = 326.000000000000000000 - Position.Y = 181.000000000000000000 - Size.Width = 27.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 42 - Text = '...' - TextSettings.Trimming = None - end - object tbSoundVolume: TTrackBar - CanParentFocus = True - Orientation = Horizontal - Position.X = 174.000000000000000000 - Position.Y = 211.000000000000000000 - Size.Width = 91.000000000000000000 - Size.Height = 19.000000000000000000 - Size.PlatformDefault = False - TabOrder = 43 - Value = 100.000000000000000000 - end - object btnSoundTest: TButton - Position.X = 273.000000000000000000 - Position.Y = 210.000000000000000000 - TabOrder = 44 - Text = #1058#1077#1089#1090 - TextSettings.Trimming = None - end - object sgSAFiles: TStringGrid - CanFocus = True - ClipChildren = True - Position.X = 8.000000000000000000 - Position.Y = 24.000000000000000000 - Size.Width = 345.000000000000000000 - Size.Height = 149.000000000000000000 - Size.PlatformDefault = False - TabOrder = 45 - RowCount = 0 - Options = [ColumnResize, ColumnMove, ColLines, RowLines, Tabs, Header, HeaderClick, AutoDisplacement] - Viewport.Width = 341.000000000000000000 - Viewport.Height = 124.000000000000000000 - object sgSAName: TStringColumn - Header = #1053#1072#1079#1074#1072#1085#1080#1077 - HeaderSettings.TextSettings.WordWrap = False + inherited sg: TStringGrid + Size.Width = 293.000000000000000000 + TabOrder = 44 + OnCellDblClick = frsgSoundssgCellDblClick + Viewport.Width = 289.000000000000000000 + Viewport.Height = 124.000000000000000000 + inherited sgR2: TStringColumn + Size.Width = 170.000000000000000000 + end end - object sgSAFile: TStringColumn - Header = #1060#1072#1081#1083 - HeaderSettings.TextSettings.WordWrap = False - Size.Width = 220.000000000000000000 + inherited edtFileName: TEdit + Size.Width = 128.000000000000000000 + end + inherited btnOpen: TButton + Position.X = 258.000000000000000000 end end end object GroupBox24: TGroupBox - Position.X = 377.000000000000000000 + Padding.Left = 10.000000000000000000 + Padding.Top = 20.000000000000000000 + Padding.Right = 10.000000000000000000 + Padding.Bottom = 10.000000000000000000 + Position.X = 329.000000000000000000 Position.Y = 458.000000000000000000 - Size.Width = 332.000000000000000000 + Size.Width = 313.000000000000000000 Size.Height = 241.000000000000000000 Size.PlatformDefault = False Text = #1060#1072#1081#1083#1099 TabOrder = 2 - object btnTextAdd: TButton - Position.X = 8.000000000000000000 - Position.Y = 211.000000000000000000 - TabOrder = 38 - Text = #1044#1086#1073#1072#1074#1080#1090#1100 - TextSettings.Trimming = None - end - object btnTextDel: TButton - Position.X = 96.000000000000000000 - Position.Y = 211.000000000000000000 - Size.Width = 70.000000000000000000 - Size.Height = 22.000000000000000000 + inline frsgFiles: TfrSimpleGrid + Align = Client + Hint = '|(' + Size.Width = 293.000000000000000000 + Size.Height = 211.000000000000000000 Size.PlatformDefault = False - TabOrder = 39 - Text = #1059#1076#1072#1083#1080#1090#1100 - TextSettings.Trimming = None - end - object edtTextName: TEdit - Touch.InteractiveGestures = [LongTap, DoubleTap] - TabOrder = 40 - Position.X = 8.000000000000000000 - Position.Y = 181.000000000000000000 - end - object edtTextFileName: TEdit - Touch.InteractiveGestures = [LongTap, DoubleTap] - TabOrder = 41 - Position.X = 116.000000000000000000 - Position.Y = 181.000000000000000000 - Size.Width = 141.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - end - object btnTextOpen: TButton - Position.X = 265.000000000000000000 - Position.Y = 181.000000000000000000 - Size.Width = 34.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 42 - Text = '...' - TextSettings.Trimming = None - end - object sgTFiles: TStringGrid - CanFocus = True - ClipChildren = True - Position.X = 8.000000000000000000 - Position.Y = 24.000000000000000000 - Size.Width = 297.000000000000000000 - Size.Height = 149.000000000000000000 - Size.PlatformDefault = False - TabOrder = 45 - RowCount = 0 - Options = [ColumnResize, ColumnMove, ColLines, RowLines, Tabs, Header, HeaderClick, AutoDisplacement] - Viewport.Width = 293.000000000000000000 - Viewport.Height = 124.000000000000000000 - object scTFileName: TStringColumn - Header = #1053#1072#1079#1074#1072#1085#1080#1077 - HeaderSettings.TextSettings.WordWrap = False + inherited sg: TStringGrid + Size.Width = 293.000000000000000000 + TabOrder = 44 + OnCellDblClick = frsgFilessgCellDblClick + Viewport.Width = 289.000000000000000000 + Viewport.Height = 124.000000000000000000 + inherited sgR2: TStringColumn + Size.Width = 170.000000000000000000 + end end - object scTFileFile: TStringColumn - Header = #1060#1072#1081#1083 - HeaderSettings.TextSettings.WordWrap = False - Size.Width = 170.000000000000000000 + inherited edtFileName: TEdit + Size.Width = 128.000000000000000000 + end + inherited btnOpen: TButton + Position.X = 258.000000000000000000 end end end @@ -580,77 +377,41 @@ object frCommands: TfrCommands Top = 392 end object GroupBox2: TGroupBox - Position.X = 717.000000000000000000 + Padding.Left = 10.000000000000000000 + Padding.Top = 20.000000000000000000 + Padding.Right = 10.000000000000000000 + Padding.Bottom = 10.000000000000000000 + Position.X = 650.000000000000000000 Position.Y = 458.000000000000000000 - Size.Width = 324.000000000000000000 + Size.Width = 313.000000000000000000 Size.Height = 240.000000000000000000 Size.PlatformDefault = False Text = #1053#1077#1081#1088#1086#1082#1086#1085#1089#1090#1088#1091#1082#1090#1086#1088 TabOrder = 8 - object sgAIGen: TStringGrid - CanFocus = True - ClipChildren = True - Position.X = 8.000000000000000000 - Position.Y = 24.000000000000000000 - Size.Width = 305.000000000000000000 - Size.Height = 149.000000000000000000 + inline frsgNeiro: TfrSimpleGrid + Align = Client + Hint = '<|' + Size.Width = 293.000000000000000000 + Size.Height = 210.000000000000000000 Size.PlatformDefault = False - TabOrder = 38 - RowCount = 0 - Options = [ColumnResize, ColumnMove, ColLines, RowLines, Tabs, Header, HeaderClick, AutoDisplacement] - Viewport.Width = 301.000000000000000000 - Viewport.Height = 124.000000000000000000 - object StringColumn1: TStringColumn - Header = #1053#1072#1079#1074#1072#1085#1080#1077 - HeaderSettings.TextSettings.WordWrap = False + inherited sg: TStringGrid + Size.Width = 293.000000000000000000 + TabOrder = 44 + OnCellDblClick = frsgNeirosgCellDblClick + Viewport.Width = 289.000000000000000000 + Viewport.Height = 124.000000000000000000 + inherited sgR2: TStringColumn + Header = #1047#1072#1087#1088#1086#1089 + Size.Width = 170.000000000000000000 + end end - object StringColumn2: TStringColumn - Header = #1047#1072#1087#1088#1086#1089 - HeaderSettings.TextSettings.WordWrap = False - Size.Width = 180.000000000000000000 + inherited edtFileName: TEdit + Size.Width = 163.000000000000000000 + end + inherited btnOpen: TButton + Position.X = 258.000000000000000000 + Visible = False end - end - object edtAIGenName: TEdit - Touch.InteractiveGestures = [LongTap, DoubleTap] - TabOrder = 39 - Position.X = 8.000000000000000000 - Position.Y = 181.000000000000000000 - Size.Width = 102.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - end - object edtAIGenRequest: TEdit - Touch.InteractiveGestures = [LongTap, DoubleTap] - TabOrder = 40 - Position.X = 118.000000000000000000 - Position.Y = 181.000000000000000000 - Size.Width = 195.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - end - object btnAIGenAdd: TButton - Position.X = 8.000000000000000000 - Position.Y = 211.000000000000000000 - TabOrder = 41 - Text = #1044#1086#1073#1072#1074#1080#1090#1100 - TextSettings.Trimming = None - end - object btnAIGenDel: TButton - Position.X = 96.000000000000000000 - Position.Y = 211.000000000000000000 - TabOrder = 42 - Text = #1059#1076#1072#1083#1080#1090#1100 - TextSettings.Trimming = None - end - object btnAIGetTextUser: TButton - Position.X = 184.000000000000000000 - Position.Y = 211.000000000000000000 - Size.Width = 129.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 43 - Text = #1058#1077#1082#1089#1090' '#1087#1086#1083#1100#1079#1086#1074#1072#1090#1077#1083#1103 - TextSettings.Trimming = None end end end diff --git a/fCommands.pas b/fCommands.pas index 1e261d8..952be8d 100644 --- a/fCommands.pas +++ b/fCommands.pas @@ -3,10 +3,12 @@ unit fCommands; interface uses - System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + System.SysUtils, System.Types, System.UITypes, System.Classes, + System.Variants, FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, System.Rtti, FMX.Grid.Style, FMX.Memo.Types, FMX.Grid, FMX.Layouts, uRecords, - FMX.ListBox, FMX.Memo, FMX.Edit, FMX.Controls.Presentation, FMX.ScrollBox; + FMX.ListBox, FMX.Memo, FMX.Edit, FMX.Controls.Presentation, FMX.ScrollBox, + fSimpleGrid, fContruct; type TfrCommands = class(TFrame) @@ -14,24 +16,6 @@ type scCommand: TStringColumn; scResponse: TStringColumn; GroupBox1: TGroupBox; - Label12: TLabel; - edtCommand: TEdit; - mResponse: TMemo; - Label14: TLabel; - GroupBox7: TGroupBox; - btnAddUserName: TButton; - btnGetDateFollow: TButton; - btnGetAgeAccaunt: TButton; - btnCounterAddtoText: TButton; - cbCounterName: TComboBox; - btnGPT: TButton; - btnRandomUserName: TButton; - btnGetChannelStat: TButton; - btnAIPic: TButton; - btnAddCommand: TButton; - btnEditCommand: TButton; - btnRmCommand: TButton; - cbTextToSpeech: TCheckBox; GroupBox9: TGroupBox; lbRandomGroup: TListBox; lbRandomRespons: TListBox; @@ -53,43 +37,40 @@ type IntegerColumn1: TIntegerColumn; scRIntTo: TIntegerColumn; GroupBox11: TGroupBox; - btnSoundAdd: TButton; - btnSoundDel: TButton; - edtSoundName: TEdit; - edtSoundFileName: TEdit; - btnSoundOpen: TButton; - tbSoundVolume: TTrackBar; - btnSoundTest: TButton; - sgSAFiles: TStringGrid; - sgSAName: TStringColumn; - sgSAFile: TStringColumn; GroupBox24: TGroupBox; - btnTextAdd: TButton; - btnTextDel: TButton; - edtTextName: TEdit; - edtTextFileName: TEdit; - btnTextOpen: TButton; - sgTFiles: TStringGrid; - scTFileName: TStringColumn; - scTFileFile: TStringColumn; OpenDialog1: TOpenDialog; GroupBox2: TGroupBox; - sgAIGen: TStringGrid; - StringColumn1: TStringColumn; - StringColumn2: TStringColumn; - edtAIGenName: TEdit; - edtAIGenRequest: TEdit; - btnAIGenAdd: TButton; - btnAIGenDel: TButton; - btnAIGetTextUser: TButton; + frsgSounds: TfrSimpleGrid; + frsgFiles: TfrSimpleGrid; + frsgNeiro: TfrSimpleGrid; + frContruct1: TfrContruct; procedure btnRandAddClick(Sender: TObject); procedure btnRandDelClick(Sender: TObject); + procedure frsgSoundsbtnSoundDelClick(Sender: TObject); + procedure frsgSoundssgCellDblClick(const Column: TColumn; + const Row: Integer); + procedure frsgFilessgCellDblClick(const Column: TColumn; + const Row: Integer); + procedure frsgNeirosgCellDblClick(const Column: TColumn; + const Row: Integer); + procedure frContruct1btnAddCommandClick(Sender: TObject); + procedure frContruct1btnEditCommandClick(Sender: TObject); + procedure frContruct1btnRmCommandClick(Sender: TObject); + procedure sgCommandsCellClick(const Column: TColumn; const Row: Integer); + procedure sgRandomIntCellDblClick(const Column: TColumn; + const Row: Integer); private { Private declarations } - procedure UpdateGridFromArray; + public { Public declarations } RandomCounters: TArray; + listSounds: TArray; + listFiles: TArray; + listNeiro: TArray; + listCommands: TArray; + + procedure UpdateGridFromArray; end; implementation @@ -103,16 +84,126 @@ var i, RowIndex: Integer; begin RowIndex := sgRandomInt.Row; - if (RowIndex < 0) or (RowIndex > High(RandomCounters)) then Exit; + if (RowIndex < 0) or (RowIndex > High(RandomCounters)) then + Exit; // Сдвигаем элементы массива - for i := RowIndex to High(RandomCounters)-1 do - RandomCounters[i] := RandomCounters[i+1]; - + for i := RowIndex to High(RandomCounters) - 1 do + RandomCounters[i] := RandomCounters[i + 1]; SetLength(RandomCounters, Length(RandomCounters) - 1); + UpdateGridFromArray; + DB.SaveRecordArray('RandomCounters', RandomCounters); +end; + +procedure TfrCommands.frContruct1btnAddCommandClick(Sender: TObject); + var + sCommand: string; + NewRec: TListCommands; +begin + sCommand := frContruct1.edtCommand.text; + if (sCommand = '') or (sCommand = '!') or (frContruct1.mResponse.text = '') then + exit; + if (sCommand <> '') and (sCommand[1] = '!') then + begin + Delete(sCommand, 1, 1); + end; + + NewRec.R1 := sCommand; + NewRec.R2 := frContruct1.mResponse.text; + SetLength(listCommands, Length(listCommands) + 1); + listCommands[High(listCommands)] := NewRec; + UpdateGridFromArray; + DB.SaveRecordArray('listCommands', listCommands); +end; + +procedure TfrCommands.frContruct1btnEditCommandClick(Sender: TObject); +var RowIndex: integer; sCommand:string; +begin + RowIndex := sgCommands.Row; + + sCommand := frContruct1.edtCommand.text; + if (sCommand = '') or (sCommand = '!') or (frContruct1.mResponse.text = '') then + exit; + if (sCommand <> '') and (sCommand[1] = '!') then + begin + Delete(sCommand, 1, 1); + end; + + if (RowIndex < 0) or (RowIndex > High(listCommands)) then + exit; + listCommands[RowIndex].R1 := sCommand; + listCommands[RowIndex].R2 := frContruct1.mResponse.text; UpdateGridFromArray; - DB.SaveGridToTable('sgRandomInt', sgRandomInt); + DB.SaveRecordArray('listCommands', listCommands); +end; + +procedure TfrCommands.frContruct1btnRmCommandClick(Sender: TObject); +var + i, RowIndex: Integer; +begin + RowIndex := sgCommands.Row; + if (RowIndex < 0) or (RowIndex > High(listCommands)) then + exit; + for i := RowIndex to High(listCommands) - 1 do + listCommands[i] := listCommands[i + 1]; + SetLength(listCommands, Length(listCommands) - 1); + UpdateGridFromArray; + DB.SaveRecordArray('listCommands', listCommands); + +end; + +procedure TfrCommands.frsgFilessgCellDblClick(const Column: TColumn; + const Row: Integer); +begin + frContruct1.mResponse.Lines.text := frContruct1.mResponse.Lines.text + ' ' + + frsgFiles.Hint + frsgFiles.sg.Cells[0, Row] + frsgFiles.Hint; +end; + +procedure TfrCommands.frsgNeirosgCellDblClick(const Column: TColumn; + const Row: Integer); +begin + frContruct1.mResponse.Lines.text := frContruct1.mResponse.Lines.text + ' ' + + frsgNeiro.Hint + frsgNeiro.sg.Cells[0, Row] + frsgNeiro.Hint; +end; + +procedure TfrCommands.frsgSoundsbtnSoundDelClick(Sender: TObject); +var + i, RowIndex: Integer; +begin + RowIndex := frsgSounds.sg.Row; + if (RowIndex < 0) or (RowIndex > High(listSounds)) then + Exit; + + // Сдвигаем элементы массива + for i := RowIndex to High(listSounds) - 1 do + listSounds[i] := listSounds[i + 1]; + + SetLength(listSounds, Length(listSounds) - 1); + + UpdateGridFromArray; + DB.SaveRecordArray('listSounds', listSounds); +end; + +procedure TfrCommands.frsgSoundssgCellDblClick(const Column: TColumn; + const Row: Integer); +begin + frContruct1.mResponse.Lines.text := frContruct1.mResponse.Lines.text + ' ' + + frsgSounds.Hint + frsgSounds.sg.Cells[0, Row] + frsgSounds.Hint; +end; + +procedure TfrCommands.sgCommandsCellClick(const Column: TColumn; + const Row: Integer); +begin + frContruct1.edtCommand.text := sgCommands.Cells[0, Row]; + frContruct1.mResponse.text := sgCommands.Cells[1, Row]; +end; + +procedure TfrCommands.sgRandomIntCellDblClick(const Column: TColumn; + const Row: Integer); +begin + frContruct1.mResponse.Lines.text := frContruct1.mResponse.Lines.text + ' [[' + sgRandomInt.Cells + [0, Row] + ']]'; end; procedure TfrCommands.UpdateGridFromArray; @@ -121,37 +212,50 @@ var begin sgRandomInt.BeginUpdate; try - sgRandomInt.RowCount := 1; // Сбрасываем строки (оставляем только заголовки) + sgRandomInt.RowCount := 0; // Сбрасываем строки (оставляем только заголовки) for i := 0 to High(RandomCounters) do begin - sgRandomInt.RowCount := i + 1; - sgRandomInt.Cells[0, i] := RandomCounters[i].Name; + sgRandomInt.RowCount := i +1; + sgRandomInt.Cells[0, i] := RandomCounters[i].rndName; sgRandomInt.Cells[1, i] := IntToStr(RandomCounters[i].Ot); sgRandomInt.Cells[2, i] := IntToStr(RandomCounters[i].ToValue); end; finally sgRandomInt.EndUpdate; end; + sgCommands.BeginUpdate; + try + sgCommands.RowCount := 0; // Сбрасываем строки (оставляем только заголовки) + + for i := 0 to High(listCommands) do + begin + sgCommands.RowCount := i+1 ; + sgCommands.Cells[0, i] := listCommands[i].R1; + sgCommands.Cells[1, i] := listCommands[i].R2; //9067254178 + end; + finally + sgCommands.EndUpdate; + end; end; procedure TfrCommands.btnRandAddClick(Sender: TObject); var NewRec: TRandomCounters; begin - NewRec.Name := edtRandomName.Text; - NewRec.Ot := StrToIntDef(edtOt.Text, 0); - NewRec.ToValue := StrToIntDef(edtTo.Text, 100); + NewRec.rndName := edtRandomName.text; + NewRec.Ot := StrToIntDef(edtOt.text, 0); + NewRec.ToValue := StrToIntDef(edtTo.text, 100); SetLength(RandomCounters, Length(RandomCounters) + 1); RandomCounters[High(RandomCounters)] := NewRec; UpdateGridFromArray; - // DB.SaveGridToTable('sgRandomInt', sgRandomInt); + // DB.SaveGridToTable('sgRandomInt', sgRandomInt); DB.SaveRecordArray('RandomCounters', RandomCounters); - edtRandomName.Text := ''; - edtOt.Text := '0'; - edtTo.Text := '100'; + edtRandomName.text := ''; + edtOt.text := '0'; + edtTo.text := '100'; end; end. diff --git a/fContruct.fmx b/fContruct.fmx new file mode 100644 index 0000000..988a9b0 --- /dev/null +++ b/fContruct.fmx @@ -0,0 +1,167 @@ +object frContruct: TfrContruct + Size.Width = 406.000000000000000000 + Size.Height = 417.000000000000000000 + Size.PlatformDefault = False + object Label12: TLabel + Position.X = 8.000000000000000000 + Position.Y = 8.000000000000000000 + TextSettings.Trimming = None + Text = #1050#1086#1084#1072#1085#1076#1072 + TabOrder = 38 + end + object edtCommand: TEdit + Touch.InteractiveGestures = [LongTap, DoubleTap] + TabOrder = 39 + Position.X = 8.000000000000000000 + Position.Y = 33.000000000000000000 + Size.Width = 208.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + end + object mResponse: TMemo + Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] + DataDetectorTypes = [] + TextSettings.WordWrap = True + Position.X = 8.000000000000000000 + Position.Y = 88.000000000000000000 + Size.Width = 392.000000000000000000 + Size.Height = 161.000000000000000000 + Size.PlatformDefault = False + TabOrder = 40 + Viewport.Width = 388.000000000000000000 + Viewport.Height = 157.000000000000000000 + end + object Label14: TLabel + Position.X = 8.000000000000000000 + Position.Y = 63.000000000000000000 + TextSettings.Trimming = None + Text = #1054#1090#1074#1077#1090 + TabOrder = 41 + end + object GroupBox7: TGroupBox + Padding.Left = 5.000000000000000000 + Padding.Top = 20.000000000000000000 + Padding.Right = 5.000000000000000000 + Padding.Bottom = 5.000000000000000000 + Position.X = 8.000000000000000000 + Position.Y = 257.000000000000000000 + Size.Width = 392.000000000000000000 + Size.Height = 120.000000000000000000 + Size.PlatformDefault = False + Text = #1042#1089#1090#1072#1074#1082#1080 + TabOrder = 42 + object btnAddUserName: TButton + Position.X = 9.000000000000000000 + Position.Y = 24.000000000000000000 + Size.Width = 94.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + TabOrder = 38 + Text = #1054#1073#1088#1072#1097#1077#1085#1080#1077 + TextSettings.Trimming = None + OnClick = btnAddUserNameClick + end + object btnGetDateFollow: TButton + Position.X = 111.000000000000000000 + Position.Y = 24.000000000000000000 + TabOrder = 39 + Text = 'Follow' + TextSettings.Trimming = None + OnClick = btnGetDateFollowClick + end + object btnGetAgeAccaunt: TButton + Position.X = 199.000000000000000000 + Position.Y = 24.000000000000000000 + TabOrder = 40 + Text = 'Age' + TextSettings.Trimming = None + OnClick = btnGetAgeAccauntClick + end + object btnCounterAddtoText: TButton + Position.X = 9.000000000000000000 + Position.Y = 54.000000000000000000 + Size.Width = 94.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + TabOrder = 41 + Text = #1057#1095#1077#1090#1095#1080#1082 + TextSettings.Trimming = None + end + object cbCounterName: TComboBox + Position.X = 111.000000000000000000 + Position.Y = 54.000000000000000000 + Size.Width = 168.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + TabOrder = 42 + end + object btnGPT: TButton + Position.X = 287.000000000000000000 + Position.Y = 24.000000000000000000 + TabOrder = 43 + Text = #1053#1077#1081#1088#1086#1085#1082#1072 + TextSettings.Trimming = None + OnClick = btnGPTClick + end + object btnRandomUserName: TButton + Position.X = 9.000000000000000000 + Position.Y = 84.000000000000000000 + Size.Width = 168.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + TabOrder = 44 + Text = #1056#1072#1085#1076#1086#1084#1085#1099#1081' '#1087#1086#1083#1100#1079#1086#1074#1072#1090#1077#1083#1100 + TextSettings.Trimming = None + OnClick = btnRandomUserNameClick + end + object btnGetChannelStat: TButton + Position.X = 185.000000000000000000 + Position.Y = 84.000000000000000000 + Size.Width = 122.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + TabOrder = 45 + Text = #1057#1090#1072#1090#1080#1089#1090#1080#1082#1072' '#1082#1072#1085#1072#1083#1072 + TextSettings.Trimming = None + OnClick = btnGetChannelStatClick + end + object btnAIPic: TButton + Position.X = 287.000000000000000000 + Position.Y = 54.000000000000000000 + TabOrder = 46 + Text = #1050#1072#1088#1090#1080#1085#1082#1072 + TextSettings.Trimming = None + OnClick = btnAIPicClick + end + end + object btnAddCommand: TButton + Position.X = 8.000000000000000000 + Position.Y = 385.000000000000000000 + TabOrder = 43 + Text = #1044#1086#1073#1072#1074#1080#1090#1100 + TextSettings.Trimming = None + end + object btnEditCommand: TButton + Position.X = 96.000000000000000000 + Position.Y = 385.000000000000000000 + TabOrder = 44 + Text = #1048#1079#1084#1077#1085#1080#1090#1100 + TextSettings.Trimming = None + end + object btnRmCommand: TButton + Position.X = 184.000000000000000000 + Position.Y = 385.000000000000000000 + TabOrder = 45 + Text = #1059#1076#1072#1083#1080#1090#1100 + TextSettings.Trimming = None + end + object cbTextToSpeech: TCheckBox + Position.X = 167.000000000000000000 + Size.Width = 217.000000000000000000 + Size.Height = 19.000000000000000000 + Size.PlatformDefault = False + TabOrder = 46 + Text = #1054#1079#1074#1091#1095#1080#1074#1072#1090#1100' '#1089#1086#1086#1073#1097#1077#1085#1080#1103' '#1087#1086#1089#1083#1077' "!!!"' + Visible = False + end +end diff --git a/fContruct.pas b/fContruct.pas new file mode 100644 index 0000000..b844e03 --- /dev/null +++ b/fContruct.pas @@ -0,0 +1,83 @@ +unit fContruct; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, + FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, + FMX.Memo.Types, FMX.ListBox, FMX.ScrollBox, FMX.Memo, FMX.Edit, + FMX.Controls.Presentation; + +type + TfrContruct = class(TFrame) + Label12: TLabel; + edtCommand: TEdit; + mResponse: TMemo; + Label14: TLabel; + GroupBox7: TGroupBox; + btnAddUserName: TButton; + btnGetDateFollow: TButton; + btnGetAgeAccaunt: TButton; + btnCounterAddtoText: TButton; + cbCounterName: TComboBox; + btnGPT: TButton; + btnRandomUserName: TButton; + btnGetChannelStat: TButton; + btnAIPic: TButton; + btnAddCommand: TButton; + btnEditCommand: TButton; + btnRmCommand: TButton; + cbTextToSpeech: TCheckBox; + procedure btnAddUserNameClick(Sender: TObject); + procedure btnGetDateFollowClick(Sender: TObject); + procedure btnGetAgeAccauntClick(Sender: TObject); + procedure btnGetChannelStatClick(Sender: TObject); + procedure btnGPTClick(Sender: TObject); + procedure btnAIPicClick(Sender: TObject); + procedure btnRandomUserNameClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +implementation + +{$R *.fmx} + +procedure TfrContruct.btnAddUserNameClick(Sender: TObject); +begin +mResponse.Lines.text := mResponse.Lines.text + '[USERNAME]'; +end; + +procedure TfrContruct.btnAIPicClick(Sender: TObject); +begin +mResponse.Lines.text := mResponse.Lines.text + ' [Kandinsky]'; +end; + +procedure TfrContruct.btnGetAgeAccauntClick(Sender: TObject); +begin + mResponse.Lines.text := mResponse.Lines.text + ' [AGE]'; +end; + +procedure TfrContruct.btnGetChannelStatClick(Sender: TObject); +begin + mResponse.Lines.text := mResponse.Lines.text + ' [STAT]'; +end; + +procedure TfrContruct.btnGetDateFollowClick(Sender: TObject); +begin + mResponse.Lines.text := mResponse.Lines.text + ' [FOLLOW]'; +end; + +procedure TfrContruct.btnGPTClick(Sender: TObject); +begin + mResponse.Lines.text := mResponse.Lines.text + ' [AI]'; +end; + +procedure TfrContruct.btnRandomUserNameClick(Sender: TObject); +begin +mResponse.Lines.text := mResponse.Lines.text + ' [RANDOMUSER]'; +end; + +end. diff --git a/fSimpleGrid.fmx b/fSimpleGrid.fmx new file mode 100644 index 0000000..712d104 --- /dev/null +++ b/fSimpleGrid.fmx @@ -0,0 +1,90 @@ +object frSimpleGrid: TfrSimpleGrid + Size.Width = 339.000000000000000000 + Size.Height = 223.000000000000000000 + Size.PlatformDefault = False + object sg: TStringGrid + Align = Top + CanFocus = True + ClipChildren = True + Size.Width = 339.000000000000000000 + Size.Height = 149.000000000000000000 + Size.PlatformDefault = False + TabOrder = 45 + RowCount = 0 + Options = [ColumnResize, ColumnMove, ColLines, RowLines, Tabs, Header, HeaderClick, AutoDisplacement] + OnCellClick = sgCellClick + Viewport.Width = 335.000000000000000000 + Viewport.Height = 124.000000000000000000 + object sgR1: TStringColumn + Header = #1053#1072#1079#1074#1072#1085#1080#1077 + HeaderSettings.TextSettings.WordWrap = False + end + object sgR2: TStringColumn + Header = #1060#1072#1081#1083 + HeaderSettings.TextSettings.WordWrap = False + Size.Width = 220.000000000000000000 + end + end + object edtName: TEdit + Touch.InteractiveGestures = [LongTap, DoubleTap] + TabOrder = 40 + Position.X = 8.000000000000000000 + Position.Y = 155.000000000000000000 + Size.Width = 106.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + end + object edtFileName: TEdit + Touch.InteractiveGestures = [LongTap, DoubleTap] + Anchors = [akLeft, akTop, akRight] + TabOrder = 41 + Position.X = 122.000000000000000000 + Position.Y = 155.000000000000000000 + Size.Width = 174.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + end + object btnOpen: TButton + Anchors = [akTop, akRight] + Position.X = 304.000000000000000000 + Position.Y = 157.000000000000000000 + Size.Width = 27.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + TabOrder = 42 + Text = '...' + TextSettings.Trimming = None + OnClick = btnOpenClick + end + object btnAdd: TButton + Position.X = 8.000000000000000000 + Position.Y = 185.000000000000000000 + TabOrder = 38 + Text = #1044#1086#1073#1072#1074#1080#1090#1100 + TextSettings.Trimming = None + OnClick = btnAddClick + end + object btnDel: TButton + Position.X = 184.000000000000000000 + Position.Y = 185.000000000000000000 + Size.Width = 70.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + TabOrder = 39 + Text = #1059#1076#1072#1083#1080#1090#1100 + TextSettings.Trimming = None + OnClick = btnDelClick + end + object btnEdt: TButton + Position.X = 96.000000000000000000 + Position.Y = 185.000000000000000000 + TabOrder = 46 + Text = #1048#1079#1084#1077#1085#1080#1090#1100 + TextSettings.Trimming = None + OnClick = btnEdtClick + end + object od: TOpenDialog + Left = 152 + Top = 96 + end +end diff --git a/fSimpleGrid.pas b/fSimpleGrid.pas new file mode 100644 index 0000000..46fb189 --- /dev/null +++ b/fSimpleGrid.pas @@ -0,0 +1,143 @@ +unit fSimpleGrid; + +interface + +uses + System.SysUtils, System.Types, System.UITypes, System.Classes, + System.Variants, + FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, + System.Rtti, FMX.Grid.Style, FMX.Edit, FMX.Grid, FMX.Controls.Presentation, + FMX.ScrollBox, uRecords; + +type + TfrSimpleGrid = class(TFrame) + sg: TStringGrid; + sgR2: TStringColumn; + sgR1: TStringColumn; + edtName: TEdit; + edtFileName: TEdit; + btnOpen: TButton; + btnAdd: TButton; + btnDel: TButton; + btnEdt: TButton; + od: TOpenDialog; + procedure btnAddClick(Sender: TObject); + procedure btnDelClick(Sender: TObject); + procedure sgCellClick(const Column: TColumn; const Row: Integer); + procedure btnOpenClick(Sender: TObject); + procedure btnEdtClick(Sender: TObject); + private + { Private declarations } + FMyRecord: TArray; + FTableName: string; + procedure SetMyArray(const Value: TArray); + procedure SetTableName(const Value: string); + + public + { Public declarations } + procedure UpdateGrid; + published + property ObjectRecord: TArray read FMyRecord + write SetMyArray; + property TableName: string read FTableName write SetTableName; + + end; + +implementation + +{$R *.fmx} + +uses ugeneral; + +{ TfrSimpleGrid } + +procedure TfrSimpleGrid.btnAddClick(Sender: TObject); +var + NewRec: TListCommands; +begin + if (edtName.Text = '') or (edtFileName.Text = '') then + exit; + NewRec.R1 := edtName.Text; + NewRec.R2 := edtFileName.Text; + SetLength(FMyRecord, Length(FMyRecord) + 1); + FMyRecord[High(FMyRecord)] := NewRec; + DB.SaveRecordArray(FTableName, FMyRecord); + edtName.Text := ''; + edtFileName.Text := ''; + UpdateGrid; +end; + +procedure TfrSimpleGrid.btnDelClick(Sender: TObject); +var + i, RowIndex: Integer; +begin + RowIndex := sg.Row; + if (RowIndex < 0) or (RowIndex > High(FMyRecord)) then + exit; + for i := RowIndex to High(FMyRecord) - 1 do + FMyRecord[i] := FMyRecord[i + 1]; + SetLength(FMyRecord, Length(FMyRecord) - 1); + DB.SaveRecordArray(FTableName, FMyRecord); + UpdateGrid; +end; + +procedure TfrSimpleGrid.btnEdtClick(Sender: TObject); +var RowIndex:integer; +begin + if (edtName.Text = '') or (edtFileName.Text = '') then + exit; + RowIndex := sg.Row; + if (RowIndex < 0) or (RowIndex > High(FMyRecord)) then + exit; + FMyRecord[RowIndex].R1 := edtName.Text; + FMyRecord[RowIndex].R2 := edtFileName.Text; + DB.SaveRecordArray(FTableName, FMyRecord); + edtName.Text := ''; + edtFileName.Text := ''; + UpdateGrid; +end; + +procedure TfrSimpleGrid.btnOpenClick(Sender: TObject); +var + i, RowIndex: Integer; +begin + if od.Execute then + edtFileName.Text := od.FileName; +end; + +procedure TfrSimpleGrid.SetMyArray(const Value: TArray); +begin + FMyRecord := Value; +end; + +procedure TfrSimpleGrid.SetTableName(const Value: string); +begin + FTableName := Value; +end; + +procedure TfrSimpleGrid.sgCellClick(const Column: TColumn; const Row: Integer); +begin + edtName.Text := sg.Cells[0, Row]; + edtFileName.Text := sg.Cells[1, Row]; +end; + +procedure TfrSimpleGrid.UpdateGrid; +var + i: Integer; +begin + sg.BeginUpdate; + try + sg.RowCount := 1; // Сбрасываем строки (оставляем только заголовки) + + for i := 0 to High(FMyRecord) do + begin + sg.RowCount := i + 1; + sg.Cells[0, i] := FMyRecord[i].R1; + sg.Cells[1, i] := FMyRecord[i].R2; + end; + finally + sg.EndUpdate; + end; +end; + +end. diff --git a/uDataBase.pas b/uDataBase.pas index 8ba4da3..739da06 100644 --- a/uDataBase.pas +++ b/uDataBase.pas @@ -484,6 +484,7 @@ begin end; end; + procedure TSettingsDatabase.SaveRecordArray(const TableName: string; const Items: array of T); var Context: TRttiContext; @@ -493,12 +494,13 @@ var Rec: T; Field: TRttiField; FieldNames, Placeholders: string; - i: Integer; + i, j: Integer; + Value: TValue; + Param: TFDParam; begin if Length(Items) = 0 then Exit; EnsureTableForRecord(TableName, TypeInfo(T)); - FConnection.ExecSQL(Format('DELETE FROM %s', [TableName])); Context := TRttiContext.Create; try @@ -509,28 +511,85 @@ begin try Query.Connection := FConnection; + // Построение списка полей и плейсхолдеров FieldNames := ''; Placeholders := ''; - for i := 0 to High(Fields) do + for j := 0 to High(Fields) do begin - if i > 0 then + if j > 0 then begin FieldNames := FieldNames + ', '; Placeholders := Placeholders + ', '; end; - FieldNames := FieldNames + Fields[i].Name; - Placeholders := Placeholders + ':p_' + Fields[i].Name; + FieldNames := FieldNames + Fields[j].Name; + Placeholders := Placeholders + ':' + Fields[j].Name; end; - Query.SQL.Text := 'INSERT INTO '+TableName+' ('+FieldNames+') VALUES ('+Placeholders+')'; + Query.SQL.Text := 'INSERT INTO ' + TableName + ' (' + FieldNames + ') VALUES (' + Placeholders + ')'; + // Подготавливаем запрос (создает параметры) + //Query.Prepare; - for Rec in Items do - begin - Query.Params.Clear; - for Field in Fields do - Query.ParamByName('p_'+Field.Name).Value := Field.GetValue(@Rec).AsVariant; - Query.ExecSQL; + // Устанавливаем размер массива параметров + Query.Params.ArraySize := Length(Items); + + // Начало транзакции + FConnection.StartTransaction; + try + // Очистка таблицы перед вставкой новых данных + FConnection.ExecSQL('DELETE FROM ' + TableName); + + i := 0; + for Rec in Items do + begin + for Field in Fields do + begin + Value := Field.GetValue(@Rec); + + // Находим параметр + Param := Query.FindParam(Field.Name); + if not Assigned(Param) then + raise Exception.CreateFmt('Parameter "%s" not found in query', [Field.Name]); + + // Обработка NULL-значений + if Value.IsEmpty then + begin + Param.Clear(i); + end + else + begin + // Обработка по типу + case Field.FieldType.TypeKind of + tkInteger, tkInt64: + Param.AsIntegers[i] := Value.AsInteger; + tkFloat: + if (Field.FieldType = TypeInfo(TDateTime)) or + (Field.FieldType = TypeInfo(TDate)) or + (Field.FieldType = TypeInfo(TTime)) then + Param.AsDateTimes[i] := Value.AsExtended + else + Param.AsFloats[i] := Value.AsExtended; + tkEnumeration: + if Field.FieldType = TypeInfo(Boolean) then + Param.AsBooleans[i] := Value.AsBoolean + else + Param.AsIntegers[i] := Value.AsOrdinal; + tkUString, tkString, tkWString, tkLString: + Param.AsStrings[i] := Value.AsString; + else + Param.AsStrings[i] := Value.ToString; + end; + end; + end; + Inc(i); + end; + + // Пакетное выполнение + Query.Execute(Length(Items), 0); + FConnection.Commit; + except + FConnection.Rollback; + raise; end; finally Query.Free; @@ -540,6 +599,7 @@ begin end; end; + procedure TSettingsDatabase.LoadRecordArray(const TableName: string; var Items: TArray); var Context: TRttiContext; diff --git a/uGeneral.fmx b/uGeneral.fmx index d4301ba..a74d9c6 100644 --- a/uGeneral.fmx +++ b/uGeneral.fmx @@ -3,7 +3,7 @@ object TTW_Bot: TTTW_Bot Top = 0 Caption = 'Form1' ClientHeight = 886 - ClientWidth = 1042 + ClientWidth = 970 Position = Designed FormFactor.Width = 320 FormFactor.Height = 480 @@ -14,30 +14,30 @@ object TTW_Bot: TTTW_Bot object V: TTabControl Align = Client Images = ImageList1 - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 744.000000000000000000 Size.PlatformDefault = False TabIndex = 2 TabOrder = 0 TabPosition = PlatformDefault Sizes = ( - 1042s + 970s 718s - 1042s + 970s 718s - 1042s + 970s 718s - 1042s + 970s 718s - 1042s + 970s 718s - 1042s + 970s 718s - 1042s + 970s 718s - 1042s + 970s 718s - 1042s + 970s 718s) object TabItem1: TTabItem CustomIcon = < @@ -56,7 +56,7 @@ object TTW_Bot: TTTW_Bot ExplicitSize.cy = 26.000000000000000000 inline frSettings1: TfrSettings Align = Client - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 718.000000000000000000 Size.PlatformDefault = False inherited GroupBox3: TGroupBox @@ -71,51 +71,50 @@ object TTW_Bot: TTTW_Bot inherited btnOpenStream: TButton Images = ImageList1 ImageIndex = 17 - TabOrder = 33 + TabOrder = 32 end inherited btnGetTokenStreamer: TButton Images = ImageList1 ImageIndex = 10 - TabOrder = 34 + TabOrder = 33 end - inherited edtBotTokenStreamer: TEdit - TabOrder = 35 + inherited Label53: TLabel + TabOrder = 36 end end inherited GroupBox22: TGroupBox inherited btnDAGetCode: TButton Images = ImageList1 ImageIndex = 10 - TabOrder = 43 end inherited Label63: TLabel - TabOrder = 35 + TabOrder = 34 end inherited edtDAClientID: TEdit - TabOrder = 38 - end - inherited Label64: TLabel - TabOrder = 36 - end - inherited edtDAClientSecret: TEdit TabOrder = 37 end + inherited Label64: TLabel + TabOrder = 35 + end + inherited edtDAClientSecret: TEdit + TabOrder = 36 + end inherited Label65: TLabel - TabOrder = 39 + TabOrder = 38 end inherited edtDARedirectURL: TEdit - TabOrder = 40 + TabOrder = 39 end inherited edtDACode: TEdit - TabOrder = 41 + TabOrder = 40 end inherited Label66: TLabel - TabOrder = 42 + TabOrder = 41 end inherited btnDAStart: TButton Images = ImageList1 ImageIndex = 18 - TabOrder = 44 + TabOrder = 43 OnClick = frSettings1btnDAStartClick end inherited btnGetDADef: TButton @@ -168,7 +167,7 @@ object TTW_Bot: TTTW_Bot ExplicitSize.cy = 26.000000000000000000 inline frAI1: TfrAI Align = Client - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 718.000000000000000000 Size.PlatformDefault = False inherited btnGetAIDef: TButton @@ -201,12 +200,12 @@ object TTW_Bot: TTTW_Bot ExplicitSize.cy = 26.000000000000000000 inline frCommands1: TfrCommands Align = Client - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 718.000000000000000000 Size.PlatformDefault = False inherited sgCommands: TStringGrid - Viewport.Width = 606.000000000000000000 - Viewport.Height = 193.000000000000000000 + Viewport.Width = 536.000000000000000000 + Viewport.Height = 168.000000000000000000 inherited scCommand: TStringColumn Size.Width = 134.000000000000000000 end @@ -215,84 +214,70 @@ object TTW_Bot: TTTW_Bot end end inherited GroupBox1: TGroupBox - inherited Label12: TLabel - TabOrder = 37 - end - inherited edtCommand: TEdit - TabOrder = 38 - end - inherited mResponse: TMemo - TabOrder = 39 - Viewport.Width = 376.000000000000000000 - Viewport.Height = 177.000000000000000000 - end - inherited Label14: TLabel - TabOrder = 40 - end - inherited GroupBox7: TGroupBox - TabOrder = 41 - inherited btnAddUserName: TButton - Images = ImageList1 - ImageIndex = 11 - TabOrder = 37 + inherited frContruct1: TfrContruct + inherited mResponse: TMemo + Size.Width = 384.000000000000000000 + Viewport.Width = 380.000000000000000000 + Viewport.Height = 157.000000000000000000 end - inherited btnGetDateFollow: TButton - Images = ImageList1 - ImageIndex = 15 - TabOrder = 38 + inherited GroupBox7: TGroupBox + inherited btnAddUserName: TButton + Images = ImageList1 + ImageIndex = 11 + TabOrder = 38 + end + inherited btnGetDateFollow: TButton + Images = ImageList1 + ImageIndex = 15 + TabOrder = 39 + end + inherited btnGetAgeAccaunt: TButton + Images = ImageList1 + ImageIndex = 15 + TabOrder = 40 + end + inherited btnCounterAddtoText: TButton + Images = ImageList1 + ImageIndex = 23 + TabOrder = 41 + end + inherited cbCounterName: TComboBox + TabOrder = 42 + end + inherited btnGPT: TButton + Images = ImageList1 + ImageIndex = 19 + TabOrder = 43 + end + inherited btnRandomUserName: TButton + Images = ImageList1 + ImageIndex = 11 + TabOrder = 44 + end + inherited btnGetChannelStat: TButton + Images = ImageList1 + ImageIndex = 22 + Size.Width = 136.000000000000000000 + TabOrder = 45 + end + inherited btnAIPic: TButton + Images = ImageList1 + ImageIndex = 5 + TabOrder = 46 + end end - inherited btnGetAgeAccaunt: TButton - Images = ImageList1 - ImageIndex = 15 - TabOrder = 39 - end - inherited btnCounterAddtoText: TButton + inherited btnAddCommand: TButton Images = ImageList1 ImageIndex = 0 - TabOrder = 40 end - inherited cbCounterName: TComboBox - TabOrder = 41 - end - inherited btnGPT: TButton + inherited btnEditCommand: TButton Images = ImageList1 - ImageIndex = 19 - TabOrder = 42 + ImageIndex = 3 end - inherited btnRandomUserName: TButton + inherited btnRmCommand: TButton Images = ImageList1 - ImageIndex = 11 - TabOrder = 43 + ImageIndex = 12 end - inherited btnGetChannelStat: TButton - Images = ImageList1 - ImageIndex = 20 - Size.Width = 128.000000000000000000 - TabOrder = 44 - end - inherited btnAIPic: TButton - Images = ImageList1 - ImageIndex = 5 - TabOrder = 45 - end - end - inherited btnAddCommand: TButton - Images = ImageList1 - ImageIndex = 0 - TabOrder = 42 - end - inherited btnEditCommand: TButton - Images = ImageList1 - ImageIndex = 3 - TabOrder = 43 - end - inherited btnRmCommand: TButton - Images = ImageList1 - ImageIndex = 4 - TabOrder = 44 - end - inherited cbTextToSpeech: TCheckBox - TabOrder = 45 end end inherited GroupBox9: TGroupBox @@ -301,7 +286,7 @@ object TTW_Bot: TTTW_Bot Viewport.Height = 116.000000000000000000 end inherited lbRandomRespons: TListBox - Viewport.Width = 270.000000000000000000 + Viewport.Width = 214.000000000000000000 Viewport.Height = 116.000000000000000000 end inherited btnRandomAdd: TButton @@ -312,25 +297,19 @@ object TTW_Bot: TTTW_Bot inherited btnRandomDel: TButton Images = ImageList1 ImageIndex = 12 - TabOrder = 37 end inherited btnRmGroup: TButton Images = ImageList1 ImageIndex = 4 - TabOrder = 38 - end - inherited Label4: TLabel - TabOrder = 39 end inherited Label5: TLabel - TabOrder = 41 + TabOrder = 42 end end inherited GroupBox8: TGroupBox inherited btnRandAdd: TButton Images = ImageList1 ImageIndex = 0 - TabOrder = 32 OnClick = frCommands1btnRandAddClick end inherited btnRandDel: TButton @@ -339,8 +318,8 @@ object TTW_Bot: TTTW_Bot end inherited sgRandomInt: TStringGrid TabOrder = 35 - Viewport.Width = 157.000000000000000000 - Viewport.Height = 144.000000000000000000 + Viewport.Width = 153.000000000000000000 + Viewport.Height = 119.000000000000000000 inherited scRIntName: TStringColumn Size.Width = 70.000000000000000000 end @@ -353,74 +332,61 @@ object TTW_Bot: TTTW_Bot end end inherited GroupBox11: TGroupBox - inherited btnSoundAdd: TButton - Images = ImageList1 - ImageIndex = 0 - TabOrder = 37 - end - inherited btnSoundDel: TButton - Images = ImageList1 - ImageIndex = 12 - TabOrder = 38 - end - inherited edtSoundName: TEdit - TabOrder = 39 - end - inherited edtSoundFileName: TEdit - TabOrder = 40 - end - inherited btnSoundOpen: TButton - Images = ImageList1 - ImageIndex = 14 - TabOrder = 41 - Text = '' - end - inherited tbSoundVolume: TTrackBar - TabOrder = 42 - end - inherited btnSoundTest: TButton - Images = ImageList1 - ImageIndex = 25 - TabOrder = 43 - end - inherited sgSAFiles: TStringGrid - TabOrder = 44 - Viewport.Width = 345.000000000000000000 - Viewport.Height = 149.000000000000000000 - inherited sgSAFile: TStringColumn - Size.Width = 220.000000000000000000 + Margins.Top = 200.000000000000000000 + inherited frsgSounds: TfrSimpleGrid + inherited sg: TStringGrid + Viewport.Width = 289.000000000000000000 + Viewport.Height = 124.000000000000000000 + inherited sgR2: TStringColumn + Size.Width = 170.000000000000000000 + end + end + inherited btnOpen: TButton + Images = ImageList1 + ImageIndex = 14 + Text = '' + end + inherited btnAdd: TButton + Images = ImageList1 + ImageIndex = 0 + end + inherited btnDel: TButton + Images = ImageList1 + ImageIndex = 12 + end + inherited btnEdt: TButton + Images = ImageList1 + ImageIndex = 3 + TabOrder = 45 end end end inherited GroupBox24: TGroupBox - inherited btnTextAdd: TButton - Images = ImageList1 - ImageIndex = 0 - TabOrder = 37 - end - inherited btnTextDel: TButton - Images = ImageList1 - ImageIndex = 12 - TabOrder = 38 - end - inherited edtTextName: TEdit - TabOrder = 39 - end - inherited edtTextFileName: TEdit - TabOrder = 40 - end - inherited btnTextOpen: TButton - Images = ImageList1 - ImageIndex = 14 - TabOrder = 41 - Text = '' - end - inherited sgTFiles: TStringGrid - TabOrder = 44 - Viewport.Width = 297.000000000000000000 - Viewport.Height = 149.000000000000000000 - inherited scTFileFile: TStringColumn - Size.Width = 170.000000000000000000 + inherited frsgFiles: TfrSimpleGrid + inherited sg: TStringGrid + Viewport.Width = 289.000000000000000000 + Viewport.Height = 124.000000000000000000 + inherited sgR2: TStringColumn + Size.Width = 170.000000000000000000 + end + end + inherited btnOpen: TButton + Images = ImageList1 + ImageIndex = 14 + Text = '' + end + inherited btnAdd: TButton + Images = ImageList1 + ImageIndex = 0 + end + inherited btnDel: TButton + Images = ImageList1 + ImageIndex = 12 + end + inherited btnEdt: TButton + Images = ImageList1 + ImageIndex = 3 + TabOrder = 45 end end end @@ -430,34 +396,27 @@ object TTW_Bot: TTTW_Bot end inherited GroupBox2: TGroupBox TabOrder = 7 - inherited sgAIGen: TStringGrid - TabOrder = 37 - Viewport.Width = 305.000000000000000000 - Viewport.Height = 149.000000000000000000 - inherited StringColumn2: TStringColumn - Size.Width = 180.000000000000000000 + inherited frsgNeiro: TfrSimpleGrid + inherited sg: TStringGrid + Viewport.Width = 289.000000000000000000 + Viewport.Height = 124.000000000000000000 + inherited sgR2: TStringColumn + Size.Width = 170.000000000000000000 + end + end + inherited btnAdd: TButton + Images = ImageList1 + ImageIndex = 0 + end + inherited btnDel: TButton + Images = ImageList1 + ImageIndex = 12 + end + inherited btnEdt: TButton + Images = ImageList1 + ImageIndex = 3 + TabOrder = 45 end - end - inherited edtAIGenName: TEdit - TabOrder = 38 - end - inherited edtAIGenRequest: TEdit - TabOrder = 39 - end - inherited btnAIGenAdd: TButton - Images = ImageList1 - ImageIndex = 0 - TabOrder = 40 - end - inherited btnAIGenDel: TButton - Images = ImageList1 - ImageIndex = 12 - TabOrder = 41 - end - inherited btnAIGetTextUser: TButton - Images = ImageList1 - ImageIndex = 11 - TabOrder = 42 end end end @@ -495,13 +454,13 @@ object TTW_Bot: TTTW_Bot ExplicitSize.cy = 26.000000000000000000 inline frOBS1: TfrOBS Align = Top - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 345.000000000000000000 Size.PlatformDefault = False inherited sgWebChats: TStringGrid - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 282.000000000000000000 - Viewport.Width = 1042.000000000000000000 + Viewport.Width = 970.000000000000000000 Viewport.Height = 282.000000000000000000 inherited StringColumn2: TStringColumn Size.Width = 200.000000000000000000 @@ -516,26 +475,14 @@ object TTW_Bot: TTTW_Bot OnClick = frChatOBS1btnCreateChatClick end inherited btnDeleteeChat: TButton + Anchors = [akTop, akRight] Images = ImageList1 ImageIndex = 4 - Position.X = 954.000000000000000000 + Position.X = 882.000000000000000000 TabOrder = 3 end inherited Label1: TLabel - TabOrder = 6 - end - object btnCreateChat: TButton [4] - Images = ImageList1 - ImageIndex = 5 - Position.X = 406.000000000000000000 - Position.Y = -80.000000000000000000 - Size.Width = 153.000000000000000000 - Size.Height = 22.000000000000000000 - Size.PlatformDefault = False - TabOrder = 1 - Text = #1057#1086#1079#1076#1072#1090#1100' '#1086#1087#1086#1074#1077#1097#1077#1085#1080#1077 - TextSettings.Trimming = None - OnClick = frChatOBS1btnCreateChatClick + TabOrder = 7 end inherited btnCreateOBSNotify: TButton Images = ImageList1 @@ -549,6 +496,19 @@ object TTW_Bot: TTTW_Bot Position.X = 264.000000000000000000 OnClick = frOBS1btnCreateOBSKandinskyClick end + object btnCreateChat: TButton + Images = ImageList1 + ImageIndex = 5 + Position.X = 406.000000000000000000 + Position.Y = -80.000000000000000000 + Size.Width = 153.000000000000000000 + Size.Height = 22.000000000000000000 + Size.PlatformDefault = False + TabOrder = 1 + Text = #1057#1086#1079#1076#1072#1090#1100' '#1086#1087#1086#1074#1077#1097#1077#1085#1080#1077 + TextSettings.Trimming = None + OnClick = frChatOBS1btnCreateChatClick + end end end object TabItem6: TTabItem @@ -568,7 +528,7 @@ object TTW_Bot: TTTW_Bot ExplicitSize.cy = 26.000000000000000000 inline frNotify1: TfrNotify Align = Client - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 718.000000000000000000 Size.PlatformDefault = False inherited btnNotifyOpen: TButton @@ -649,7 +609,7 @@ object TTW_Bot: TTTW_Bot ExplicitSize.cy = 26.000000000000000000 inline frAutoActions1: TfrAutoActions Align = Client - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 718.000000000000000000 Size.PlatformDefault = False inherited GroupBox20: TGroupBox @@ -768,20 +728,20 @@ object TTW_Bot: TTTW_Bot ExplicitSize.cy = 26.000000000000000000 inline frLog1: TfrLog Align = Client - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 718.000000000000000000 Size.PlatformDefault = False inherited Panel1: TPanel - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 inherited btnClear: TButton Images = ImageList1 ImageIndex = 4 end end inherited sgLog: TStringGrid - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 685.000000000000000000 - Viewport.Width = 1042.000000000000000000 + Viewport.Width = 970.000000000000000000 Viewport.Height = 685.000000000000000000 inherited StringColumn2: TStringColumn Size.Width = 170.000000000000000000 @@ -799,7 +759,7 @@ object TTW_Bot: TTTW_Bot object Panel1: TPanel Align = Bottom Position.Y = 744.000000000000000000 - Size.Width = 1042.000000000000000000 + Size.Width = 970.000000000000000000 Size.Height = 142.000000000000000000 Size.PlatformDefault = False TabOrder = 10 diff --git a/uGeneral.pas b/uGeneral.pas index 315e879..c96f874 100644 --- a/uGeneral.pas +++ b/uGeneral.pas @@ -135,8 +135,18 @@ begin myConst.cfg1 := myConst.GeneralPath + 'botapp.cfg'; db := TSettingsDatabase.Create(myConst.DBPath); - ReadDB; + frCommands1.frsgSounds.ObjectRecord:=frCommands1.listSounds; + frCommands1.frsgSounds.TableName:='listSounds'; + frCommands1.frsgSounds.UpdateGrid; + frCommands1.frsgFiles.ObjectRecord:=frCommands1.listFiles; + frCommands1.frsgFiles.TableName:='listFiles'; + frCommands1.frsgFiles.UpdateGrid; + frCommands1.frsgNeiro.ObjectRecord:=frCommands1.listNeiro; + frCommands1.frsgNeiro.TableName:='listNeiro'; + frCommands1.frsgNeiro.UpdateGrid; + + for Path in TDirectory.GetFiles(myConst.stlPath) do cbTheme.Items.Add(ExtractFileName(Path)); @@ -260,6 +270,12 @@ var procedure LoadGridsData; begin DB.LoadRecordArray('RandomCounters', frCommands1.RandomCounters); + DB.LoadRecordArray('listSounds', frCommands1.listSounds); + DB.LoadRecordArray('listFiles', frCommands1.listFiles); + DB.LoadRecordArray('listNeiro', frCommands1.listNeiro); + DB.LoadRecordArray('listCommands', frCommands1.listCommands); + + frCommands1.UpdateGridFromArray; { db.LoadGridFromTable('sgRandomInt', frCommands1.sgRandomInt); db.LoadGridFromTable('sgCommands', frCommands1.sgCommands); db.LoadGridFromTable('sgSAFiles', frCommands1.sgSAFiles); diff --git a/uRecords.pas b/uRecords.pas index 094887d..c9e8512 100644 --- a/uRecords.pas +++ b/uRecords.pas @@ -5,11 +5,18 @@ interface type TRandomCounters = record - Name: string; + rndName: string; Ot: Integer; ToValue: Integer; end; + type + TListCommands = record + R1: string; + R2: string; + end; + + type TConst = record GeneralPath: string;