Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::screen Class Reference

Provides some functions to get the metrics of the monitors. More...

Classes

struct  implement
 

Public Member Functions

 screen ()
 
void reload ()
 Reload has no preconditions, it's safe to call on moved-from. More...
 
std::size_t count () const
 Returns the number of display monitors installed in the system. More...
 
displayfrom_point (const point &)
 gets the display monitor that contains the specified point More...
 
displayfrom_window (window)
 gets the display monitor that contains the specified window More...
 
displayget_display (std::size_t index) const
 
displayget_primary () const
 
void for_each (std::function< void(display &)>) const
 applies a given function to all display monitors More...
 

Static Public Member Functions

::nana::size desktop_size ()
 gets the size in pixel of the whole virtual desktop More...
 
::nana::size primary_monitor_size ()
 

Detailed Description

Provides some functions to get the metrics of the monitors.

#include <nana/gui/screen.hpp>
#include <nana/gui.hpp>
int main()
{
using namespace nana;
auto s = screen();
auto pa = s.get_primary().workarea();
form fm0, fm1, fm2, fm3;
fm0.move(pa.x, pa.y);
fm0.outline_size({pa.width / 2, pa.height / 2});
fm0.caption("screen 0");
fm1.move(pa.x + pa.width / 2, pa.y);
fm1.outline_size({pa.width / 2, pa.height / 2});
fm1.caption("screen 1");
fm2.move(pa.x, pa.y + pa.height / 2);
fm2.outline_size({pa.width / 2, pa.height / 2});
fm2.caption("screen 2");
fm3.move(pa.x + pa.width / 2, pa.y + pa.height / 2);
fm3.outline_size({pa.width / 2, pa.height / 2});
fm3.caption("screen 3");
fm0.show();
fm1.show();
fm2.show();
fm3.show();
exec();
}
Examples:
screen.cpp.

Constructor & Destructor Documentation

nana::screen::screen ( )

Member Function Documentation

std::size_t nana::screen::count ( ) const

Returns the number of display monitors installed in the system.

nana::size nana::screen::desktop_size ( )
static

gets the size in pixel of the whole virtual desktop

void nana::screen::for_each ( std::function< void(display &)>  fn) const

applies a given function to all display monitors

display & nana::screen::from_point ( const point pos)

gets the display monitor that contains the specified point

display & nana::screen::from_window ( window  wd)

gets the display monitor that contains the specified window

display & nana::screen::get_display ( std::size_t  index) const
display & nana::screen::get_primary ( ) const
nana::size nana::screen::primary_monitor_size ( )
static

gets the resolution in pixel of the primary monitor, if there is only one monitor installed in the system, the return value of primary_monitor_size is equal to desktop_size's.

void nana::screen::reload ( )

Reload has no preconditions, it's safe to call on moved-from.