Page 1 of 1

many Buttons ... and Icons ?

Posted: Wed Nov 06, 2019 10:14 am
by AUGE_OHR
hi,

i want to make this
Shell32 Icon.jpg
Shell32 Icon.jpg (354.52 KiB) Viewed 1956 times
it have a lot of Button which are create in FOR / NEXT Loop
so how todo it wit HMG :?:

Code: Select all

      FOR j := 1 TO jMax
         FOR i := 1 TO iMax
            cNr := STRZERO(nCount,3)
            cButton := "Button"+cNr
            cName := "_Form_1_"+cButton

            @ (j-1)*((nHeigh-30)/jMax)+nY-10, (i-1)*((nWide+nX)/iMax) BUTTON &cButton ;
               PARENT  Label_1         ;
               CAPTION cNr             ;
               PICTURE "button.bmp"    ;
               ACTION MsgInfo("hello "+cNr) ;
               RIGHT     ;
               WIDTH  48 ;
               HEIGHT 48

               // how to add all to Array ?
               // AADD(aButton,ThisWindow.Name+This.Name)
               // AADD(aButton,&cName)

            nCount++
         NEXT
      NEXT
i try to use a Macro &cButton for Button-Name ... and add "Object" to Array for later use to hide()/show()
i also like to ask if i can use PICTURE with Icon / Imagelist :?:

---

many Windows System DLL include Icons.
this Way i get it under Xbase++

Code: Select all

         // create Icon
         oIco := XbpIcon() :new() :create()
         // load from Windows System DLL  
         IF nResId = 2526 .OR. nResId = 2389
           oIco:load( WinDir+"\System32\DDORes.dll", nResId,64,64 )
         ELSE
           oIco:load( WinDir+"\System32\imageres.dll", nResId,64,64 )
         ENDIF

         IF oIco:xSize > 0
            xImage := oIco
         ELSE
            oIco:Destroy()
         ENDIF
in HMG i have search for IMAGE_ICON but i seems me it "loadIcon" only from "own" Resource ... not from DLL :?:
so how todo it under harbour / HMG :?:

Re: many Buttons ... and Icons ?

Posted: Wed Nov 06, 2019 11:38 am
by gfilatov
AUGE_OHR wrote: Wed Nov 06, 2019 10:14 am hi,

i want to make this
...
i also like to ask if i can use PICTURE with Icon / Imagelist :?:
...
so how todo it under harbour / HMG :?:
Hi,

You can not do it in the HMG because the BUTTON control is not supported an ICON clause here. :o

BTW Please take a look for the following image from a basic sample in the MiniGUI Extended :arrow:
icons.png
icons.png (350.03 KiB) Viewed 1944 times
P.S. The all source code of the above sample is available at the MiniguiEX distribution, of course.

Re: many Buttons ... and Icons ?

Posted: Wed Nov 06, 2019 9:24 pm
by AUGE_OHR
hi

Thx for Answer.

can you tell me please which Sample produce that Snapshot :?:

---

i have HMG in C:\hmg.3.4.4 and MiniGUI in c:\MiniGUI
so what to use now ... :?:

Re: many Buttons ... and Icons ?

Posted: Thu Nov 07, 2019 5:16 am
by AUGE_OHR
hi,

found it : c:\MiniGUI\SAMPLES\BASIC\ExtractIcon\demo2.prg :D

---

i found in c in c:\MiniGUI\SOURCE\c_icon.c

Code: Select all

// HICON ExtractIcon( HINSTANCE hInst, LPCTSTR lpszExeFileName, UINT nIconIndex )
HB_FUNC( EXTRACTICON )

// UINT ExtractIconEx( LPCTSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons )
HB_FUNC( EXTRACTICONEX )
as i see it use nIconIndex.
Question : how to use it with Resource-ID :?:

nIconIndex 315 = Resource-ID 16826
Shell32_ResourceID.jpg
Shell32_ResourceID.jpg (18.02 KiB) Viewed 1863 times
attached file include Array with all Resource-ID found in System DLL
RESID.ZIP
(7.32 KiB) Downloaded 177 times