-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDialogRuntimeEditor.h
More file actions
50 lines (35 loc) · 1.44 KB
/
DialogRuntimeEditor.h
File metadata and controls
50 lines (35 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (c) 2018 https://www.thecoderscorner.com (Dave Cherry).
* This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
*/
#ifndef TCMENU_DIALOGRUNTIMEEDITOR_H
#define TCMENU_DIALOGRUNTIMEEDITOR_H
#include "../MenuItems.h"
#include "../RuntimeMenuItem.h"
#include "../BaseDialog.h"
/**
* @file DialogRuntimeEditor.h
* Contains the functionality to handle editing runtime multipart items
*/
void onScrollingChanged(int id);
class DialogMultiPartEditor : BaseDialogController {
private:
MenuBasedDialog *dialog;
EditableMultiPartMenuItem* menuItemBeingEdited;
AnalogMenuInfo scrollingInfo = {"Item Value", nextRandomId(), 0xffff, 0, 1, onScrollingChanged, 0, 1, "" };
AnalogMenuItem scrollingEditor = AnalogMenuItem(&scrollingInfo, 0, nullptr, INFO_LOCATION_RAM);
public:
static DialogMultiPartEditor* theInstance;
DialogMultiPartEditor() {
theInstance = this;
menuItemBeingEdited = nullptr;
dialog = nullptr;
};
void startEditing(MenuBasedDialog* dlg, EditableMultiPartMenuItem* item);
void scrollChanged();
void dialogDismissed(ButtonType buttonType) override;
bool dialogButtonPressed(int buttonNum) override;
void copyCustomButtonText(int buttonNumber, char *buffer, size_t bufferSize) override;
void initialiseAndGetHeader(BaseDialog* dialog, char* buffer, size_t bufferSize) override;
};
#endif //TCMENU_DIALOGRUNTIMEEDITOR_H