Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Trying to make a button UI element for DUI toolbar (Read 6680 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Trying to make a button UI element for DUI toolbar

Hi guys,

I have asked a friend who can code in C++ to make me a button which I may add to the DUI default toolbar. I want this button to be a selectable in the default toolbar context menu and be placed on the toolbar as another UI element just like all the others seen in the toolbar context menu. This button would do only one thing; open a specified external path when clicked . . . that's it, nothing more!

In a nutshell, I am trying to have made a Default UI component which does the same thing as this here:

My developer friend has put WAY MORE effort into this than I expected . . . I thought this was going to be a straightforward easy component to make compared to other components out there. He managed to compile a first build of this component . . . It started up with foobar2000 without a problem. I went to fb2k Preferences and the component had a Preference page and it was registered as an "Installed component" . . . . going to the fb2k toolbar, I right-clicked to select the item but its menu entry was non-existent !!!!!!

My developer friend is scratching his head wondering what the problem is . . . he has read the foobar2000 SDK back-to-front, he has looked at the source code of other components for clues . . . he is trying hard to figure this out and refuses to give up. I must give this guy A LOT of credit because he has dived right into this without any previous knowledge of foobar2000 !!

I have conducted an exhaustive web search for some discussions on this, and have come up with nothing useful. I am starting to think that I am making this guy bark up a tree that does not exist !!

Can a developer who has solid knowledge of foobar2000 component development please answer this:

Is it possible to create a UI element/button with corresponding context menu for the foobar2000 DUI default toolbar? YES or NO

If the answer is YES, can you PLEASE offer some notes, tips and guidelines for creating this button.
If the answer is NO, can you PLEASE offer a few words explaining why.

I plan to send my friend here to read this discussion.

Thanks for your time +++++
derty2


Trying to make a button UI element for DUI toolbar

Reply #1
your friend can make a main menu command for whatever action you want to perform. then it should appear when you add a button to a standard buttons toolbar.

you cannot create any kind of custom toolbar as the SDK doesn't support it. the columns UI SDK does. why? you'll have to wait for someone else to answer that...

Trying to make a button UI element for DUI toolbar

Reply #2
This button would do only one thing; open a specified external path when clicked . . . that's it, nothing more!

Why don't you use foo_run, that should be straightforward without the need for developing a component.

Trying to make a button UI element for DUI toolbar

Reply #3
NEMO7538 -- I know about foo_run. As a developer who has tried going down this road himself, can you share your insights and experiences on the matter of this topic.
You asked a similar question once upon a time at another thread...but all you got was one useless reply...the topic fizzed out to oblivion.
My friend and I have spent many hours attempting to place a custom button on the toolbar and I want to discover some "truths".
I want the limits of foobar2000 DUI component development to be clearly defined.
If nothing else, this topic may prevent somebody else from wasting his time attempting something like this . . .

marc2003 -- can you please clarify this statement:
"..can make a main menu command for whatever action you want to perform. then it should appear when you add a button to a standard buttons toolbar."
I'm not exactly sure what you are saying....."when you add a button" means I can add an extra button to the standard button array? (ie, Stop, Play, Pause, ..., MyButton).

I specifically wanted to have another menu item of my own immediately to the right of "Help"; I wanted the font to be exactly like the default menu items (File, Edit, View, ..., Help, MyButton). When "MyButton" was clicked I was going to launch an external popup menu, specifically: PopSel by Horst Schaeffer (Germany).

FYI: Menu extra - Wikipedia

Trying to make a button UI element for DUI toolbar

Reply #4
I'm not exactly sure what you are saying....."when you add a button" means I can add an extra button to the standard button array? (ie, Stop, Play, Pause, ..., MyButton).


yes. right click>customise buttons.



as you can see, it has to be bound to an existing main menu or context command. this is something any component developer can add.

you won't ever be able to make a menu item to integrate with the default one so that idea is a complete non starter.

edit: you can make popup menus for buttons with WSH panel mod (or your own custom component panel of course). for example, i made this some time ago...



when you click the help button, a menu pops up like this. all items are opened in your browser.


Trying to make a button UI element for DUI toolbar

Reply #5
Thanks for the explanation marc +++++
I guess the fundamental driving force behind my quest is the burning desire to practically utilize all the blank space to the right of "Help"...everything on one slim toolbar.
I HATE double-toolbars as in your screenshots; to me it's a critical waste of vertical space; I want everything on one toolbar.
I have a Columns UI layout which uses one toolbar for all. I really was crossing my fingers that I could achieve this with Default UI.
It's a real shame that foobar2000 has this limitation. I hope the SDK can be updated one day to allow such customization.

 

Trying to make a button UI element for DUI toolbar

Reply #6
well you can put standard buttons toolbar to the right of the main menu. remove the buttons you don't want and then use foo_run as NEMO suggested. with foo_run being context based, you must have a playlist item selected for it to work but that's not really an issue.