1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| //---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
addLine=true;
ValueListEditor1->InsertRow("Start","",true);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ValueListEditor1GetPickList(TObject *Sender,
const AnsiString KeyName, TStrings *Values)
{
Values->Clear();
Values->Append("Hello 1");
Values->Append("Hello 2");
Values->Append("Hello 3");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ValueListEditor1Validate(TObject *Sender, int ACol,
int ARow, const AnsiString KeyName, const AnsiString KeyValue)
{
MessageDlg(KeyName+"="+KeyValue+" is ok",mtInformation,
TMsgDlgButtons()<<mbOK,0);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ValueListEditor1StringsChange(TObject *Sender)
{
if (!addLine) return;
addLine=false;
ValueListEditor1->InsertRow("New","",true);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ValueListEditor1SelectCell(TObject *Sender,
int ACol, int ARow, bool &CanSelect)
{
AnsiString currentContent=ValueListEditor1->Cells[ACol][ARow];
if (currentContent.IsEmpty()) addLine=true;
else addLine=false;
}
//--------------------------------------------------------------------------- |
Partager