Mercurial > hg > octave-nkf
comparison libgui/graphics/PopupMenuControl.cc @ 20176:3cc0734283dc
style fixes in Qt graphics code
* Backend.cc, BaseControl.cc, ButtonControl.cc, Canvas.cc,
CheckBoxControl.cc, Container.cc, ContextMenu.cc, EditControl.cc,
Figure.cc, FigureWindow.cc, GLCanvas.cc, KeyMap.cc, ListBoxControl.cc,
Logger.cc, Menu.cc, MouseModeActionGroup.cc, Object.cc,
ObjectFactory.cc, ObjectProxy.cc, Panel.cc, PopupMenuControl.cc,
PushButtonControl.cc, PushTool.cc, QtHandlesUtils.cc,
RadioButtonControl.cc, SliderControl.cc, TextControl.cc, TextEdit.cc,
ToggleButtonControl.cc, ToggleTool.cc, ToolBar.cc, ToolBarButton.cc,
__init_qt__.cc: Follow a few more Octave coding conventions.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 19 Mar 2015 12:27:54 -0400 |
parents | fe0e34be5576 |
children | f0e61a67ad9f |
comparison
equal
deleted
inserted
replaced
20175:40b2c4323c16 | 20176:3cc0734283dc |
---|---|
31 #include "QtHandlesUtils.h" | 31 #include "QtHandlesUtils.h" |
32 | 32 |
33 namespace QtHandles | 33 namespace QtHandles |
34 { | 34 { |
35 | 35 |
36 PopupMenuControl* PopupMenuControl::create (const graphics_object& go) | 36 PopupMenuControl* |
37 PopupMenuControl::create (const graphics_object& go) | |
37 { | 38 { |
38 Object* parent = Object::parentObject (go); | 39 Object* parent = Object::parentObject (go); |
39 | 40 |
40 if (parent) | 41 if (parent) |
41 { | 42 { |
47 | 48 |
48 return 0; | 49 return 0; |
49 } | 50 } |
50 | 51 |
51 PopupMenuControl::PopupMenuControl (const graphics_object& go, QComboBox *box) | 52 PopupMenuControl::PopupMenuControl (const graphics_object& go, QComboBox *box) |
52 : BaseControl (go, box), m_blockUpdate (false) | 53 : BaseControl (go, box), m_blockUpdate (false) |
53 { | 54 { |
54 uicontrol::properties& up = properties<uicontrol> (); | 55 uicontrol::properties& up = properties<uicontrol> (); |
55 | 56 |
56 box->addItems (Utils::fromStdString (up.get_string_string ()).split ('|')); | 57 box->addItems (Utils::fromStdString (up.get_string_string ()).split ('|')); |
57 | 58 |
92 false); | 93 false); |
93 } | 94 } |
94 } | 95 } |
95 m_blockUpdate = false; | 96 m_blockUpdate = false; |
96 break; | 97 break; |
98 | |
97 case uicontrol::properties::ID_VALUE: | 99 case uicontrol::properties::ID_VALUE: |
98 { | 100 { |
99 Matrix value = up.get_value ().matrix_value (); | 101 Matrix value = up.get_value ().matrix_value (); |
100 | 102 |
101 if (value.numel () > 0) | 103 if (value.numel () > 0) |
108 box->setCurrentIndex (newIndex); | 110 box->setCurrentIndex (newIndex); |
109 } | 111 } |
110 } | 112 } |
111 } | 113 } |
112 break; | 114 break; |
115 | |
113 default: | 116 default: |
114 BaseControl::update (pId); | 117 BaseControl::update (pId); |
115 break; | 118 break; |
116 } | 119 } |
117 } | 120 } |
118 | 121 |
119 void PopupMenuControl::currentIndexChanged (int index) | 122 void |
123 PopupMenuControl::currentIndexChanged (int index) | |
120 { | 124 { |
121 if (! m_blockUpdate) | 125 if (! m_blockUpdate) |
122 { | 126 { |
123 gh_manager::post_set (m_handle, "value", | 127 gh_manager::post_set (m_handle, "value", |
124 octave_value (double (index + 1)), | 128 octave_value (double (index + 1)), |