tcMenu
Loading...
Searching...
No Matches
DialogRuntimeEditor.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 https://www.thecoderscorner.com (Dave Cherry).
3 * This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4 */
5
6#ifndef TCMENU_DIALOGRUNTIMEEDITOR_H
7#define TCMENU_DIALOGRUNTIMEEDITOR_H
8
9#include "../MenuItems.h"
10#include "../RuntimeMenuItem.h"
11#include "../BaseDialog.h"
12
17
18
19void onScrollingChanged(int id);
20
21class DialogMultiPartEditor : BaseDialogController {
22private:
23 MenuBasedDialog *dialog;
24 EditableMultiPartMenuItem* menuItemBeingEdited;
25 AnalogMenuInfo scrollingInfo = {"Item Value", nextRandomId(), 0xffff, 1, onScrollingChanged, 0, 1, "" };
26 AnalogMenuItem scrollingEditor = AnalogMenuItem(&scrollingInfo, 0, nullptr, INFO_LOCATION_RAM);
27
28public:
29 static DialogMultiPartEditor* theInstance;
30
31 DialogMultiPartEditor() {
32 theInstance = this;
33 menuItemBeingEdited = nullptr;
34 dialog = nullptr;
35 };
36
37 void startEditing(MenuBasedDialog* dlg, EditableMultiPartMenuItem* item);
38
39 void scrollChanged();
40
41 void dialogDismissed(ButtonType buttonType) override;
42
43 bool dialogButtonPressed(int buttonNum) override;
44
45 void copyCustomButtonText(int buttonNumber, char *buffer, size_t bufferSize) override;
46
47 void initialiseAndGetHeader(BaseDialog* dialog, char* buffer, size_t bufferSize) override;
48};
49
50#endif //TCMENU_DIALOGRUNTIMEEDITOR_H
The definition of the base dialog object, that can be used with any display type. These are designed ...
ButtonType
Definition BaseDialog.h:22
In TcMenu, MenuItem storage is shared between program memory and RAM. Usually each MenuItem has assoc...
Definition MenuItems.h:71
Contains definitions of menu items that can be fully defined at runtime with no need for prog mem str...
menuid_t nextRandomId()
Definition RuntimeMenuItem.cpp:15
Definition MenuItems.h:485
Definition BaseDialog.h:62
Definition BaseDialog.h:102
void copyCustomButtonText(int buttonNumber, char *buffer, size_t bufferSize) override
Definition DialogRuntimeEditor.cpp:45
void initialiseAndGetHeader(BaseDialog *dialog, char *buffer, size_t bufferSize) override
Definition DialogRuntimeEditor.cpp:51
bool dialogButtonPressed(int buttonNum) override
Definition DialogRuntimeEditor.cpp:32
void dialogDismissed(ButtonType buttonType) override
Definition DialogRuntimeEditor.cpp:25
Definition RuntimeMenuItem.h:230
Definition BaseDialog.h:295