When I click one of buttons in toolbar, nothing happens yet.

How can I use them?
Posted on 2003-05-16 12:21:26 by Gandalf
Hi Gandalf

Guess you mean the toolbox.
You need to open a dialog file or create a new dialog to use it. It is only used in visual dialog design and has no function when editing code.

KetilO
Posted on 2003-05-16 15:16:58 by KetilO
Which toolbars are you talking about, the toolbar control in the dialog editor, the RadASM MDI toolbar or the Toolbar creator. I admit that I overlooked the toolbar creator in my help file, it will be added on the next update. The RadASM MDI toolbar has never been known to malfunction so I assume it's not that. That leaves the Toolbar control in the Dialog Editor.

To use the Toolbar control you must place a toolbar on your dialog. Once that is done you essentially only have the frame of the window, you have to fill it. In your program you have to set up the buttons, usually with the TB_ADDBUTTONS message and an array of button information structures e.g.
.const

TBNumOfBtn equ 5
; Note the IML_BTNx constants are the index# of the button in an imagelist
TBBtnArray TBBUTTON <IML_BTN1, IDC_TBB01, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0>
TBBUTTON <NULL, NULL, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0>
TBBUTTON <IML_BTN2, IDC_TBB02, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0>
TBBUTTON <IML_BTN3, IDC_TBB03, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0>
TBBUTTON <IML_BTN4, IDC_TBB04, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0>
IDC_TBB01 equ 101
IDC_TBB02 equ 102
IDC_TBB03 equ 103
IDC_TBB04 equ 104

.code
invoke SendDlgItemMessage, hDlg, TBR1, TB_SETIMAGELIST, 0, hIML
invoke SendDlgItemMessage, hDlg, TBR1, TB_ADDBUTTONS, TBNumOfBtn, ADDR TBBtnArray

The toolbar AddIn (found on the tools menu) is a code generator that will output the code necessary to build a toolbar programatically. Hit Export and it will create the necessary code and output it to the small window in it's dialog to be pasted into your code.
Posted on 2003-05-16 15:29:46 by donkey