MCPcopy Create free account
hub / github.com/davisking/dlib / base_window

Method base_window

dlib/gui_core/gui_core_kernel_1.cpp:1626–1664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624// ----------------------------------------------------------------------------------------
1625
1626 base_window::
1627 base_window (
1628 bool resizable,
1629 bool undecorated
1630 ) :
1631 globals(gui_core_kernel_1_globals::global_data()),
1632 has_been_destroyed(false),
1633 prevx(-1),
1634 prevy(-1),
1635 prev_state(0),
1636 wm(globals->window_table.get_mutex())
1637 {
1638 using namespace gui_core_kernel_1_globals;
1639 DLIB_ASSERT(!(undecorated == true && resizable == true),
1640 "\tbase_window::base_window()"
1641 << "\n\tThere is no such thing as an undecorated window that is resizable by the user."
1642 << "\n\tthis: " << this
1643 );
1644
1645 if (resizable)
1646 style = WS_OVERLAPPEDWINDOW;
1647 else if (undecorated)
1648 style = WS_CHILD;
1649 else
1650 style = WS_OVERLAPPEDWINDOW ^ WS_THICKFRAME ^ WS_MAXIMIZEBOX;
1651
1652 hwnd = gui_core_kernel_1_globals::make_window(style);
1653
1654 if (hwnd == NULL)
1655 throw gui_error("unable to create base_window");
1656
1657 auto_mutex M(wm);
1658
1659 mouse_in = false;
1660
1661 HWND temp = hwnd;
1662 base_window* ttemp = this;
1663 globals->window_table.add(temp,ttemp);
1664 }
1665
1666// ----------------------------------------------------------------------------------------
1667

Callers

nothing calls this directly

Calls 4

global_dataClass · 0.85
make_windowFunction · 0.85
gui_errorClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected