many Buttons ... and Icons ?

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 802
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 113 times
Been thanked: 202 times

many Buttons ... and Icons ?

Post by AUGE_OHR »

hi,

i want to make this
Shell32 Icon.jpg
Shell32 Icon.jpg (354.52 KiB) Viewed 527 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 :?:
have fun
Jimmy

User avatar
gfilatov
Posts: 727
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 27 times
Been thanked: 336 times
Contact:

Post 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 515 times
P.S. The all source code of the above sample is available at the MiniguiEX distribution, of course.
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
AUGE_OHR
Posts: 802
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 113 times
Been thanked: 202 times

Post 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 ... :?:
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 802
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 113 times
Been thanked: 202 times

Post 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 434 times
attached file include Array with all Resource-ID found in System DLL
RESID.ZIP
(7.32 KiB) Downloaded 41 times
have fun
Jimmy

Post Reply