***
https://www.hmgforum.com/viewtopic.php?f ... 229#p36229
1st Step is to assign BT_ImageListGetSystemIcon() to GRID "ImageList"
Code: Select all
STATIC PROCEDURE DefGridLeft( cForm, cObj, nDimStack )
@ nRow, nCol GRID &cObj ;
PARENT &cForm ;
...
SetProperty( cForm, cObj, "ImageList", BT_ImageListGetSystemIcon() )Code: Select all
STATIC PROCEDURE FillWithDir( cForm, cObj, cNewPath, cUpDn )
aNewDir := DIRECTORY( cNewPath + "*.*", "DHS" )
aFiles_Left := BT_DirectoryInfo ( cNewPath, BT_DIRECTORYINFO_LISTALL )Great Sample from Dr. Claudio Soto use these Step
Code: Select all
FOR i = 1 TO HMG_LEN (aFiles)
...
Form_1.Grid_1.AddItem (aItem)
Form_1.Grid_1.ImageIndex (i,1) := aFiles [i] [BT_DIRECTORYINFO_INTERNALDATA_IMAGEINDEX]as i have "Split" it Icon are assign in 3th Step
Code: Select all
STATIC PROCEDURE DirImageColor( aDir, cForm, cObj )
LOCAL cExt, i, iMax := LEN( aDir )
LOCAL cName, nPosi, nIndex
FOR i := 1 TO iMax
cName := aDir[i][F_NAME]
IF cForm = "WinLeft"
nPosi := ASCAN( aFiles_Left, {|e| e[BT_DIRECTORYINFO_NAME] = cName })
IF nPosi > 0
nIndex := aFiles_Left[nPosi][BT_DIRECTORYINFO_INTERNALDATA_IMAGEINDEX]
SetProperty( cForm, cObj, "ImageIndex", i, 1, nIndex )
ENDIF
ELSEIF cForm = "WinRight"