|
nux-1.14.0
|
Public Member Functions | |
| View (NUX_FILE_LINE_DECL) | |
| virtual long | ComputeChildLayout () |
| virtual void | PositionChildLayout (float offsetX, float offsetY) |
| virtual long | ComputeLayout2 () |
| virtual void | ComputePosition2 (float offsetX, float offsetY) |
| virtual void | PreLayoutManagement () |
| virtual long | PostLayoutManagement (long LayoutResult) |
| virtual void | PreResizeGeometry () |
| virtual void | PostResizeGeometry () |
| virtual long | PostProcessEvent2 (IEvent &ievent, long TraverseInfo, long ProcessEventInfo) |
| virtual bool | IsLayout () const |
| virtual bool | IsSpaceLayout () const |
| virtual bool | IsArea () const |
| virtual bool | IsView () const |
| void | SetUsingStyleDrawing (bool b) |
| bool | IsUsingStyleDrawing () const |
| void | DeactivateView () |
| void | ActivateView () |
| bool | IsViewActive () const |
| virtual void | ProcessDraw (GraphicsEngine &GfxContext, bool force_draw) |
| virtual void | QueueDraw () |
| Causes a redraw. The widget parameter _need_redraw is set to true. The widget Draw(), DrawContent() and PostDraw() are called. | |
| virtual void | NeedSoftRedraw () |
| Causes a soft redraw. The widget parameter _need_redraw is set to false. The widget DrawContent() and PostDraw() are called. | |
| virtual bool | IsRedrawNeeded () |
| virtual void | DoneRedraw () |
| virtual void | OverlayDrawing (GraphicsEngine &GfxContext) |
| bool | SearchInAllSubNodes (Area *bo) |
| bool | SearchInFirstSubNodes (Area *bo) |
| virtual void | SetGeometry (const Geometry &geo) |
| Set Geometry. | |
| virtual bool | CanBreakLayout () |
| Return true if this object can break the layout. | |
| virtual void | SetTextColor (const Color &color) |
| virtual Color | GetTextColor () |
| virtual Layout * | GetLayout () |
| Get the default layout of this view. | |
| virtual bool | SetLayout (Layout *layout) |
| Set the default layout for this view. | |
| void | SetFont (ObjectPtr< FontTexture > font) |
| ObjectPtr< FontTexture > | GetFont () |
| virtual long | ProcessFocusEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo) |
| virtual void | DoSetFocused (bool focused) |
| virtual bool | DoCanFocus () |
| virtual bool | DoGetFocused () |
| void | SetCanFocus (bool can_focus) |
| void | SetFocusControl (bool focus_control) |
| bool | HasFocusControl () |
| bool | HasPassiveFocus () |
| virtual Area * | KeyNavIteration (KeyNavDirection direction) |
| virtual bool | AcceptKeyNavFocus () |
| void | IsHitDetectionSkipingChildren (bool skip_children) |
Public Attributes | |
|
sigc::signal< void, View *, Layout * > | LayoutAdded |
|
sigc::signal< void, View *, Layout * > | LayoutRemoved |
| sigc::signal< void, View * > | OnQueueDraw |
| Signal emitted when a view is scheduled for a draw. | |
Protected Member Functions | |
| void | OnChildFocusChanged (Area *child) |
| virtual long | ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo) |
| virtual void | Draw (GraphicsEngine &GfxContext, bool force_draw)=0 |
| virtual void | DrawContent (GraphicsEngine &GfxContext, bool force_draw) |
| virtual void | PostDraw (GraphicsEngine &GfxContext, bool force_draw) |
| void | DoMouseDownOutsideArea (int x, int y, unsigned long mousestate, unsigned long keystate) |
| void | InitializeWidgets () |
| void | InitializeLayout () |
| virtual Layout * | GetCompositionLayout () |
| Deprecated. Use GetLayout();. | |
| virtual bool | SetCompositionLayout (Layout *layout) |
| Deprecated. Use SetLayout();. | |
| void | RemoveLayout () |
| void | RemoveCompositionLayout () |
| bool | IsFullRedraw () const |
| virtual void | GeometryChangePending () |
| virtual void | GeometryChanged () |
| virtual Area * | FindAreaUnderMouse (const Point &mouse_position, NuxEventType event_type) |
| virtual Area * | FindKeyFocusArea (unsigned int key_symbol, unsigned long x11_key_code, unsigned long special_keys_state) |
Protected Attributes | |
| bool | _can_focus |
| sigc::connection | _on_focus_changed_handler |
| Color | m_TextColor |
| ObjectPtr< FontTexture > | _font |
| Layout * | m_CompositionLayout |
| bool | _need_redraw |
| bool | _full_redraw |
| bool | _is_active |
| True if the view is enabled (it can receive events and process them). | |
| bool | _can_pass_focus_to_composite_layout |
Friends | |
| class | WindowCompositor |
| class | Layout |
| class | Area |
| class | LayeredLayout |
| void nux::View::ActivateView | ( | ) |
| void nux::View::DeactivateView | ( | ) |
| Area * nux::View::FindAreaUnderMouse | ( | const Point & | mouse_position, |
| NuxEventType | event_type | ||
| ) | [protected, virtual] |
Return the area under the mouse pointer.
Reimplemented from nux::InputArea.
Reimplemented in TilesView, nux::BaseWindow, nux::ComboBoxSimple, nux::FloatingWindow, nux::HScrollBar, nux::HSplitter, nux::Matrix4Editor, nux::MenuPage, nux::ScrollView, nux::TabView, nux::TextEntry, nux::VScrollBar, and nux::VSplitter.
Definition at line 624 of file View.cpp.
References nux::Area::AcceptMouseWheelEvent(), nux::Layout::FindAreaUnderMouse(), and nux::Area::TestMousePointerInclusionFilterMouseWheel().
{
bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);
if (mouse_inside == false)
return NULL;
if (m_CompositionLayout)
{
Area* view = m_CompositionLayout->FindAreaUnderMouse(mouse_position, event_type);
if (view)
return view;
}
if ((event_type == NUX_MOUSE_WHEEL) && (!AcceptMouseWheelEvent()))
return NULL;
return this;
}
| Layout * nux::View::GetLayout | ( | ) | [virtual] |
Get the default layout of this view.
Get the default layout of this view.
Reimplemented in nux::BaseWindow.
Definition at line 350 of file View.cpp.
Referenced by GetCompositionLayout().
{
return m_CompositionLayout;
}
| bool nux::View::IsFullRedraw | ( | ) | const [protected] |
| bool nux::View::IsViewActive | ( | ) | const |
| void nux::View::QueueDraw | ( | ) | [virtual] |
Causes a redraw. The widget parameter _need_redraw is set to true. The widget Draw(), DrawContent() and PostDraw() are called.
Emits the signal OnQueueDraw.
Reimplemented in nux::ClientArea, and nux::TableCtrl.
Definition at line 301 of file View.cpp.
References OnQueueDraw, and nux::Layout::QueueDraw().
Referenced by nux::WindowThread::ComputeElementLayout(), nux::Layout::QueueDraw(), nux::TextureArea::Set2DRotation(), nux::LayeredLayout::SetActiveLayerN(), nux::TextureArea::SetPaintLayer(), nux::TextureArea::SetTexture(), and nux::MenuPage::StopMenu().
{
//GetWindowCompositor()..AddToDrawList(this);
WindowThread* application = GetWindowThread ();
if(application)
{
application->AddToDrawList(this);
application->RequestRedraw();
//GetWindowCompositor().AddToDrawList(this);
}
if (m_CompositionLayout)
m_CompositionLayout->QueueDraw ();
_need_redraw = true;
OnQueueDraw.emit (this);
}
| bool nux::View::SetLayout | ( | Layout * | layout | ) | [virtual] |
Set the default layout for this view.
Set the default layout for this view.
| layout | A Layout object. |
Reimplemented in nux::BaseWindow, nux::GroupBox, nux::GroupBox2, nux::Panel, and nux::ScrollView.
Definition at line 360 of file View.cpp.
References nux::WindowThread::QueueObjectLayout(), nux::Area::SetParentObject(), and nux::Area::UnParentObject().
Referenced by SetCompositionLayout(), nux::ScrollView::SetLayout(), nux::Panel::SetLayout(), nux::GroupBox2::SetLayout(), nux::GroupBox::SetLayout(), and nux::BaseWindow::SetLayout().
{
nuxAssert(layout->IsLayout());
NUX_RETURN_VALUE_IF_NULL (layout, false);
NUX_RETURN_VALUE_IF_TRUE (m_CompositionLayout == layout, true);
Area *parent = layout->GetParentObject();
if (parent == this)
{
nuxAssert (m_CompositionLayout == layout);
return false;
}
else if (parent != 0)
{
nuxDebugMsg (0, TEXT ("[View::SetCompositionLayout] Object already has a parent. You must UnParent the object before you can parenting again.") );
return false;
}
if (m_CompositionLayout)
{
if (GetFocused ())
m_CompositionLayout->SetFocused (false);
_on_focus_changed_handler.disconnect ();
/* we need to emit the signal before the unparent, just in case
one of the callbacks wanted to use this object */
LayoutRemoved.emit (this, m_CompositionLayout);
m_CompositionLayout->UnParentObject();
}
layout->SetParentObject (this);
m_CompositionLayout = layout;
GetWindowThread()->QueueObjectLayout (this);
if (GetFocused ())
layout->SetFocused (true);
_on_focus_changed_handler = layout->ChildFocusChanged.connect (sigc::mem_fun (this, &View::OnChildFocusChanged));
LayoutAdded.emit (this, m_CompositionLayout);
return true;
}