getmusicbee.com

Support => Developers' Area => MusicBee API => Topic started by: Mayibongwe on October 27, 2022, 10:43:38 PM

Title: Set Panel Scrollable Area
Post by: Mayibongwe on October 27, 2022, 10:43:38 PM
I know it's in the name but can I get clarity on what SetPanelScrollableArea is supposed to do?
Like what should I expect MusicBee to do when I've defined the following?

Code
mbApi.MB_SetPanelScrollableArea(panel, new Size(100, 200), true);
I've been working on a quiz plugin for the past few weeks that's near-ready.
I just need to get some scrolling to take place in there if ever the panel size is too small.
Can I rely on that function to get me the scrollbar that's showing up in the 'Upcoming Tracks' panel below or do I just have to add my own scroll control.

(https://i.imgur.com/STdbF6y.png)
Title: Re: Set Panel Scrollable Area
Post by: Steven on October 29, 2022, 03:25:35 AM
as long as the panel used was created with MB_AddPanel using type 1, 2 or 5 then the SetPanelScrollableArea can be used to set the virtual height of the panel and if that value exceeds the actual height then a vertical scrollbar that follows the skin settings should show
Title: Re: Set Panel Scrollable Area
Post by: Mayibongwe on October 29, 2022, 01:16:08 PM
I've modified the panel passed in by the OnDockablePanelCreated method using MB_AddPanel, but I'm still having no luck I'm afraid.
Below is what I have and according to my understanding of the above:

- this should introduce a vertical scrollbar given that the scrollArea height will always be 100px longer than the actual panel height.
- but whether I've used the below in the OnDockablePanelCreated method or the paint event itself, I'm still unable to get it to appear.

Code
panel = mbApi.MB_AddPanel(panel, (PluginPanelDock)1);
mbApi.MB_SetPanelScrollableArea(panel, new Size(panel.Width, panel.Height + 100), true);
Hope I'm still not misunderstanding how this should be used.
Source files are here (https://drive.google.com/drive/folders/11XDvOSc2KYeG5GhFi2s9r-7_JQzK1Uqu?usp=sharing) in case you may want to have a look.
Title: Re: Set Panel Scrollable Area
Post by: Steven on October 30, 2022, 06:10:18 AM
Disregard what i said about using MB_AddPanel - its not needed for the type of plugin panel you are using
There is an issue with MB_SetPanelScrollableArea and i should be resolve it
Title: Re: Set Panel Scrollable Area
Post by: Steven on October 30, 2022, 09:10:20 AM
https://getmusicbee.com/patches/MusicBee35_Patched.zip
should work if you set MB_SetPanelScrollableArea within OnDockablePanelCreated
only vertical scrollbar is supported though, so make sure the scrollable width is set to 0 or at least less than the panel width
Title: Re: Set Panel Scrollable Area
Post by: Mayibongwe on November 04, 2022, 09:09:30 PM
Fantastic. Can confirm all is working fine now.
Thank you Steven...for this and the artist thumb skin image in the other thread.