mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 16:07:43 +00:00
make the ptext_prompt func can define which keyboard to enter (#2608)
* _ * format * use define
This commit is contained in:

committed by
GitHub

parent
4162820409
commit
1377516dce
@@ -131,6 +131,7 @@ ADSBCallsignView::ADSBCallsignView(
|
||||
nav,
|
||||
callsign,
|
||||
8,
|
||||
ENTER_KEYBOARD_MODE_ALPHA,
|
||||
[this](std::string& s) {
|
||||
button_callsign.set_text(s);
|
||||
});
|
||||
|
@@ -227,6 +227,7 @@ void HopperView::save_list() {
|
||||
nav_,
|
||||
filename_buffer,
|
||||
64,
|
||||
ENTER_KEYBOARD_MODE_ALPHA,
|
||||
[this](std::string& value) {
|
||||
auto path = hopper_dir / (value + ".PHOP");
|
||||
|
||||
|
2
firmware/application/external/lcr/ui_lcr.cpp
vendored
2
firmware/application/external/lcr/ui_lcr.cpp
vendored
@@ -189,6 +189,7 @@ void LCRView::on_button_set_am(NavigationView& nav, int16_t button_id) {
|
||||
nav,
|
||||
litteral[button_id],
|
||||
7,
|
||||
ENTER_KEYBOARD_MODE_ALPHA,
|
||||
[this, button_id](std::string& buffer) {
|
||||
texts[button_id].set(buffer);
|
||||
});
|
||||
@@ -257,6 +258,7 @@ LCRView::LCRView(NavigationView& nav) {
|
||||
nav,
|
||||
rgsb,
|
||||
4,
|
||||
ENTER_KEYBOARD_MODE_ALPHA,
|
||||
[this](std::string& buffer) {
|
||||
button_set_rgsb.set_text(buffer);
|
||||
});
|
||||
|
@@ -311,6 +311,7 @@ LGEView::LGEView(NavigationView& nav) {
|
||||
nav,
|
||||
nickname,
|
||||
15,
|
||||
ENTER_KEYBOARD_MODE_ALPHA,
|
||||
[this](std::string& buffer) {
|
||||
button_text.set_text(buffer);
|
||||
});
|
||||
|
@@ -212,6 +212,7 @@ MetronomeTapTempoView::MetronomeTapTempoView(NavigationView& nav, uint16_t bpm)
|
||||
nav_,
|
||||
input_buffer,
|
||||
3,
|
||||
ENTER_KEYBOARD_MODE_DIGITS,
|
||||
[this](std::string& buffer) {
|
||||
if (buffer.empty()) {
|
||||
return;
|
||||
|
@@ -99,7 +99,7 @@ static msg_t loopthread_fn(void* arg) {
|
||||
}
|
||||
|
||||
void MorseView::on_set_text(NavigationView& nav) {
|
||||
text_prompt(nav, buffer, 28);
|
||||
text_prompt(nav, buffer, 28, ENTER_KEYBOARD_MODE_ALPHA);
|
||||
}
|
||||
|
||||
void MorseView::focus() {
|
||||
|
@@ -210,6 +210,7 @@ OOKEditorAppView::OOKEditorAppView(NavigationView& nav)
|
||||
nav,
|
||||
outputFileBuffer,
|
||||
64,
|
||||
ENTER_KEYBOARD_MODE_ALPHA,
|
||||
[this](std::string& buffer) {
|
||||
on_save_file(buffer);
|
||||
});
|
||||
@@ -263,6 +264,7 @@ OOKEditorAppView::OOKEditorAppView(NavigationView& nav)
|
||||
nav,
|
||||
ook_data.payload,
|
||||
100,
|
||||
ENTER_KEYBOARD_MODE_DIGITS,
|
||||
[this](std::string& s) {
|
||||
text_payload.set(s);
|
||||
draw_waveform();
|
||||
|
@@ -83,6 +83,7 @@ OOKBruteView::OOKBruteView(NavigationView& nav)
|
||||
nav_,
|
||||
text_input_buffer,
|
||||
8, // currently longest is princeton
|
||||
ENTER_KEYBOARD_MODE_DIGITS,
|
||||
[this](std::string& buffer) {
|
||||
field_start.set_value(atoi(buffer.c_str()));
|
||||
validate_start_stop();
|
||||
@@ -100,6 +101,7 @@ OOKBruteView::OOKBruteView(NavigationView& nav)
|
||||
nav_,
|
||||
text_input_buffer,
|
||||
8, // currently longest is princeton
|
||||
ENTER_KEYBOARD_MODE_DIGITS,
|
||||
[this](std::string& buffer) {
|
||||
field_stop.set_value(atoi(buffer.c_str()));
|
||||
validate_start_stop();
|
||||
|
@@ -122,6 +122,7 @@ bool PlaylistEditorView::on_create_ppl() {
|
||||
nav_,
|
||||
current_ppl_name_buffer,
|
||||
100,
|
||||
ENTER_KEYBOARD_MODE_ALPHA,
|
||||
[&](std::string& s) {
|
||||
current_ppl_name_buffer = s;
|
||||
|
||||
@@ -307,6 +308,7 @@ PlaylistItemEditView::PlaylistItemEditView(
|
||||
nav_,
|
||||
delay_str,
|
||||
100,
|
||||
ENTER_KEYBOARD_MODE_ALPHA,
|
||||
[&](std::string& s) {
|
||||
delay_ = atoi(s.c_str());
|
||||
field_delay.set_value(delay_);
|
||||
|
@@ -330,7 +330,7 @@ RemoteAppView::RemoteAppView(
|
||||
|
||||
field_title.on_select = [this, &nav](TextField&) {
|
||||
temp_buffer_ = model_.name;
|
||||
text_prompt(nav_, temp_buffer_, text_edit_max, [this](std::string& new_name) {
|
||||
text_prompt(nav_, temp_buffer_, text_edit_max, ENTER_KEYBOARD_MODE_ALPHA, [this](std::string& new_name) {
|
||||
model_.name = new_name;
|
||||
refresh_ui();
|
||||
set_needs_save();
|
||||
@@ -339,7 +339,7 @@ RemoteAppView::RemoteAppView(
|
||||
|
||||
field_filename.on_select = [this, &nav](TextField&) {
|
||||
temp_buffer_ = remote_path_.stem().string();
|
||||
text_prompt(nav_, temp_buffer_, text_edit_max, [this](std::string& new_name) {
|
||||
text_prompt(nav_, temp_buffer_, text_edit_max, ENTER_KEYBOARD_MODE_ALPHA, [this](std::string& new_name) {
|
||||
rename_remote(new_name);
|
||||
refresh_ui();
|
||||
});
|
||||
|
@@ -56,7 +56,7 @@ SpectrumInputTextView::~SpectrumInputTextView() {
|
||||
}
|
||||
|
||||
void SpectrumInputTextView::on_set_text(NavigationView& nav) {
|
||||
text_prompt(nav, buffer, 300);
|
||||
text_prompt(nav, buffer, 300, ENTER_KEYBOARD_MODE_DIGITS);
|
||||
}
|
||||
|
||||
void SpectrumInputTextView::focus() {
|
||||
|
Reference in New Issue
Block a user