QUOTE(Squeller @ Apr 14 2006, 04:30 PM)

Thx, now I remember the problem: If I have only one panel without caption loaded, I cannot add another one. This was a problem escpecially with foo_uie_tabs, because youe had to completely rebuild it after resetting the sidebar.
That is why sidebar is being axed in favour of something that doesn't have this limitation

QUOTE(mixcherry @ Apr 15 2006, 02:56 PM)

Hi. I've got question about Columns UI SDK. Any hints on how could I add my own toolbar (whith drop-down menu like in Playback order)?
SDK is well documented, but IMO it lacks examples. I wish there were sources for all default panels and toolbars available...
The same for foobar2000-SDK - there is only one example of plugin. I have to search HA for sources of other 3rd party plugins to see how some things are done.
I am planning to add a couple example components to next version of sdk.
Here is simple example of a multiple-instance panel:
CODE
#include "../SDK/foobar2000.h"
#include "../helpers/helpers.h"
#include <commctrl.h>
#include <windowsx.h>
#include "../columns_ui-sdk/ui_extension.h"
/** Declare some information about our component */
DECLARE_COMPONENT_VERSION("Example Columns UI Panel",
"0.1",
"compiled: " __DATE__ "\n"
"with Panel API version: " UI_EXTENSION_VERSION
);
/** Our window class */
class example_window : public uie::container_ui_extension
{
public:
example_window();
~example_window();
virtual const GUID & get_extension_guid() const;
virtual void get_name(pfc::string_base & out)const;
virtual void get_category(pfc::string_base & out)const;
unsigned get_type () const;
private:
/** Our window procedure */
LRESULT on_message(HWND wnd,UINT msg,WPARAM wp,LPARAM lp);
virtual class_data & get_class_data()const;
static const GUID g_extension_guid;
/** Our child window */
HWND wnd_static;
};
example_window::example_window() : wnd_static(NULL)
{}
example_window::~example_window()
{}
LRESULT example_window::on_message(HWND wnd,UINT msg,WPARAM wp,LPARAM lp)
{
switch(msg)
{
case WM_CREATE:
{
RECT rc;
GetClientRect(wnd, &rc);
/** Create a static window, with text "Example" */
wnd_static = CreateWindowEx(0, WC_STATIC, _T("Example panel"),
WS_CHILD | WS_VISIBLE, 0, 0, rc.right, rc.bottom,
wnd, HMENU(0), core_api::get_my_instance(), NULL);
}
break;
case WM_SIZE:
/** Reposition our child window */
SetWindowPos(wnd_static, 0, 0, 0, LOWORD(lp), HIWORD(lp), SWP_NOZORDER);
break;
case WM_DESTROY:
/** DefWindowProc will destroy our child window. Set our window handle to NULL now. */
wnd_static=NULL;
break;
}
return DefWindowProc(wnd, msg, wp, lp);
}
example_window::class_data & example_window::get_class_data() const
{
__implement_get_class_data(_T("{79F574F1-DC70-4f3f-8155-384B00AE0679}"), true);
}
const GUID & example_window::get_extension_guid() const
{
return g_extension_guid;
}
void example_window::get_name(pfc::string_base & out)const
{
out.set_string("Example");
}
void example_window::get_category(pfc::string_base & out)const
{
out.set_string("Panels");
}
unsigned example_window::get_type() const{return uie::type_panel;}
/** Do not use the same GUID! */
// {79F574F1-DC70-4f3f-8155-384B00AE0679}
const GUID example_window::g_extension_guid =
{ 0x79f574f1, 0xdc70, 0x4f3f, { 0x81, 0x55, 0x38, 0x4b, 0x0, 0xae, 0x6, 0x79 } };
uie::window_factory<example_window> g_example_window_factory;
What you may want to do from there may include:
- Change the child window to a Combo Box
- Change the font of the child window using WM_SETFONT
- Keep a list of the instances of your class that have windows
- Use the above list to update your windows from callbacks/whatever
- Change the type of the panel to uie::type_toolbar
- Add the style WS_TABSTOP to your Combo Box
- Handle the WM_GETMINMAXINFO window message
- Subclass the Combo Box's window procedure and process key presses as indicated in window_host.h
- Change the extension GUID
QUOTE(Stuart60611 @ Apr 16 2006, 04:56 AM)

Is there a way to assign a button to a masstagger script? It appears no option exists on the context menu choices when trying to bind to a button.
Strange, seems to be broken. I'll look into it.