tcMenu
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 
19 void onScrollingChanged(int id);
20 
22 private:
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 
28 public:
29  static DialogMultiPartEditor* theInstance;
30 
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
ButtonType
Definition: BaseDialog.h:22
Definition: MenuItems.h:71
menuid_t nextRandomId()
Definition: RuntimeMenuItem.cpp:15
Definition: MenuItems.h:476
Definition: BaseDialog.h:62
Definition: BaseDialog.h:102
Definition: DialogRuntimeEditor.h:21
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:228
Definition: BaseDialog.h:295