Nux

Merge lp:~gordallott/nux/nux-keynav-fixes-17-03-11 into lp:nux

Proposed by Gord Allott
Status: Merged
Merged at revision: 274
Proposed branch: lp:~gordallott/nux/nux-keynav-fixes-17-03-11
Merge into: lp:nux
Diff against target: 507 lines (+175/-23)
12 files modified
Nux/Area.cpp (+1/-1)
Nux/Area.h (+3/-0)
Nux/GridHLayout.cpp (+58/-5)
Nux/GridHLayout.h (+2/-2)
Nux/HLayout.cpp (+2/-2)
Nux/Layout.cpp (+12/-1)
Nux/Layout.h (+3/-4)
Nux/ScrollView.cpp (+41/-0)
Nux/ScrollView.h (+4/-0)
Nux/View.cpp (+29/-3)
Nux/View.h (+8/-0)
examples/focus.cpp (+12/-5)
To merge this branch: bzr merge lp:~gordallott/nux/nux-keynav-fixes-17-03-11
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Review via email: mp+53777@code.launchpad.net

Description of the change

linked bugs, some keynav fixes

To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Nux/Area.cpp'
--- Nux/Area.cpp 2011-03-17 00:27:16 +0000
+++ Nux/Area.cpp 2011-03-17 10:13:29 +0000
@@ -825,7 +825,7 @@
825 {825 {
826 if (_is_focused == focused)826 if (_is_focused == focused)
827 return;827 return;
828828
829 _is_focused = focused;829 _is_focused = focused;
830 FocusChanged.emit (this);830 FocusChanged.emit (this);
831 }831 }
832832
=== modified file 'Nux/Area.h'
--- Nux/Area.h 2011-03-17 00:27:16 +0000
+++ Nux/Area.h 2011-03-17 10:13:29 +0000
@@ -23,6 +23,7 @@
23#ifndef BASEOBJECT_H23#ifndef BASEOBJECT_H
24#define BASEOBJECT_H24#define BASEOBJECT_H
2525
26#include <sigc++/sigc++.h>
26#include "NuxCore/InitiallyUnownedObject.h"27#include "NuxCore/InitiallyUnownedObject.h"
27#include "Focusable.h"28#include "Focusable.h"
28#include "Utils.h"29#include "Utils.h"
@@ -31,6 +32,7 @@
3132
3233
3334
35
34namespace nux36namespace nux
35{37{
36 class WindowThread;38 class WindowThread;
@@ -297,6 +299,7 @@
297 299
298 sigc::signal <void, Area *> FocusActivated;300 sigc::signal <void, Area *> FocusActivated;
299 sigc::signal <void, Area *> FocusChanged;301 sigc::signal <void, Area *> FocusChanged;
302 sigc::signal <void, Area*, Area*> ChildFocusChanged; // sends parent + child
300303
301 //! Queue a relayout304 //! Queue a relayout
302 /*!305 /*!
303306
=== modified file 'Nux/GridHLayout.cpp'
--- Nux/GridHLayout.cpp 2011-03-10 13:03:38 +0000
+++ Nux/GridHLayout.cpp 2011-03-17 10:13:29 +0000
@@ -97,17 +97,56 @@
97 return NULL;97 return NULL;
98 }98 }
9999
100 long GridHLayout::DoFocusLeft (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
101 {
102 // if we are left on an edge, then send up
103 Area* focused_child = GetFocusedChild ();
104 int position = GetChildPos (focused_child);
105 Area *parent = GetParentObject ();
106
107 if (parent == NULL || position % GetNumColumn ())
108 {
109 return Layout::DoFocusLeft (ievent, TraverseInfo, ProcessEventInfo);
110 }
111 else
112 {
113 // left edge
114 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);
115 }
116 }
117
118 long GridHLayout::DoFocusRight (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
119 {
120 // if we are left on an edge, then send up
121 Area* focused_child = GetFocusedChild ();
122 int position = GetChildPos (focused_child);
123 Area *parent = GetParentObject ();
124
125 if (parent == NULL || (position + 1) % GetNumColumn ())
126 {
127 return Layout::DoFocusRight (ievent, TraverseInfo, ProcessEventInfo);
128 }
129 else
130 {
131 // Right Edge
132 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);
133 }
134 }
135
100 //up and down should pass event to parent136 //up and down should pass event to parent
101 long GridHLayout::DoFocusUp (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)137 long GridHLayout::DoFocusUp (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
102 {138 {
103 Area* focused_child = GetFocusedChild ();139 Area* focused_child = GetFocusedChild ();
104 int position = GetChildPos (focused_child);140 int position = GetChildPos (focused_child);
141 Area *parent = GetParentObject ();
105 142
106 if (focused_child == NULL || position < GetNumColumn ())143 if (focused_child == NULL || position < GetNumColumn ())
107 {144 {
108 Area *parent = GetParentObject ();145
109 if (parent != NULL)146 if (parent != NULL)
110 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);147 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);
148 else
149 FocusFirstChild ();
111150
112 }151 }
113 else152 else
@@ -117,7 +156,17 @@
117 focused_child->SetFocused (false);156 focused_child->SetFocused (false);
118 focused_child = GetChildAtPosition (position - GetNumColumn ());157 focused_child = GetChildAtPosition (position - GetNumColumn ());
119 if (focused_child)158 if (focused_child)
159 {
120 focused_child->SetFocused (true);160 focused_child->SetFocused (true);
161 ChildFocusChanged.emit (this, focused_child);
162 }
163 else
164 {
165 if (parent != NULL)
166 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);
167 else
168 FocusFirstChild ();
169 }
121 }170 }
122171
123 return TraverseInfo;172 return TraverseInfo;
@@ -126,14 +175,14 @@
126 {175 {
127 Area* focused_child = GetFocusedChild ();176 Area* focused_child = GetFocusedChild ();
128 int position = GetChildPos (focused_child);177 int position = GetChildPos (focused_child);
178 Area *parent = GetParentObject ();
129 179
130 if (focused_child == NULL || position > GetNumColumn () * (GetNumRow () - 1))180 if (focused_child == NULL || position > GetNumColumn () * (GetNumRow () - 1))
131 {181 {
132 Area *parent = GetParentObject ();
133 if (parent != NULL)182 if (parent != NULL)
134 {
135 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);183 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);
136 }184 else
185 FocusLastChild ();
137 }186 }
138 else187 else
139 {188 {
@@ -144,10 +193,14 @@
144 if (focused_child)193 if (focused_child)
145 {194 {
146 focused_child->SetFocused (true);195 focused_child->SetFocused (true);
196 ChildFocusChanged.emit (this, focused_child);
147 }197 }
148 else198 else
149 {199 {
150 FocusLastChild ();200 if (parent != NULL)
201 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);
202 else
203 FocusLastChild ();
151 }204 }
152 }205 }
153206
154207
=== modified file 'Nux/GridHLayout.h'
--- Nux/GridHLayout.h 2011-03-09 15:20:56 +0000
+++ Nux/GridHLayout.h 2011-03-17 10:13:29 +0000
@@ -109,8 +109,8 @@
109 Area* GetChildAtPosition (int pos);109 Area* GetChildAtPosition (int pos);
110 virtual long DoFocusUp (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);110 virtual long DoFocusUp (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
111 virtual long DoFocusDown (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);111 virtual long DoFocusDown (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
112 //virtual long DoFocusLeft (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);112 virtual long DoFocusLeft (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
113 //virtual long DoFocusRight (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);113 virtual long DoFocusRight (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
114 114
115 private:115 private:
116 Size _children_size;116 Size _children_size;
117117
=== modified file 'Nux/HLayout.cpp'
--- Nux/HLayout.cpp 2011-03-10 13:03:38 +0000
+++ Nux/HLayout.cpp 2011-03-17 10:13:29 +0000
@@ -71,7 +71,7 @@
71 if (parent != NULL)71 if (parent != NULL)
72 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);72 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);
73 else73 else
74 FocusFirstChild ();74 FocusPreviousChild (GetFocusedChild ());
7575
76 return TraverseInfo;76 return TraverseInfo;
77 }77 }
@@ -82,7 +82,7 @@
82 if (parent != NULL)82 if (parent != NULL)
83 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);83 return SendEventToArea (parent, ievent, TraverseInfo, ProcessEventInfo);
84 else84 else
85 FocusFirstChild ();85 FocusNextChild (GetFocusedChild ());
86 return TraverseInfo;86 return TraverseInfo;
87 }87 }
8888
8989
=== modified file 'Nux/Layout.cpp'
--- Nux/Layout.cpp 2011-03-10 13:03:38 +0000
+++ Nux/Layout.cpp 2011-03-17 10:13:29 +0000
@@ -80,8 +80,13 @@
80 FocusNextChild ((*it));80 FocusNextChild ((*it));
81 }81 }
82 }82 }
83
84 (*it)->SetFocused (false);
83 }85 }
8486
87 sigc::connection onchildfocuscon = _connection_map[bo];
88 onchildfocuscon.disconnect ();
89
85 if (it != _layout_element_list.end())90 if (it != _layout_element_list.end())
86 {91 {
87 bo->UnParentObject();92 bo->UnParentObject();
@@ -154,6 +159,11 @@
154 return false;159 return false;
155 }160 }
156161
162 void Layout::OnChildFocusChanged (Area *parent, Area *child)
163 {
164 ChildFocusChanged.emit (parent, child);
165 }
166
157// If(stretchfactor == 0): the WidgetLayout geometry will be set to SetGeometry(0,0,1,1);167// If(stretchfactor == 0): the WidgetLayout geometry will be set to SetGeometry(0,0,1,1);
158// and the children will take their natural size by expending WidgetLayout.168// and the children will take their natural size by expending WidgetLayout.
159// If the parent of WidgetLayout offers more space, it won't be used by WidgetLayout.169// If the parent of WidgetLayout offers more space, it won't be used by WidgetLayout.
@@ -198,6 +208,7 @@
198 }208 }
199209
200 _layout_element_list.push_back (layout);210 _layout_element_list.push_back (layout);
211 _connection_map[layout] = layout->ChildFocusChanged.connect (sigc::mem_fun (this, &Layout::OnChildFocusChanged));
201212
202 //--->> Removed because it cause problem with The splitter widget: ComputeLayout2();213 //--->> Removed because it cause problem with The splitter widget: ComputeLayout2();
203 }214 }
@@ -265,6 +276,7 @@
265276
266277
267 _layout_element_list.push_back (bo);278 _layout_element_list.push_back (bo);
279 _connection_map[bo] = bo->ChildFocusChanged.connect (sigc::mem_fun (this, &Layout::OnChildFocusChanged));
268280
269 //--->> Removed because it cause problem with The splitter widget: ComputeLayout2();281 //--->> Removed because it cause problem with The splitter widget: ComputeLayout2();
270 }282 }
@@ -512,7 +524,6 @@
512 return 0;524 return 0;
513 }525 }
514526
515
516 long ret = 0;527 long ret = 0;
517 if ( area->IsView() )528 if ( area->IsView() )
518 {529 {
519530
=== modified file 'Nux/Layout.h'
--- Nux/Layout.h 2011-03-10 12:12:07 +0000
+++ Nux/Layout.h 2011-03-17 10:13:29 +0000
@@ -231,8 +231,6 @@
231231
232 bool HasFocusableEntries ();232 bool HasFocusableEntries ();
233233
234 sigc::signal <void, Layout *, Area*> ChildFocusChanged;
235
236 // this should not be public, but has to be because of nux's object setup234 // this should not be public, but has to be because of nux's object setup
237 long ProcessFocusEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);235 long ProcessFocusEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
238 bool _has_focus_control;236 bool _has_focus_control;
@@ -252,8 +250,9 @@
252 virtual bool FocusLastChild ();250 virtual bool FocusLastChild ();
253 virtual bool FocusNextChild (Area *child);251 virtual bool FocusNextChild (Area *child);
254 virtual bool FocusPreviousChild (Area *child);252 virtual bool FocusPreviousChild (Area *child);
255 253 void OnChildFocusChanged (Area *parent, Area *child);
256 254
255 std::map<Area*, sigc::connection> _connection_map; // map our children to connections
257 256
258 bool _queued_draw; //<! The rendering of the layout needs to be refreshed.257 bool _queued_draw; //<! The rendering of the layout needs to be refreshed.
259258
260259
=== modified file 'Nux/ScrollView.cpp'
--- Nux/ScrollView.cpp 2011-03-04 16:42:15 +0000
+++ Nux/ScrollView.cpp 2011-03-17 10:13:29 +0000
@@ -66,6 +66,8 @@
66 m_ViewContentBottomMargin = 0;66 m_ViewContentBottomMargin = 0;
67 FormatContent();67 FormatContent();
6868
69 ChildFocusChanged.connect (sigc::mem_fun (this, &ScrollView::OnChildFocusChanged));
70
69 }71 }
7072
71 ScrollView::~ScrollView()73 ScrollView::~ScrollView()
@@ -75,6 +77,45 @@
75 vscrollbar->Dispose ();77 vscrollbar->Dispose ();
76 }78 }
7779
80 void ScrollView::OnChildFocusChanged (Area *parent, Area *child)
81 {
82 if (child->IsView ())
83 {
84 View *view = (View*)child;
85 if (view->HasPassiveFocus ())
86 {
87 return;
88 }
89 }
90 if (child->IsLayout ())
91 return;
92
93 int child_y = child->GetGeometry ().y - GetGeometry ().y;
94 int child_y_diff = child_y - abs (_delta_y);
95
96
97 if (child_y_diff + child->GetGeometry ().height < GetGeometry ().height && child_y_diff >= 0)
98 {
99 return;
100 }
101
102 if (child_y_diff < 0)
103 {
104 ScrollUp (1, abs (child_y_diff));
105 }
106 else
107 {
108 int size = child_y_diff - GetGeometry ().height;
109
110 // always keeps the top of a view on the screen
111 size += (child->GetGeometry ().height, GetGeometry ().height) ? child->GetGeometry ().height : GetGeometry ().height;
112
113 ScrollDown (1, size);
114 }
115
116 }
117
118
78 long ScrollView::ProcessEvent (Event &event, long TraverseInfo, long ProcessEventInfo)119 long ScrollView::ProcessEvent (Event &event, long TraverseInfo, long ProcessEventInfo)
79 {120 {
80 long ret = TraverseInfo;121 long ret = TraverseInfo;
81122
=== modified file 'Nux/ScrollView.h'
--- Nux/ScrollView.h 2011-03-04 16:42:15 +0000
+++ Nux/ScrollView.h 2011-03-17 10:13:29 +0000
@@ -25,6 +25,7 @@
2525
26#include "Nux.h"26#include "Nux.h"
2727
28
28namespace nux29namespace nux
29{30{
30 class HScrollBar;31 class HScrollBar;
@@ -156,6 +157,9 @@
156 virtual void PostDraw (GraphicsEngine &GfxContext, bool force_draw);157 virtual void PostDraw (GraphicsEngine &GfxContext, bool force_draw);
157 virtual long ProcessEvent (Event &event, long TraverseInfo, long ProcessEventInfo);158 virtual long ProcessEvent (Event &event, long TraverseInfo, long ProcessEventInfo);
158159
160 void OnChildFocusChanged (Area *parent, Area *child);
161
162
159 // Backup texture to speed up scrolling163 // Backup texture to speed up scrolling
160 ObjectPtr<IOpenGLFrameBufferObject> m_FrameBufferObject;164 ObjectPtr<IOpenGLFrameBufferObject> m_FrameBufferObject;
161165
162166
=== modified file 'Nux/View.cpp'
--- Nux/View.cpp 2011-03-17 00:34:40 +0000
+++ Nux/View.cpp 2011-03-17 10:13:29 +0000
@@ -71,8 +71,11 @@
7171
72 Area *parent = GetParentObject ();72 Area *parent = GetParentObject ();
73 if (parent == NULL)73 if (parent == NULL)
74 {
75 GetLayout ()->SetFocused (false);
74 GetLayout ()->SetFocused (true); // just reset the layout focus becase we are top level76 GetLayout ()->SetFocused (true); // just reset the layout focus becase we are top level
7577 }
78
76 if (parent != NULL && parent->IsLayout ())79 if (parent != NULL && parent->IsLayout ())
77 {80 {
78 Layout *parent_layout = (Layout *)parent;81 Layout *parent_layout = (Layout *)parent;
@@ -262,6 +265,7 @@
262 }265 }
263 }266 }
264267
268// just leave this here, its helpful for debugging focus issues :)
265// if (GetFocused () && _can_pass_focus_to_composite_layout == false)269// if (GetFocused () && _can_pass_focus_to_composite_layout == false)
266// {270// {
267// GetPainter ().Paint2DQuadColor (GfxContext, GetGeometry (), nux::Color (0.2, 1.0, 0.2, 1.0));271// GetPainter ().Paint2DQuadColor (GfxContext, GetGeometry (), nux::Color (0.2, 1.0, 0.2, 1.0));
@@ -294,7 +298,7 @@
294 //GetWindowCompositor()..AddToDrawList(this);298 //GetWindowCompositor()..AddToDrawList(this);
295 WindowThread* application = GetWindowThread ();299 WindowThread* application = GetWindowThread ();
296 if(application)300 if(application)
297 {301 {
298 application->AddToDrawList(this);302 application->AddToDrawList(this);
299 application->RequestRedraw();303 application->RequestRedraw();
300 //GetWindowCompositor().AddToDrawList(this);304 //GetWindowCompositor().AddToDrawList(this);
@@ -372,8 +376,13 @@
372 }376 }
373377
374 if (m_CompositionLayout)378 if (m_CompositionLayout)
379 {
380 if (GetFocused ())
381 m_CompositionLayout->SetFocused (false);
382
383 _on_focus_changed_handler.disconnect ();
375 m_CompositionLayout->UnParentObject();384 m_CompositionLayout->UnParentObject();
376385 }
377 layout->SetParentObject (this);386 layout->SetParentObject (this);
378 m_CompositionLayout = layout;387 m_CompositionLayout = layout;
379388
@@ -381,9 +390,16 @@
381 if (GetFocused ())390 if (GetFocused ())
382 layout->SetFocused (true);391 layout->SetFocused (true);
383392
393 _on_focus_changed_handler = layout->ChildFocusChanged.connect (sigc::mem_fun (this, &View::OnChildFocusChanged));
384 return true;394 return true;
385 }395 }
386396
397 //propogate the signal
398 void View::OnChildFocusChanged (Area *parent, Area *child)
399 {
400 ChildFocusChanged.emit (parent, child);
401 }
402
387 bool View::SetCompositionLayout (Layout *layout)403 bool View::SetCompositionLayout (Layout *layout)
388 {404 {
389 return SetLayout (layout);405 return SetLayout (layout);
@@ -542,6 +558,16 @@
542 }558 }
543 }559 }
544560
561 // if we have a layout, returns true if we pass focus to it
562 // else returns false
563 bool View::HasPassiveFocus ()
564 {
565 if (_can_pass_focus_to_composite_layout && GetLayout () != NULL)
566 return true;
567
568 return false;
569 }
570
545 void View::SetFocusControl (bool focus_control)571 void View::SetFocusControl (bool focus_control)
546 {572 {
547 Area *_parent = GetParentObject ();573 Area *_parent = GetParentObject ();
548574
=== modified file 'Nux/View.h'
--- Nux/View.h 2011-03-17 01:12:20 +0000
+++ Nux/View.h 2011-03-17 10:13:29 +0000
@@ -180,9 +180,17 @@
180 void SetFocusControl (bool focus_control);180 void SetFocusControl (bool focus_control);
181 bool HasFocusControl ();181 bool HasFocusControl ();
182182
183 /*
184 Returns true if the view has a layout and passes focus to that layout
185 */
186 bool HasPassiveFocus ();
187
183 protected:188 protected:
184 bool _can_focus;189 bool _can_focus;
185190
191 void OnChildFocusChanged (Area *parent, Area *child);
192 sigc::connection _on_focus_changed_handler;
193
186 virtual long ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo) = 0;194 virtual long ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo) = 0;
187 virtual void Draw (GraphicsEngine &GfxContext, bool force_draw) = 0;195 virtual void Draw (GraphicsEngine &GfxContext, bool force_draw) = 0;
188 virtual void DrawContent (GraphicsEngine &GfxContext, bool force_draw);196 virtual void DrawContent (GraphicsEngine &GfxContext, bool force_draw);
189197
=== modified file 'examples/focus.cpp'
--- examples/focus.cpp 2011-03-10 12:12:07 +0000
+++ examples/focus.cpp 2011-03-17 10:13:29 +0000
@@ -37,7 +37,7 @@
37 return ((float)rand ()) / RAND_MAX;37 return ((float)rand ()) / RAND_MAX;
38}38}
3939
40static void OnFocusChildChanged (nux::Layout *layout, nux::Area *view)40static void OnFocusChildChanged (nux::Area *layout, nux::Area *view)
41{41{
42 g_debug ("focus has changed, woo %i", rand ());42 g_debug ("focus has changed, woo %i", rand ());
43}43}
@@ -77,11 +77,18 @@
77 nux::VLayout* layout_scroll_container = new nux::VLayout (NUX_TRACKER_LOCATION);77 nux::VLayout* layout_scroll_container = new nux::VLayout (NUX_TRACKER_LOCATION);
78 78
79 nux::VLayout* layout_scroll_1 = new nux::VLayout(NUX_TRACKER_LOCATION);79 nux::VLayout* layout_scroll_1 = new nux::VLayout(NUX_TRACKER_LOCATION);
80
81
80 nux::HLayout* layout_scroll_11 = new nux::HLayout(NUX_TRACKER_LOCATION);82 nux::HLayout* layout_scroll_11 = new nux::HLayout(NUX_TRACKER_LOCATION);
81 nux::GridHLayout* layout_scroll_12 = new nux::GridHLayout (NUX_TRACKER_LOCATION);83 nux::ScrollView *layout_scroll_12 = new nux::ScrollView (NUX_TRACKER_LOCATION);
84 nux::GridHLayout* layout_scroll_12_content = new nux::GridHLayout (NUX_TRACKER_LOCATION);
85 layout_scroll_12->EnableHorizontalScrollBar (false);
86 layout_scroll_12->EnableVerticalScrollBar (true);
87 layout_scroll_12->SetLayout (layout_scroll_12_content);
88
8289
83 layout_scroll_1->AddLayout (layout_scroll_11, 0, nux::MINOR_POSITION_TOP);90 layout_scroll_1->AddLayout (layout_scroll_11, 0, nux::MINOR_POSITION_TOP);
84 layout_scroll_1->AddLayout (layout_scroll_12, 1, nux::MINOR_POSITION_TOP);91 layout_scroll_1->AddView (layout_scroll_12, 1, nux::MINOR_POSITION_TOP);
85 92
86 nux::VLayout* layout_scroll_2 = new nux::VLayout(NUX_TRACKER_LOCATION);93 nux::VLayout* layout_scroll_2 = new nux::VLayout(NUX_TRACKER_LOCATION);
87 nux::HLayout* layout_scroll_21 = new nux::HLayout(NUX_TRACKER_LOCATION);94 nux::HLayout* layout_scroll_21 = new nux::HLayout(NUX_TRACKER_LOCATION);
@@ -124,14 +131,14 @@
124 layout_scroll_11->AddView (texture_area, 1, nux::eLeft, nux::eFull);131 layout_scroll_11->AddView (texture_area, 1, nux::eLeft, nux::eFull);
125 }132 }
126133
127 for (int i = 0; i < 16; i++)134 for (int i = 0; i < 128; i++)
128 {135 {
129 nux::ColorLayer color (nux::Color (0.2, 0.2, 0.4+ frand ()*0.3, 1.0));136 nux::ColorLayer color (nux::Color (0.2, 0.2, 0.4+ frand ()*0.3, 1.0));
130 nux::TextureArea* texture_area = new nux::TextureArea ();137 nux::TextureArea* texture_area = new nux::TextureArea ();
131 texture_area->SetPaintLayer (&color);138 texture_area->SetPaintLayer (&color);
132 texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));139 texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));
133 //~ //~140 //~ //~
134 layout_scroll_12->AddView (texture_area, 1, nux::eLeft, nux::eFull);141 layout_scroll_12_content->AddView (texture_area, 1, nux::eLeft, nux::eFull);
135 }142 }
136143
137 for (int i = 0; i < 6; i++)144 for (int i = 0; i < 6; i++)

Subscribers

People subscribed via source and target branches