Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ToolbarWindow32 - Icons
#1
Im finding it difficult to add custom icons,

i use 2 ToolbarWindow32 in my dialog which changes depending on selections that have been previos selected.

what i want to do, is add certain icons to the cases [1001,1002,1003,1004,2001,2002,2003,2004]

i have used the examples from the ARCHIVE
here is whats in DEX_Main where it loads the icons or bitmap.

Function DEX_Main
Code:
Copy      Help
#compile "DEX_CC_API"

type DEX_DATA il1 il2 il3 ;;you can add more members to store various data
DEX_DATA d ;;to access this variable from dialog procedure, use DEX_DATA& d; &d=+DT_GetParam(hDlg)

#if QMVER>=0x2030003
;add bitmap containing all icons
d.il1=__ImageListLoad("$qm$\il_qm.bmp") ;;the function loads an imagelist created with the imagelist editor. The function and the editor are unavailable in older QM versions. Instead can be used for example ImageList_LoadImage.
#else
;load multiple files (slower):
d.il1=ImageList_Create(16 16 ILC_MASK|ILC_COLOR32 0 10)
Dir k; int i
foreach(k "$qm$\*.ico" FE_Dir) ImageList_ReplaceIcon(d.il1 -1 GetIcon(k.FileName(1))); i+1; if(i=15) break
;or add bitmap containing all icons
;d.il1=ImageList_LoadImage(0 _s.expandpath("$my qm$\for_imagelist.bmp") 16 0 0xFF00FF IMAGE_BITMAP LR_LOADFROMFILE)
#endif

d.il2=d.il1; d.il3=d.il1 ;;in real world, you can use ImageList_LoadImage/ImageList_Destroy to use different bitmaps for each control

if(!ShowDialog("DEX_Dialog" &DEX_Dialog 0 0 0 0 0 &d)) ret

ImageList_Destroy(d.il1);; ImageList_Destroy(d.il2); ImageList_Destroy(d.il3)

im a little lost on what to do, if u can poitn me in right direction would be great thanks.
#2
d.il1=ImageList_Create(16 16 ILC_MASK|ILC_COLOR32 0 10)
Dir k; int i
foreach(k "$qm$\*.ico" FE_Dir) ImageList_ReplaceIcon(d.il1 -1 GetIcon(k.FileName(1))); i+1; if(i=15) break

-->

Code:
Copy      Help
str iconlist=
;$qm$\close.ico
;$qm$\controls.ico
;$qm$\copy.ico
;$qm$\cut.ico
;$qm$\del.ico
;$qm$\dialog.ico
;$qm$\email.ico
;$qm$\favorites.ico
;$qm$\files.ico
;$qm$\find.ico
d.il1=ImageList_Create(16 16 ILC_MASK|ILC_COLOR32 0 10)
for(_i 0 10) _s.getl(iconlist -_i); ImageList_ReplaceIcon(d.il1 -1 GetIcon(_s))
#3
thank you.


Forum Jump:


Users browsing this thread: 1 Guest(s)