Помощи не дождешься, пришлось самому писать
вот может кому пригодится и проще чем в примере с оффсайта
Код: [no]//---------------------------------------------------------------------------
void TForm1::LoadSkinInfo(AnsiString SkinFolder,TdxGalleryControl *Gallery)
{
TSearchRec sr;
AnsiString SkinNane,SkinGroupName;
int KlGroup=0;
int GroupIndex;
if (FindFirst(SkinFolder+"\\*.skinres", faAnyFile, sr) == 0)
{
do
{
TBitmap *SkinIcon = new TBitmap();
TStream* AStream= new TFileStream(SkinFolder+"\\"+sr.Name,fmOpenRead | fmShareDenyWrite);
TdxSkinBinaryReader *AReader = new TdxSkinBinaryReader(AStream);
SkinGroupName=AReader->SkinDetails[0]->GroupName;
SkinNane=AReader->SkinDetails[0]->DisplayName;
SkinIcon=AReader->SkinDetails[0]->Icons[sis48]->GetAsBitmap();
for (int i = 0; i < Gallery->Gallery->Groups->Count; i++)
{
if (Gallery->Gallery->Groups->Groups[i]->Caption==SkinGroupName)
{
KlGroup++;
GroupIndex=i;
}
}
if (KlGroup==0)
{
Gallery->Gallery->Groups->Add();
Gallery->Gallery->Groups->Groups[Gallery->Gallery->Groups->Count-1]->Caption=SkinGroupName;
GroupIndex=Gallery->Gallery->Groups->Count-1;
}
TdxGalleryControlItem *AItem = Gallery->Gallery->Groups->Groups[GroupIndex]->Items->Add();
AItem->Glyph->Assign(SkinIcon);
AItem->Caption = SkinNane;
AItem->Name=sr.Name.SubString(1,sr.Name.Pos(".")-1);
delete AStream;
delete AReader;
} while (FindNext(sr) == 0);
FindClose(sr);
}
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
LoadSkinInfo(Edit1->Text,dxGalleryControl123);
}
//---------------------------------------------------------------------------
[/no]
вот может кому пригодится и проще чем в примере с оффсайта
Код: [no]//---------------------------------------------------------------------------
void TForm1::LoadSkinInfo(AnsiString SkinFolder,TdxGalleryControl *Gallery)
{
TSearchRec sr;
AnsiString SkinNane,SkinGroupName;
int KlGroup=0;
int GroupIndex;
if (FindFirst(SkinFolder+"\\*.skinres", faAnyFile, sr) == 0)
{
do
{
TBitmap *SkinIcon = new TBitmap();
TStream* AStream= new TFileStream(SkinFolder+"\\"+sr.Name,fmOpenRead | fmShareDenyWrite);
TdxSkinBinaryReader *AReader = new TdxSkinBinaryReader(AStream);
SkinGroupName=AReader->SkinDetails[0]->GroupName;
SkinNane=AReader->SkinDetails[0]->DisplayName;
SkinIcon=AReader->SkinDetails[0]->Icons[sis48]->GetAsBitmap();
for (int i = 0; i < Gallery->Gallery->Groups->Count; i++)
{
if (Gallery->Gallery->Groups->Groups[i]->Caption==SkinGroupName)
{
KlGroup++;
GroupIndex=i;
}
}
if (KlGroup==0)
{
Gallery->Gallery->Groups->Add();
Gallery->Gallery->Groups->Groups[Gallery->Gallery->Groups->Count-1]->Caption=SkinGroupName;
GroupIndex=Gallery->Gallery->Groups->Count-1;
}
TdxGalleryControlItem *AItem = Gallery->Gallery->Groups->Groups[GroupIndex]->Items->Add();
AItem->Glyph->Assign(SkinIcon);
AItem->Caption = SkinNane;
AItem->Name=sr.Name.SubString(1,sr.Name.Pos(".")-1);
delete AStream;
delete AReader;
} while (FindNext(sr) == 0);
FindClose(sr);
}
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
LoadSkinInfo(Edit1->Text,dxGalleryControl123);
}
//---------------------------------------------------------------------------
[/no]