nux-1.14.0
|
Public Member Functions | |
FloatingWindow (const TCHAR *WindowName=TEXT(""), NUX_FILE_LINE_PROTO) | |
void | SetVisibleSizeGrip (bool b) |
bool | IsVisibleSizeGrip () |
void | EnableTitleBar (bool b) |
bool | HasTitleBar () const |
void | OnSizeGrigMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags) |
void | OnSizeGrigMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags) |
void | RecvCloseButtonClick (int x, int y, unsigned long button_flags, unsigned long key_flags) |
void | RecvTitleBarMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags) |
void | RecvTitleBarMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags) |
void | SetWindowTitle (const char *title) |
NString | GetWindowTitle () |
virtual bool | CanBreakLayout () |
Return true if this object can break the layout. | |
Protected Member Functions | |
virtual long | ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo) |
virtual Area * | FindAreaUnderMouse (const Point &mouse_position, NuxEventType event_type) |
virtual void | Draw (GraphicsEngine &GfxContext, bool force_draw) |
virtual void | DrawContent (GraphicsEngine &GfxContext, bool force_draw) |
virtual void | PostDraw (GraphicsEngine &GfxContext, bool force_draw) |
virtual void | PreLayoutManagement () |
virtual long | PostLayoutManagement (long LayoutResult) |
virtual void | PositionChildLayout (float offsetX, float offsetY) |
virtual void | LayoutWindowElements () |
Layout the window elements. | |
Protected Attributes | |
int | m_SizeGripDragPositionX |
int | m_SizeGripDragPositionY |
Friends | |
class | PopUpWindow |
class | ComboBox_Logic_WindowView |
class | ComboBoxComplex |
class | WindowCompositor |
Definition at line 44 of file FloatingWindow.h.
Area * nux::FloatingWindow::FindAreaUnderMouse | ( | const Point & | mouse_position, |
NuxEventType | event_type | ||
) | [protected, virtual] |
Return the area under the mouse pointer.
Reimplemented from nux::BaseWindow.
Definition at line 204 of file FloatingWindow.cpp.
References nux::Area::AcceptMouseWheelEvent(), nux::Layout::FindAreaUnderMouse(), nux::Area::TestMousePointerInclusion(), and nux::Area::TestMousePointerInclusionFilterMouseWheel().
{ bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type); if(mouse_inside == false) return NULL; NUX_RETURN_VALUE_IF_TRUE(_resize_handle->TestMousePointerInclusion(mouse_position, event_type), _resize_handle); NUX_RETURN_VALUE_IF_TRUE(_close_button->TestMousePointerInclusion(mouse_position, event_type), _close_button); if(HasTitleBar()) { NUX_RETURN_VALUE_IF_TRUE(_title_bar->TestMousePointerInclusion(mouse_position, event_type), _title_bar); } // if(_title_bar_layout) // { // nuxAssert(_title_bar_layout->IsLayout()); // Area* found_area = _title_bar_layout->FindAreaUnderMouse(mouse_position, event_type); // if(found_area) // return found_area; // } if(m_layout) { nuxAssert(m_layout->IsLayout()); Area* found_area = m_layout->FindAreaUnderMouse(mouse_position, event_type); if(found_area) return found_area; } if((event_type == NUX_MOUSE_WHEEL) && (!AcceptMouseWheelEvent())) return NULL; return this; }
void nux::FloatingWindow::LayoutWindowElements | ( | ) | [protected, virtual] |
Layout the window elements.
Layout elements such as button on the title bar, and the resize widget according to the current geometry of the window. Also initiate the computation of the child layout if there is one.
Reimplemented from nux::BaseWindow.
Definition at line 528 of file FloatingWindow.cpp.
References nux::WindowThread::ComputeElementLayout(), nux::Area::GetGeometry(), and nux::Area::SetGeometry().
{ // Define the geometry of some of the component of the window. Otherwise, if the composition layout is not set, // then the component won't be correctly placed after a SetGeometry. This can be redundant if the composition layout is set. Geometry base = GetGeometry(); _title_bar->SetGeometry (0, 0, base.GetWidth(), _title_bar_height); _title_bar_layout->SetGeometry (_title_bar->GetGeometry() ); GetWindowThread ()->ComputeElementLayout (_title_bar_layout); // Size grip Geometry Geometry temp (base.GetWidth() - _resize_handle_width, base.GetHeight() - _resize_handle_height, _resize_handle_width, _resize_handle_height); _resize_handle->SetGeometry (temp); }