Pushbutton Question

Can a push button be added to a window by code ?

For that mater can any controls and windows be added by code ?

Lets say I have 4 buttons as categories and a user wants to add more categories and be able
to add a button/s or something to access those added categories. Is there another way to do this ?

Am I going to have to use a listbox to do this ? I really don’t want to if I don’t have to.
I don’t want the look of a listbox, I want it to look like button selections but a user has a choice to add/delete
as many as needed.

You have 2 options: Control Set or ContainerControl.

Hey, Tim

Can you elaborate a little more on these. I did read the LR but I’m not understanding the information.

The Users Guide has good info. Read through those sections and come back with your questions and we’ll fill in the gaps. There are also (I believe) some example projects that specifically cover both of them.

Control set: you add one button, with a name and an index of 0
Then you can add a new button by cloning that: dim b as new MYExistingButtonName

You might find its easier to use a listbox, where each row acts like a button. (i.e. you click and something happens)
You can take over the drawing of the cell and make it look more button like by adding a border and shading if you wish

Here is an example of what I am trying to do. These buttons are category buttons and grouped together.
A user can add/delete as many categories as they wish. I not looking for code on how to do this, just
some direction on the best way to do it. In this example when a button has focus it becomes white and
drops to the bottom of the list of buttons as “Software Titles” shows.

Example button group > >>

Is the category button used to display different content in another pane?
(Not sure why you make it drop to the bottom of the list in this way)

Both buttons and a listbox still work for this method.
The listbox may take the edge if the number of categories can make the list exceed the page size.

The shading above doesn’t look like a normal button anyway, but is easily achieved in the call background paint event of a listbox.
(Just have a small graphic and stretch it to the cell width)

If you do need the chosen item to go to the bottom of the list, then clicking an item will need to:
delete the item.
Add it at the end.
scroll the list to the end if the end is not already visible
invalidate the cells affected

I agree with Jeff and recommend using a list box for this functionality. It will be a lot easier to manage.

Yes. It displays a list of names in a list box based on category choice.

I think from the information from you guys and reading docs that a listbox is the way to go.

Thanks for the input.

Can anyone help me with this ? I am trying to create a set of buttons from a list box and have the graphics
but can’t seem to get it as the picture above shows. I have the start project here Button Test

I am trying to get the foldericon to show with the bluebuttonicon as the image above shows.

Am I going to have to make the bluebuttonicon and foldericon as one image ?

for starters… your folder image IS HUGE!!! try www.iconfinder.com
find one the is the same height as your listbox row.

then in the CELL background paint event

g.drawpicture icon_folder, 0,0 <= adjust to make best alignment

Ok I made a 32x32 folder image and tried what you said. I have tried this before but it
over writes the blueListboxbutton.png image and shows nothing. The first line shows the rows as the blue button.
That is what I want but with the folder icon also showing.

[code] g.drawpicture blueListboxbutton,0,0,g.width,g.height,0,0,blueListboxbutton.width,blueListboxbutton.height

g.drawpicture FolderIcon2, 0,0[/code]

What is the best Icon program for making icons on a mac. I use Axialis IconWorkshop on windows but am trying to
get away from windows programs ?

Got it Dave. I did have the image to big and thats why it did not show.

Thanks for the help.