I was playing around with the TParamListBox to see if I could select an icon. I tried setting it up as a Custom Edit item and put the inside of it. It showed the icon like I wanted. So with an event for OnParamCustomEdit() I extracted the icon index, put up a dialog to select the icon, then set the value. The new value showed as the raw text and didn't change the icon itself. Here's my test code to see if I could get this to work:
void __fastcall TSettingsForm::ParamListBox1ParamCustomEdit(TObject *Sender, int idx,
UnicodeString href, UnicodeString value, UnicodeString props, TRect &EditRect)
{
int pos=value.Pos(_T("idx:"));
TImageIndex ii=_tcstoul(value.SubString(pos, 4).t_str(), NULL, 10);
if (TIconSelectionForm::SelectIcon(this, ii)==mrOk) {
value.sprintf(_T("<IMG src=\"idx:%i\">"), ii);
TParamListBox *plb=dynamic_cast<TParamListBox *>(Sender);
if (plb) {
plb->Parameter[href]=value;
}
}
}
Is there some way to easily do what I want? It's almost there, just setting the value doesn't result with the changed icon (it shows the icon and then the raw text).
Thanks.