nux-1.16.0
nux::View Class Reference
Inheritance diagram for nux::View:
nux::InputArea nux::Area nux::InitiallyUnownedObject nux::Focusable nux::Object nux::Trackable nux::Introspectable nux::AbstractButton nux::AbstractComboBox nux::AbstractSeparator nux::AnimatedTextureArea nux::BaseWindow nux::BezierCurveControl nux::BezierCurveControl2 nux::Canvas nux::ClientArea nux::ColorArea nux::ColorEditor nux::ColorGradient nux::ColorPreview nux::CurveControl nux::EditTextBox nux::FileSelector nux::FunctionGraph nux::GroupBox nux::GroupBox2 nux::Histogram nux::HSplitter nux::HToolBar nux::Matrix3Editor nux::Matrix3Preview nux::Matrix4Editor nux::Matrix4Preview nux::MenuBar nux::MenuItem nux::MenuPage nux::MenuSeparator nux::MouseAreaCtrl nux::RangeValue nux::RangeValueInteger nux::RGBValuator nux::ScrollBar nux::ScrollView nux::SpinBox_Logic nux::SplineCurveEditor nux::SplineCurvePreview nux::StaticText nux::StaticTextBox nux::TabView nux::TextEntry nux::TextureArea nux::TimeGraph nux::ToolButton nux::Valuator nux::Vector3Valuator nux::VSplitter nux::VToolBar TilesView

List of all members.

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
void SetViewActive (bool active)
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 LayoutGetLayout ()
 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< FontTextureGetFont ()
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 AreaKeyNavIteration (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 LayoutGetCompositionLayout ()
 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 AreaFindAreaUnderMouse (const Point &mouse_position, NuxEventType event_type)
virtual AreaFindKeyFocusArea (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
Layoutm_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

Detailed Description

Definition at line 46 of file View.h.


Member Function Documentation

void nux::View::ActivateView ( )

Activate the View. It can process them. The rendering of the View is normal.

Definition at line 474 of file View.cpp.

  {
    _is_view_active = true;
  }
void nux::View::DeactivateView ( )

Activate the View. The view cannot receive events. Its rendering is grayed (NUXTODO).

Definition at line 479 of file View.cpp.

  {
    _is_view_active = false;
  }
Area * nux::View::FindAreaUnderMouse ( const Point mouse_position,
NuxEventType  event_type 
) [protected, virtual]

Return the area under the mouse pointer.

Returns:
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 629 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.

Returns:
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]

Accessed inside ContentDraw () to help determine if some parts needs to be rendered. Do not use it elsewhere.

Returns:
True if Draw () was called before ContentDraw ().

Definition at line 335 of file View.cpp.

  {
    return _full_redraw;
  }
bool nux::View::IsViewActive ( ) const
Returns:
True if the view is active.

Definition at line 484 of file View.cpp.

  {
    return _is_view_active;
  }
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.

Parameters:
layoutA 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;
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends