13
13
14
14
#include < Simfile/SegmentGroup.h>
15
15
16
- #define Dlg DialogLabelBreakdown
17
-
18
16
namespace Vortex {
19
17
20
18
// ================================================================================================
@@ -25,7 +23,7 @@ enum DisplayType {
25
23
ROW
26
24
};
27
25
28
- struct Dlg ::LabelButton : public GuiWidget {
26
+ struct DialogLabelBreakdown ::LabelButton : public GuiWidget {
29
27
30
28
LabelButton (GuiContext* gui, TileRect2* bar, int row, String time, String text)
31
29
: GuiWidget(gui)
@@ -68,7 +66,7 @@ void onTick() override
68
66
69
67
void onDraw () override
70
68
{
71
- recti r = myRect ;
69
+ recti r = rect_ ;
72
70
73
71
TextStyle textStyle;
74
72
textStyle.textFlags = Text::ELLIPSES;
@@ -78,9 +76,9 @@ void onDraw() override
78
76
button.base .draw (r, 0 );
79
77
80
78
// Draw the button text.
81
- recti left = { myRect .x , myRect .y , 74 , 20 };
79
+ recti left = { rect_ .x , rect_ .y , 74 , 20 };
82
80
83
- color32 color = COLOR32 (139 , 148 , 148 , 255 );
81
+ color32 color = RGBAtoColor32 (139 , 148 , 148 , 255 );
84
82
myBar->draw (left, 0 , color);
85
83
86
84
Text::arrange (Text::MR, myDisplayTime.str ());
@@ -109,7 +107,7 @@ TileRect2* myBar;
109
107
// ================================================================================================
110
108
// LabelList
111
109
112
- struct Dlg ::LabelList : public WgScrollRegion {
110
+ struct DialogLabelBreakdown ::LabelList : public WgScrollRegion {
113
111
114
112
Vector<LabelButton*> myButtons;
115
113
TileRect2 myButtonTex;
@@ -145,42 +143,42 @@ LabelList(GuiContext* gui)
145
143
146
144
void onUpdateSize () override
147
145
{
148
- myScrollH = max (24 , myButtons.size () * 21 );
149
- myClampScrollValues ();
146
+ scroll_height_ = max (24 , myButtons.size () * 21 );
147
+ ClampScrollPositions ();
150
148
}
151
149
152
150
void onTick () override
153
151
{
154
- myPreTick ();
152
+ PreTick ();
155
153
156
- int viewW = getViewWidth () - 2 * myScrollbarActiveV ;
154
+ int viewW = getViewWidth () - 2 * is_vertical_scrollbar_active_ ;
157
155
158
156
// Update the properties of each button.
159
- int y = myRect .y - myScrollY ;
157
+ int y = rect_ .y - scroll_position_y_ ;
160
158
for (int i = 0 ; i < myButtons.size (); ++i)
161
159
{
162
160
auto button = myButtons[i];
163
- button->arrange ({myRect .x , y, viewW, 20 });
161
+ button->arrange ({rect_ .x , y, viewW, 20 });
164
162
button->tick ();
165
163
y += 21 ;
166
164
}
167
165
168
- myPostTick ();
166
+ PostTick ();
169
167
}
170
168
171
169
void onDraw () override
172
170
{
173
171
if (gSimfile ->isClosed ()) return ;
174
172
175
173
TextStyle textStyle;
176
- int w = getViewWidth () - 2 * myScrollbarActiveV ;
174
+ int w = getViewWidth () - 2 * is_vertical_scrollbar_active_ ;
177
175
int h = getViewHeight ();
178
- int x = myRect .x ;
179
- int y = myRect .y - myScrollY ;
176
+ int x = rect_ .x ;
177
+ int y = rect_ .y - scroll_position_y_ ;
180
178
const Style* style = nullptr ;
181
179
int chartIndex = 0 ;
182
180
183
- Renderer::pushScissorRect ({myRect .x , myRect .y , w, h});
181
+ Renderer::pushScissorRect ({rect_ .x , rect_ .y , w, h});
184
182
if (myButtons.empty ())
185
183
{
186
184
Text::arrange (Text::MC, textStyle, " - no labels -" );
@@ -262,11 +260,11 @@ void copyLabels()
262
260
// ================================================================================================
263
261
// DialogLabelList
264
262
265
- Dlg ::~Dlg ()
263
+ DialogLabelBreakdown ::~DialogLabelBreakdown ()
266
264
{
267
265
}
268
266
269
- Dlg::Dlg ()
267
+ DialogLabelBreakdown::DialogLabelBreakdown ()
270
268
{
271
269
setTitle (" LABELS" );
272
270
@@ -283,19 +281,19 @@ Dlg::Dlg()
283
281
clear ();
284
282
}
285
283
286
- void Dlg ::clear ()
284
+ void DialogLabelBreakdown ::clear ()
287
285
{
288
286
myLabelText.clear ();
289
287
}
290
288
291
- void Dlg ::myCreateWidgets ()
289
+ void DialogLabelBreakdown ::myCreateWidgets ()
292
290
{
293
291
myLayout.row ().col (44 ).col (234 , true );
294
292
295
293
WgLineEdit* text = myLayout.add <WgLineEdit>(" Label" );
296
294
text->text .bind (&myLabelText);
297
295
text->setMaxLength (1000 );
298
- text->onChange .bind (this , &Dlg ::onChange);
296
+ text->onChange .bind (this , &DialogLabelBreakdown ::onChange);
299
297
text->setTooltip (" Label text" );
300
298
301
299
myLayout.row ().col (284 , true );
@@ -307,16 +305,16 @@ void Dlg::myCreateWidgets()
307
305
myDisplayTypeList->addItem (" Beat" );
308
306
myDisplayTypeList->addItem (" Row" );
309
307
myDisplayTypeList->value .bind (&myDisplayType);
310
- myDisplayTypeList->onChange .bind (this , &Dlg ::mySetDisplayType);
308
+ myDisplayTypeList->onChange .bind (this , &DialogLabelBreakdown ::mySetDisplayType);
311
309
myDisplayTypeList->setTooltip (" Change the unit used for timestamps." );
312
310
313
311
WgButton* copy = myLayout.add <WgButton>();
314
312
copy->text .set (" {g:copy}" );
315
313
copy->setTooltip (" Copy labels to clipboard" );
316
- copy->onPress .bind (this , &Dlg ::myCopyLabels);
314
+ copy->onPress .bind (this , &DialogLabelBreakdown ::myCopyLabels);
317
315
}
318
316
319
- void Dlg ::onChanges (int changes)
317
+ void DialogLabelBreakdown ::onChanges (int changes)
320
318
{
321
319
if (changes & VCM_FILE_CHANGED)
322
320
{
@@ -336,12 +334,12 @@ void Dlg::onChanges(int changes)
336
334
}
337
335
}
338
336
339
- void Dlg ::onUpdateSize ()
337
+ void DialogLabelBreakdown ::onUpdateSize ()
340
338
{
341
339
myLayout.onUpdateSize ();
342
340
}
343
341
344
- void Dlg ::onTick ()
342
+ void DialogLabelBreakdown ::onTick ()
345
343
{
346
344
recti bounds = getInnerRect ();
347
345
myList->setHeight (bounds.h - 58 );
@@ -357,7 +355,7 @@ void Dlg::onTick()
357
355
EditorDialog::onTick ();
358
356
}
359
357
360
- void Dlg ::onChange ()
358
+ void DialogLabelBreakdown ::onChange ()
361
359
{
362
360
if (gSimfile ->isClosed ()) return ;
363
361
@@ -371,13 +369,13 @@ void Dlg::onChange()
371
369
gTempo ->addSegment (Label (row, myLabelText));
372
370
}
373
371
374
- void Dlg ::mySetDisplayType ()
372
+ void DialogLabelBreakdown ::mySetDisplayType ()
375
373
{
376
374
myList->setDisplayType (myDisplayType);
377
375
}
378
376
379
377
380
- void Dlg ::myCopyLabels ()
378
+ void DialogLabelBreakdown ::myCopyLabels ()
381
379
{
382
380
myList->copyLabels ();
383
381
}
0 commit comments