Mercurial > octave-nkf
comparison libgui/graphics/ListBoxControl.cc @ 18501:523878f76518 gui-release
style fix: eliminate lines of slashes to separate functions.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Feb 2014 15:10:07 -0500 |
parents | 49877d3be064 |
children | fb96b7f55242 |
comparison
equal
deleted
inserted
replaced
18500:49877d3be064 | 18501:523878f76518 |
---|---|
28 | 28 |
29 #include "Container.h" | 29 #include "Container.h" |
30 #include "ListBoxControl.h" | 30 #include "ListBoxControl.h" |
31 #include "Utils.h" | 31 #include "Utils.h" |
32 | 32 |
33 ////////////////////////////////////////////////////////////////////////////// | |
34 | |
35 namespace QtHandles | 33 namespace QtHandles |
36 { | 34 { |
37 | |
38 ////////////////////////////////////////////////////////////////////////////// | |
39 | 35 |
40 static void updateSelection (QListWidget* list, const Matrix& value) | 36 static void updateSelection (QListWidget* list, const Matrix& value) |
41 { | 37 { |
42 octave_idx_type n = value.numel (); | 38 octave_idx_type n = value.numel (); |
43 int lc = list->count (); | 39 int lc = list->count (); |
62 break; | 58 break; |
63 } | 59 } |
64 } | 60 } |
65 } | 61 } |
66 | 62 |
67 ////////////////////////////////////////////////////////////////////////////// | |
68 | |
69 ListBoxControl* ListBoxControl::create (const graphics_object& go) | 63 ListBoxControl* ListBoxControl::create (const graphics_object& go) |
70 { | 64 { |
71 Object* parent = Object::parentObject (go); | 65 Object* parent = Object::parentObject (go); |
72 | 66 |
73 if (parent) | 67 if (parent) |
78 return new ListBoxControl (go, new QListWidget (container)); | 72 return new ListBoxControl (go, new QListWidget (container)); |
79 } | 73 } |
80 | 74 |
81 return 0; | 75 return 0; |
82 } | 76 } |
83 | |
84 ////////////////////////////////////////////////////////////////////////////// | |
85 | 77 |
86 ListBoxControl::ListBoxControl (const graphics_object& go, QListWidget* list) | 78 ListBoxControl::ListBoxControl (const graphics_object& go, QListWidget* list) |
87 : BaseControl (go, list), m_blockCallback (false) | 79 : BaseControl (go, list), m_blockCallback (false) |
88 { | 80 { |
89 uicontrol::properties& up = properties<uicontrol> (); | 81 uicontrol::properties& up = properties<uicontrol> (); |
119 | 111 |
120 connect (list, SIGNAL (itemSelectionChanged (void)), | 112 connect (list, SIGNAL (itemSelectionChanged (void)), |
121 SLOT (itemSelectionChanged (void))); | 113 SLOT (itemSelectionChanged (void))); |
122 } | 114 } |
123 | 115 |
124 ////////////////////////////////////////////////////////////////////////////// | |
125 | |
126 ListBoxControl::~ListBoxControl (void) | 116 ListBoxControl::~ListBoxControl (void) |
127 { | 117 { |
128 } | 118 } |
129 | |
130 ////////////////////////////////////////////////////////////////////////////// | |
131 | 119 |
132 void ListBoxControl::update (int pId) | 120 void ListBoxControl::update (int pId) |
133 { | 121 { |
134 uicontrol::properties& up = properties<uicontrol> (); | 122 uicontrol::properties& up = properties<uicontrol> (); |
135 QListWidget* list = qWidget<QListWidget> (); | 123 QListWidget* list = qWidget<QListWidget> (); |
159 BaseControl::update (pId); | 147 BaseControl::update (pId); |
160 break; | 148 break; |
161 } | 149 } |
162 } | 150 } |
163 | 151 |
164 ////////////////////////////////////////////////////////////////////////////// | |
165 | |
166 void ListBoxControl::itemSelectionChanged (void) | 152 void ListBoxControl::itemSelectionChanged (void) |
167 { | 153 { |
168 if (! m_blockCallback) | 154 if (! m_blockCallback) |
169 { | 155 { |
170 QListWidget* list = qWidget<QListWidget> (); | 156 QListWidget* list = qWidget<QListWidget> (); |
179 gh_manager::post_set (m_handle, "value", octave_value (value), false); | 165 gh_manager::post_set (m_handle, "value", octave_value (value), false); |
180 gh_manager::post_callback (m_handle, "callback"); | 166 gh_manager::post_callback (m_handle, "callback"); |
181 } | 167 } |
182 } | 168 } |
183 | 169 |
184 ////////////////////////////////////////////////////////////////////////////// | |
185 | |
186 }; // namespace QtHandles | 170 }; // namespace QtHandles |