mayhem-firmware/firmware/application/ui_freqman.cpp

81 lines
1.6 KiB
C++

/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui_freqman.hpp"
#include "ch.h"
#include "ff.h"
#include "portapack.hpp"
#include "event_m0.hpp"
#include "hackrf_hal.hpp"
#include "portapack_shared_memory.hpp"
#include <cstring>
using namespace portapack;
namespace ui {
void FreqManView::paint(Painter& painter) {
(void)painter;
}
FreqManView::FreqManView(
NavigationView& nav
) {
add_children({ {
&button_ok
} });
size_t n = 0;
for(auto& text : text_list) {
add_child(&text);
text.set_parent_rect({
static_cast<Coord>(0),
static_cast<Coord>(16 + (n * 16)),
240, 16
});
const std::string label {
(char)(n + 0x30)
};
text.set(label);
n++;
}
button_ok.on_select = [this, &nav](Button&) {
nav.pop();
};
}
void FreqManView::on_show() {
}
void FreqManView::on_hide() {
}
}