gipy: new menu to reverse path quickly
parent
ae784dc4f1
commit
8bfa4e32cc
|
|
@ -130,4 +130,5 @@
|
||||||
* Switching screen will clear the screen immediately so you can know your screen touch has been received
|
* Switching screen will clear the screen immediately so you can know your screen touch has been received
|
||||||
|
|
||||||
0.24:
|
0.24:
|
||||||
* Fix for loading very large files (> 65kb)
|
* Fix for loading very large files (> 65kb)
|
||||||
|
* new menu on file selection : reverse path without waiting for file to load
|
||||||
|
|
@ -1370,14 +1370,47 @@ function drawMenu() {
|
||||||
menu["Exit"] = function () {
|
menu["Exit"] = function () {
|
||||||
load();
|
load();
|
||||||
};
|
};
|
||||||
|
Bangle.setLCDBrightness(settings.brightness);
|
||||||
|
Bangle.setLocked(false);
|
||||||
E.showMenu(menu);
|
E.showMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function ask_options(fn) {
|
||||||
|
g.clear();
|
||||||
|
let height = g.getHeight();
|
||||||
|
let width = g.getWidth();
|
||||||
|
g.drawRect(10, 10, width - 10, height / 2 - 10);
|
||||||
|
g.drawRect(10, height/2 + 10, width - 10, height - 10);
|
||||||
|
g.setFont("Vector:30").setFontAlign(0,0).drawString("Forward", width/2, height/4);
|
||||||
|
g.drawString("Backward", width/2, 3*height/4);
|
||||||
|
g.flip();
|
||||||
|
|
||||||
|
function options_select(b, xy) {
|
||||||
|
end = false;
|
||||||
|
if (xy.y < height / 2 - 10) {
|
||||||
|
g.setColor(0, 0, 0).fillRect(10, 10, width - 10, height / 2 - 10);
|
||||||
|
g.setColor(1, 1, 1).setFont("Vector:30").setFontAlign(0,0).drawString("Forward", width/2, height/4);
|
||||||
|
end = true;
|
||||||
|
} else if (xy.y > height/2 + 10) {
|
||||||
|
g.setColor(0, 0, 0).fillRect(10, height/2 + 10, width - 10, height - 10);
|
||||||
|
g.setColor(1, 1, 1).setFont("Vector:30").setFontAlign(0,0).drawString("Backward", width/2, 3*height/4);
|
||||||
|
go_backwards = true;
|
||||||
|
end = true;
|
||||||
|
}
|
||||||
|
if (end) {
|
||||||
|
g.flip();
|
||||||
|
Bangle.removeListener("touch", options_select);
|
||||||
|
console.log("loading", fn);
|
||||||
|
load_gps(fn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Bangle.on("touch", options_select);
|
||||||
|
}
|
||||||
|
|
||||||
function start(fn) {
|
function start(fn) {
|
||||||
E.showMenu();
|
E.showMenu();
|
||||||
console.log("loading", fn);
|
ask_options(fn);
|
||||||
|
|
||||||
load_gps(fn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_gipy(path, maps, interests, heights) {
|
function start_gipy(path, maps, interests, heights) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue