本文整理汇总了C++中NavigationView::push方法的典型用法代码示例。如果您正苦于以下问题:C++ NavigationView::push方法的具体用法?C++ NavigationView::push怎么用?C++ NavigationView::push使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NavigationView
的用法示例。
在下文中一共展示了NavigationView::push方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
DebugMenuView::DebugMenuView(NavigationView& nav) {
add_items<7>({ {
{ "Memory", [&nav](){ nav.push(new DebugMemoryView { nav }); } },
{ "Radio State", [&nav](){ nav.push(new NotImplementedView { nav }); } },
{ "SD Card", [&nav](){ nav.push(new NotImplementedView { nav }); } },
{ "RFFC5072", [&nav](){ nav.push(new DebugRFFC5072View { nav }); } },
{ "MAX2837", [&nav](){ nav.push(new NotImplementedView { nav }); } },
{ "Si5351C", [&nav](){ nav.push(new NotImplementedView { nav }); } },
{ "WM8731", [&nav](){ nav.push(new NotImplementedView { nav }); } },
} });
on_left = [&nav](){ nav.pop(); };
}
示例2:
PlayDeadView::PlayDeadView(NavigationView& nav, bool booting) {
_booting = booting;
persistent_memory::set_playing_dead(0x59);
add_children({ {
&text_playdead1,
&text_playdead2,
&button_done,
} });
button_done.on_dir = [this,&nav](Button&, KeyEvent key){
sequence = (sequence<<3) | static_cast<std::underlying_type<KeyEvent>::type>(key);
};
button_done.on_select = [this,&nav](Button&){
if (sequence == persistent_memory::playdead_sequence()) {
persistent_memory::set_playing_dead(0);
if (_booting) {
nav.pop();
nav.push(new SystemMenuView { nav });
} else {
nav.pop();
}
} else {
sequence = 0;
}
};
}
示例3:
SetupMenuView::SetupMenuView(NavigationView& nav) {
add_items<3>({ {
{ "Date/Time", [&nav]() {
nav.push(new SetDateTimeView { nav });
}
},
{ "Frequency Correction", [&nav]() {
nav.push(new SetFrequencyCorrectionView { nav });
}
},
{ "Touch", [&nav]() {
nav.push(new NotImplementedView { nav });
}
},
}
});
on_left = [&nav]() {
nav.pop();
};
}
示例4:
ReceiverView::ReceiverView(
NavigationView& nav,
ReceiverModel& receiver_model
) : receiver_model(receiver_model)
{
add_children({ {
&rssi,
&channel,
&audio,
&button_done,
&field_frequency,
&field_lna,
//&options_baseband_bandwidth,
&field_vga,
&options_modulation,
//&options_baseband_oversampling,
&field_volume,
&view_frequency_options,
&view_rf_gain_options,
&waterfall,
} });
button_done.on_select = [&nav](Button&){
nav.pop();
};
field_frequency.set_value(receiver_model.tuning_frequency());
field_frequency.set_step(receiver_model.frequency_step());
field_frequency.on_change = [this](rf::Frequency f) {
this->on_tuning_frequency_changed(f);
};
field_frequency.on_edit = [this, &nav]() {
// TODO: Provide separate modal method/scheme?
auto new_view = new FrequencyKeypadView { nav, this->receiver_model.tuning_frequency() };
new_view->on_changed = [this](rf::Frequency f) {
this->on_tuning_frequency_changed(f);
this->field_frequency.set_value(f);
};
nav.push(new_view);
};
field_frequency.on_show_options = [this]() {
this->on_show_options_frequency();
};
field_lna.set_value(receiver_model.lna());
field_lna.on_change = [this](int32_t v) {
this->on_lna_changed(v);
};
field_lna.on_show_options = [this]() {
this->on_show_options_rf_gain();
};
/*
options_baseband_bandwidth.set_by_value(receiver_model.baseband_bandwidth());
options_baseband_bandwidth.on_change = [this](size_t n, OptionsField::value_t v) {
(void)n;
this->on_baseband_bandwidth_changed(v);
};
*/
field_vga.set_value(receiver_model.vga());
field_vga.on_change = [this](int32_t v_db) {
this->on_vga_changed(v_db);
};
options_modulation.set_by_value(receiver_model.modulation());
options_modulation.on_change = [this](size_t n, OptionsField::value_t v) {
(void)n;
this->on_modulation_changed(v);
};
/*
options_baseband_oversampling.set_by_value(receiver_model.baseband_oversampling());
options_baseband_oversampling.on_change = [this](size_t n, OptionsField::value_t v) {
(void)n;
this->on_baseband_oversampling_changed(v);
};
*/
field_volume.set_value((receiver_model.headphone_volume() - wolfson::wm8731::headphone_gain_range.max).decibel() + 99);
field_volume.on_change = [this](int32_t v) {
this->on_headphone_volume_changed(v);
};
view_frequency_options.hidden(true);
view_frequency_options.set_step(receiver_model.frequency_step());
view_frequency_options.on_change_step = [this](rf::Frequency f) {
this->on_frequency_step_changed(f);
};
view_frequency_options.set_reference_ppm_correction(receiver_model.reference_ppm_correction());
view_frequency_options.on_change_reference_ppm_correction = [this](int32_t v) {
this->on_reference_ppm_correction_changed(v);
};
view_rf_gain_options.hidden(true);
view_rf_gain_options.set_rf_amp(receiver_model.rf_amp());
view_rf_gain_options.on_change_rf_amp = [this](bool enable) {
this->on_rf_amp_changed(enable);
};
receiver_model.enable();
}