Что делает этот код?…
- User
Что делает этот код?
//---------------------------------------------------------------------------
#include <fmx.h> #pragma hdrstop
#include "Unit5.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.fmx" TForm5 Owner) : TForm(Owner) { ShowMessage(ListBox1->Count); } //--------------------------------------------------------------------------- void __fastcall TForm5::SpeedButton4Click(TObject *Sender) { //ShowMessage("«апись сохранена"); int NewIndex; TListBoxItem *NewListBoxItem=new TListBoxItem(this); NewListBoxItem->Parent=ListBox1; NewIndex=ListBox1->Count+1; arDate[NewIndex]=deDateNew->Date; arTime[NewIndex]=teTimeNew->Time; arLength[NewIndex]=sbLengthNew->Value; arWater[NewIndex]=swWaterNew->IsChecked; arComment[NewIndex]=meCommentNew->Text; //NewListBoxItem=TListBoxItem->Create(ListBox1); NewListBoxItem->StyleLookup="listboxitembottomdetail"; NewListBoxItem->Height=44; NewListBoxItem->OnClick=ListBoxItem1Click; //NewListBoxItem->ItemData->Accessory=aMore; NewListBoxItem->ItemData->Text=DateToStr(arDate[NewIndex])+' '+TimeToStr(arTime[NewIndex]); NewListBoxItem->ItemData->Detail="ƒлина ростка " + FloatToStr(arLength[NewIndex])+ " мм"; ChangeTabAction2->ExecuteTarget(TabControl1); } //--------------------------------------------------------------------------- void __fastcall TForm5::ListBoxItem1Click(TObject *Sender) { int ListBoxItemIndex; if(ListBox1->ItemIndex<0) return; ListBoxItemIndex=ListBox1->ItemIndex+2; laDateTimeValue->Text=DateToStr(arDate[ListBoxItemIndex])+' '+TimeToStr(arTime[ListBoxItemIndex]); laLengthValue->Text="ƒлина ростка "+FloatToStr(arLength[ListBoxItemIndex])+" мм"; if (arWater[ListBoxItemIndex]) laWaterValue->Text="ƒа"; else laWaterValue->Text="Ќет"; laCommentValue->Text=arComment[ListBoxItemIndex]; ChangeTabAction3->ExecuteTarget(TabControl1); } //--------------------------------------------------------------------------- void __fastcall TForm5::FormCreate(TObject *Sender) { for(int i=0;i<31;i++){ arLength[i]=0.0; arWater[i]=false; arComment[i]=""; arDate[i]=0; arTime[i]=0; } } //---------------------------------------------------------------------------
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.