new docker-place branch
This commit is contained in:
@@ -98,25 +98,31 @@ namespace nana
|
||||
}
|
||||
};
|
||||
|
||||
void add_crook(const std::string& name, const pat::cloneable<factory_interface<crook_interface>>&);
|
||||
crook_interface* const * keeper_crook(const std::string& name);
|
||||
void add_arrow(const std::string&, const pat::cloneable<factory_interface<arrow_interface>>&);
|
||||
arrow_interface* const * cite_arrow(const std::string&);
|
||||
|
||||
void add_border(const std::string&, const pat::cloneable<factory_interface<border_interface>>&);
|
||||
border_interface* const * keeper_border(const std::string&);
|
||||
|
||||
void add_arrow(const std::string&, const pat::cloneable<factory_interface<arrow_interface>>&);
|
||||
arrow_interface* const * keeper_arrow(const std::string&);
|
||||
border_interface* const * cite_border(const std::string&);
|
||||
|
||||
void add_button(const std::string&, const pat::cloneable<factory_interface<element_interface>>&);
|
||||
element_interface* const* keeper_button(const std::string&);
|
||||
element_interface* const* cite_button(const std::string&);
|
||||
|
||||
void add_x_icon(const std::string& name, const pat::cloneable<factory_interface<element_interface>>&);
|
||||
element_interface* const* cite_x_icon(const std::string&);
|
||||
|
||||
void add_crook(const std::string& name, const pat::cloneable<factory_interface<crook_interface>>&);
|
||||
crook_interface* const * cite_crook(const std::string& name);
|
||||
|
||||
void add_cross(const std::string& name, const pat::cloneable<factory_interface<element_interface>>&);
|
||||
element_interface* const* cite_cross(const std::string&);
|
||||
};
|
||||
|
||||
class crook;
|
||||
template<typename UserElement>
|
||||
void add_crook(const std::string& name)
|
||||
class arrow;
|
||||
template<typename ArrowElement>
|
||||
void add_arrow(const std::string& name)
|
||||
{
|
||||
using factory_t = provider::factory<UserElement, crook_interface>;
|
||||
provider().add_crook(name, pat::cloneable<typename factory_t::interface_type>(factory_t()));
|
||||
using factory_t = provider::factory<ArrowElement, arrow_interface>;
|
||||
provider().add_arrow(name, pat::cloneable<typename factory_t::interface_type>(factory_t()));
|
||||
}
|
||||
|
||||
class border;
|
||||
@@ -127,14 +133,6 @@ namespace nana
|
||||
provider().add_border(name, pat::cloneable<typename factory_t::interface_type>(factory_t()));
|
||||
}
|
||||
|
||||
class arrow;
|
||||
template<typename ArrowElement>
|
||||
void add_arrow(const std::string& name)
|
||||
{
|
||||
using factory_t = provider::factory<ArrowElement, arrow_interface>;
|
||||
provider().add_arrow(name, pat::cloneable<typename factory_t::interface_type>(factory_t()));
|
||||
}
|
||||
|
||||
class button;
|
||||
template<typename ButtonElement>
|
||||
void add_button(const std::string& name)
|
||||
@@ -142,6 +140,30 @@ namespace nana
|
||||
using factory_t = provider::factory<ButtonElement, element_interface>;
|
||||
provider().add_button(name, pat::cloneable<typename factory_t::interface_type>(factory_t()));
|
||||
}
|
||||
|
||||
class x_icon;
|
||||
template<typename UserElement>
|
||||
void add_x_icon(const std::string& name)
|
||||
{
|
||||
using factory_t = provider::factory<UserElement, element_interface>;
|
||||
provider().add_x_icon(name, pat::cloneable<typename factory_t::interface_type>(factory_t()));
|
||||
}
|
||||
|
||||
class crook;
|
||||
template<typename UserElement>
|
||||
void add_crook(const std::string& name)
|
||||
{
|
||||
using factory_t = provider::factory<UserElement, crook_interface>;
|
||||
provider().add_crook(name, pat::cloneable<typename factory_t::interface_type>(factory_t()));
|
||||
}
|
||||
|
||||
class cross;
|
||||
template<typename UserElement>
|
||||
void add_cross(const std::string& name)
|
||||
{
|
||||
using factory_t = provider::factory<UserElement, element_interface>;
|
||||
provider().add_cross(name, pat::cloneable<typename factory_t::interface_type>(factory_t()));
|
||||
}
|
||||
}//end namespace element
|
||||
|
||||
template<typename Element> class facade;
|
||||
@@ -169,9 +191,27 @@ namespace nana
|
||||
bool draw(graph_reference, const nana::color& bgcolor, const nana::color& fgcolor, const nana::rectangle& r, element_state) override;
|
||||
private:
|
||||
element::crook_interface::data data_;
|
||||
element::crook_interface* const * keeper_;
|
||||
element::crook_interface* const * cite_;
|
||||
}; //end class facade<element::crook>
|
||||
|
||||
template<> class facade<element::cross>
|
||||
: public element::element_interface
|
||||
{
|
||||
public:
|
||||
facade(const char* name = nullptr);
|
||||
void switch_to(const char*);
|
||||
|
||||
void thickness(unsigned thk);
|
||||
void size(unsigned size_pixels);
|
||||
public:
|
||||
//Implement element_interface
|
||||
bool draw(graph_reference, const ::nana::color& bgcolor, const ::nana::color& fgcolor, const ::nana::rectangle&, element_state) override;
|
||||
private:
|
||||
unsigned thickness_{6};
|
||||
unsigned size_{ 14 };
|
||||
element::element_interface* const * cite_;
|
||||
};
|
||||
|
||||
template<>
|
||||
class facade<element::border>
|
||||
: public element::element_interface
|
||||
@@ -185,7 +225,7 @@ namespace nana
|
||||
//Implement element_interface
|
||||
bool draw(graph_reference, const nana::color& bgcolor, const nana::color& fgcolor, const nana::rectangle&, element_state) override;
|
||||
private:
|
||||
element::border_interface* const * keeper_;
|
||||
element::border_interface* const * cite_;
|
||||
};//end class facade<element::border>
|
||||
|
||||
template<>
|
||||
@@ -207,7 +247,7 @@ namespace nana
|
||||
//Implement element_interface
|
||||
bool draw(graph_reference, const nana::color& bgcolor, const nana::color& fgcolor, const nana::rectangle&, element_state) override;
|
||||
private:
|
||||
element::arrow_interface* const * keeper_;
|
||||
element::arrow_interface* const * cite_;
|
||||
::nana::direction dir_{::nana::direction::north};
|
||||
};//end class facade<element::arrow>
|
||||
|
||||
@@ -222,9 +262,22 @@ namespace nana
|
||||
//Implement element_interface
|
||||
bool draw(graph_reference, const ::nana::color& bgcolor, const ::nana::color& fgcolor, const ::nana::rectangle&, element_state) override;
|
||||
private:
|
||||
element::element_interface* const * keeper_;
|
||||
element::element_interface* const * cite_;
|
||||
};//end class facade<element::button>
|
||||
|
||||
template<>
|
||||
class facade<element::x_icon>
|
||||
: public element::element_interface
|
||||
{
|
||||
public:
|
||||
facade(const char* name = nullptr);
|
||||
void switch_to(const char*);
|
||||
public:
|
||||
//Implement element_interface
|
||||
bool draw(graph_reference, const ::nana::color& bgcolor, const ::nana::color& fgcolor, const ::nana::rectangle&, element_state) override;
|
||||
private:
|
||||
element::element_interface* const * cite_;
|
||||
};//end class facade<element::button>
|
||||
|
||||
namespace element
|
||||
{
|
||||
|
||||
@@ -109,9 +109,11 @@ namespace nana
|
||||
window window_handle() const;
|
||||
|
||||
void div(const char* s); ///< Divides the attached widget into fields.
|
||||
void modify(const char* field_name, const char* div_text); ///< Modifies a specified field.
|
||||
|
||||
field_reference field(const char* name);///< Returns a field with the specified name.
|
||||
|
||||
void field_visible(const char* filed_name, bool visible); ///<<Shows/Hides an existing field.
|
||||
void field_visible(const char* field_name, bool visible); ///<<Shows/Hides an existing field.
|
||||
bool field_visible(const char* field_name) const; ///<Determines whether the specified field is visible.
|
||||
|
||||
void field_display(const char* field_name, bool display); ///<Displays/Discards an existing field.
|
||||
@@ -122,6 +124,18 @@ namespace nana
|
||||
void erase(window handle); ///< Erases a window from field.
|
||||
|
||||
field_reference operator[](const char* name); ///< Returns a field with the specified name. Equal to field();
|
||||
|
||||
/// Add a panel factory
|
||||
template<typename Panel, typename ...Args>
|
||||
void dock(const std::string& dockname, Args&& ... args)
|
||||
{
|
||||
dock(dockname, std::bind([](window parent, Args && ... args)
|
||||
{
|
||||
return std::unique_ptr<widget>(new Panel(parent, std::forward<Args>(args)...));
|
||||
}, std::placeholders::_1, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
void dock(const std::string& dockname, std::function<std::unique_ptr<widget>(window)> factory);
|
||||
private:
|
||||
implement * impl_;
|
||||
};
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace API
|
||||
}
|
||||
|
||||
point window_position(window);
|
||||
void move_window(window, int x, int y);
|
||||
void move_window(window, const point&);
|
||||
void move_window(window wd, const rectangle&);
|
||||
|
||||
void bring_top(window, bool activated);
|
||||
|
||||
Reference in New Issue
Block a user