nux-1.16.0
|
Public Member Functions | |
ScrollView (NUX_FILE_LINE_PROTO) | |
void | EnableVerticalScrollBar (bool b) |
void | EnableHorizontalScrollBar (bool b) |
virtual bool | SetLayout (Layout *layout) |
Set the default layout for this view. | |
void | SetSizeMatchContent (bool b) |
bool | IsSizeMatchContent () const |
virtual void | SetGeometry (const Geometry &geo) |
Inherited from Area. | |
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 | EmitMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags) |
virtual void | ScrollLeft (float stepx, int mousedx) |
virtual void | ScrollRight (float stepx, int mousedx) |
virtual void | ScrollUp (float stepy, int mousedy) |
virtual void | ScrollDown (float stepy, int mousedy) |
virtual void | ResetScrollToLeft () |
virtual void | ResetScrollToRight () |
virtual void | ResetScrollToUp () |
virtual void | ResetScrollToDown () |
void | SetViewContentLeftMargin (int margin) |
int | GetViewContentLeftMargin () const |
void | SetViewContentRightMargin (int margin) |
int | GetViewContentRightMargin () const |
void | SetViewContentTopMargin (int margin) |
int | GetViewContentTopMargin () const |
void | SetViewContentBottomMargin (int margin) |
int | GetViewContentBottomMargin () const |
Public Attributes | |
int | m_MouseWheelScrollSize |
int | m_ViewContentX |
X Position of the content. | |
int | m_ViewContentY |
Y Position of the content. | |
int | m_ViewContentWidth |
Width of content. | |
int | m_ViewContentHeight |
Height of content. | |
int | m_ViewX |
X position of the scroll view content area. | |
int | m_ViewY |
Y position of the scroll view content area. | |
int | m_ViewWidth |
Width of the scroll view content area. | |
int | m_ViewHeight |
Height of the scroll view content area. | |
Geometry | m_ViewGeometry |
Geometry | m_ContentGeometry |
sigc::signal< void > | SigTest |
sigc::signal< void > | sigMoveWindow |
sigc::signal< void, int, int, int, int > | sigResize |
Protected Member Functions | |
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 long | ProcessEvent (Event &event, long TraverseInfo, long ProcessEventInfo) |
virtual Area * | FindAreaUnderMouse (const Point &mouse_position, NuxEventType event_type) |
void | RecvMouseWheel (int x, int y, int wheel_delta, long button_flags, unsigned long key_flags) |
void | SetVScrollBar (VScrollBar *newVScrollBar) |
Change Vertical Scrollbar in the ScrollView. | |
void | OnChildFocusChanged (Area *child) |
void | SwapTextureIndex () |
void | SetTextureIndex (int index) |
int | GetTextureIndex () |
void | FormatContent () |
virtual void | PreLayoutManagement () |
virtual long | PostLayoutManagement (long LayoutResult) |
virtual void | PositionChildLayout (float offsetX, float offsetY) |
virtual long | PostLayoutManagement2 (long LayoutResult) |
Protected Attributes | |
ObjectPtr < IOpenGLFrameBufferObject > | m_FrameBufferObject |
int | m_TextureIndex |
bool | m_ReformatTexture |
HScrollBar * | _hscrollbar |
VScrollBar * | _vscrollbar |
bool | m_horizontal_scrollbar_enable |
bool | m_vertical_scrollbar_enable |
int | m_top_border |
int | m_border |
int | _delta_x |
Horizontal scrollbar offsets. | |
int | _delta_y |
Vertical scrollbar offsets. |
Definition at line 36 of file ScrollView.h.
Area * nux::ScrollView::FindAreaUnderMouse | ( | const Point & | mouse_position, |
NuxEventType | event_type | ||
) | [protected, virtual] |
Return the area under the mouse pointer.
Reimplemented from nux::View.
Definition at line 222 of file ScrollView.cpp.
References nux::HScrollBar::FindAreaUnderMouse(), nux::VScrollBar::FindAreaUnderMouse(), and nux::Area::TestMousePointerInclusionFilterMouseWheel().
{ // Test if the mouse is inside the ScrollView. // The last parameter of TestMousePointerInclusion is a boolean used to test if the case // of mouse wheel events. If that boolean value is true, then TestMousePointerInclusion // returns true only if the mouse pointer is over this area and the the area accepts // mouse wheel events (see Area::SetAcceptMouseWheelEvent) bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type); if(mouse_inside == false) { // The mouse pointer is not over this Area. return NULL. return NULL; } Area* found_area; // Recursively go over the ui element that are managed by this ScrollView and look // for the area that is below the mouse. // Test the vertical scrollbar found_area = _vscrollbar->FindAreaUnderMouse(mouse_position, event_type); NUX_RETURN_VALUE_IF_NOTNULL(found_area, found_area); // Test the horizontal scrollbar found_area = _hscrollbar->FindAreaUnderMouse(mouse_position, event_type); NUX_RETURN_VALUE_IF_NOTNULL(found_area, found_area); // If the code gets here, it means that no area has been found yet. // Test the layout of the ScrollView return View::FindAreaUnderMouse(mouse_position, event_type); }
bool nux::ScrollView::IsSizeMatchContent | ( | ) | const |
Check if the table size is constrained by its content.
Definition at line 904 of file ScrollView.cpp.
Referenced by nux::TableCtrl::CanBreakLayout().
{
return m_bSizeMatchContent;
}
bool nux::ScrollView::SetLayout | ( | Layout * | layout | ) | [virtual] |
Set the default layout for this view.
Set the default layout for this view.
layout | A Layout object. |
Reimplemented from nux::View.
Reimplemented in nux::Panel.
Definition at line 255 of file ScrollView.cpp.
References nux::View::SetLayout().
{ if(View::SetLayout(layout) == false) { return false; } FormatContent(); return true; }
void nux::ScrollView::SetSizeMatchContent | ( | bool | b | ) |
Set the table size to be such that all the content items of the table are visible . The scrollbar will be useless as the content is entirely visible all the time. If the table is empty, then it assume its minimum size. This is needed for table inside ComboBox drop down memu.
b | If b is true, the size of the table is constrained by its content. |
Definition at line 896 of file ScrollView.cpp.
{
m_bSizeMatchContent = b;
if (m_CompositionLayout)
m_CompositionLayout->ComputeLayout2();
}
void nux::ScrollView::SetVScrollBar | ( | VScrollBar * | newVScrollBar | ) | [protected] |
Change Vertical Scrollbar in the ScrollView.
For styling purpose, allow the classes that inherit from ScrollView to change the vertical scrollbar.
Definition at line 94 of file ScrollView.cpp.
References nux::Area::SetParentObject(), nux::Area::SetReconfigureParentLayoutOnGeometryChange(), and nux::Object::UnReference().
{ if(_vscrollbar) { // disconnect old _vscrollbar _vscrollbar->OnScrollUp.connect (sigc::mem_fun (this, &ScrollView::ScrollUp)); _vscrollbar->OnScrollDown.connect (sigc::mem_fun (this, &ScrollView::ScrollDown)); _vscrollbar->UnReference (); } _vscrollbar = newVScrollBar; _vscrollbar->SetParentObject (this); _vscrollbar->SetReconfigureParentLayoutOnGeometryChange(false); // connect new _vscrollbar _vscrollbar->OnScrollUp.connect (sigc::mem_fun (this, &ScrollView::ScrollUp)); _vscrollbar->OnScrollDown.connect (sigc::mem_fun (this, &ScrollView::ScrollDown)); }