New button on toolbar

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
Big Muscle
Posts: 72
Joined: 2004-01-23 14:45

New button on toolbar

Post by Big Muscle » 2004-03-01 10:11

How can I add the new button on toolbar??? I have tried to copy it from another button and it works, but DC++ very often freeze. Thanks :-)

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2004-03-01 16:05

There are a number of steps

Add the button to the toolbar bitmaps. (unless you are reusing an old icon)
Edit createToolbar() in mainform.cpp to actually add the button (fairly simple just look at the code)
Add a command_id_handler to mainform.h with the new buttons id and the name of the function its to call
make the function it has to call.

Thats pretty much it. I can't see why it freezes occasionally, does it only freeze when you click the button? if not maybe the button isnt the problem.

Big Muscle
Posts: 72
Joined: 2004-01-23 14:45

Post by Big Muscle » 2004-03-01 16:34

I tried to remove the button and it doesn't freeze. It only do if button can be checked.

If freeze, for example, when disconnects from hub....

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2004-03-01 17:26

if you're running in the debugger why not break and see where its getting stuck?

Big Muscle
Posts: 72
Joined: 2004-01-23 14:45

Post by Big Muscle » 2004-03-02 13:21

OK. But I can't compile it in debug mode. While linking it writes many errors such as "Object already defined...".

Big Muscle
Posts: 72
Joined: 2004-01-23 14:45

Post by Big Muscle » 2004-03-03 12:30

Ohhh, it isn't caused by a button. It freeze if I add some new line to

void MainFrame::onAction(TimerManagerListener::Types type, u_int32_t aTick) throw()

Locked