In a larger script I get icons which I want to display collected in a row forming a button bar.
In the simulated screenshot herafter the top icons is constant. in reality it is the selction from a list and then I want to add it to the tool bar by using button Add. After using the button 3 times I shall get this:
How to achieve this?
Code: Select all
; addBtn2Tbar.ahk icons shall be presented 48 x 48 pix
global x := 20 - 48, n, iconCurBtn
n := 0 ; # icons collected
iconCurBtn := A_ScriptDir . "\Undefined.png"
Gui Add, Picture, x100 y020 w048 h048 , %iconCurBtn% ; will be scaled
Gui Add, Button, x100 y080 w120 h025 , Add to collection
Gui Add, Text, x020 y120 w350 h025 vAdd , Accumulate icons below starting at pos 20 pix
Gui Add, Picture, x%x% y150 w048 h048 vC1a ;
Gui Show, w400
Add() {
newIcon := iconCurBtn ; in reality this depends
n += 1 ; # icons collected
x += 48
loop %n% {
GuiControl,, C1a, %newIcon%
}
}