добавил групповые ответы

This commit is contained in:
PC1\PTyTb
2025-08-07 19:04:26 +03:00
parent b62450b6ec
commit a4cbf1c709
8 changed files with 273 additions and 161 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ uses
uWSDA in 'uWSDA.pas',
uQ in 'uQ.pas' {frmQ},
fSimpleGrid in 'fSimpleGrid.pas' {frSimpleGrid: TFrame},
fContruct in 'fContruct.pas' {frContruct: TFrame};
fContruct in 'fContruct.pas' {frContruct: TFrame},
fGroupsRequest in 'fGroupsRequest.pas' {frGroupsRequest: TFrame};
{$R *.res}
+5
View File
@@ -387,6 +387,11 @@
<FormType>fmx</FormType>
<DesignClass>TFrame</DesignClass>
</DCCReference>
<DCCReference Include="fGroupsRequest.pas">
<Form>frGroupsRequest</Form>
<FormType>fmx</FormType>
<DesignClass>TFrame</DesignClass>
</DCCReference>
<None Include=".gitignore"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
+22 -99
View File
@@ -100,106 +100,29 @@ object frCommands: TfrCommands
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
TabOrder = 3
object lbRandomGroup: TListBox
Position.X = 9.000000000000000000
Position.Y = 49.000000000000000000
Size.Width = 121.000000000000000000
Size.Height = 120.000000000000000000
inline frGroupsRequest1: TfrGroupsRequest
Align = Client
Size.Width = 344.000000000000000000
Size.Height = 216.000000000000000000
Size.PlatformDefault = False
TabOrder = 11
DisableFocusEffect = True
ItemHeight = 13.000000000000000000
DefaultItemStyles.ItemStyle = ''
DefaultItemStyles.GroupHeaderStyle = ''
DefaultItemStyles.GroupFooterStyle = ''
Left = 208
Top = 315
Viewport.Width = 117.000000000000000000
Viewport.Height = 116.000000000000000000
end
object lbRandomRespons: TListBox
Position.X = 127.000000000000000000
Position.Y = 49.000000000000000000
Size.Width = 218.000000000000000000
Size.Height = 120.000000000000000000
Size.PlatformDefault = False
TabOrder = 13
DisableFocusEffect = True
ItemHeight = 13.000000000000000000
DefaultItemStyles.ItemStyle = ''
DefaultItemStyles.GroupHeaderStyle = ''
DefaultItemStyles.GroupFooterStyle = ''
Left = 335
Top = 315
Viewport.Width = 214.000000000000000000
Viewport.Height = 116.000000000000000000
end
object edtRandomGroup: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
TabOrder = 12
Text = 'GRP1'
Position.X = 9.000000000000000000
Position.Y = 177.000000000000000000
Size.Width = 121.000000000000000000
Size.Height = 21.000000000000000000
Size.PlatformDefault = False
Left = 208
Top = 514
end
object edtRandomRespons: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
TabOrder = 14
Position.X = 127.000000000000000000
Position.Y = 177.000000000000000000
Size.Width = 218.000000000000000000
Size.Height = 21.000000000000000000
Size.PlatformDefault = False
Left = 335
Top = 514
end
object btnRandomAdd: TButton
Position.X = 8.000000000000000000
Position.Y = 206.000000000000000000
TabOrder = 38
Text = #1044#1086#1073#1072#1074#1080#1090#1100
TextSettings.Trimming = None
end
object btnRandomDel: TButton
Position.X = 97.000000000000000000
Position.Y = 206.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
end
object btnRmGroup: TButton
Position.X = 207.000000000000000000
Position.Y = 206.000000000000000000
Size.Width = 138.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 40
Text = #1059#1076#1072#1083#1080#1090#1100' '#1074#1089#1102' '#1075#1088#1091#1087#1087#1091
TextSettings.Trimming = None
end
object Label4: TLabel
Position.X = 9.000000000000000000
Position.Y = 24.000000000000000000
Size.Width = 110.000000000000000000
Size.Height = 17.000000000000000000
Size.PlatformDefault = False
TextSettings.Trimming = None
Text = #1043#1088#1091#1087#1087#1072
TabOrder = 41
end
object Label5: TLabel
Position.X = 127.000000000000000000
Position.Y = 24.000000000000000000
TextSettings.Trimming = None
Text = #1042#1072#1088#1080#1072#1085#1090#1099' '#1086#1090#1074#1077#1090#1072
TabOrder = 44
inherited lbRandomGroup: TListBox
OnDblClick = frGroupsRequest1lbRandomGroupDblClick
Viewport.Width = 117.000000000000000000
Viewport.Height = 116.000000000000000000
end
inherited lbRandomRespons: TListBox
Viewport.Width = 207.000000000000000000
Viewport.Height = 116.000000000000000000
end
inherited btnRandomAdd: TButton
TabOrder = 37
end
inherited btnRandomDel: TButton
TabOrder = 38
end
inherited btnRmGroup: TButton
TabOrder = 39
end
end
end
object GroupBox8: TGroupBox
+9 -10
View File
@@ -8,7 +8,7 @@ uses
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,
fSimpleGrid, fContruct;
fSimpleGrid, fContruct, fGroupsRequest;
type
TfrCommands = class(TFrame)
@@ -17,15 +17,6 @@ type
scResponse: TStringColumn;
GroupBox1: TGroupBox;
GroupBox9: TGroupBox;
lbRandomGroup: TListBox;
lbRandomRespons: TListBox;
edtRandomGroup: TEdit;
edtRandomRespons: TEdit;
btnRandomAdd: TButton;
btnRandomDel: TButton;
btnRmGroup: TButton;
Label4: TLabel;
Label5: TLabel;
GroupBox8: TGroupBox;
edtRandomName: TEdit;
edtOt: TEdit;
@@ -44,6 +35,7 @@ type
frsgFiles: TfrSimpleGrid;
frsgNeiro: TfrSimpleGrid;
frContruct1: TfrContruct;
frGroupsRequest1: TfrGroupsRequest;
procedure btnRandAddClick(Sender: TObject);
procedure btnRandDelClick(Sender: TObject);
procedure frsgSoundsbtnSoundDelClick(Sender: TObject);
@@ -59,6 +51,7 @@ type
procedure sgCommandsCellClick(const Column: TColumn; const Row: Integer);
procedure sgRandomIntCellDblClick(const Column: TColumn;
const Row: Integer);
procedure frGroupsRequest1lbRandomGroupDblClick(Sender: TObject);
private
{ Private declarations }
@@ -153,6 +146,12 @@ begin
end;
procedure TfrCommands.frGroupsRequest1lbRandomGroupDblClick(Sender: TObject);
begin
frContruct1.mResponse.Lines.text := frContruct1.mResponse.Lines.text + ' {{' + frGroupsRequest1.lbRandomGroup.Items
[frGroupsRequest1.lbRandomGroup.ItemIndex] + '}}';
end;
procedure TfrCommands.frsgFilessgCellDblClick(const Column: TColumn;
const Row: Integer);
begin
+112
View File
@@ -0,0 +1,112 @@
object frGroupsRequest: TfrGroupsRequest
Align = Client
Size.Width = 351.000000000000000000
Size.Height = 219.000000000000000000
Size.PlatformDefault = False
object lbRandomGroup: TListBox
Position.X = 8.000000000000000000
Position.Y = 33.000000000000000000
Size.Width = 121.000000000000000000
Size.Height = 120.000000000000000000
Size.PlatformDefault = False
TabOrder = 11
DisableFocusEffect = True
ItemHeight = 13.000000000000000000
DefaultItemStyles.ItemStyle = ''
DefaultItemStyles.GroupHeaderStyle = ''
DefaultItemStyles.GroupFooterStyle = ''
OnChange = lbRandomGroupChange
Left = 208
Top = 315
Viewport.Width = 117.000000000000000000
Viewport.Height = 116.000000000000000000
end
object lbRandomRespons: TListBox
Position.X = 126.000000000000000000
Position.Y = 33.000000000000000000
Size.Width = 211.000000000000000000
Size.Height = 120.000000000000000000
Size.PlatformDefault = False
TabOrder = 13
OnClick = lbRandomResponsClick
DisableFocusEffect = True
ItemHeight = 13.000000000000000000
DefaultItemStyles.ItemStyle = ''
DefaultItemStyles.GroupHeaderStyle = ''
DefaultItemStyles.GroupFooterStyle = ''
Left = 335
Top = 315
Viewport.Width = 207.000000000000000000
Viewport.Height = 116.000000000000000000
end
object edtRandomGroup: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
TabOrder = 12
Text = 'GRP1'
Position.X = 8.000000000000000000
Position.Y = 161.000000000000000000
Size.Width = 121.000000000000000000
Size.Height = 21.000000000000000000
Size.PlatformDefault = False
Left = 208
Top = 514
end
object edtRandomRespons: TEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
TabOrder = 14
Position.X = 126.000000000000000000
Position.Y = 161.000000000000000000
Size.Width = 211.000000000000000000
Size.Height = 21.000000000000000000
Size.PlatformDefault = False
Left = 335
Top = 514
end
object btnRandomAdd: TButton
Position.X = 7.000000000000000000
Position.Y = 190.000000000000000000
TabOrder = 38
Text = #1044#1086#1073#1072#1074#1080#1090#1100
TextSettings.Trimming = None
OnClick = btnRandomAddClick
end
object btnRandomDel: TButton
Position.X = 96.000000000000000000
Position.Y = 190.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 = btnRandomDelClick
end
object btnRmGroup: TButton
Position.X = 205.000000000000000000
Position.Y = 190.000000000000000000
Size.Width = 138.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 40
Text = #1059#1076#1072#1083#1080#1090#1100' '#1074#1089#1102' '#1075#1088#1091#1087#1087#1091
TextSettings.Trimming = None
OnClick = btnRmGroupClick
end
object Label4: TLabel
Position.X = 8.000000000000000000
Position.Y = 8.000000000000000000
Size.Width = 110.000000000000000000
Size.Height = 17.000000000000000000
Size.PlatformDefault = False
TextSettings.Trimming = None
Text = #1043#1088#1091#1087#1087#1072
TabOrder = 41
end
object Label5: TLabel
Position.X = 126.000000000000000000
Position.Y = 8.000000000000000000
TextSettings.Trimming = None
Text = #1042#1072#1088#1080#1072#1085#1090#1099' '#1086#1090#1074#1077#1090#1072
TabOrder = 44
end
end
+87
View File
@@ -0,0 +1,87 @@
unit fGroupsRequest;
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.Controls.Presentation, FMX.Edit, FMX.Layouts, FMX.ListBox;
type
TfrGroupsRequest = class(TFrame)
lbRandomGroup: TListBox;
lbRandomRespons: TListBox;
edtRandomGroup: TEdit;
edtRandomRespons: TEdit;
btnRandomAdd: TButton;
btnRandomDel: TButton;
btnRmGroup: TButton;
Label4: TLabel;
Label5: TLabel;
procedure btnRandomAddClick(Sender: TObject);
procedure btnRandomDelClick(Sender: TObject);
procedure btnRmGroupClick(Sender: TObject);
procedure lbRandomGroupChange(Sender: TObject);
procedure lbRandomResponsClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
implementation
{$R *.fmx}
uses ugeneral;
procedure TfrGroupsRequest.btnRandomAddClick(Sender: TObject);
var
i: Integer;
begin
i := lbRandomGroup.ItemIndex;
DB.addGroupResponse(edtRandomGroup.text, edtRandomRespons.text);
DB.getGroupName(lbRandomGroup.Items);
if i <> -1 then
begin
DB.getGroupResponse(lbRandomGroup.Items[i], lbRandomRespons.Items);
lbRandomGroup.ItemIndex := i;
end;
end;
procedure TfrGroupsRequest.btnRandomDelClick(Sender: TObject);
var
i: Integer;
begin
i := lbRandomGroup.ItemIndex;
if (edtRandomGroup.text = '') or (edtRandomRespons.text = '') then
exit;
DB.delGroupResponse(edtRandomGroup.text, edtRandomRespons.text);
DB.getGroupResponse(lbRandomGroup.Items[i], lbRandomRespons.Items);
lbRandomGroup.ItemIndex := i;
end;
procedure TfrGroupsRequest.btnRmGroupClick(Sender: TObject);
begin
if lbRandomGroup.ItemIndex = -1 then
exit;
DB.delGroupName(lbRandomGroup.Items[lbRandomGroup.ItemIndex]);
DB.getGroupName(lbRandomGroup.Items);
lbRandomRespons.Items.Clear;
end;
procedure TfrGroupsRequest.lbRandomGroupChange(Sender: TObject);
begin
DB.getGroupResponse(lbRandomGroup.Items[lbRandomGroup.ItemIndex],
lbRandomRespons.Items);
end;
procedure TfrGroupsRequest.lbRandomResponsClick(Sender: TObject);
begin
if (lbRandomGroup.ItemIndex = -1) or (lbRandomRespons.ItemIndex = -1) then
exit;
edtRandomGroup.text := lbRandomGroup.Items[lbRandomGroup.ItemIndex];
edtRandomRespons.text := lbRandomRespons.Items[lbRandomRespons.ItemIndex];
end;
end.
+35 -50
View File
@@ -204,8 +204,8 @@ object TTW_Bot: TTTW_Bot
Size.Height = 718.000000000000000000
Size.PlatformDefault = False
inherited sgCommands: TStringGrid
Viewport.Width = 536.000000000000000000
Viewport.Height = 168.000000000000000000
Viewport.Width = 540.000000000000000000
Viewport.Height = 193.000000000000000000
inherited scCommand: TStringColumn
Size.Width = 134.000000000000000000
end
@@ -217,53 +217,42 @@ object TTW_Bot: TTTW_Bot
inherited frContruct1: TfrContruct
inherited mResponse: TMemo
Size.Width = 384.000000000000000000
Viewport.Width = 380.000000000000000000
Viewport.Height = 157.000000000000000000
Viewport.Width = 384.000000000000000000
Viewport.Height = 161.000000000000000000
end
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 btnAddCommand: TButton
@@ -281,29 +270,21 @@ object TTW_Bot: TTTW_Bot
end
end
inherited GroupBox9: TGroupBox
inherited lbRandomGroup: TListBox
Viewport.Width = 117.000000000000000000
Viewport.Height = 116.000000000000000000
end
inherited lbRandomRespons: TListBox
Viewport.Width = 214.000000000000000000
Viewport.Height = 116.000000000000000000
end
inherited btnRandomAdd: TButton
Images = ImageList1
ImageIndex = 0
TabOrder = 36
end
inherited btnRandomDel: TButton
Images = ImageList1
ImageIndex = 12
end
inherited btnRmGroup: TButton
Images = ImageList1
ImageIndex = 4
end
inherited Label5: TLabel
TabOrder = 42
inherited frGroupsRequest1: TfrGroupsRequest
inherited lbRandomGroup: TListBox
Viewport.Width = 117.000000000000000000
Viewport.Height = 116.000000000000000000
end
inherited lbRandomRespons: TListBox
Viewport.Width = 207.000000000000000000
Viewport.Height = 116.000000000000000000
end
inherited Label4: TLabel
TabOrder = 40
end
inherited Label5: TLabel
TabOrder = 43
end
end
end
inherited GroupBox8: TGroupBox
@@ -318,8 +299,8 @@ object TTW_Bot: TTTW_Bot
end
inherited sgRandomInt: TStringGrid
TabOrder = 35
Viewport.Width = 153.000000000000000000
Viewport.Height = 119.000000000000000000
Viewport.Width = 157.000000000000000000
Viewport.Height = 144.000000000000000000
inherited scRIntName: TStringColumn
Size.Width = 70.000000000000000000
end
@@ -335,8 +316,8 @@ object TTW_Bot: TTTW_Bot
Margins.Top = 200.000000000000000000
inherited frsgSounds: TfrSimpleGrid
inherited sg: TStringGrid
Viewport.Width = 289.000000000000000000
Viewport.Height = 124.000000000000000000
Viewport.Width = 293.000000000000000000
Viewport.Height = 149.000000000000000000
inherited sgR2: TStringColumn
Size.Width = 170.000000000000000000
end
@@ -364,8 +345,8 @@ object TTW_Bot: TTTW_Bot
inherited GroupBox24: TGroupBox
inherited frsgFiles: TfrSimpleGrid
inherited sg: TStringGrid
Viewport.Width = 289.000000000000000000
Viewport.Height = 124.000000000000000000
Viewport.Width = 293.000000000000000000
Viewport.Height = 149.000000000000000000
inherited sgR2: TStringColumn
Size.Width = 170.000000000000000000
end
@@ -398,8 +379,8 @@ object TTW_Bot: TTTW_Bot
TabOrder = 7
inherited frsgNeiro: TfrSimpleGrid
inherited sg: TStringGrid
Viewport.Width = 289.000000000000000000
Viewport.Height = 124.000000000000000000
Viewport.Width = 293.000000000000000000
Viewport.Height = 149.000000000000000000
inherited sgR2: TStringColumn
Size.Width = 170.000000000000000000
end
@@ -880,7 +861,8 @@ object TTW_Bot: TTTW_Bot
TabOrder = 11
end
object Label1: TLabel
Position.X = 760.000000000000000000
Anchors = [akTop, akRight]
Position.X = 821.000000000000000000
Position.Y = 8.000000000000000000
Text = #1054#1090#1076#1077#1083#1100#1085#1086#1077' '#1089#1087#1072#1089#1080#1073#1086':'
TabOrder = 12
@@ -914,9 +896,10 @@ object TTW_Bot: TTTW_Bot
TabOrder = 0
end
object SpeedButton1: TSpeedButton
Anchors = [akTop, akRight]
Images = ImageList1
ImageIndex = 11
Position.X = 760.000000000000000000
Position.X = 821.000000000000000000
Position.Y = 33.000000000000000000
Size.Width = 141.000000000000000000
Size.Height = 22.000000000000000000
@@ -926,9 +909,10 @@ object TTW_Bot: TTTW_Bot
OnClick = SpeedButton1Click
end
object SpeedButton2: TSpeedButton
Anchors = [akTop, akRight]
Images = ImageList1
ImageIndex = 11
Position.X = 760.000000000000000000
Position.X = 821.000000000000000000
Position.Y = 63.000000000000000000
Size.Width = 141.000000000000000000
Size.Height = 22.000000000000000000
@@ -938,9 +922,10 @@ object TTW_Bot: TTTW_Bot
OnClick = SpeedButton2Click
end
object SpeedButton3: TSpeedButton
Anchors = [akTop, akRight]
Images = ImageList1
ImageIndex = 11
Position.X = 760.000000000000000000
Position.X = 821.000000000000000000
Position.Y = 93.000000000000000000
Size.Width = 141.000000000000000000
Size.Height = 22.000000000000000000
+1 -1
View File
@@ -286,7 +286,7 @@ var
// Çàãðóçêà ñïèñêà ãðóïï
procedure LoadGroupNames;
begin
db.getGroupName(frCommands1.lbRandomGroup.Items);
db.getGroupName(frCommands1.frGroupsRequest1.lbRandomGroup.Items);
end;
// Çàãðóçêà çàøèôðîâàííîãî êîíôèãà