improve dockpane factory

This commit is contained in:
Jinhao
2015-09-19 05:18:15 +08:00
parent 44a067fd51
commit 5d2127e613
3 changed files with 109 additions and 36 deletions

View File

@@ -127,15 +127,16 @@ namespace nana
/// Add a panel factory
template<typename Panel, typename ...Args>
void dock(const std::string& dockname, Args&& ... args)
place& dock(const std::string& dockname, const std::string& factory_name, Args&& ... args)
{
dock(dockname, std::bind([](window parent, Args & ... args)
return dock(dockname, factory_name, std::bind([](window parent, Args & ... args)
{
return std::unique_ptr<widget>(new Panel(parent, std::forward<Args>(args)...));
}, std::placeholders::_1, args...));
}
void dock(const std::string& dockname, std::function<std::unique_ptr<widget>(window)> factory);
place& dock(const std::string& dockname, std::string factory_name, std::function<std::unique_ptr<widget>(window)> factory);
place& dock_create(const std::string& factory);
private:
implement * impl_;
};