Added a sub window to the windows propery object..

This commit is contained in:
Roger Hughston 2007-03-22 04:32:00 +00:00
parent 4d949e95a6
commit 70222eaeda
3 changed files with 66 additions and 1 deletions

View File

@ -573,6 +573,7 @@ set_icon_filename(const Filename &icon_filename) {
_specified |= S_icon_filename; _specified |= S_icon_filename;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: WindowProperties::get_icon_filename // Function: WindowProperties::get_icon_filename
// Access: Published // Access: Published
@ -744,6 +745,48 @@ clear_mouse_mode() {
_mouse_mode=MOUSE_absolute; _mouse_mode=MOUSE_absolute;
} }
////////////////////////////////////////////////////////////////////
// Function: WindowProperties::set_parent_window
// Access: Published
// Description: Removes the z_order specification from the properties.
////////////////////////////////////////////////////////////////////
INLINE void WindowProperties::
set_parent_window(size_t parent) {
_parent_window=parent;
_specified |= S_parent_window;
}
////////////////////////////////////////////////////////////////////
// Function: WindowProperties::get_parent_window
// Access: Published
// Description: Removes the parent Window
////////////////////////////////////////////////////////////////////
INLINE size_t WindowProperties::
get_parent_window() const {
return _parent_window;
}
////////////////////////////////////////////////////////////////////
// Function: WindowProperties::has_parent_window
// Access: Published
// Description: Checks the S_parent_window specification from the properties.
////////////////////////////////////////////////////////////////////
INLINE bool WindowProperties::
has_parent_window() const {
return ((_specified & S_parent_window)!=0);
}
////////////////////////////////////////////////////////////////////
// Function: WindowProperties::clear_parent_window
// Access: Published
// Description: Removes the S_parent_window specification from the properties.
////////////////////////////////////////////////////////////////////
INLINE void WindowProperties::
clear_parent_window() {
_specified &= ~S_parent_window;
_parent_window=NULL;
}
INLINE ostream & INLINE ostream &
operator << (ostream &out, const WindowProperties &properties) { operator << (ostream &out, const WindowProperties &properties) {

View File

@ -48,6 +48,7 @@ operator = (const WindowProperties &copy) {
_z_order = copy._z_order; _z_order = copy._z_order;
_flags = copy._flags; _flags = copy._flags;
_mouse_mode = copy._mouse_mode; _mouse_mode = copy._mouse_mode;
_parent_window = copy._parent_window;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -145,6 +146,7 @@ clear() {
_z_order = Z_normal; _z_order = Z_normal;
_flags = 0; _flags = 0;
_mouse_mode = MOUSE_absolute; _mouse_mode = MOUSE_absolute;
_parent_window = 0;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -195,9 +197,15 @@ add_properties(const WindowProperties &other) {
if (other.has_z_order()) { if (other.has_z_order()) {
set_z_order(other.get_z_order()); set_z_order(other.get_z_order());
} }
if (other.has_mouse_mode()) { if (other.has_mouse_mode()) {
set_mouse_mode(other.get_mouse_mode()); set_mouse_mode(other.get_mouse_mode());
} }
if (other.has_parent_window()) {
set_parent_window(other.get_parent_window());
}
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -251,6 +259,10 @@ output(ostream &out) const {
if (has_mouse_mode()) { if (has_mouse_mode()) {
out << get_mouse_mode() << " "; out << get_mouse_mode() << " ";
} }
if (has_parent_window()) {
out << get_parent_window() << " ";
}
} }
ostream & ostream &

View File

@ -32,6 +32,8 @@
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
class EXPCL_PANDA WindowProperties { class EXPCL_PANDA WindowProperties {
PUBLISHED: PUBLISHED:
enum ZOrder { enum ZOrder {
Z_bottom, Z_bottom,
Z_normal, Z_normal,
@ -129,6 +131,12 @@ PUBLISHED:
INLINE bool has_z_order() const; INLINE bool has_z_order() const;
INLINE void clear_z_order(); INLINE void clear_z_order();
INLINE void set_parent_window(size_t parent);
INLINE size_t get_parent_window() const;
INLINE bool has_parent_window() const;
INLINE void clear_parent_window();
void add_properties(const WindowProperties &other); void add_properties(const WindowProperties &other);
void output(ostream &out) const; void output(ostream &out) const;
@ -152,6 +160,7 @@ private:
S_icon_filename = 0x0800, S_icon_filename = 0x0800,
S_cursor_filename = 0x1000, S_cursor_filename = 0x1000,
S_mouse_mode = 0x2000, S_mouse_mode = 0x2000,
S_parent_window = 0x4000,
}; };
// This bitmask represents the true/false settings for various // This bitmask represents the true/false settings for various
@ -178,6 +187,7 @@ private:
Filename _icon_filename; Filename _icon_filename;
ZOrder _z_order; ZOrder _z_order;
int _flags; int _flags;
size_t _parent_window; // a HWND or WindowRef or .. what ever it is on X win...
}; };
EXPCL_PANDA ostream & EXPCL_PANDA ostream &