refactor the class screen

This commit is contained in:
Jinhao
2015-03-22 11:19:27 +08:00
parent 2ca3573049
commit e4382239e5
6 changed files with 124 additions and 102 deletions

View File

@@ -27,25 +27,37 @@ namespace nana
/// The index of monitor.
virtual std::size_t get_index() const = 0;
virtual bool is_primary_monitor() const = 0;
/// Returns the positional coordinates and size of the display device in reference to the desktop area
virtual const ::nana::rectangle& area() const = 0;
virtual const ::nana::rectangle& workarea() const = 0;
};
class screen
{
struct implement;
public:
static ::nana::size desktop_size();
static ::nana::size primary_monitor_size();
static std::shared_ptr<display> from_point(const point&);
static std::shared_ptr<display> from_window(window);
screen();
/// Reload has no preconditions, it's safe to call on moved-from
void reload();
/// Returns the number of display monitors
std::size_t count() const;
std::shared_ptr<display> get_display(std::size_t index) const;
std::shared_ptr<display> get_primary() const;
display& from_point(const point&);
display& from_window(window);
display& get_display(std::size_t index) const;
display& get_primary() const;
void for_each(std::function<void(display&)>) const;
private:
std::shared_ptr<implement> impl_;
};
}//end namespace nana

View File

@@ -8,6 +8,8 @@
* http://www.boost.org/LICENSE_1_0.txt)
*
* @file: nana/gui/widgets/panel.hpp
* @author: Jinhao
* @contributors: qPCR4vir
*
* @brief panel is a widget used for placing some widgets.
*/
@@ -44,13 +46,13 @@ namespace nana
panel(window wd, bool visible)
{
this->create(wd, rectangle(), visible);
bgcolor(API::bgcolor(wd));
bgcolor(API::bgcolor(wd));
}
panel(window wd, const nana::rectangle& r = rectangle(), bool visible = true)
{
this->create(wd, r, visible);
bgcolor(API::bgcolor(wd));
bgcolor(API::bgcolor(wd));
}
bool transparent() const