MeOS version 3.8.1290 RC2
This commit is contained in:
parent
62a69d2e1f
commit
39114f894b
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1023,7 +1023,7 @@ bool MeosSQL::storeData(oDataInterface odi, const RowWrapper &row, unsigned long
|
|||||||
list<oVariableInt>::iterator it_int;
|
list<oVariableInt>::iterator it_int;
|
||||||
for(it_int=varint.begin(); it_int!=varint.end(); it_int++) {
|
for(it_int=varint.begin(); it_int!=varint.end(); it_int++) {
|
||||||
if (it_int->data32) {
|
if (it_int->data32) {
|
||||||
int val = int(row[it_int->name]);
|
int val = int(row[(const char *)it_int->name]);
|
||||||
|
|
||||||
if (val != *(it_int->data32)) {
|
if (val != *(it_int->data32)) {
|
||||||
*(it_int->data32) = val;
|
*(it_int->data32) = val;
|
||||||
@ -1031,7 +1031,7 @@ bool MeosSQL::storeData(oDataInterface odi, const RowWrapper &row, unsigned long
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
__int64 val = row[it_int->name].ulonglong();
|
__int64 val = row[(const char*)it_int->name].ulonglong();
|
||||||
__int64 oldVal = *(it_int->data64);
|
__int64 oldVal = *(it_int->data64);
|
||||||
if (val != oldVal) {
|
if (val != oldVal) {
|
||||||
memcpy(it_int->data64, &val, 8);
|
memcpy(it_int->data64, &val, 8);
|
||||||
@ -1049,7 +1049,7 @@ bool MeosSQL::storeData(oDataInterface odi, const RowWrapper &row, unsigned long
|
|||||||
odi.getVariableString(varstring);
|
odi.getVariableString(varstring);
|
||||||
list<oVariableString>::iterator it_string;
|
list<oVariableString>::iterator it_string;
|
||||||
for(it_string=varstring.begin(); it_string!=varstring.end(); it_string++) {
|
for(it_string=varstring.begin(); it_string!=varstring.end(); it_string++) {
|
||||||
wstring w(fromUTF(row[it_string->name].c_str()));
|
wstring w(fromUTF(row[(const char*)it_string->name].c_str()));
|
||||||
if (it_string->store(w.c_str()))
|
if (it_string->store(w.c_str()))
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
@ -1822,12 +1822,12 @@ OpFailStatus MeosSQL::storeRunner(const RowWrapper &row, oRunner &r,
|
|||||||
if (rid>0) {
|
if (rid>0) {
|
||||||
pRunner pr = oe->getRunner(rid, 0);
|
pRunner pr = oe->getRunner(rid, 0);
|
||||||
if (pr==0) {
|
if (pr==0) {
|
||||||
oRunner or(oe, rid);
|
oRunner oR(oe, rid);
|
||||||
or.setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
if (allowSubRead)
|
if (allowSubRead)
|
||||||
success = min(success, syncRead(true, &or, false, readCourseCard));
|
success = min(success, syncRead(true, &oR, false, readCourseCard));
|
||||||
if (!or.isRemoved()) {
|
if (!oR.isRemoved()) {
|
||||||
pr = oe->addRunner(or , false);
|
pr = oe->addRunner(oR , false);
|
||||||
addedFromDatabase(pr);
|
addedFromDatabase(pr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1931,18 +1931,18 @@ OpFailStatus MeosSQL::storeTeam(const RowWrapper &row, oTeam &t,
|
|||||||
if (rns[k]>0) {
|
if (rns[k]>0) {
|
||||||
pRns[k] = oe->getRunner(rns[k], 0);
|
pRns[k] = oe->getRunner(rns[k], 0);
|
||||||
if (!pRns[k]) {
|
if (!pRns[k]) {
|
||||||
oRunner or(oe, rns[k]);
|
oRunner oR(oe, rns[k]);
|
||||||
or.setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
if (allowSubRead)
|
if (allowSubRead)
|
||||||
success = min(success, syncRead(true, &or, readRecursive, readRecursive));
|
success = min(success, syncRead(true, &oR, readRecursive, readRecursive));
|
||||||
|
|
||||||
if (or.sName.empty()) {
|
if (oR.sName.empty()) {
|
||||||
or.sName = L"@AutoCorrection";
|
oR.sName = L"@AutoCorrection";
|
||||||
or.getRealName(or.sName, or.tRealName);
|
oR.getRealName(oR.sName, oR.tRealName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!or.isRemoved()) {
|
if (!oR.isRemoved()) {
|
||||||
pRns[k] = oe->addRunner(or , false);
|
pRns[k] = oe->addRunner(oR , false);
|
||||||
addedFromDatabase(pRns[k]);
|
addedFromDatabase(pRns[k]);
|
||||||
assert(pRns[k] && !pRns[k]->changed);
|
assert(pRns[k] && !pRns[k]->changed);
|
||||||
}
|
}
|
||||||
@ -3262,10 +3262,10 @@ bool MeosSQL::syncListRunner(oEvent *oe)
|
|||||||
st = opStatusOK;
|
st = opStatusOK;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
oRunner or(oe, Id);
|
oRunner oR(oe, Id);
|
||||||
or.setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
st = syncRead(true, &or, false, false);
|
st = syncRead(true, &oR, false, false);
|
||||||
r = oe->addRunner(or, false);
|
r = oe->addRunner(oR, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateCounters(st, counter, modified, oe->sqlRunners, maxCounterRunner);
|
updateCounters(st, counter, modified, oe->sqlRunners, maxCounterRunner);
|
||||||
@ -4259,9 +4259,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
|
|||||||
checkAgainstDB("oControl", bmap, needUpdate);
|
checkAgainstDB("oControl", bmap, needUpdate);
|
||||||
for (auto id : needUpdate) {
|
for (auto id : needUpdate) {
|
||||||
if (!id.second) {
|
if (!id.second) {
|
||||||
oControl or(oe, id.first);
|
oControl oR(oe, id.first);
|
||||||
or.setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
auto c = oe->addControl(or);
|
auto c = oe->addControl(oR);
|
||||||
if (c != nullptr)
|
if (c != nullptr)
|
||||||
syncRead(true, c);
|
syncRead(true, c);
|
||||||
}
|
}
|
||||||
@ -4275,9 +4275,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
|
|||||||
checkAgainstDB("oCourse", bmap, needUpdate);
|
checkAgainstDB("oCourse", bmap, needUpdate);
|
||||||
for (auto id : needUpdate) {
|
for (auto id : needUpdate) {
|
||||||
if (!id.second) {
|
if (!id.second) {
|
||||||
oCourse or(oe, id.first);
|
oCourse oR(oe, id.first);
|
||||||
or.setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
auto c = oe->addCourse(or);
|
auto c = oe->addCourse(oR);
|
||||||
if (c != nullptr)
|
if (c != nullptr)
|
||||||
syncRead(true, c);
|
syncRead(true, c);
|
||||||
}
|
}
|
||||||
@ -4291,9 +4291,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
|
|||||||
checkAgainstDB("oClass", bmap, needUpdate);
|
checkAgainstDB("oClass", bmap, needUpdate);
|
||||||
for (auto id : needUpdate) {
|
for (auto id : needUpdate) {
|
||||||
if (!id.second) {
|
if (!id.second) {
|
||||||
oClass or(oe, id.first);
|
oClass oR(oe, id.first);
|
||||||
or .setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
auto c = oe->addClass(or);
|
auto c = oe->addClass(oR);
|
||||||
if (c != nullptr)
|
if (c != nullptr)
|
||||||
syncRead(true, c);
|
syncRead(true, c);
|
||||||
}
|
}
|
||||||
@ -4307,9 +4307,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
|
|||||||
checkAgainstDB("oClub", bmap, needUpdate);
|
checkAgainstDB("oClub", bmap, needUpdate);
|
||||||
for (auto id : needUpdate) {
|
for (auto id : needUpdate) {
|
||||||
if (!id.second) {
|
if (!id.second) {
|
||||||
oClub or(oe, id.first);
|
oClub oR(oe, id.first);
|
||||||
or.setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
auto c = oe->addClub(or);
|
auto c = oe->addClub(oR);
|
||||||
if (c != nullptr)
|
if (c != nullptr)
|
||||||
syncRead(true, c);
|
syncRead(true, c);
|
||||||
}
|
}
|
||||||
@ -4323,9 +4323,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
|
|||||||
checkAgainstDB("oCard", bmap, needUpdate);
|
checkAgainstDB("oCard", bmap, needUpdate);
|
||||||
for (auto id : needUpdate) {
|
for (auto id : needUpdate) {
|
||||||
if (!id.second) {
|
if (!id.second) {
|
||||||
oCard or (oe, id.first);
|
oCard oR(oe, id.first);
|
||||||
or .setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
auto c = oe->addCard(or );
|
auto c = oe->addCard(oR);
|
||||||
if (c != nullptr)
|
if (c != nullptr)
|
||||||
syncRead(true, c);
|
syncRead(true, c);
|
||||||
}
|
}
|
||||||
@ -4339,10 +4339,10 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
|
|||||||
checkAgainstDB("oRunner", bmap, needUpdate);
|
checkAgainstDB("oRunner", bmap, needUpdate);
|
||||||
for (auto id : needUpdate) {
|
for (auto id : needUpdate) {
|
||||||
if (!id.second) {
|
if (!id.second) {
|
||||||
oRunner or (oe, id.first);
|
oRunner oR(oe, id.first);
|
||||||
or .setImplicitlyCreated();
|
oR.setImplicitlyCreated();
|
||||||
syncRead(true, &or );
|
syncRead(true, &oR);
|
||||||
oe->addRunner(or , false);
|
oe->addRunner(oR, false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
id.second->counter = 0;
|
id.second->counter = 0;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -89,7 +89,7 @@ protected:
|
|||||||
bool storeData(oDataInterface odi, const RowWrapper &row, unsigned long &revision);
|
bool storeData(oDataInterface odi, const RowWrapper &row, unsigned long &revision);
|
||||||
|
|
||||||
void importLists(oEvent *oe, const char *bf);
|
void importLists(oEvent *oe, const char *bf);
|
||||||
void encodeLists(const oEvent *or, string &listEnc) const;
|
void encodeLists(const oEvent *oe, string &listEnc) const;
|
||||||
|
|
||||||
//Set DB to default competition DB
|
//Set DB to default competition DB
|
||||||
void setDefaultDB();
|
void setDefaultDB();
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -95,19 +95,19 @@ struct PrinterObject {
|
|||||||
bool onlyChanged;
|
bool onlyChanged;
|
||||||
|
|
||||||
struct DATASET {
|
struct DATASET {
|
||||||
int pWidth_mm;
|
int pWidth_mm = 0;
|
||||||
int pHeight_mm;
|
int pHeight_mm = 0;
|
||||||
double pMgBottom;
|
double pMgBottom = 0.0;
|
||||||
double pMgTop;
|
double pMgTop = 0.0;
|
||||||
double pMgRight;
|
double pMgRight = 0.0;
|
||||||
double pMgLeft;
|
double pMgLeft = 0.0;
|
||||||
|
|
||||||
int MarginX;
|
int MarginX = 0;
|
||||||
int MarginY;
|
int MarginY = 0;
|
||||||
int PageX;
|
int PageX = 0;
|
||||||
int PageY;
|
int PageY = 0;
|
||||||
double Scale;
|
double Scale = 0.0;
|
||||||
bool LastPage;
|
bool LastPage = false;
|
||||||
} ds;
|
} ds;
|
||||||
|
|
||||||
void operator=(const PrinterObject &po);
|
void operator=(const PrinterObject &po);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -872,7 +872,6 @@ void RunnerDB::loadClubs(const wstring &file)
|
|||||||
else if (pc != pc2)
|
else if (pc != pc2)
|
||||||
problems.push_back(pc->getName() + L"-" + pc2->getName());
|
problems.push_back(pc->getName() + L"-" + pc2->getName());
|
||||||
}
|
}
|
||||||
problems.begin();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1330,11 +1329,24 @@ void RunnerDB::refreshRunnerTableData(Table &table) {
|
|||||||
int runnerId;
|
int runnerId;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
|
pRunner r = nullptr;
|
||||||
if (rdb[k].extId != 0)
|
if (rdb[k].extId != 0)
|
||||||
found = runnerInEvent.lookup(rdb[k].extId, runnerId);
|
found = runnerInEvent.lookup(rdb[k].extId, runnerId);
|
||||||
|
else if (rdb[k].cardNo != 0) {
|
||||||
|
found = runnerInEvent.lookup(rdb[k].cardNo + cardIdConstant, runnerId);
|
||||||
|
if (found) {
|
||||||
|
r = oe->getRunner(runnerId, 0);
|
||||||
|
const RunnerWDBEntry &rw = rwdb[k];
|
||||||
|
rw.initName();
|
||||||
|
if (!r || !r->matchName(rw.name)) {
|
||||||
|
found = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
pRunner r = oe->getRunner(runnerId, 0);
|
if (r == nullptr)
|
||||||
|
r = oe->getRunner(runnerId, 0);
|
||||||
row->updateCell(cellEntryIndex, cellEdit, r ? r->getClass(true) : L"");
|
row->updateCell(cellEntryIndex, cellEdit, r ? r->getClass(true) : L"");
|
||||||
}
|
}
|
||||||
else if (!found && row->getCellType(cellEntryIndex) == cellEdit) {
|
else if (!found && row->getCellType(cellEntryIndex) == cellEdit) {
|
||||||
@ -1414,8 +1426,18 @@ void oDBRunnerEntry::addTableRow(Table &table) const {
|
|||||||
int runnerId;
|
int runnerId;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
|
pRunner cr = nullptr;
|
||||||
if (rn.extId != 0)
|
if (rn.extId != 0)
|
||||||
found = db->runnerInEvent.lookup(rn.extId, runnerId);
|
found = db->runnerInEvent.lookup(rn.extId, runnerId);
|
||||||
|
else if (rn.cardNo != 0) {
|
||||||
|
found = db->runnerInEvent.lookup(rn.cardNo + cardIdConstant, runnerId);
|
||||||
|
if (found) {
|
||||||
|
cr = oe->getRunner(runnerId, 0);
|
||||||
|
if (!cr || !cr->matchName(r.name)) {
|
||||||
|
found = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (canEdit)
|
if (canEdit)
|
||||||
table.setTableProp(Table::CAN_DELETE|Table::CAN_INSERT|Table::CAN_PASTE);
|
table.setTableProp(Table::CAN_DELETE|Table::CAN_INSERT|Table::CAN_PASTE);
|
||||||
@ -1426,8 +1448,9 @@ void oDBRunnerEntry::addTableRow(Table &table) const {
|
|||||||
if (!found)
|
if (!found)
|
||||||
table.set(row++, it, TID_ENTER, L"@+", false, cellAction);
|
table.set(row++, it, TID_ENTER, L"@+", false, cellAction);
|
||||||
else {
|
else {
|
||||||
pRunner r = oe->getRunner(runnerId, 0);
|
if (cr == nullptr)
|
||||||
table.set(row++, it, TID_ENTER, r ? r->getClass(true) : L"", false, cellEdit);
|
cr = oe->getRunner(runnerId, 0);
|
||||||
|
table.set(row++, it, TID_ENTER, cr ? cr->getClass(true) : L"", false, cellEdit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
const int baseNameLength = 64;
|
const int baseNameLength = 64;
|
||||||
const int baseNameLengthUTF = 96;
|
const int baseNameLengthUTF = 96;
|
||||||
|
constexpr int64_t cardIdConstant = 100000000000L;
|
||||||
//Has 0-clearing constructor. Must not contain any
|
//Has 0-clearing constructor. Must not contain any
|
||||||
//dynamic data etc.
|
//dynamic data etc.
|
||||||
struct RunnerDBEntryV1 {
|
struct RunnerDBEntryV1 {
|
||||||
@ -139,7 +139,7 @@ public:
|
|||||||
void setNameUTF(const char *name);
|
void setNameUTF(const char *name);
|
||||||
|
|
||||||
|
|
||||||
const wchar_t *RunnerWDBEntry::getNameCstr() const;
|
const wchar_t *getNameCstr() const;
|
||||||
|
|
||||||
wstring getGivenName() const;
|
wstring getGivenName() const;
|
||||||
wstring getFamilyName() const;
|
wstring getFamilyName() const;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1926,14 +1926,6 @@ void SportIdent::EnumrateSerialPorts(list<int> &ports)
|
|||||||
//Make sure we clear out any elements which may already be in the array
|
//Make sure we clear out any elements which may already be in the array
|
||||||
ports.clear();
|
ports.clear();
|
||||||
|
|
||||||
//Determine what OS we are running on
|
|
||||||
OSVERSIONINFO osvi;
|
|
||||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
|
||||||
BOOL bGetVer = GetVersionEx(&osvi);
|
|
||||||
|
|
||||||
//On NT use the QueryDosDevice API
|
|
||||||
if (bGetVer && (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT))
|
|
||||||
{
|
|
||||||
//Use QueryDosDevice to look for all devices of the form COMx. This is a better
|
//Use QueryDosDevice to look for all devices of the form COMx. This is a better
|
||||||
//solution as it means that no ports have to be opened at all.
|
//solution as it means that no ports have to be opened at all.
|
||||||
TCHAR szDevices[65535];
|
TCHAR szDevices[65535];
|
||||||
@ -1970,48 +1962,8 @@ void SportIdent::EnumrateSerialPorts(list<int> &ports)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else
|
|
||||||
// TRACE(_T("Failed in call to QueryDosDevice, GetLastError:%d\n"), GetLastError());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//On 95/98 open up each port to determine their existence
|
|
||||||
|
|
||||||
//Up to 255 COM ports are supported so we iterate through all of them seeing
|
|
||||||
//if we can open them or if we fail to open them, get an access denied or general error error.
|
|
||||||
//Both of these cases indicate that there is a COM port at that number.
|
|
||||||
for (UINT i=1; i<256; i++)
|
|
||||||
{
|
|
||||||
//Form the Raw device name
|
|
||||||
wchar_t sPort[256];
|
|
||||||
|
|
||||||
swprintf_s(sPort, 256, L"\\\\.\\COM%d", i);
|
|
||||||
|
|
||||||
//Try to open the port
|
|
||||||
BOOL bSuccess = FALSE;
|
|
||||||
HANDLE hPort = ::CreateFile(sPort, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
|
|
||||||
if (hPort == INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
DWORD dwError = GetLastError();
|
|
||||||
|
|
||||||
//Check to see if the error was because some other app had the port open or a general failure
|
|
||||||
if (dwError == ERROR_ACCESS_DENIED || dwError == ERROR_GEN_FAILURE)
|
|
||||||
bSuccess = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//The port was opened successfully
|
|
||||||
bSuccess = TRUE;
|
|
||||||
|
|
||||||
//Don't forget to close the port, since we are going to do nothing with it anyway
|
|
||||||
CloseHandle(hPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Add the port number to the array which will be returned
|
|
||||||
if (bSuccess)
|
|
||||||
ports.push_front(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -100,7 +100,10 @@ AutoMachine *TabAuto::getMachine(int id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AutoMachine::save(oEvent &oe, gdioutput &gdi, bool doProcess) {
|
void AutoMachine::save(oEvent &oe, gdioutput &gdi, bool doProcess) {
|
||||||
|
wstring oldMachineName = getMachineName();
|
||||||
machineName = gdi.getText("MachineName");
|
machineName = gdi.getText("MachineName");
|
||||||
|
wstring newMachineName = getMachineName();
|
||||||
|
oe.getMachineContainer().rename(getTypeString(), oldMachineName, newMachineName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoMachine::status(gdioutput &gdi) {
|
void AutoMachine::status(gdioutput &gdi) {
|
||||||
@ -665,18 +668,18 @@ bool TabAuto::loadPage(gdioutput &gdi, bool showSettingsLast)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoMachine::settingsTitle(gdioutput &gdi, char *title) {
|
void AutoMachine::settingsTitle(gdioutput &gdi, const char *title) {
|
||||||
gdi.fillDown();
|
gdi.fillDown();
|
||||||
gdi.dropLine(0.5);
|
gdi.dropLine(0.5);
|
||||||
gdi.addString("", fontMediumPlus, title).setColor(colorDarkBlue);
|
gdi.addString("", fontMediumPlus, title).setColor(colorDarkBlue);
|
||||||
gdi.dropLine(0.5);
|
gdi.dropLine(0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoMachine::startCancelInterval(gdioutput &gdi, char *startCommand, State state, IntervalType type, const wstring &intervalIn) {
|
void AutoMachine::startCancelInterval(gdioutput &gdi, const char *startCommand, State state, IntervalType type, const wstring &intervalIn) {
|
||||||
gdi.pushX();
|
gdi.pushX();
|
||||||
gdi.fillRight();
|
gdi.fillRight();
|
||||||
|
|
||||||
gdi.addInput("MachineName", machineName, 10, nullptr, L"Namn", L"Om du vill kan du namnge automaten");
|
gdi.addInput("MachineName", machineName, 10, nullptr, L"Automatnamn:", L"Om du vill kan du namnge automaten");
|
||||||
|
|
||||||
if (type == IntervalMinute)
|
if (type == IntervalMinute)
|
||||||
gdi.addInput("Interval", intervalIn, 7, 0, L"Tidsintervall (MM:SS):");
|
gdi.addInput("Interval", intervalIn, 7, 0, L"Tidsintervall (MM:SS):");
|
||||||
@ -1117,7 +1120,7 @@ void PunchMachine::process(gdioutput &gdi, oEvent *oe, AutoSyncType ast)
|
|||||||
if (!sic.empty()) {
|
if (!sic.empty()) {
|
||||||
if (!radio) si.addCard(sic);
|
if (!radio) si.addCard(sic);
|
||||||
}
|
}
|
||||||
else gdi.addInfoBox("", L"Failed to generate card.", interval * 2);
|
else gdi.addInfoBox("", L"Failed to generate card.", interval * 2000);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SICard sic(ConvertedTimeStatus::Hour24);
|
SICard sic(ConvertedTimeStatus::Hour24);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -67,9 +67,9 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
bool editMode;
|
bool editMode;
|
||||||
|
|
||||||
void settingsTitle(gdioutput &gdi, char *title);
|
void settingsTitle(gdioutput &gdi, const char *title);
|
||||||
enum IntervalType {IntervalNone, IntervalMinute, IntervalSecond};
|
enum IntervalType {IntervalNone, IntervalMinute, IntervalSecond};
|
||||||
void startCancelInterval(gdioutput &gdi, char *startCommand, State state, IntervalType type, const wstring &interval);
|
void startCancelInterval(gdioutput &gdi, const char *startCommand, State state, IntervalType type, const wstring &interval);
|
||||||
|
|
||||||
virtual bool hasSaveMachine() const {
|
virtual bool hasSaveMachine() const {
|
||||||
return false;
|
return false;
|
||||||
@ -81,6 +81,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void loadMachine(oEvent &oe, const wstring &name) {
|
virtual void loadMachine(oEvent &oe, const wstring &name) {
|
||||||
|
if (name != L"default")
|
||||||
|
machineName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return true to auto-remove
|
// Return true to auto-remove
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -81,7 +81,7 @@ class TabClass :
|
|||||||
void drawDialog(gdioutput &gdi, oEvent::DrawMethod method, const oClass &cls);
|
void drawDialog(gdioutput &gdi, oEvent::DrawMethod method, const oClass &cls);
|
||||||
void pursuitDialog(gdioutput &gdi);
|
void pursuitDialog(gdioutput &gdi);
|
||||||
void addVacantPosition(gdioutput &gdi);
|
void addVacantPosition(gdioutput &gdi);
|
||||||
oEvent::VacantPosition TabClass::readVacantPosition(gdioutput &gdi) const;
|
oEvent::VacantPosition readVacantPosition(gdioutput &gdi) const;
|
||||||
|
|
||||||
bool warnDrawStartTime(gdioutput &gdi, int time, bool absTime);
|
bool warnDrawStartTime(gdioutput &gdi, int time, bool absTime);
|
||||||
bool warnDrawStartTime(gdioutput &gdi, const wstring &firstStart);
|
bool warnDrawStartTime(gdioutput &gdi, const wstring &firstStart);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -2382,7 +2382,7 @@ void TabCompetition::copyrightLine(gdioutput &gdi) const
|
|||||||
|
|
||||||
gdi.dropLine(0.4);
|
gdi.dropLine(0.4);
|
||||||
gdi.fillDown();
|
gdi.fillDown();
|
||||||
gdi.addString("", 0, makeDash(L"#Copyright © 2007-2021 Melin Software HB"));
|
gdi.addString("", 0, makeDash(L"#Copyright © 2007-2022 Melin Software HB"));
|
||||||
gdi.dropLine(1);
|
gdi.dropLine(1);
|
||||||
gdi.popX();
|
gdi.popX();
|
||||||
|
|
||||||
@ -2412,7 +2412,7 @@ void TabCompetition::loadAboutPage(gdioutput &gdi) const
|
|||||||
gdi.dropLine(1.5);
|
gdi.dropLine(1.5);
|
||||||
gdi.setCX(gdi.getCX() + gdi.scaleLength(20));
|
gdi.setCX(gdi.getCX() + gdi.scaleLength(20));
|
||||||
|
|
||||||
gdi.addStringUT(1, makeDash(L"Copyright © 2007-2021 Melin Software HB"));
|
gdi.addStringUT(1, makeDash(L"Copyright © 2007-2022 Melin Software HB"));
|
||||||
gdi.dropLine();
|
gdi.dropLine();
|
||||||
gdi.addStringUT(10, "The database connection used is MySQL++\nCopyright "
|
gdi.addStringUT(10, "The database connection used is MySQL++\nCopyright "
|
||||||
"(c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by MySQL AB,"
|
"(c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by MySQL AB,"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -398,7 +398,7 @@ int TabList::listCB(gdioutput &gdi, int type, void *data)
|
|||||||
}
|
}
|
||||||
else if (bi.id == "Window" || bi.id == "AutoScroll" ||
|
else if (bi.id == "Window" || bi.id == "AutoScroll" ||
|
||||||
bi.id == "FullScreen" || bi.id == "FullScreenLive") {
|
bi.id == "FullScreen" || bi.id == "FullScreenLive") {
|
||||||
gdioutput *gdi_new;
|
gdioutput *gdi_new = nullptr;
|
||||||
TabList *tl_new = this;
|
TabList *tl_new = this;
|
||||||
if (!ownWindow) {
|
if (!ownWindow) {
|
||||||
auto nw = makeOwnWindow(gdi);
|
auto nw = makeOwnWindow(gdi);
|
||||||
@ -571,8 +571,9 @@ int TabList::listCB(gdioutput &gdi, int type, void *data)
|
|||||||
gdi.getTabs().get(TabType(bi.getExtraInt()))->loadPage(gdi);
|
gdi.getTabs().get(TabType(bi.getExtraInt()))->loadPage(gdi);
|
||||||
}
|
}
|
||||||
else if (bi.id=="SavePS") {
|
else if (bi.id=="SavePS") {
|
||||||
const char *ctype = (char *)gdi.getData("Type");
|
string ctype;
|
||||||
saveExtraLines(*oe, ctype, gdi);
|
gdi.getData("Type", ctype);
|
||||||
|
saveExtraLines(*oe, ctype.c_str(), gdi);
|
||||||
|
|
||||||
if (gdi.hasWidget("SplitAnalysis")) {
|
if (gdi.hasWidget("SplitAnalysis")) {
|
||||||
int aflag = (gdi.isChecked("SplitAnalysis") ? 0 : 1) + (gdi.isChecked("Speed") ? 0 : 2)
|
int aflag = (gdi.isChecked("SplitAnalysis") ? 0 : 1) + (gdi.isChecked("Speed") ? 0 : 2)
|
||||||
@ -2745,7 +2746,7 @@ void TabList::splitPrintSettings(oEvent &oe, gdioutput &gdi, bool setupPrinter,
|
|||||||
}
|
}
|
||||||
gdi.popX();
|
gdi.popX();
|
||||||
gdi.fillDown();
|
gdi.fillDown();
|
||||||
char *ctype = type == Splits ? "SPExtra" : "EntryExtra";
|
const char *ctype = type == Splits ? "SPExtra" : "EntryExtra";
|
||||||
customTextLines(oe, ctype, gdi);
|
customTextLines(oe, ctype, gdi);
|
||||||
|
|
||||||
if (type == Splits) {
|
if (type == Splits) {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -51,6 +51,7 @@
|
|||||||
#include "autocomplete.h"
|
#include "autocomplete.h"
|
||||||
|
|
||||||
constexpr bool addTestPort = false;
|
constexpr bool addTestPort = false;
|
||||||
|
void tabForceSync(gdioutput& gdi, pEvent oe);
|
||||||
|
|
||||||
TabSI::TabSI(oEvent *poe):TabBase(poe), activeSIC(ConvertedTimeStatus::Unknown) {
|
TabSI::TabSI(oEvent *poe):TabBase(poe), activeSIC(ConvertedTimeStatus::Unknown) {
|
||||||
editCardData.tabSI = this;
|
editCardData.tabSI = this;
|
||||||
@ -74,6 +75,7 @@ TabSI::TabSI(oEvent *poe):TabBase(poe), activeSIC(ConvertedTimeStatus::Unknown)
|
|||||||
inputId = 0;
|
inputId = 0;
|
||||||
printErrorShown = false;
|
printErrorShown = false;
|
||||||
NC = 8;
|
NC = 8;
|
||||||
|
splitPrinter.onlyChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TabSI::~TabSI(void)
|
TabSI::~TabSI(void)
|
||||||
@ -117,6 +119,22 @@ int SportIdentCB(gdioutput *gdi, int type, void *data) {
|
|||||||
return tsi.siCB(*gdi, type, data);
|
return tsi.siCB(*gdi, type, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string TabSI::typeFromSndType(SND s) {
|
||||||
|
switch (s) {
|
||||||
|
case SND::OK:
|
||||||
|
return "SoundOK";
|
||||||
|
case SND::NotOK:
|
||||||
|
return "SoundNotOK";
|
||||||
|
case SND::Leader:
|
||||||
|
return "SoundLeader";
|
||||||
|
case SND::ActionNeeded:
|
||||||
|
return "SoundAction";
|
||||||
|
default:
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
int TabSI::siCB(gdioutput &gdi, int type, void *data)
|
int TabSI::siCB(gdioutput &gdi, int type, void *data)
|
||||||
{
|
{
|
||||||
if (type == GUI_BUTTON) {
|
if (type == GUI_BUTTON) {
|
||||||
@ -150,11 +168,29 @@ int TabSI::siCB(gdioutput &gdi, int type, void *data)
|
|||||||
gdi.fillRight();
|
gdi.fillRight();
|
||||||
|
|
||||||
auto addSoundWidget = [&gdi, this](const wchar_t *name, SND type, const wstring &label) {
|
auto addSoundWidget = [&gdi, this](const wchar_t *name, SND type, const wstring &label) {
|
||||||
|
int itype = int(type);
|
||||||
string nname = gdioutput::narrow(name);
|
string nname = gdioutput::narrow(name);
|
||||||
gdi.addInput(nname, oe->getPropertyString(nname.c_str(), L""), 32, nullptr, label);
|
wstring fn = oe->getPropertyString(nname.c_str(), L"");
|
||||||
|
bool doPlay = true;
|
||||||
|
if (fn == L"none") {
|
||||||
|
doPlay = false;
|
||||||
|
fn = L"";
|
||||||
|
}
|
||||||
|
|
||||||
|
gdi.dropLine(1);
|
||||||
|
gdi.addCheckbox(("DoPlay" + nname).c_str(), "", SportIdentCB, doPlay, "Använd").setExtra(itype);
|
||||||
|
gdi.dropLine(-1);
|
||||||
|
gdi.addInput("SoundFile", fn, 32, SportIdentCB, label).setExtra(itype);
|
||||||
gdi.dropLine(0.8);
|
gdi.dropLine(0.8);
|
||||||
gdi.addButton("BrowseSound", "Bläddra...", SportIdentCB).setExtra(name);
|
gdi.addButton("BrowseSound", "Bläddra...", SportIdentCB).setExtra(itype);
|
||||||
gdi.addButton("TestSound", "Testa", SportIdentCB).setExtra(int(type));
|
gdi.addButton("TestSound", "Testa", SportIdentCB).setExtra(itype);
|
||||||
|
|
||||||
|
if (!doPlay) {
|
||||||
|
gdi.setInputStatus("SoundFile", false, false, itype);
|
||||||
|
gdi.setInputStatus("BrowseSound", false, false, itype);
|
||||||
|
gdi.setInputStatus("TestSound", false, false, itype);
|
||||||
|
}
|
||||||
|
|
||||||
gdi.dropLine(3);
|
gdi.dropLine(3);
|
||||||
gdi.popX();
|
gdi.popX();
|
||||||
};
|
};
|
||||||
@ -193,15 +229,26 @@ int TabSI::siCB(gdioutput &gdi, int type, void *data)
|
|||||||
|
|
||||||
wstring file = gdi.browseForOpen(ext, L"wav");
|
wstring file = gdi.browseForOpen(ext, L"wav");
|
||||||
if (!file.empty()) {
|
if (!file.empty()) {
|
||||||
wchar_t *type = bi.getExtra();
|
SND iType = SND(bi.getExtraInt());
|
||||||
string name = gdioutput::narrow(type);
|
gdi.setText("SoundFile", file, false, int(iType));
|
||||||
gdi.setText(name, file);
|
string name = typeFromSndType(iType);
|
||||||
oe->setProperty(name.c_str(), file);
|
oe->setProperty(name.c_str(), file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (bi.id == "SoundOK" || bi.id == "SoundNotOK" ||
|
else if (bi.id.substr(0, 6) == "DoPlay") {
|
||||||
bi.id == "SoundLeader" || bi.id == "SoundAction") {
|
SND itype = SND(bi.getExtraInt());
|
||||||
oe->setProperty(bi.id.c_str(), bi.text);
|
bool checked = gdi.isChecked(bi.id);
|
||||||
|
gdi.setInputStatus("SoundFile", checked, false, int(itype));
|
||||||
|
gdi.setInputStatus("BrowseSound", checked, false, int(itype));
|
||||||
|
gdi.setInputStatus("TestSound", checked, false, int(itype));
|
||||||
|
string name = typeFromSndType(itype);
|
||||||
|
if (!checked) {
|
||||||
|
oe->setProperty(name.c_str(), L"none");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
wstring sf = gdi.getText("SoundFile", false, int(itype));
|
||||||
|
oe->setProperty(name.c_str(), sf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (bi.id == "TestSound") {
|
else if (bi.id == "TestSound") {
|
||||||
oe->setProperty("PlaySound", 1);
|
oe->setProperty("PlaySound", 1);
|
||||||
@ -1623,6 +1670,11 @@ int TabSI::siCB(gdioutput &gdi, int type, void *data)
|
|||||||
gdi.setText(ii.id, L"");
|
gdi.setText(ii.id, L"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (ii.id == "SoundFile") {
|
||||||
|
SND iType = SND(ii.getExtraInt());
|
||||||
|
string name = typeFromSndType(iType);
|
||||||
|
oe->setProperty(name.c_str(), ii.text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (type==GUI_INFOBOX) {
|
else if (type==GUI_INFOBOX) {
|
||||||
DWORD loaded;
|
DWORD loaded;
|
||||||
@ -3174,6 +3226,7 @@ void TabSI::generateStartInfo(gdioutput &gdi, const oRunner &r) {
|
|||||||
void TabSI::printerSetup(gdioutput &gdi)
|
void TabSI::printerSetup(gdioutput &gdi)
|
||||||
{
|
{
|
||||||
gdi.printSetup(splitPrinter);
|
gdi.printSetup(splitPrinter);
|
||||||
|
splitPrinter.onlyChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabSI::checkMoreCardsInQueue(gdioutput &gdi) {
|
void TabSI::checkMoreCardsInQueue(gdioutput &gdi) {
|
||||||
@ -3865,7 +3918,7 @@ void TabSI::showRegisterHiredCards(gdioutput &gdi) {
|
|||||||
gdi.fillDown();
|
gdi.fillDown();
|
||||||
|
|
||||||
oe->synchronizeList(oListId::oLPunchId);
|
oe->synchronizeList(oListId::oLPunchId);
|
||||||
auto &hiredCards = oe->getHiredCards();
|
auto hiredCards = oe->getHiredCards();
|
||||||
for (int i : hiredCards) {
|
for (int i : hiredCards) {
|
||||||
gdi.addStringUT(0, itos(i)).setExtra(i).setHandler(getResetHiredCardHandler());
|
gdi.addStringUT(0, itos(i)).setExtra(i).setHandler(getResetHiredCardHandler());
|
||||||
}
|
}
|
||||||
@ -4375,17 +4428,32 @@ void TabSI::playReadoutSound(SND type) {
|
|||||||
case SND::NotOK:
|
case SND::NotOK:
|
||||||
fn = oe->getPropertyString("SoundNotOK", L"");
|
fn = oe->getPropertyString("SoundNotOK", L"");
|
||||||
res = 52;
|
res = 52;
|
||||||
|
if (fn == L"none") {
|
||||||
|
fn = oe->getPropertyString("SoundAction", L"");
|
||||||
|
res = 53;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SND::Leader:
|
case SND::Leader:
|
||||||
fn = oe->getPropertyString("SoundLeader", L"");
|
fn = oe->getPropertyString("SoundLeader", L"");
|
||||||
res = 51;
|
res = 51;
|
||||||
|
if (fn == L"none") {
|
||||||
|
fn = oe->getPropertyString("SoundOK", L"");
|
||||||
|
res = 50;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SND::ActionNeeded:
|
case SND::ActionNeeded:
|
||||||
fn = oe->getPropertyString("SoundAction", L"");
|
fn = oe->getPropertyString("SoundAction", L"");
|
||||||
res = 53;
|
res = 53;
|
||||||
|
if (fn == L"none") {
|
||||||
|
fn = oe->getPropertyString("SoundNotOK", L"");
|
||||||
|
res = 52;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fn == L"none")
|
||||||
|
return;
|
||||||
|
|
||||||
if (checkedSound.count(fn) || (!fn.empty() && fileExists(fn))) {
|
if (checkedSound.count(fn) || (!fn.empty() && fileExists(fn))) {
|
||||||
playSoundFile(fn);
|
playSoundFile(fn);
|
||||||
checkedSound.insert(fn);
|
checkedSound.insert(fn);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -75,6 +75,8 @@ private:
|
|||||||
ActionNeeded
|
ActionNeeded
|
||||||
};
|
};
|
||||||
|
|
||||||
|
string typeFromSndType(SND s);
|
||||||
|
|
||||||
set<wstring> checkedSound;
|
set<wstring> checkedSound;
|
||||||
|
|
||||||
void playReadoutSound(SND type);
|
void playReadoutSound(SND type);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1302,10 +1302,10 @@ SpeakerMonitor *TabSpeaker::getSpeakerMonitor() {
|
|||||||
void TabSpeaker::getSettings(gdioutput &gdi, multimap<string, wstring> &settings) {
|
void TabSpeaker::getSettings(gdioutput &gdi, multimap<string, wstring> &settings) {
|
||||||
RECT rc;
|
RECT rc;
|
||||||
gdi.getWindowsPosition(rc);
|
gdi.getWindowsPosition(rc);
|
||||||
settings.insert(make_pair("left", itow(rc.left)));
|
settings.insert(make_pair("left", itow(int(rc.left))));
|
||||||
settings.insert(make_pair("right", itow(rc.right)));
|
settings.insert(make_pair("right", itow(int(rc.right))));
|
||||||
settings.insert(make_pair("top", itow(rc.top)));
|
settings.insert(make_pair("top", itow(int(rc.top))));
|
||||||
settings.insert(make_pair("bottom", itow(rc.bottom)));
|
settings.insert(make_pair("bottom", itow(int(rc.bottom))));
|
||||||
|
|
||||||
for (auto clsId : classesToWatch) {
|
for (auto clsId : classesToWatch) {
|
||||||
pClass cls = oe->getClass(clsId);
|
pClass cls = oe->getClass(clsId);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -28,18 +28,13 @@
|
|||||||
#include "meos.h"
|
#include "meos.h"
|
||||||
#include "TimeStamp.h"
|
#include "TimeStamp.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include "meos_util.h"
|
||||||
#ifdef _DEBUG
|
|
||||||
#undef THIS_FILE
|
|
||||||
static char THIS_FILE[]=__FILE__;
|
|
||||||
#define new DEBUG_NEW
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
const __int64 minYearConstant = 2014 - 1601;
|
constexpr __int64 minYearConstant = 2014 - 1601;
|
||||||
|
|
||||||
TimeStamp::TimeStamp()
|
TimeStamp::TimeStamp()
|
||||||
{
|
{
|
||||||
@ -129,9 +124,9 @@ string TimeStamp::getStampStringN() const
|
|||||||
FILETIME &ft = *(FILETIME*)&ft64;
|
FILETIME &ft = *(FILETIME*)&ft64;
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
FileTimeToSystemTime(&ft, &st);
|
FileTimeToSystemTime(&ft, &st);
|
||||||
|
int y = getThisYear();
|
||||||
if (st.wYear > 2021 || st.wYear < 2009) {
|
if (st.wYear > y || st.wYear < 2009) {
|
||||||
st.wYear = 2021;
|
st.wYear = y;
|
||||||
st.wDay = 1;
|
st.wDay = 1;
|
||||||
st.wMonth = 1;
|
st.wMonth = 1;
|
||||||
st.wHour = 2;
|
st.wHour = 2;
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -70,12 +70,12 @@ AnimationData::~AnimationData() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AnimationData::takeOver(shared_ptr<AnimationData> &other) {
|
bool AnimationData::takeOver(const shared_ptr<AnimationData> &other) {
|
||||||
delayedTakeOver = other;
|
delayedTakeOver = other;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationData::takeOverInternal(shared_ptr<AnimationData> &other) {
|
void AnimationData::takeOverInternal(const shared_ptr<AnimationData> &other) {
|
||||||
pages.swap(other->pages);
|
pages.swap(other->pages);
|
||||||
width = other->width;
|
width = other->width;
|
||||||
height = other->height;
|
height = other->height;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -48,7 +48,7 @@ class AnimationData : public GuiHandler {
|
|||||||
|
|
||||||
shared_ptr<thread> animationThread;
|
shared_ptr<thread> animationThread;
|
||||||
shared_ptr<AnimationData> delayedTakeOver;
|
shared_ptr<AnimationData> delayedTakeOver;
|
||||||
void takeOverInternal(shared_ptr<AnimationData> &other);
|
void takeOverInternal(const shared_ptr<AnimationData> &other);
|
||||||
|
|
||||||
void threadRender(gdioutput *gdi, size_t sp, int delay);
|
void threadRender(gdioutput *gdi, size_t sp, int delay);
|
||||||
public:
|
public:
|
||||||
@ -58,7 +58,7 @@ public:
|
|||||||
~AnimationData();
|
~AnimationData();
|
||||||
|
|
||||||
void handle(gdioutput &gdi, BaseInfo &info, GuiEventType type);
|
void handle(gdioutput &gdi, BaseInfo &info, GuiEventType type);
|
||||||
bool takeOver(shared_ptr<AnimationData> &other);
|
bool takeOver(const shared_ptr<AnimationData> &other);
|
||||||
|
|
||||||
void renderPage(HDC hDC, gdioutput &gdi, DWORD time);
|
void renderPage(HDC hDC, gdioutput &gdi, DWORD time);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -176,7 +176,7 @@ void AutoCompleteInfo::enter() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoCompleteInfo::setData(vector<AutoCompleteRecord> &items) {
|
void AutoCompleteInfo::setData(const vector<AutoCompleteRecord> &items) {
|
||||||
int newDataIx = -1;
|
int newDataIx = -1;
|
||||||
if (modifedAutoComplete && size_t(currentIx) < data.size()) {
|
if (modifedAutoComplete && size_t(currentIx) < data.size()) {
|
||||||
for (size_t k = 0; k < items.size(); k++) {
|
for (size_t k = 0; k < items.size(); k++) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -65,7 +65,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void paint(HDC hDC);
|
void paint(HDC hDC);
|
||||||
void setData(vector<AutoCompleteRecord> &items);
|
void setData(const vector<AutoCompleteRecord> &items);
|
||||||
void click(int x, int y);
|
void click(int x, int y);
|
||||||
void show();
|
void show();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -46,7 +46,7 @@ class ProgressWindow;
|
|||||||
|
|
||||||
class Download {
|
class Download {
|
||||||
private:
|
private:
|
||||||
volatile unsigned hThread;
|
volatile uintptr_t hThread;
|
||||||
volatile bool doExit;
|
volatile bool doExit;
|
||||||
//HWND hProgress;
|
//HWND hProgress;
|
||||||
|
|
||||||
|
|||||||
@ -1263,7 +1263,7 @@ Zooma ut (Ctrl + '-') = Zoom out (Ctrl + '-')
|
|||||||
[Bevaka] = [Watch]
|
[Bevaka] = [Watch]
|
||||||
[Flytta ner] = [Move down]
|
[Flytta ner] = [Move down]
|
||||||
[Bort] = [Remove]
|
[Bort] = [Remove]
|
||||||
[Klassens bana] = [From Class]
|
[Klassens bana] = [From class]
|
||||||
[Uppdaterad anmälan] = [Updated entry]
|
[Uppdaterad anmälan] = [Updated entry]
|
||||||
[VARNING] ingen/okänd = [VARNING] none/unknown
|
[VARNING] ingen/okänd = [VARNING] none/unknown
|
||||||
[Återställ] = [Reset]
|
[Återställ] = [Reset]
|
||||||
@ -1326,8 +1326,8 @@ help:59395 = In this form, you can quickly make basic settings for many classes
|
|||||||
help:59395_more = The class fees, which shows if you have activated Economy features, are used for new entries. If you change a fee, MeOS will ask if you wish to apply the change to existing competitors.\n\nFor bibs you have the options None, Consecutive and Manual. You can also type the first bib in the class, for example A100, or 50. Consecutive means that the last number of the preceeding class is used to define the first number in this class. Reserved bib numbers gives a gap (of the specified width) in the numbering between classes.\n\nMeOS updates bibs when you draw start times or change the settings. Manual means that MeOS will never automatically update bibs.\n\nFor classes with teams the setting Team member controls the relation between the team number and the bibs. It can be the same, increasing (100, 101, 102), leg dependent (100-1, 100-2, etc.) or completely independent.
|
help:59395_more = The class fees, which shows if you have activated Economy features, are used for new entries. If you change a fee, MeOS will ask if you wish to apply the change to existing competitors.\n\nFor bibs you have the options None, Consecutive and Manual. You can also type the first bib in the class, for example A100, or 50. Consecutive means that the last number of the preceeding class is used to define the first number in this class. Reserved bib numbers gives a gap (of the specified width) in the numbering between classes.\n\nMeOS updates bibs when you draw start times or change the settings. Manual means that MeOS will never automatically update bibs.\n\nFor classes with teams the setting Team member controls the relation between the team number and the bibs. It can be the same, increasing (100, 101, 102), leg dependent (100-1, 100-2, etc.) or completely independent.
|
||||||
help:7618 = The number of runners in a team is specified on the page Classes.
|
help:7618 = The number of runners in a team is specified on the page Classes.
|
||||||
help:7620 = Interval (seconds). Leave the field blank to update when the competition is changed.
|
help:7620 = Interval (seconds). Leave the field blank to update when the competition is changed.
|
||||||
help:89064 = For every control, you specify one or more code number (SI codes). In a course, you refer to the control by its ID number. Usually, you do not need to add controls manually, since MeOS automatically adds all controls needed.\n\nMore than one SI code is useful for replacing malfunctioning controls or to create simple forks. For an ordinary control, it is required that the runner visit on of the specified controls. If the control status is <Multiple>, all specified controls must be visited (in any order). If the status is <Bad>, the control is ignored.\n\nIf you specify a control name, it is possible to print result lists with intermediate times at named controls.\n\nTime adjustment can be used if it turns out that a control has wrong time. Time format is +/-MM:SS or +/-HH:MM:SS.\n\nShortest leg time defines the shortest possible time on that leg. No runner will get a shorter time to this control, no matter how fast he/she is. This can be used, for example, if a dangerous road must be crossed.\n\nStatus <No timing> means that the time to the control is ignored; the total time will be the same no matter what the actual time to this control is.
|
help:89064 = For every control, you specify one or more code number (SI codes). In a course, you refer to the control by its ID number. Usually, you do not need to add controls manually, since MeOS automatically adds all controls needed.\n\nMore than one SI code is useful for replacing malfunctioning controls or to create simple forks. For an ordinary control, it is required that the runner visit on of the specified controls. If the control status is <Multiple>, all specified controls must be visited (in any order). If the status is <Bad>, the control is ignored.\n\nThe status <Lost> works like <Bad>, but in addition the running time to the next control is ignored; it does not matter for the final time how much time was spent looking for the lost control.\n\nIf you specify a control name, it is possible to print result lists with intermediate times at named controls.\n\nTime adjustment can be used if it turns out that a control has wrong time. Time format is +/-MM:SS or +/-HH:MM:SS.\n\nShortest leg time defines the shortest possible time on that leg. No runner will get a shorter time to this control, no matter how fast he/she is. This can be used, for example, if a dangerous road must be crossed.\n\nStatus <No timing> means that the time to the control is ignored; the total time will be the same no matter what the actual time to this control is.
|
||||||
help:9373 = Give one or more control numbers (SI codes) used by this control.\nExample: 31, 32, 33.
|
help:9373 = Provide one or more control numbers (SI codes) used by this control.\nExample: 31, 250.
|
||||||
help:9615 = Received no answer. Do you want to open the port in passive mode; should MeOS listen to incoming punches?
|
help:9615 = Received no answer. Do you want to open the port in passive mode; should MeOS listen to incoming punches?
|
||||||
help:assignfee = MeOS will take care of entry fees for you automatically in many cases. The competitors are assigned fees based on age and entry date (you define the limits under Competition Settings). Every class defines its fees. You provide default values for different class types under Competition Settings, but you can also manually change class settings using Quick Settings for the class.\n\nThis page lets you manually use different ages and time limits for different fees. On the page competitor, you can manually adjust the fee for individual competitors, if needed.
|
help:assignfee = MeOS will take care of entry fees for you automatically in many cases. The competitors are assigned fees based on age and entry date (you define the limits under Competition Settings). Every class defines its fees. You provide default values for different class types under Competition Settings, but you can also manually change class settings using Quick Settings for the class.\n\nThis page lets you manually use different ages and time limits for different fees. On the page competitor, you can manually adjust the fee for individual competitors, if needed.
|
||||||
help:baudrate = Transmission speed/Baudrate: use 4800 or 38400.
|
help:baudrate = Transmission speed/Baudrate: use 4800 or 38400.
|
||||||
@ -1531,7 +1531,7 @@ Mappnamnet får inte vara tomt = Folder name cannot be empty
|
|||||||
Onlineresultat = Online Results
|
Onlineresultat = Online Results
|
||||||
Packa stora filer (zip) = Compress large files (zip)
|
Packa stora filer (zip) = Compress large files (zip)
|
||||||
Publicera resultat direkt på nätet = Publish results directly on the web
|
Publicera resultat direkt på nätet = Publish results directly on the web
|
||||||
Resultat online = Results OnLine
|
Resultat online = Results Online
|
||||||
Skicka till webben = Send to the web
|
Skicka till webben = Send to the web
|
||||||
Spara på disk = Save to disk
|
Spara på disk = Save to disk
|
||||||
Till exempel X = For example X
|
Till exempel X = For example X
|
||||||
@ -2586,3 +2586,7 @@ Testa = Test
|
|||||||
Fel: Använd X i texten där värdet (Y) ska sättas in = Error: Use X in the text where the value (Y) should be used
|
Fel: Använd X i texten där värdet (Y) ska sättas in = Error: Use X in the text where the value (Y) should be used
|
||||||
info:teamcourseassignment = The imported file contains forking data for teams. To import this data you must prepare the competition to match the imported file: \n\n1. Ensure all classes are setup with the correct number of legs.\n2. Provide bib numbers in each class. Use Quick Settings on the page Classes and enter the first bib number in each class (meaning automatic bib setting). You can also import the teams first and assign bibs as usual.\n3. Import the courses. You can import this file several times if needed to update the forking.
|
info:teamcourseassignment = The imported file contains forking data for teams. To import this data you must prepare the competition to match the imported file: \n\n1. Ensure all classes are setup with the correct number of legs.\n2. Provide bib numbers in each class. Use Quick Settings on the page Classes and enter the first bib number in each class (meaning automatic bib setting). You can also import the teams first and assign bibs as usual.\n3. Import the courses. You can import this file several times if needed to update the forking.
|
||||||
Försvunnen = Missing
|
Försvunnen = Missing
|
||||||
|
Automatnamn = Service name
|
||||||
|
Använd = Use
|
||||||
|
Om du vill kan du namnge automaten = You may give the service a name
|
||||||
|
Spara inställningar = Save settings
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -44,23 +44,23 @@ enum gdiFonts {
|
|||||||
formatIgnore = 1000,
|
formatIgnore = 1000,
|
||||||
};
|
};
|
||||||
|
|
||||||
const int pageNewPage=100;
|
constexpr int pageNewPage=100;
|
||||||
//const int pageReserveHeight=101;
|
constexpr int pagePageInfo=102;
|
||||||
const int pagePageInfo=102;
|
constexpr int pageNewChapter = 103;
|
||||||
const int pageNewChapter = 103;
|
|
||||||
|
|
||||||
const int textRight=256;
|
constexpr int textRight=256;
|
||||||
const int textCenter=512;
|
constexpr int textCenter=512;
|
||||||
const int timerCanBeNegative=1024;
|
constexpr int timerCanBeNegative=1024;
|
||||||
const int breakLines=2048;
|
constexpr int breakLines=2048;
|
||||||
const int fullTimeHMS = 4096;
|
constexpr int fullTimeHMS = 4096;
|
||||||
const int timeWithTenth = 1<<13;
|
constexpr int timeWithTenth = 1<<13;
|
||||||
const int timeSeconds = 1<<14;
|
constexpr int timeSeconds = 1<<14;
|
||||||
const int timerIgnoreSign = 1<<15;
|
constexpr int timerIgnoreSign = 1<<15;
|
||||||
const int Capitalize = 1<<16;
|
constexpr int Capitalize = 1<<16;
|
||||||
const int absolutePosition = 1 << 17;
|
constexpr int absolutePosition = 1 << 17;
|
||||||
const int skipBoundingBox = 1 << 18;
|
constexpr int skipBoundingBox = 1 << 18;
|
||||||
const int hiddenText = 1 << 19;
|
constexpr int hiddenText = 1 << 19;
|
||||||
|
constexpr int textLimitEllipsis = 1 << 20;
|
||||||
|
|
||||||
enum GDICOLOR {
|
enum GDICOLOR {
|
||||||
colorBlack = RGB(0, 0, 0),
|
colorBlack = RGB(0, 0, 0),
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -793,7 +793,7 @@ void gdioutput::timerProc(TimerInfo &timer, DWORD timeout) {
|
|||||||
else if (timer.callBack)
|
else if (timer.callBack)
|
||||||
timer.callBack(this, GUI_TIMER, &timer);
|
timer.callBack(this, GUI_TIMER, &timer);
|
||||||
|
|
||||||
remove_if(timers.begin(), timers.end(), [timerId](TimerInfo &x) {return x.getId() == timerId; });
|
timers.erase(remove_if(timers.begin(), timers.end(), [timerId](TimerInfo &x) {return x.getId() == timerId; }), timers.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void gdioutput::removeHandler(GuiHandler *h) {
|
void gdioutput::removeHandler(GuiHandler *h) {
|
||||||
@ -1471,7 +1471,7 @@ LRESULT CALLBACK GetMsgProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
LPARAM res = CallWindowProc(lbi->originalProc, hWnd, iMsg, wParam, lParam);
|
LPARAM res = CallWindowProc(lbi->originalProc, hWnd, iMsg, wParam, lParam);
|
||||||
if (iMsg == WM_VSCROLL || iMsg == WM_MOUSEWHEEL || iMsg == WM_KEYDOWN) {
|
if (iMsg == WM_VSCROLL || iMsg == WM_MOUSEWHEEL || iMsg == WM_KEYDOWN) {
|
||||||
int topIndex = CallWindowProc(lbi->originalProc, hWnd, LB_GETTOPINDEX, 0, 0);
|
LRESULT topIndex = CallWindowProc(lbi->originalProc, hWnd, LB_GETTOPINDEX, 0, 0);
|
||||||
if (lbi->lbiSync) {
|
if (lbi->lbiSync) {
|
||||||
ListBoxInfo *other = lbi->lbiSync;
|
ListBoxInfo *other = lbi->lbiSync;
|
||||||
CallWindowProc(other->originalProc, other->hWnd, LB_SETTOPINDEX, topIndex, 0);
|
CallWindowProc(other->originalProc, other->hWnd, LB_SETTOPINDEX, topIndex, 0);
|
||||||
@ -1554,12 +1554,12 @@ void gdioutput::setSelection(const string &id, const set<int> &selection)
|
|||||||
if (selection.count(-1)==1)
|
if (selection.count(-1)==1)
|
||||||
SendMessage(it->hWnd, LB_SETSEL, 1, -1);
|
SendMessage(it->hWnd, LB_SETSEL, 1, -1);
|
||||||
else {
|
else {
|
||||||
int count=SendMessage(it->hWnd, LB_GETCOUNT, 0,0);
|
LRESULT count=SendMessage(it->hWnd, LB_GETCOUNT, 0,0);
|
||||||
SendMessage(it->hWnd, LB_SETSEL, 0, -1);
|
SendMessage(it->hWnd, LB_SETSEL, 0, -1);
|
||||||
for(int i=0;i<count;i++){
|
for(int i=0;i<count;i++){
|
||||||
int d=SendMessage(it->hWnd, LB_GETITEMDATA, i, 0);
|
LRESULT d=SendMessage(it->hWnd, LB_GETITEMDATA, i, 0);
|
||||||
|
|
||||||
if (selection.count(d)==1)
|
if (selection.count(int(d))==1)
|
||||||
SendMessage(it->hWnd, LB_SETSEL, 1, i);
|
SendMessage(it->hWnd, LB_SETSEL, 1, i);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1573,12 +1573,12 @@ void gdioutput::getSelection(const string &id, set<int> &selection) {
|
|||||||
for(it=LBI.begin(); it != LBI.end(); ++it){
|
for(it=LBI.begin(); it != LBI.end(); ++it){
|
||||||
if (it->id==id && !it->IsCombo) {
|
if (it->id==id && !it->IsCombo) {
|
||||||
selection.clear();
|
selection.clear();
|
||||||
int count=SendMessage(it->hWnd, LB_GETCOUNT, 0,0);
|
LRESULT count=SendMessage(it->hWnd, LB_GETCOUNT, 0,0);
|
||||||
for(int i=0;i<count;i++){
|
for(int i=0;i<count;i++){
|
||||||
int s=SendMessage(it->hWnd, LB_GETSEL, i, 0);
|
LRESULT s=SendMessage(it->hWnd, LB_GETSEL, i, 0);
|
||||||
if (s) {
|
if (s) {
|
||||||
int d=SendMessage(it->hWnd, LB_GETITEMDATA, i, 0);
|
LRESULT d=SendMessage(it->hWnd, LB_GETITEMDATA, i, 0);
|
||||||
selection.insert(d);
|
selection.insert(int(d));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1683,14 +1683,14 @@ bool gdioutput::addItem(const string &id, const wstring &text, size_t data)
|
|||||||
for (it=LBI.rbegin(); it != LBI.rend(); ++it) {
|
for (it=LBI.rbegin(); it != LBI.rend(); ++it) {
|
||||||
if (it->id==id) {
|
if (it->id==id) {
|
||||||
if (it->IsCombo) {
|
if (it->IsCombo) {
|
||||||
int index=SendMessage(it->hWnd, CB_ADDSTRING, 0, LPARAM(text.c_str()));
|
LRESULT index=SendMessage(it->hWnd, CB_ADDSTRING, 0, LPARAM(text.c_str()));
|
||||||
SendMessage(it->hWnd, CB_SETITEMDATA, index, data);
|
SendMessage(it->hWnd, CB_SETITEMDATA, index, data);
|
||||||
it->data2Index[data] = index;
|
it->data2Index[data] = int(index);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int index=SendMessage(it->hWnd, LB_INSERTSTRING, -1, LPARAM(text.c_str()));
|
LRESULT index=SendMessage(it->hWnd, LB_INSERTSTRING, -1, LPARAM(text.c_str()));
|
||||||
SendMessage(it->hWnd, LB_SETITEMDATA, index, data);
|
SendMessage(it->hWnd, LB_SETITEMDATA, index, data);
|
||||||
it->data2Index[data] = index;
|
it->data2Index[data] = int(index);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1709,9 +1709,9 @@ bool gdioutput::addItem(const string &id, const vector< pair<wstring, size_t> >
|
|||||||
it->data2Index.clear();
|
it->data2Index.clear();
|
||||||
|
|
||||||
for (size_t k = 0; k < items.size(); k++) {
|
for (size_t k = 0; k < items.size(); k++) {
|
||||||
int index=SendMessage(it->hWnd, CB_ADDSTRING, 0, LPARAM(items[k].first.c_str()));
|
LRESULT index = SendMessage(it->hWnd, CB_ADDSTRING, 0, LPARAM(items[k].first.c_str()));
|
||||||
SendMessage(it->hWnd, CB_SETITEMDATA, index, items[k].second);
|
SendMessage(it->hWnd, CB_SETITEMDATA, index, items[k].second);
|
||||||
it->data2Index[items[k].second] = index;
|
it->data2Index[items[k].second] = int(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1719,9 +1719,9 @@ bool gdioutput::addItem(const string &id, const vector< pair<wstring, size_t> >
|
|||||||
SendMessage(it->hWnd, LB_INITSTORAGE, items.size(), 48);
|
SendMessage(it->hWnd, LB_INITSTORAGE, items.size(), 48);
|
||||||
it->data2Index.clear();
|
it->data2Index.clear();
|
||||||
for (size_t k = 0; k < items.size(); k++) {
|
for (size_t k = 0; k < items.size(); k++) {
|
||||||
int index=SendMessage(it->hWnd, LB_INSERTSTRING, -1, LPARAM(items[k].first.c_str()));
|
LRESULT index = SendMessage(it->hWnd, LB_INSERTSTRING, -1, LPARAM(items[k].first.c_str()));
|
||||||
SendMessage(it->hWnd, LB_SETITEMDATA, index, items[k].second);
|
SendMessage(it->hWnd, LB_SETITEMDATA, index, items[k].second);
|
||||||
it->data2Index[items[k].second] = index;
|
it->data2Index[items[k].second] = int(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1738,10 +1738,10 @@ void gdioutput::filterOnData(const string &id, const unordered_set<int> &filter)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const HWND &hWnd = it->hWnd;
|
const HWND &hWnd = it->hWnd;
|
||||||
int count = SendMessage(hWnd, LB_GETCOUNT, 0, 0);
|
LRESULT count = SendMessage(hWnd, LB_GETCOUNT, 0, 0);
|
||||||
for (int ix = count - 1; ix>=0; ix--) {
|
for (intptr_t ix = count - 1; ix>=0; ix--) {
|
||||||
int ret = SendMessage(hWnd, LB_GETITEMDATA, ix, 0);
|
LRESULT ret = SendMessage(hWnd, LB_GETITEMDATA, ix, 0);
|
||||||
if (ret != LB_ERR && filter.count(ret) == 0)
|
if (ret != LB_ERR && filter.count(int(ret)) == 0)
|
||||||
SendMessage(hWnd, LB_DELETESTRING, ix, 0);
|
SendMessage(hWnd, LB_DELETESTRING, ix, 0);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1804,14 +1804,14 @@ void ListBoxInfo::copyUserData(ListBoxInfo &dest) const {
|
|||||||
|
|
||||||
bool gdioutput::getSelectedItem(ListBoxInfo &lbi) {
|
bool gdioutput::getSelectedItem(ListBoxInfo &lbi) {
|
||||||
if (lbi.IsCombo) {
|
if (lbi.IsCombo) {
|
||||||
int index=SendMessage(lbi.hWnd, CB_GETCURSEL, 0, 0);
|
LRESULT index=SendMessage(lbi.hWnd, CB_GETCURSEL, 0, 0);
|
||||||
|
|
||||||
if (index == CB_ERR) {
|
if (index == CB_ERR) {
|
||||||
wchar_t bf[256];
|
wchar_t bf[256];
|
||||||
GetWindowText(lbi.hWnd, bf, 256);
|
GetWindowText(lbi.hWnd, bf, 256);
|
||||||
lbi.text=bf;
|
lbi.text=bf;
|
||||||
lbi.data=-1;
|
lbi.data=-1;
|
||||||
lbi.index=index;
|
lbi.index=int(index);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
lbi.data=SendMessage(lbi.hWnd, CB_GETITEMDATA, index, 0);
|
lbi.data=SendMessage(lbi.hWnd, CB_GETITEMDATA, index, 0);
|
||||||
@ -1820,13 +1820,13 @@ bool gdioutput::getSelectedItem(ListBoxInfo &lbi) {
|
|||||||
lbi.text=bf;
|
lbi.text=bf;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int index=SendMessage(lbi.hWnd, LB_GETCURSEL, 0, 0);
|
LRESULT index=SendMessage(lbi.hWnd, LB_GETCURSEL, 0, 0);
|
||||||
|
|
||||||
if (index==LB_ERR)
|
if (index==LB_ERR)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lbi.data=SendMessage(lbi.hWnd, LB_GETITEMDATA, index, 0);
|
lbi.data=SendMessage(lbi.hWnd, LB_GETITEMDATA, index, 0);
|
||||||
lbi.index=index;
|
lbi.index=int(index);
|
||||||
|
|
||||||
TCHAR bf[1024];
|
TCHAR bf[1024];
|
||||||
if (SendMessage(lbi.hWnd, LB_GETTEXT, index, LPARAM(bf))!=LB_ERR)
|
if (SendMessage(lbi.hWnd, LB_GETTEXT, index, LPARAM(bf))!=LB_ERR)
|
||||||
@ -1839,10 +1839,10 @@ int gdioutput::getNumItems(const char *id) {
|
|||||||
for (auto &lbi : LBI) {
|
for (auto &lbi : LBI) {
|
||||||
if (lbi.id == id) {
|
if (lbi.id == id) {
|
||||||
if (lbi.IsCombo) {
|
if (lbi.IsCombo) {
|
||||||
return SendMessage(lbi.hWnd, CB_GETCOUNT, 0, 0);
|
return (int)SendMessage(lbi.hWnd, CB_GETCOUNT, 0, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return SendMessage(lbi.hWnd, LB_GETCOUNT, 0, 0);
|
return (int)SendMessage(lbi.hWnd, LB_GETCOUNT, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1861,16 +1861,16 @@ int gdioutput::getItemDataByName(const char *id, const char *name) const{
|
|||||||
for(it = LBI.begin(); it != LBI.end(); ++it){
|
for(it = LBI.begin(); it != LBI.end(); ++it){
|
||||||
if (it->id==id) {
|
if (it->id==id) {
|
||||||
if (it->IsCombo) {
|
if (it->IsCombo) {
|
||||||
int ix = SendMessage(it->hWnd, CB_FINDSTRING, -1, LPARAM(wname.c_str()));
|
LRESULT ix = SendMessage(it->hWnd, CB_FINDSTRING, -1, LPARAM(wname.c_str()));
|
||||||
if (ix >= 0) {
|
if (ix >= 0) {
|
||||||
return SendMessage(it->hWnd, CB_GETITEMDATA, ix, 0);
|
return (int)SendMessage(it->hWnd, CB_GETITEMDATA, ix, 0);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int ix = SendMessage(it->hWnd, LB_FINDSTRING, -1, LPARAM(wname.c_str()));
|
LRESULT ix = SendMessage(it->hWnd, LB_FINDSTRING, -1, LPARAM(wname.c_str()));
|
||||||
if (ix >= 0) {
|
if (ix >= 0) {
|
||||||
return SendMessage(it->hWnd, LB_GETITEMDATA, ix, 0);
|
return (int)SendMessage(it->hWnd, LB_GETITEMDATA, ix, 0);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1895,10 +1895,10 @@ bool gdioutput::selectItemByData(const char *id, int data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int count = SendMessage(it->hWnd, CB_GETCOUNT, 0, 0);
|
LRESULT count = SendMessage(it->hWnd, CB_GETCOUNT, 0, 0);
|
||||||
|
|
||||||
for (int m = 0; m < count; m++) {
|
for (int m = 0; m < count; m++) {
|
||||||
int ret = SendMessage(it->hWnd, CB_GETITEMDATA, m, 0);
|
LRESULT ret = SendMessage(it->hWnd, CB_GETITEMDATA, m, 0);
|
||||||
if (ret == data) {
|
if (ret == data) {
|
||||||
SendMessage(it->hWnd, CB_SETCURSEL, m, 0);
|
SendMessage(it->hWnd, CB_SETCURSEL, m, 0);
|
||||||
it->data = data;
|
it->data = data;
|
||||||
@ -1924,9 +1924,9 @@ bool gdioutput::selectItemByData(const char *id, int data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int count = SendMessage(it->hWnd, LB_GETCOUNT, 0, 0);
|
LRESULT count = SendMessage(it->hWnd, LB_GETCOUNT, 0, 0);
|
||||||
for (int m = 0; m < count; m++) {
|
for (int m = 0; m < count; m++) {
|
||||||
int ret = SendMessage(it->hWnd, LB_GETITEMDATA, m, 0);
|
LRESULT ret = SendMessage(it->hWnd, LB_GETITEMDATA, m, 0);
|
||||||
|
|
||||||
if (ret == data) {
|
if (ret == data) {
|
||||||
SendMessage(it->hWnd, LB_SETCURSEL, m, 0);
|
SendMessage(it->hWnd, LB_SETCURSEL, m, 0);
|
||||||
@ -1962,7 +1962,7 @@ bool gdioutput::selectItemByIndex(const char *id, int index) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SendMessage(it->hWnd, CB_SETCURSEL, index, 0);
|
SendMessage(it->hWnd, CB_SETCURSEL, index, 0);
|
||||||
int data = SendMessage(it->hWnd, CB_GETITEMDATA, index, 0);
|
LRESULT data = SendMessage(it->hWnd, CB_GETITEMDATA, index, 0);
|
||||||
it->data = data;
|
it->data = data;
|
||||||
it->originalIdx = data;
|
it->originalIdx = data;
|
||||||
TCHAR bf[1024];
|
TCHAR bf[1024];
|
||||||
@ -1985,7 +1985,7 @@ bool gdioutput::selectItemByIndex(const char *id, int index) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SendMessage(it->hWnd, LB_SETCURSEL, index, 0);
|
SendMessage(it->hWnd, LB_SETCURSEL, index, 0);
|
||||||
int data = SendMessage(it->hWnd, LB_GETITEMDATA, index, 0);
|
LRESULT data = SendMessage(it->hWnd, LB_GETITEMDATA, index, 0);
|
||||||
|
|
||||||
it->data = data;
|
it->data = data;
|
||||||
it->originalIdx = data;
|
it->originalIdx = data;
|
||||||
@ -2018,7 +2018,7 @@ bool gdioutput::autoGrow(const char *id) {
|
|||||||
for(it=LBI.begin(); it != LBI.end(); ++it){
|
for(it=LBI.begin(); it != LBI.end(); ++it){
|
||||||
if (it->id==id) {
|
if (it->id==id) {
|
||||||
if (it->IsCombo) {
|
if (it->IsCombo) {
|
||||||
int count = SendMessage(it->hWnd, CB_GETCOUNT, 0, 0);
|
LRESULT count = SendMessage(it->hWnd, CB_GETCOUNT, 0, 0);
|
||||||
for (int m = 0; m < count; m++) {
|
for (int m = 0; m < count; m++) {
|
||||||
wchar_t bf[1024];
|
wchar_t bf[1024];
|
||||||
if (SendMessage(it->hWnd, CB_GETLBTEXT, m, LPARAM(bf))!=CB_ERR) {
|
if (SendMessage(it->hWnd, CB_GETLBTEXT, m, LPARAM(bf))!=CB_ERR) {
|
||||||
@ -2026,7 +2026,6 @@ bool gdioutput::autoGrow(const char *id) {
|
|||||||
calcStringSize(TI, hDC);
|
calcStringSize(TI, hDC);
|
||||||
size = max<int>(size, TI.textRect.right - TI.textRect.left);
|
size = max<int>(size, TI.textRect.right - TI.textRect.left);
|
||||||
}
|
}
|
||||||
m++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReleaseDC(hWndTarget, hDC);
|
ReleaseDC(hWndTarget, hDC);
|
||||||
@ -2041,15 +2040,15 @@ bool gdioutput::autoGrow(const char *id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int count = SendMessage(it->hWnd, LB_GETCOUNT, 0, 0);
|
LRESULT count = SendMessage(it->hWnd, LB_GETCOUNT, 0, 0);
|
||||||
for (int m = 0; m < count; m++) {
|
for (int m = 0; m < count; m++) {
|
||||||
wchar_t bf[1024];
|
wchar_t bf[1024];
|
||||||
int len = SendMessage(it->hWnd, LB_GETTEXT, m, LPARAM(bf));
|
LRESULT len = SendMessage(it->hWnd, LB_GETTEXT, m, LPARAM(bf));
|
||||||
if (len!=LB_ERR) {
|
if (len!=LB_ERR) {
|
||||||
if (it->lastTabStop == 0)
|
if (it->lastTabStop == 0)
|
||||||
TI.text = bf;
|
TI.text = bf;
|
||||||
else {
|
else {
|
||||||
int pos = len;
|
auto pos = len;
|
||||||
while(pos > 0) {
|
while(pos > 0) {
|
||||||
if (bf[pos-1] == '\t') {
|
if (bf[pos-1] == '\t') {
|
||||||
break;
|
break;
|
||||||
@ -2122,7 +2121,7 @@ void gdioutput::processButtonMessage(ButtonInfo &bi, WPARAM wParam)
|
|||||||
cmd = "press(\"" + bi.id + "\", \"" + narrow(bi.getExtra()) + "\"); //" + toUTF8(bi.text);
|
cmd = "press(\"" + bi.id + "\", \"" + narrow(bi.getExtra()) + "\"); //" + toUTF8(bi.text);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int arg = int(bi.extra);
|
int arg = int((size_t)bi.extra);
|
||||||
if (arg > 1000000 || arg < -1000000 || arg == 0)
|
if (arg > 1000000 || arg < -1000000 || arg == 0)
|
||||||
cmd = "press(\"" + bi.id + "\"); //" + toUTF8(bi.text);
|
cmd = "press(\"" + bi.id + "\"); //" + toUTF8(bi.text);
|
||||||
else
|
else
|
||||||
@ -2205,7 +2204,7 @@ void gdioutput::processEditMessage(InputInfo &bi, WPARAM wParam)
|
|||||||
void gdioutput::processComboMessage(ListBoxInfo &bi, WPARAM wParam)
|
void gdioutput::processComboMessage(ListBoxInfo &bi, WPARAM wParam)
|
||||||
{
|
{
|
||||||
WORD hwParam = HIWORD(wParam);
|
WORD hwParam = HIWORD(wParam);
|
||||||
int index;
|
LRESULT index;
|
||||||
switch (hwParam) {
|
switch (hwParam) {
|
||||||
case CBN_SETFOCUS:
|
case CBN_SETFOCUS:
|
||||||
currentFocus = bi.hWnd;
|
currentFocus = bi.hWnd;
|
||||||
@ -2322,7 +2321,7 @@ void gdioutput::keyCommand(KeyCommandCode code) {
|
|||||||
void gdioutput::processListMessage(ListBoxInfo &bi, WPARAM wParam)
|
void gdioutput::processListMessage(ListBoxInfo &bi, WPARAM wParam)
|
||||||
{
|
{
|
||||||
WORD hwParam = HIWORD(wParam);
|
WORD hwParam = HIWORD(wParam);
|
||||||
int index;
|
LRESULT index;
|
||||||
|
|
||||||
switch (hwParam) {
|
switch (hwParam) {
|
||||||
case LBN_SETFOCUS:
|
case LBN_SETFOCUS:
|
||||||
@ -3118,7 +3117,8 @@ void gdioutput::clearPage(bool autoRefresh, bool keepToolbar) {
|
|||||||
|
|
||||||
CurrentX = scaleLength(40);
|
CurrentX = scaleLength(40);
|
||||||
CurrentY = scaleLength(START_YP);
|
CurrentY = scaleLength(START_YP);
|
||||||
|
SX = CurrentX;
|
||||||
|
SY = CurrentY;
|
||||||
OffsetX = 0;
|
OffsetX = 0;
|
||||||
OffsetY = 0;
|
OffsetY = 0;
|
||||||
|
|
||||||
@ -3206,14 +3206,14 @@ BaseInfo &gdioutput::getBaseInfo(const char *id) const {
|
|||||||
throw std::exception(err.c_str());
|
throw std::exception(err.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
const wstring &gdioutput::getText(const char *id, bool acceptMissing) const
|
const wstring &gdioutput::getText(const char *id, bool acceptMissing, int requireExtraMatch) const
|
||||||
{
|
{
|
||||||
TCHAR bf[1024];
|
TCHAR bf[1024];
|
||||||
TCHAR *bptr=bf;
|
TCHAR *bptr=bf;
|
||||||
|
|
||||||
for(list<InputInfo>::const_iterator it=II.begin();
|
for(list<InputInfo>::const_iterator it=II.begin();
|
||||||
it != II.end(); ++it){
|
it != II.end(); ++it){
|
||||||
if (it->id==id){
|
if (it->id==id && it->matchExtra(requireExtraMatch)){
|
||||||
int len=GetWindowTextLength(it->hWnd);
|
int len=GetWindowTextLength(it->hWnd);
|
||||||
|
|
||||||
if (len>1023)
|
if (len>1023)
|
||||||
@ -3231,7 +3231,7 @@ const wstring &gdioutput::getText(const char *id, bool acceptMissing) const
|
|||||||
|
|
||||||
for(list<ListBoxInfo>::const_iterator it=LBI.begin();
|
for(list<ListBoxInfo>::const_iterator it=LBI.begin();
|
||||||
it != LBI.end(); ++it){
|
it != LBI.end(); ++it){
|
||||||
if (it->id==id && it->IsCombo){
|
if (it->id==id && it->IsCombo && it->matchExtra(requireExtraMatch)){
|
||||||
if (!it->writeLock) {
|
if (!it->writeLock) {
|
||||||
GetWindowText(it->hWnd, bf, 1024);
|
GetWindowText(it->hWnd, bf, 1024);
|
||||||
const_cast<wstring&>(it->text)=bf;
|
const_cast<wstring&>(it->text)=bf;
|
||||||
@ -3242,7 +3242,7 @@ const wstring &gdioutput::getText(const char *id, bool acceptMissing) const
|
|||||||
|
|
||||||
for(list<TextInfo>::const_iterator it=TL.begin();
|
for(list<TextInfo>::const_iterator it=TL.begin();
|
||||||
it != TL.end(); ++it){
|
it != TL.end(); ++it){
|
||||||
if (it->id==id) {
|
if (it->id==id && it->matchExtra(requireExtraMatch)) {
|
||||||
return it->text;
|
return it->text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3324,11 +3324,10 @@ BaseInfo *gdioutput::setTextZeroBlank(const char *id, int number, bool Update)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BaseInfo *gdioutput::setText(const char *id, const wstring &text, bool Update)
|
BaseInfo *gdioutput::setText(const char *id, const wstring &text, bool Update, int requireExtraMatch)
|
||||||
{
|
{
|
||||||
for (list<InputInfo>::iterator it=II.begin();
|
for (auto it = II.begin(); it != II.end(); ++it) {
|
||||||
it != II.end(); ++it) {
|
if (it->id == id && it->matchExtra(requireExtraMatch)) {
|
||||||
if (it->id==id) {
|
|
||||||
bool oldWR = it->writeLock;
|
bool oldWR = it->writeLock;
|
||||||
it->writeLock = true;
|
it->writeLock = true;
|
||||||
SetWindowText(it->hWnd, text.c_str());
|
SetWindowText(it->hWnd, text.c_str());
|
||||||
@ -3341,9 +3340,8 @@ BaseInfo *gdioutput::setText(const char *id, const wstring &text, bool Update)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (list<ListBoxInfo>::iterator it=LBI.begin();
|
for (auto it = LBI.begin(); it != LBI.end(); ++it) {
|
||||||
it != LBI.end(); ++it) {
|
if (it->id == id && it->IsCombo && it->matchExtra(requireExtraMatch)) {
|
||||||
if (it->id==id && it->IsCombo) {
|
|
||||||
SetWindowText(it->hWnd, text.c_str());
|
SetWindowText(it->hWnd, text.c_str());
|
||||||
it->text = text;
|
it->text = text;
|
||||||
it->original = text;
|
it->original = text;
|
||||||
@ -3351,18 +3349,16 @@ BaseInfo *gdioutput::setText(const char *id, const wstring &text, bool Update)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (list<ButtonInfo>::iterator it=BI.begin();
|
for (auto it = BI.begin(); it != BI.end(); ++it) {
|
||||||
it != BI.end(); ++it) {
|
if (it->id == id && it->matchExtra(requireExtraMatch)) {
|
||||||
if (it->id==id) {
|
|
||||||
SetWindowText(it->hWnd, text.c_str());
|
SetWindowText(it->hWnd, text.c_str());
|
||||||
it->text = text;
|
it->text = text;
|
||||||
return &*it;
|
return &*it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(list<TextInfo>::iterator it=TL.begin();
|
for (auto it = TL.begin(); it != TL.end(); ++it) {
|
||||||
it != TL.end(); ++it){
|
if (it->id == id && it->matchExtra(requireExtraMatch)) {
|
||||||
if (it->id==id) {
|
|
||||||
RECT rc = it->textRect;
|
RECT rc = it->textRect;
|
||||||
|
|
||||||
it->text = text;
|
it->text = text;
|
||||||
@ -3406,7 +3402,7 @@ bool gdioutput::insertText(const string &id, const wstring &text)
|
|||||||
|
|
||||||
void gdioutput::setData(const string &id, DWORD data)
|
void gdioutput::setData(const string &id, DWORD data)
|
||||||
{
|
{
|
||||||
void *pd = (void *)(data);
|
void *pd = (void *)(size_t(data));
|
||||||
setData(id, pd);
|
setData(id, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3433,7 +3429,7 @@ bool gdioutput::getData(const string &id, DWORD &data) const
|
|||||||
list<DataStore>::const_iterator it;
|
list<DataStore>::const_iterator it;
|
||||||
for(it=DataInfo.begin(); it != DataInfo.end(); ++it){
|
for(it=DataInfo.begin(); it != DataInfo.end(); ++it){
|
||||||
if (it->id==id){
|
if (it->id==id){
|
||||||
data=DWORD(it->data);
|
data=DWORD(size_t(it->data));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3690,20 +3686,20 @@ void gdioutput::setTabStops(const string &Name, int t1, int t2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gdioutput::setInputStatus(const char *id, bool status, bool acceptMissing) {
|
void gdioutput::setInputStatus(const char *id, bool status, bool acceptMissing, int matchExtra) {
|
||||||
bool hit = false;
|
bool hit = false;
|
||||||
for(list<InputInfo>::iterator it=II.begin(); it != II.end(); ++it)
|
for(list<InputInfo>::iterator it=II.begin(); it != II.end(); ++it)
|
||||||
if (it->id==id) {
|
if (it->id==id && (matchExtra == -1 || it->getExtraInt() == matchExtra)) {
|
||||||
EnableWindow(it->hWnd, status);
|
EnableWindow(it->hWnd, status);
|
||||||
hit = true;
|
hit = true;
|
||||||
}
|
}
|
||||||
for(list<ListBoxInfo>::iterator it=LBI.begin(); it != LBI.end(); ++it)
|
for(list<ListBoxInfo>::iterator it=LBI.begin(); it != LBI.end(); ++it)
|
||||||
if (it->id==id) {
|
if (it->id==id && (matchExtra == -1 || it->getExtraInt() == matchExtra)) {
|
||||||
EnableWindow(it->hWnd, status);
|
EnableWindow(it->hWnd, status);
|
||||||
hit = true;
|
hit = true;
|
||||||
}
|
}
|
||||||
for(list<ButtonInfo>::iterator it=BI.begin(); it != BI.end(); ++it)
|
for(list<ButtonInfo>::iterator it=BI.begin(); it != BI.end(); ++it)
|
||||||
if (it->id==id) {
|
if (it->id==id && (matchExtra == -1 || it->getExtraInt() == matchExtra)) {
|
||||||
EnableWindow(it->hWnd, status);
|
EnableWindow(it->hWnd, status);
|
||||||
if (it->isCheckbox) {
|
if (it->isCheckbox) {
|
||||||
string tid = "T" + it->id;
|
string tid = "T" + it->id;
|
||||||
@ -4247,19 +4243,23 @@ void gdioutput::RenderString(TextInfo &ti, HDC hDC)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DrawText(hDC, ti.text.c_str(), ti.text.length(), &rc, DT_CALCRECT|DT_NOPREFIX);
|
int flags = DT_NOPREFIX;
|
||||||
|
if (ti.format & textLimitEllipsis)
|
||||||
|
flags = DT_END_ELLIPSIS;
|
||||||
|
|
||||||
|
DrawText(hDC, ti.text.c_str(), ti.text.length(), &rc, DT_CALCRECT | flags);
|
||||||
ti.realWidth = rc.right - rc.left;
|
ti.realWidth = rc.right - rc.left;
|
||||||
if (ti.format&textRight) {
|
if (ti.format&textRight) {
|
||||||
rc.right = rc.left + ti.xlimit - (rc.bottom - rc.top) / 2;
|
rc.right = rc.left + ti.xlimit - (rc.bottom - rc.top) / 2;
|
||||||
DrawText(hDC, ti.text.c_str(), ti.text.length(), &rc, DT_RIGHT|DT_NOPREFIX);
|
DrawText(hDC, ti.text.c_str(), ti.text.length(), &rc, DT_RIGHT | flags);
|
||||||
}
|
}
|
||||||
else if (ti.format&textCenter) {
|
else if (ti.format&textCenter) {
|
||||||
rc.right = rc.left + ti.xlimit - (rc.bottom - rc.top) / 2;
|
rc.right = rc.left + ti.xlimit - (rc.bottom - rc.top) / 2;
|
||||||
DrawText(hDC, ti.text.c_str(), ti.text.length(), &rc, DT_CENTER|DT_NOPREFIX);
|
DrawText(hDC, ti.text.c_str(), ti.text.length(), &rc, DT_CENTER | flags);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rc.right = rc.left + ti.xlimit;
|
rc.right = rc.left + ti.xlimit;
|
||||||
DrawText(hDC, ti.text.c_str(), -1, &rc, DT_LEFT|DT_NOPREFIX);
|
DrawText(hDC, ti.text.c_str(), -1, &rc, DT_LEFT | flags);
|
||||||
}
|
}
|
||||||
ti.textRect = rc;
|
ti.textRect = rc;
|
||||||
}
|
}
|
||||||
@ -5633,7 +5633,7 @@ wstring gdioutput::browseForFolder(const wstring &folderStart, const wchar_t *de
|
|||||||
|
|
||||||
bool gdioutput::openDoc(const wchar_t *doc)
|
bool gdioutput::openDoc(const wchar_t *doc)
|
||||||
{
|
{
|
||||||
return (int)ShellExecute(hWndTarget, L"open", doc, NULL, L"", SW_SHOWNORMAL ) >32;
|
return (intptr_t)ShellExecute(hWndTarget, L"open", doc, NULL, L"", SW_SHOWNORMAL ) >32;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gdioutput::init(HWND hWnd, HWND hMain, HWND hTab)
|
void gdioutput::init(HWND hWnd, HWND hMain, HWND hTab)
|
||||||
@ -5664,8 +5664,8 @@ ToolInfo &gdioutput::addToolTip(const string &tipId, const wstring &tip, HWND hW
|
|||||||
|
|
||||||
if (hWnd != 0) {
|
if (hWnd != 0) {
|
||||||
ti.uFlags = TTF_IDISHWND;
|
ti.uFlags = TTF_IDISHWND;
|
||||||
info.id = int(hWnd);
|
info.id = uintptr_t(hWnd);
|
||||||
ti.uId = (UINT) hWnd;
|
ti.uId = (UINT_PTR) hWnd;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ti.uFlags = TTF_SUBCLASS;
|
ti.uFlags = TTF_SUBCLASS;
|
||||||
@ -6900,7 +6900,7 @@ string gdioutput::dbSelect(const string &id, int data) {
|
|||||||
if (!IsWindowEnabled(it->hWnd))
|
if (!IsWindowEnabled(it->hWnd))
|
||||||
throw meosException("Selection " + id + " is not active.");
|
throw meosException("Selection " + id + " is not active.");
|
||||||
if (it->multipleSelection) {
|
if (it->multipleSelection) {
|
||||||
map<int,int>::const_iterator res = it->data2Index.find(data);
|
auto res = it->data2Index.find(data);
|
||||||
if (res != it->data2Index.end())
|
if (res != it->data2Index.end())
|
||||||
SendMessage(it->hWnd, LB_SETSEL, true, res->second);
|
SendMessage(it->hWnd, LB_SETSEL, true, res->second);
|
||||||
else
|
else
|
||||||
@ -7137,7 +7137,7 @@ DWORD gdioutput::selectColor(wstring &def, DWORD input) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gdioutput::setAnimationMode(shared_ptr<AnimationData> &data) {
|
void gdioutput::setAnimationMode(const shared_ptr<AnimationData> &data) {
|
||||||
if (animationData && animationData->takeOver(data))
|
if (animationData && animationData->takeOver(data))
|
||||||
return;
|
return;
|
||||||
animationData = data;
|
animationData = data;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -174,7 +174,7 @@ protected:
|
|||||||
struct FucusInfo {
|
struct FucusInfo {
|
||||||
bool wasTabbed;
|
bool wasTabbed;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
FucusInfo() : wasTabbed(false), hWnd(false) {}
|
FucusInfo() : wasTabbed(false), hWnd(0) {}
|
||||||
FucusInfo(HWND wnd) : wasTabbed(false), hWnd(wnd) {}
|
FucusInfo(HWND wnd) : wasTabbed(false), hWnd(wnd) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -365,7 +365,7 @@ public:
|
|||||||
DWORD getBGColor2() const;
|
DWORD getBGColor2() const;
|
||||||
const wstring &getBGImage() const;
|
const wstring &getBGImage() const;
|
||||||
|
|
||||||
void setAnimationMode(shared_ptr<AnimationData> &mode);
|
void setAnimationMode(const shared_ptr<AnimationData> &mode);
|
||||||
|
|
||||||
void setAutoScroll(double speed);
|
void setAutoScroll(double speed);
|
||||||
void getAutoScroll(double &speed, double &pos) const;
|
void getAutoScroll(double &speed, double &pos) const;
|
||||||
@ -533,11 +533,13 @@ public:
|
|||||||
BaseInfo *setInputFocus(const string &id, bool select=false);
|
BaseInfo *setInputFocus(const string &id, bool select=false);
|
||||||
InputInfo *getInputFocus();
|
InputInfo *getInputFocus();
|
||||||
|
|
||||||
void enableInput(const char *id, bool acceptMissing = false) {setInputStatus(id, true, acceptMissing);}
|
void enableInput(const char *id, bool acceptMissing = false,
|
||||||
void disableInput(const char *id, bool acceptMissing = false) {setInputStatus(id, false, acceptMissing);}
|
int requireExtraMatch = -1) {setInputStatus(id, true, acceptMissing, requireExtraMatch);}
|
||||||
void setInputStatus(const char *id, bool status, bool acceptMissing = false);
|
void disableInput(const char *id, bool acceptMissing = false,
|
||||||
void setInputStatus(const string &id, bool status, bool acceptMissing = false)
|
int requireExtraMatch = -1) {setInputStatus(id, false, acceptMissing, requireExtraMatch);}
|
||||||
{setInputStatus(id.c_str(), status, acceptMissing);}
|
void setInputStatus(const char *id, bool status, bool acceptMissing = false, int requireExtraMatch = -1);
|
||||||
|
void setInputStatus(const string &id, bool status, bool acceptMissing = false, int requireExtraMatch = -1)
|
||||||
|
{setInputStatus(id.c_str(), status, acceptMissing, requireExtraMatch);}
|
||||||
|
|
||||||
void setTabStops(const string &Name, int t1, int t2=-1);
|
void setTabStops(const string &Name, int t1, int t2=-1);
|
||||||
void setData(const string &id, DWORD data);
|
void setData(const string &id, DWORD data);
|
||||||
@ -611,7 +613,7 @@ public:
|
|||||||
|
|
||||||
bool hasWidget(const string &id) const;
|
bool hasWidget(const string &id) const;
|
||||||
|
|
||||||
const wstring &getText(const char *id, bool acceptMissing = false) const;
|
const wstring &getText(const char *id, bool acceptMissing = false, int requireExtraMatch = -1) const;
|
||||||
|
|
||||||
BaseInfo &getBaseInfo(const string &id) const {
|
BaseInfo &getBaseInfo(const string &id) const {
|
||||||
return getBaseInfo(id.c_str());
|
return getBaseInfo(id.c_str());
|
||||||
@ -642,7 +644,7 @@ public:
|
|||||||
BaseInfo *setTextTranslate(const string &id, const wstring &text, bool update=false);
|
BaseInfo *setTextTranslate(const string &id, const wstring &text, bool update=false);
|
||||||
|
|
||||||
|
|
||||||
BaseInfo *setText(const char *id, const wstring &text, bool update=false);
|
BaseInfo *setText(const char *id, const wstring &text, bool update=false, int requireExtraMatch = -1);
|
||||||
BaseInfo *setText(const wchar_t *id, const wstring &text, bool update=false) {
|
BaseInfo *setText(const wchar_t *id, const wstring &text, bool update=false) {
|
||||||
return setText(narrow(id), text, update);
|
return setText(narrow(id), text, update);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -35,6 +35,10 @@ protected:
|
|||||||
bool dataString;
|
bool dataString;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
bool matchExtra(int requireExtraMatch) const {
|
||||||
|
return requireExtraMatch == -1 || requireExtraMatch == getExtraInt();
|
||||||
|
}
|
||||||
|
|
||||||
bool hasEventHandler() const {
|
bool hasEventHandler() const {
|
||||||
return handler != 0;
|
return handler != 0;
|
||||||
}
|
}
|
||||||
@ -168,8 +172,8 @@ public:
|
|||||||
wstring text;
|
wstring text;
|
||||||
wstring font;
|
wstring font;
|
||||||
|
|
||||||
int xp;
|
int xp = -1;
|
||||||
int yp;
|
int yp = -1;
|
||||||
|
|
||||||
int format;
|
int format;
|
||||||
DWORD color;
|
DWORD color;
|
||||||
@ -179,8 +183,8 @@ public:
|
|||||||
int absPrintY;
|
int absPrintY;
|
||||||
|
|
||||||
bool hasTimer;
|
bool hasTimer;
|
||||||
DWORD zeroTime;
|
DWORD zeroTime = -1;
|
||||||
DWORD timeOut;
|
DWORD timeOut = 0;
|
||||||
|
|
||||||
bool hasCapture;
|
bool hasCapture;
|
||||||
GUICALLBACK callBack;
|
GUICALLBACK callBack;
|
||||||
@ -328,10 +332,10 @@ private:
|
|||||||
bool isEditControl;
|
bool isEditControl;
|
||||||
bool writeLock;
|
bool writeLock;
|
||||||
wstring original;
|
wstring original;
|
||||||
int originalIdx;
|
size_t originalIdx;
|
||||||
bool ignoreCheck; // True if changed-state should be ignored
|
bool ignoreCheck; // True if changed-state should be ignored
|
||||||
|
|
||||||
map<int, int> data2Index;
|
map<size_t, int> data2Index;
|
||||||
|
|
||||||
// Synchronize with other list box
|
// Synchronize with other list box
|
||||||
WNDPROC originalProc;
|
WNDPROC originalProc;
|
||||||
@ -428,7 +432,7 @@ struct ToolInfo {
|
|||||||
string name;
|
string name;
|
||||||
TOOLINFOW ti;
|
TOOLINFOW ti;
|
||||||
wstring tip;
|
wstring tip;
|
||||||
int id;
|
uintptr_t id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -38,7 +38,7 @@ GeneralResultCtr::GeneralResultCtr(const char *tagIn, const wstring &nameIn, con
|
|||||||
ptr = ptrIn;
|
ptr = ptrIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralResultCtr::GeneralResultCtr(wstring &file, const shared_ptr<DynamicResult> &ptrIn) {
|
GeneralResultCtr::GeneralResultCtr(const wstring &file, const shared_ptr<DynamicResult> &ptrIn) {
|
||||||
ptr = ptrIn;
|
ptr = ptrIn;
|
||||||
name = ptrIn->getName(false);
|
name = ptrIn->getName(false);
|
||||||
tag = ptrIn->getTag();
|
tag = ptrIn->getTag();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -343,7 +343,7 @@ struct GeneralResultCtr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GeneralResultCtr(const char *tag, const wstring &name, const shared_ptr<GeneralResult> &ptr);
|
GeneralResultCtr(const char *tag, const wstring &name, const shared_ptr<GeneralResult> &ptr);
|
||||||
GeneralResultCtr(wstring &file, const shared_ptr<DynamicResult> &ptr);
|
GeneralResultCtr(const wstring &file, const shared_ptr<DynamicResult> &ptr);
|
||||||
GeneralResultCtr() {}
|
GeneralResultCtr() {}
|
||||||
|
|
||||||
~GeneralResultCtr();
|
~GeneralResultCtr();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -256,7 +256,7 @@ void IOF30Interface::readCourseData(gdioutput &gdi, const xmlobject &xo, bool up
|
|||||||
if (pc->getNumStages() == 0) {
|
if (pc->getNumStages() == 0) {
|
||||||
pc->setNumStages(coursePattern[0].size());
|
pc->setNumStages(coursePattern[0].size());
|
||||||
}
|
}
|
||||||
for (int leg = 0; leg < pc->getNumStages() && leg < coursePattern[0].size(); leg++) {
|
for (unsigned leg = 0; leg < pc->getNumStages() && leg < coursePattern[0].size(); leg++) {
|
||||||
pc->clearStageCourses(leg);
|
pc->clearStageCourses(leg);
|
||||||
for (int m = 0; m < period; m++)
|
for (int m = 0; m < period; m++)
|
||||||
pc->addStageCourse(leg, coursePattern[(patternStart + m)%period][leg], -1);
|
pc->addStageCourse(leg, coursePattern[(patternStart + m)%period][leg], -1);
|
||||||
@ -2501,12 +2501,12 @@ pRunner IOF30Interface::readPerson(gdioutput &gdi, const xmlobject &person) {
|
|||||||
|
|
||||||
if (!r) {
|
if (!r) {
|
||||||
if ( pid > 0) {
|
if ( pid > 0) {
|
||||||
oRunner or(&oe, pid);
|
oRunner oR(&oe, pid);
|
||||||
r = oe.addRunner(or, true);
|
r = oe.addRunner(oR, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
oRunner or(&oe);
|
oRunner oR(&oe);
|
||||||
r = oe.addRunner(or, true);
|
r = oe.addRunner(oR, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2560,7 +2560,7 @@ pClub IOF30Interface::readOrganization(gdioutput &gdi, const xmlobject &xclub, b
|
|||||||
if (clubId)
|
if (clubId)
|
||||||
pc = oe.getClubCreate(clubId, name);
|
pc = oe.getClubCreate(clubId, name);
|
||||||
|
|
||||||
if (!pc) return false;
|
if (!pc) return nullptr;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pc = new oClub(&oe, clubId);
|
pc = new oClub(&oe, clubId);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -94,6 +94,8 @@ void ListEditor::show(TabBase *dst, gdioutput &gdi) {
|
|||||||
show(gdi);
|
show(gdi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int editListCB(gdioutput* gdi, int type, void* data);
|
||||||
|
|
||||||
void ListEditor::show(gdioutput &gdi) {
|
void ListEditor::show(gdioutput &gdi) {
|
||||||
|
|
||||||
gdi.setRestorePoint("BeginListEdit");
|
gdi.setRestorePoint("BeginListEdit");
|
||||||
@ -396,6 +398,13 @@ int ListEditor::editList(gdioutput &gdi, int type, BaseInfo &data) {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
if ( bi.id.substr(0, 8) == "EditPost" ) {
|
if ( bi.id.substr(0, 8) == "EditPost" ) {
|
||||||
|
if (gdi.hasData("CurrentId")) {
|
||||||
|
DWORD id;
|
||||||
|
gdi.getData("CurrentId", id);
|
||||||
|
getPosFromId(id, groupIx, lineIx, ix);
|
||||||
|
MetaListPost &mlp = currentList->getMLP(groupIx, lineIx, ix);
|
||||||
|
saveListPost(gdi, mlp);
|
||||||
|
}
|
||||||
int id = atoi(bi.id.substr(8).c_str());
|
int id = atoi(bi.id.substr(8).c_str());
|
||||||
getPosFromId(id, groupIx, lineIx, ix);
|
getPosFromId(id, groupIx, lineIx, ix);
|
||||||
MetaListPost &mlp = currentList->getMLP(groupIx, lineIx, ix);
|
MetaListPost &mlp = currentList->getMLP(groupIx, lineIx, ix);
|
||||||
@ -464,55 +473,7 @@ int ListEditor::editList(gdioutput &gdi, int type, BaseInfo &data) {
|
|||||||
|
|
||||||
MetaListPost &mlp = currentList->getMLP(groupIx, lineIx, ix);
|
MetaListPost &mlp = currentList->getMLP(groupIx, lineIx, ix);
|
||||||
|
|
||||||
ListBoxInfo lbi;
|
bool force = saveListPost(gdi, mlp);
|
||||||
bool force = false;
|
|
||||||
gdi.getSelectedItem("Type", lbi);
|
|
||||||
|
|
||||||
EPostType ptype = EPostType(lbi.data);
|
|
||||||
|
|
||||||
wstring str = gdi.getText("Text");
|
|
||||||
if (ptype != lString) {
|
|
||||||
if (!str.empty() && str.find_first_of('X') == string::npos && str[0]!='@') {
|
|
||||||
throw meosException("Texten ska innehålla tecknet X, som byts ut mot tävlingsspecifik data");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wstring t1 = mlp.getType();
|
|
||||||
EPostType newType = EPostType(lbi.data);
|
|
||||||
mlp.setType(newType);
|
|
||||||
if (t1 != mlp.getType())
|
|
||||||
force = true;
|
|
||||||
mlp.setText(str);
|
|
||||||
|
|
||||||
gdi.getSelectedItem("AlignType", lbi);
|
|
||||||
mlp.align(EPostType(lbi.data));
|
|
||||||
|
|
||||||
mlp.limitBlockWidth(gdi.isChecked("LimitBlockWidth"));
|
|
||||||
mlp.alignText(gdi.getText("AlignText"));
|
|
||||||
|
|
||||||
auto relPrev = gdi.getSelectedItem("RelPrevious");
|
|
||||||
mlp.packWithPrevious(relPrev.first == 2);
|
|
||||||
mlp.mergePrevious(relPrev.first == 1);
|
|
||||||
|
|
||||||
gdi.getSelectedItem("TextAdjust", lbi);
|
|
||||||
mlp.setTextAdjust(lbi.data);
|
|
||||||
|
|
||||||
mlp.setColor(GDICOLOR(gdi.getExtraInt("Color")));
|
|
||||||
|
|
||||||
int leg = readLeg(gdi, newType, true);
|
|
||||||
mlp.setLeg(leg);
|
|
||||||
|
|
||||||
if (gdi.hasWidget("UseResultModule") && gdi.isChecked("UseResultModule"))
|
|
||||||
mlp.setResultModule(currentList->getResultModule());
|
|
||||||
else
|
|
||||||
mlp.setResultModule("");
|
|
||||||
|
|
||||||
mlp.setBlock(gdi.getTextNo("BlockSize"));
|
|
||||||
mlp.indent(gdi.getTextNo("MinIndent"));
|
|
||||||
|
|
||||||
gdi.getSelectedItem("Fonts", lbi);
|
|
||||||
mlp.setFont(gdiFonts(lbi.data));
|
|
||||||
makeDirty(gdi, MakeDirty, MakeDirty);
|
|
||||||
|
|
||||||
if (!gdi.hasData("NoRedraw") || force) {
|
if (!gdi.hasData("NoRedraw") || force) {
|
||||||
gdi.restore("BeginListEdit", false);
|
gdi.restore("BeginListEdit", false);
|
||||||
@ -819,6 +780,60 @@ int ListEditor::editList(gdioutput &gdi, int type, BaseInfo &data) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ListEditor::saveListPost(gdioutput &gdi, MetaListPost &mlp) {
|
||||||
|
ListBoxInfo lbi;
|
||||||
|
bool force = false;
|
||||||
|
gdi.getSelectedItem("Type", lbi);
|
||||||
|
|
||||||
|
EPostType ptype = EPostType(lbi.data);
|
||||||
|
|
||||||
|
wstring str = gdi.getText("Text");
|
||||||
|
if (ptype != lString) {
|
||||||
|
if (!str.empty() && str.find_first_of('X') == string::npos && str[0] != '@') {
|
||||||
|
throw meosException("Texten ska innehålla tecknet X, som byts ut mot tävlingsspecifik data");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wstring t1 = mlp.getType();
|
||||||
|
EPostType newType = EPostType(lbi.data);
|
||||||
|
mlp.setType(newType);
|
||||||
|
if (t1 != mlp.getType())
|
||||||
|
force = true;
|
||||||
|
mlp.setText(str);
|
||||||
|
|
||||||
|
gdi.getSelectedItem("AlignType", lbi);
|
||||||
|
mlp.align(EPostType(lbi.data));
|
||||||
|
|
||||||
|
mlp.limitBlockWidth(gdi.isChecked("LimitBlockWidth"));
|
||||||
|
mlp.alignText(gdi.getText("AlignText"));
|
||||||
|
|
||||||
|
auto relPrev = gdi.getSelectedItem("RelPrevious");
|
||||||
|
mlp.packWithPrevious(relPrev.first == 2);
|
||||||
|
mlp.mergePrevious(relPrev.first == 1);
|
||||||
|
|
||||||
|
gdi.getSelectedItem("TextAdjust", lbi);
|
||||||
|
mlp.setTextAdjust(lbi.data);
|
||||||
|
|
||||||
|
mlp.setColor(GDICOLOR(gdi.getExtraInt("Color")));
|
||||||
|
|
||||||
|
int leg = readLeg(gdi, newType, true);
|
||||||
|
mlp.setLeg(leg);
|
||||||
|
|
||||||
|
if (gdi.hasWidget("UseResultModule") && gdi.isChecked("UseResultModule"))
|
||||||
|
mlp.setResultModule(currentList->getResultModule());
|
||||||
|
else
|
||||||
|
mlp.setResultModule("");
|
||||||
|
|
||||||
|
mlp.setBlock(gdi.getTextNo("BlockSize"));
|
||||||
|
mlp.indent(gdi.getTextNo("MinIndent"));
|
||||||
|
|
||||||
|
gdi.getSelectedItem("Fonts", lbi);
|
||||||
|
mlp.setFont(gdiFonts(lbi.data));
|
||||||
|
makeDirty(gdi, MakeDirty, MakeDirty);
|
||||||
|
|
||||||
|
return force;
|
||||||
|
}
|
||||||
|
|
||||||
int ListEditor::readLeg(gdioutput &gdi, EPostType newType, bool checkError) const {
|
int ListEditor::readLeg(gdioutput &gdi, EPostType newType, bool checkError) const {
|
||||||
if (MetaList::isResultModuleOutput(newType)) {
|
if (MetaList::isResultModuleOutput(newType)) {
|
||||||
int leg = gdi.getTextNo("Leg");
|
int leg = gdi.getTextNo("Leg");
|
||||||
@ -891,9 +906,13 @@ void ListEditor::updateType(int iType, gdioutput & gdi) {
|
|||||||
|
|
||||||
void ListEditor::checkUnsaved(gdioutput &gdi) {
|
void ListEditor::checkUnsaved(gdioutput &gdi) {
|
||||||
if (gdi.hasData("IsEditing")) {
|
if (gdi.hasData("IsEditing")) {
|
||||||
if (gdi.isInputChanged("")) {
|
if (gdi.hasData("CurrentId")) {
|
||||||
gdi.setData("NoRedraw", 1);
|
DWORD id;
|
||||||
gdi.sendCtrlMessage("Apply");
|
gdi.getData("CurrentId", id);
|
||||||
|
int groupIx, lineIx, ix;
|
||||||
|
getPosFromId(id, groupIx, lineIx, ix);
|
||||||
|
MetaListPost &mlp = currentList->getMLP(groupIx, lineIx, ix);
|
||||||
|
saveListPost(gdi, mlp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (gdi.hasData("IsEditingList")) {
|
if (gdi.hasData("IsEditingList")) {
|
||||||
@ -1085,6 +1104,7 @@ void ListEditor::editListPost(gdioutput &gdi, const MetaListPost &mlp, int id) {
|
|||||||
|
|
||||||
|
|
||||||
gdi.addInput("MinIndent", itow(mlp.getMinimalIndent()), 7, 0, L"Justering i sidled:");
|
gdi.addInput("MinIndent", itow(mlp.getMinimalIndent()), 7, 0, L"Justering i sidled:");
|
||||||
|
int maxX = gdi.getCX();
|
||||||
gdi.popX();
|
gdi.popX();
|
||||||
gdi.dropLine(3);
|
gdi.dropLine(3);
|
||||||
vector< pair<wstring, size_t> > fonts;
|
vector< pair<wstring, size_t> > fonts;
|
||||||
@ -1094,7 +1114,7 @@ void ListEditor::editListPost(gdioutput &gdi, const MetaListPost &mlp, int id) {
|
|||||||
gdi.addSelection("Fonts", 200, 500, 0, L"Format:");
|
gdi.addSelection("Fonts", 200, 500, 0, L"Format:");
|
||||||
gdi.addItem("Fonts", fonts);
|
gdi.addItem("Fonts", fonts);
|
||||||
gdi.selectItemByData("Fonts", currentFont);
|
gdi.selectItemByData("Fonts", currentFont);
|
||||||
int maxX = gdi.getCX();
|
maxX = max(maxX, gdi.getCX());
|
||||||
|
|
||||||
gdi.popX();
|
gdi.popX();
|
||||||
gdi.dropLine(3);
|
gdi.dropLine(3);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -53,6 +53,8 @@ private:
|
|||||||
int editList(gdioutput &gdi, int type, BaseInfo &data);
|
int editList(gdioutput &gdi, int type, BaseInfo &data);
|
||||||
void updateType(int iType, gdioutput &gdi);
|
void updateType(int iType, gdioutput &gdi);
|
||||||
|
|
||||||
|
bool saveListPost(gdioutput &gdi, MetaListPost &mlp);
|
||||||
|
|
||||||
ButtonInfo &addButton(gdioutput &gdi, const MetaListPost &mlp, int x, int y,
|
ButtonInfo &addButton(gdioutput &gdi, const MetaListPost &mlp, int x, int y,
|
||||||
int lineIx, int ix) const;
|
int lineIx, int ix) const;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/********************i****************************************************
|
/********************i****************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -4,6 +4,8 @@
|
|||||||
#include "meos_util.h"
|
#include "meos_util.h"
|
||||||
#include "xmlparser.h"
|
#include "xmlparser.h"
|
||||||
#include "gdioutput.h"
|
#include "gdioutput.h"
|
||||||
|
#include "TabAuto.h"
|
||||||
|
|
||||||
int MachineContainer::AbstractMachine::getInt(const string &v) const {
|
int MachineContainer::AbstractMachine::getInt(const string &v) const {
|
||||||
return _wtoi(getString(v).c_str());
|
return _wtoi(getString(v).c_str());
|
||||||
}
|
}
|
||||||
@ -20,7 +22,7 @@ vector<int> MachineContainer::AbstractMachine::getVectorInt(const string &v) con
|
|||||||
vector<wstring> sp;
|
vector<wstring> sp;
|
||||||
split(s, L",", sp);
|
split(s, L",", sp);
|
||||||
vector<int> res(sp.size());
|
vector<int> res(sp.size());
|
||||||
for (int j = 0; j < sp.size(); j++)
|
for (size_t j = 0; j < sp.size(); j++)
|
||||||
res[j] = _wtoi(sp[j].c_str());
|
res[j] = _wtoi(sp[j].c_str());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -40,7 +42,7 @@ void MachineContainer::AbstractMachine::set(const string &name, int v) {
|
|||||||
|
|
||||||
void MachineContainer::AbstractMachine::set(const string &name, const vector<int> &v) {
|
void MachineContainer::AbstractMachine::set(const string &name, const vector<int> &v) {
|
||||||
wstring &r = props[name];
|
wstring &r = props[name];
|
||||||
for (int j = 0; j < v.size(); j++) {
|
for (size_t j = 0; j < v.size(); j++) {
|
||||||
if (j == 0)
|
if (j == 0)
|
||||||
r = itow(v[j]);
|
r = itow(v[j]);
|
||||||
else
|
else
|
||||||
@ -66,7 +68,7 @@ namespace {
|
|||||||
string encode(const string &in) {
|
string encode(const string &in) {
|
||||||
string out;
|
string out;
|
||||||
out.reserve(in.length());
|
out.reserve(in.length());
|
||||||
for (int j = 0; j < in.length(); j++) {
|
for (size_t j = 0; j < in.length(); j++) {
|
||||||
if (in[j] == '|' || in[j] == '$' || in[j] == '%') {
|
if (in[j] == '|' || in[j] == '$' || in[j] == '%') {
|
||||||
out.push_back('%');
|
out.push_back('%');
|
||||||
if (in[j] == '|')
|
if (in[j] == '|')
|
||||||
@ -85,14 +87,14 @@ namespace {
|
|||||||
string decode(const string &in) {
|
string decode(const string &in) {
|
||||||
string out;
|
string out;
|
||||||
out.reserve(in.length());
|
out.reserve(in.length());
|
||||||
for (int j = 0; j < in.length(); j++) {
|
for (size_t j = 0; j < in.length(); j++) {
|
||||||
if (in[j] == '%') {
|
if (in[j] == '%') {
|
||||||
j++;
|
j++;
|
||||||
if (j < in.length()) {
|
if (j < in.length()) {
|
||||||
if (in[j] == '1')
|
if (in[j] == '1')
|
||||||
out.push_back('|');
|
out.push_back('|');
|
||||||
else if (in[j] == '2')
|
else if (in[j] == '2')
|
||||||
out.push_back('§');
|
out.push_back('$');
|
||||||
else if (in[j] == '3')
|
else if (in[j] == '3')
|
||||||
out.push_back('%');
|
out.push_back('%');
|
||||||
}
|
}
|
||||||
@ -168,8 +170,19 @@ void MachineContainer::save(xmlparser &data) {
|
|||||||
void MachineContainer::load(const string &data) {
|
void MachineContainer::load(const string &data) {
|
||||||
vector<string> parts;
|
vector<string> parts;
|
||||||
split(data, "$", parts);
|
split(data, "$", parts);
|
||||||
for (int j = 0; j + 2 < parts.size(); j++) {
|
if ((parts.size() % 3) != 0) {
|
||||||
|
// Data is corrupt. Repair by delete...
|
||||||
|
if (parts.size() > 3)
|
||||||
|
parts.resize(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
machines.clear();
|
||||||
|
for (size_t j = 0; j + 2 < parts.size(); j+=3) {
|
||||||
const string &type = parts[j];
|
const string &type = parts[j];
|
||||||
|
|
||||||
|
if (AutoMachine::getType(type) == Machines::Unknown)
|
||||||
|
continue;
|
||||||
|
|
||||||
wstring tag = gdioutput::fromUTF8(decode(parts[j + 1]));
|
wstring tag = gdioutput::fromUTF8(decode(parts[j + 1]));
|
||||||
auto res = machines.emplace(make_pair(type, tag), MachineContainer::AbstractMachine());
|
auto res = machines.emplace(make_pair(type, tag), MachineContainer::AbstractMachine());
|
||||||
if (res.second)
|
if (res.second)
|
||||||
@ -200,3 +213,13 @@ string MachineContainer::save() {
|
|||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MachineContainer::rename(const string& type, const wstring& oldName, const wstring& newName) {
|
||||||
|
if (newName != oldName) {
|
||||||
|
auto res = machines.find(make_pair(type, oldName));
|
||||||
|
if (res != machines.end()) {
|
||||||
|
machines.emplace(make_pair(type, newName), res->second);
|
||||||
|
machines.erase(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -64,6 +64,8 @@ public:
|
|||||||
machines.erase(make_pair(type, name));
|
machines.erase(make_pair(type, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rename(const string& type, const wstring& oldName, const wstring& newName);
|
||||||
|
|
||||||
AbstractMachine &set(const string &type, const wstring &name) {
|
AbstractMachine &set(const string &type, const wstring &name) {
|
||||||
auto &m = machines[make_pair(type, name)];
|
auto &m = machines[make_pair(type, name)];
|
||||||
m.clear();
|
m.clear();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -118,7 +118,7 @@ HWND hMainTab=NULL;
|
|||||||
|
|
||||||
list<TabObject> *tabList = nullptr;
|
list<TabObject> *tabList = nullptr;
|
||||||
void scrollVertical(gdioutput *gdi, int yInc, HWND hWnd);
|
void scrollVertical(gdioutput *gdi, int yInc, HWND hWnd);
|
||||||
static int currentFocusIx = 0;
|
static size_t currentFocusIx = 0;
|
||||||
|
|
||||||
void resetSaveTimer() {
|
void resetSaveTimer() {
|
||||||
if (autoTask)
|
if (autoTask)
|
||||||
|
|||||||
@ -169,7 +169,7 @@ BEGIN
|
|||||||
VALUE "FileDescription", "meos"
|
VALUE "FileDescription", "meos"
|
||||||
VALUE "FileVersion", "3.8.0.1"
|
VALUE "FileVersion", "3.8.0.1"
|
||||||
VALUE "InternalName", "meos"
|
VALUE "InternalName", "meos"
|
||||||
VALUE "LegalCopyright", "Copyright © 2007-2021"
|
VALUE "LegalCopyright", "Copyright © 2007-2022"
|
||||||
VALUE "OriginalFilename", "meos.exe"
|
VALUE "OriginalFilename", "meos.exe"
|
||||||
VALUE "ProductName", " meos"
|
VALUE "ProductName", " meos"
|
||||||
VALUE "ProductVersion", "3.8.0.1"
|
VALUE "ProductVersion", "3.8.0.1"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -2286,3 +2286,8 @@ int compareStringIgnoreCase(const wstring &a, const wstring &b) {
|
|||||||
return CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, a.c_str(), a.length(),
|
return CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, a.c_str(), a.length(),
|
||||||
b.c_str(), b.length()) - CSTR_EQUAL;
|
b.c_str(), b.length()) - CSTR_EQUAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* meosException::narrow(const wstring& msg) {
|
||||||
|
static string nmsg(msg.begin(), msg.end());
|
||||||
|
return nmsg.c_str();
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -25,10 +25,7 @@
|
|||||||
|
|
||||||
class meosException : public std::exception {
|
class meosException : public std::exception {
|
||||||
wstring wideMessage;
|
wstring wideMessage;
|
||||||
static const char *narrow(const wstring &msg) {
|
static const char *narrow(const wstring& msg);
|
||||||
static string nmsg(msg.begin(), msg.end());
|
|
||||||
return nmsg.c_str();
|
|
||||||
}
|
|
||||||
public:
|
public:
|
||||||
meosException(const wstring &wmsg) : std::exception(narrow(wmsg)), wideMessage(wmsg) {
|
meosException(const wstring &wmsg) : std::exception(narrow(wmsg)), wideMessage(wmsg) {
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,6 @@
|
|||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{B854EF2A-2BB7-4D62-B08B-96BD64B347E8}</ProjectGuid>
|
<ProjectGuid>{B854EF2A-2BB7-4D62-B08B-96BD64B347E8}</ProjectGuid>
|
||||||
<RootNamespace>meos</RootNamespace>
|
<RootNamespace>meos</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>5.01</WindowsTargetPlatformVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='test|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='test|Win32'" Label="Configuration">
|
||||||
@ -68,7 +67,7 @@
|
|||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<PlatformToolset>v140_xp</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
@ -218,13 +217,14 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||||
<PrecompiledHeaderOutputFile>.\Release/meos.pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>.\x64/meos.pch</PrecompiledHeaderOutputFile>
|
||||||
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
|
<AssemblerListingLocation>./x64/Release/</AssemblerListingLocation>
|
||||||
<ObjectFileName>.\Release/</ObjectFileName>
|
<ObjectFileName>./x64/Release/</ObjectFileName>
|
||||||
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>./x64/Release/</ProgramDataBaseFileName>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<DisableSpecificWarnings>4091;4267</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4091;4267</DisableSpecificWarnings>
|
||||||
|
<BrowseInformation>false</BrowseInformation>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
@ -235,13 +235,14 @@
|
|||||||
<OutputFile>$(TargetPath)</OutputFile>
|
<OutputFile>$(TargetPath)</OutputFile>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<AdditionalLibraryDirectories>./lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>./lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<ProgramDatabaseFile>.\Release/meos.pdb</ProgramDatabaseFile>
|
<ProgramDatabaseFile>./x64/Release/meos.pdb</ProgramDatabaseFile>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
<DataExecutionPrevention>
|
<DataExecutionPrevention>false</DataExecutionPrevention>
|
||||||
</DataExecutionPrevention>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
|
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
|
||||||
|
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
|
||||||
|
<SetChecksum>true</SetChecksum>
|
||||||
</Link>
|
</Link>
|
||||||
<Bscmake>
|
<Bscmake>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -328,9 +329,9 @@
|
|||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||||
<PrecompiledHeaderOutputFile>.\Debug/meos.pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>.\Debug/meos.pch</PrecompiledHeaderOutputFile>
|
||||||
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
|
<AssemblerListingLocation>./x64/Debug/</AssemblerListingLocation>
|
||||||
<ObjectFileName>.\Debug/</ObjectFileName>
|
<ObjectFileName>./x64/Debug/</ObjectFileName>
|
||||||
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>./x64/Debug/</ProgramDataBaseFileName>
|
||||||
<BrowseInformation>false</BrowseInformation>
|
<BrowseInformation>false</BrowseInformation>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
@ -344,18 +345,17 @@
|
|||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;mysqlpp_vc15.lib;libhpdf.lib;RestBed.lib;libpng.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;mysqlpp_vc15.lib;libhpdf.lib;RestBed.lib;libpng.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<OutputFile>.\Debug/meos.exe</OutputFile>
|
<OutputFile>./x64/Debug/meos.exe</OutputFile>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<AdditionalLibraryDirectories>./lib_db;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>./lib_db;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<ProgramDatabaseFile>.\Debug/meos.pdb</ProgramDatabaseFile>
|
<ProgramDatabaseFile>./x64/Debug/meos.pdb</ProgramDatabaseFile>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
<DataExecutionPrevention>
|
<DataExecutionPrevention>
|
||||||
</DataExecutionPrevention>
|
</DataExecutionPrevention>
|
||||||
<IgnoreSpecificDefaultLibraries>
|
<IgnoreSpecificDefaultLibraries>
|
||||||
</IgnoreSpecificDefaultLibraries>
|
</IgnoreSpecificDefaultLibraries>
|
||||||
<AdditionalOptions>/FORCE:MULTIPLE %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
</Link>
|
</Link>
|
||||||
<Bscmake>
|
<Bscmake>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -25,17 +25,17 @@
|
|||||||
|
|
||||||
//ABCDEFGHIJKLMNO
|
//ABCDEFGHIJKLMNO
|
||||||
int getMeosBuild() {
|
int getMeosBuild() {
|
||||||
string revision("$Rev: 1103 $");
|
string revision("$Rev: 1116 $");
|
||||||
return 174 + atoi(revision.substr(5, string::npos).c_str());
|
return 174 + atoi(revision.substr(5, string::npos).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
wstring getMeosDate() {
|
wstring getMeosDate() {
|
||||||
wstring date(L"$Date: 2021-12-11 15:54:57 +0100 (lör, 11 dec 2021) $");
|
wstring date(L"$Date: 2022-02-18 14:51:32 +0100 (fre, 18 feb 2022) $");
|
||||||
return date.substr(7,10);
|
return date.substr(7,10);
|
||||||
}
|
}
|
||||||
|
|
||||||
wstring getBuildType() {
|
wstring getBuildType() {
|
||||||
return L"Beta II"; // No parantheses (...)
|
return L"RC2"; // No parantheses (...)
|
||||||
}
|
}
|
||||||
|
|
||||||
wstring getMajorVersion() {
|
wstring getMajorVersion() {
|
||||||
@ -68,38 +68,7 @@ wstring getMeosCompectVersion() {
|
|||||||
|
|
||||||
void getSupporters(vector<wstring> &supp, vector<wstring> &developSupp)
|
void getSupporters(vector<wstring> &supp, vector<wstring> &developSupp)
|
||||||
{
|
{
|
||||||
supp.emplace_back(L"Tjalve IF");
|
developSupp.emplace_back(L"Almby IK, Örebro");//2019--
|
||||||
supp.emplace_back(L"Nyköpings Orienteringsklubb");
|
|
||||||
supp.emplace_back(L"Motionsorientering Göteborg");
|
|
||||||
supp.emplace_back(L"OK Måsen");
|
|
||||||
supp.emplace_back(L"IF Thor");
|
|
||||||
supp.emplace_back(L"SOS Jindřichův Hradec");
|
|
||||||
supp.emplace_back(L"Mats Holmberg, OK Gränsen");
|
|
||||||
supp.emplace_back(L"Christoffer Ohlsson, Uddevalla OK");
|
|
||||||
supp.emplace_back(L"O-Ringen AB");
|
|
||||||
supp.emplace_back(L"Hans Carlstedt, Sävedalens AIK");
|
|
||||||
supp.emplace_back(L"IFK Mora OK");
|
|
||||||
supp.emplace_back(L"Attunda OK");
|
|
||||||
supp.emplace_back(L"Siguldas Takas, Latvia");
|
|
||||||
supp.emplace_back(L"Eric Teutsch, Ottawa Orienteering Club, Canada");
|
|
||||||
supp.emplace_back(L"Silkeborg OK, Denmark");
|
|
||||||
supp.emplace_back(L"Erik Ivarsson Sandberg");
|
|
||||||
supp.emplace_back(L"Stenungsunds OK");
|
|
||||||
supp.emplace_back(L"OK Leipzig");
|
|
||||||
supp.emplace_back(L"Degerfors OK");
|
|
||||||
supp.emplace_back(L"OK Tjärnen");
|
|
||||||
supp.emplace_back(L"Leksands OK");
|
|
||||||
supp.emplace_back(L"O-Travel");
|
|
||||||
developSupp.emplace_back(L"KOB Kysak");
|
|
||||||
supp.emplace_back(L"Ingemar Carlsson");
|
|
||||||
supp.emplace_back(L"Tolereds AIK");
|
|
||||||
supp.emplace_back(L"OK Snab");
|
|
||||||
supp.emplace_back(L"OK 73");
|
|
||||||
supp.emplace_back(L"Herlufsholm OK");
|
|
||||||
supp.emplace_back(L"Helsingborgs SOK");
|
|
||||||
supp.emplace_back(L"Sala OK");
|
|
||||||
supp.emplace_back(L"OK Roskilde");
|
|
||||||
developSupp.emplace_back(L"Almby IK, Örebro");
|
|
||||||
supp.emplace_back(L"Ligue PACA");
|
supp.emplace_back(L"Ligue PACA");
|
||||||
supp.emplace_back(L"SC vebr-sport");
|
supp.emplace_back(L"SC vebr-sport");
|
||||||
supp.emplace_back(L"IP Skogen Göteborg");
|
supp.emplace_back(L"IP Skogen Göteborg");
|
||||||
@ -162,6 +131,10 @@ void getSupporters(vector<wstring> &supp, vector<wstring> &developSupp)
|
|||||||
supp.emplace_back(L"Järla Orientering");
|
supp.emplace_back(L"Järla Orientering");
|
||||||
supp.emplace_back(L"Hans Wilhelmsson, Säffle OK");
|
supp.emplace_back(L"Hans Wilhelmsson, Säffle OK");
|
||||||
supp.emplace_back(L"Cent Vallées Orientation 12 (C.V.O. 12)");
|
supp.emplace_back(L"Cent Vallées Orientation 12 (C.V.O. 12)");
|
||||||
|
supp.emplace_back(L"OK Tyr, Karlstad");
|
||||||
|
supp.emplace_back(L"Miroslav Kollar, KOB Kysak");
|
||||||
|
supp.emplace_back(L"Zdenko Rohac, KOB ATU Košice");
|
||||||
|
supp.emplace_back(L"Hans Carlstedt, Sävedalens AIK");
|
||||||
|
supp.emplace_back(L"Javier Arufe Varela, O-Liceo");
|
||||||
reverse(supp.begin(), supp.end());
|
reverse(supp.begin(), supp.end());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -41,8 +41,6 @@
|
|||||||
extern oEvent *gEvent;
|
extern oEvent *gEvent;
|
||||||
|
|
||||||
const int MAXLISTPARAMID = 10000000;
|
const int MAXLISTPARAMID = 10000000;
|
||||||
using namespace tr1;
|
|
||||||
|
|
||||||
|
|
||||||
class PositionVer2 {
|
class PositionVer2 {
|
||||||
struct Block {
|
struct Block {
|
||||||
@ -170,7 +168,7 @@ public:
|
|||||||
blocks.back().back().alignWith.emplace_back(row, ix);
|
blocks.back().back().alignWith.emplace_back(row, ix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addAlignNext(const string &newName, int width, int indent) {
|
bool addAlignNext(const string &newName, int width, int indent) {
|
||||||
int best = 10000;
|
int best = 10000;
|
||||||
string bestName;
|
string bestName;
|
||||||
|
|
||||||
@ -188,7 +186,10 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (bestName.empty())
|
||||||
|
return false;
|
||||||
addAlignWith(bestName, newName, width, indent, false);
|
addAlignWith(bestName, newName, width, indent, false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -202,7 +203,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int get(const string &name, double scale) const {
|
int get(const string &name, double scale) const {
|
||||||
auto &r = pmap.find(name);
|
auto r = pmap.find(name);
|
||||||
if (r != pmap.end())
|
if (r != pmap.end())
|
||||||
return int(blocks[r->second.first][r->second.second].getPos() * scale);
|
return int(blocks[r->second.first][r->second.second].getPos() * scale);
|
||||||
return 0;
|
return 0;
|
||||||
@ -213,7 +214,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int getOriginalPos(const string &name, double scale) const {
|
int getOriginalPos(const string &name, double scale) const {
|
||||||
auto &r = pmap.find(name);
|
auto r = pmap.find(name);
|
||||||
if (r != pmap.end())
|
if (r != pmap.end())
|
||||||
return int(blocks[r->second.first][r->second.second].getOriginalPos() * scale);
|
return int(blocks[r->second.first][r->second.second].getOriginalPos() * scale);
|
||||||
return 0;
|
return 0;
|
||||||
@ -746,7 +747,9 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
|
|||||||
typeFormats.push_back(make_pair(cline[kk].type, encode(cline[kk].type, cline[kk].text, dmy)));
|
typeFormats.push_back(make_pair(cline[kk].type, encode(cline[kk].type, cline[kk].text, dmy)));
|
||||||
kk++;
|
kk++;
|
||||||
}
|
}
|
||||||
|
if (mp.limitWidth && mp.blockWidth > 0)
|
||||||
|
width = gdi.scaleLength(mp.blockWidth);
|
||||||
|
else
|
||||||
width = li.getMaxCharWidth(oe, gdi, par.selection, typeFormats, font,
|
width = li.getMaxCharWidth(oe, gdi, par.selection, typeFormats, font,
|
||||||
oPrintPost::encodeFont(fontFaces[i].font,
|
oPrintPost::encodeFont(fontFaces[i].font,
|
||||||
fontFaces[i].scale).c_str(),
|
fontFaces[i].scale).c_str(),
|
||||||
@ -763,9 +766,11 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (mp.alignType == lAlignNext)
|
if (mp.alignType == lAlignNext) {
|
||||||
pos.addAlignNext(label, width, mp.minimalIndent);
|
if (!pos.addAlignNext(label, width, mp.minimalIndent))
|
||||||
|
pos.add(label, width, mp.minimalIndent, mp.packPrevious);
|
||||||
//pos.alignNext(label, width, mp.alignBlock);
|
//pos.alignNext(label, width, mp.alignBlock);
|
||||||
|
}
|
||||||
else if (mp.alignType == lString) {
|
else if (mp.alignType == lString) {
|
||||||
if (stringLabelMap.count(mp.alignWithText) == 0) {
|
if (stringLabelMap.count(mp.alignWithText) == 0) {
|
||||||
throw meosException(L"Don't know how to align with 'X'#" + mp.alignWithText);
|
throw meosException(L"Don't know how to align with 'X'#" + mp.alignWithText);
|
||||||
@ -874,6 +879,9 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
|
|||||||
added.color = mp.color;
|
added.color = mp.color;
|
||||||
if (!mp.mergeWithPrevious)
|
if (!mp.mergeWithPrevious)
|
||||||
base = &added;
|
base = &added;
|
||||||
|
added.useStrictWidth = mp.getLimitBlockWidth();
|
||||||
|
if (added.useStrictWidth)
|
||||||
|
added.format |= textLimitEllipsis;
|
||||||
|
|
||||||
if (last && mp.mergeWithPrevious) {
|
if (last && mp.mergeWithPrevious) {
|
||||||
//last->mergeWith = &added;
|
//last->mergeWith = &added;
|
||||||
@ -926,6 +934,10 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
|
|||||||
if (!mp.mergeWithPrevious)
|
if (!mp.mergeWithPrevious)
|
||||||
base = &added;
|
base = &added;
|
||||||
|
|
||||||
|
added.useStrictWidth = mp.getLimitBlockWidth();
|
||||||
|
if (added.useStrictWidth)
|
||||||
|
added.format |= textLimitEllipsis;
|
||||||
|
|
||||||
if (last && mp.mergeWithPrevious) {
|
if (last && mp.mergeWithPrevious) {
|
||||||
//last->mergeWith = &added;
|
//last->mergeWith = &added;
|
||||||
last->doMergeNext = true;
|
last->doMergeNext = true;
|
||||||
@ -969,6 +981,9 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
|
|||||||
added.resultModuleIndex = getResultModuleIndex(oe, li, mp);
|
added.resultModuleIndex = getResultModuleIndex(oe, li, mp);
|
||||||
setFixedWidth(added, indexPosToWidth, MLList, j, k);
|
setFixedWidth(added, indexPosToWidth, MLList, j, k);
|
||||||
added.xlimit = indexPosToWidthSrc[tuple<int, int, int>(MLList, j, k)];
|
added.xlimit = indexPosToWidthSrc[tuple<int, int, int>(MLList, j, k)];
|
||||||
|
added.useStrictWidth = mp.getLimitBlockWidth();
|
||||||
|
if (added.useStrictWidth)
|
||||||
|
added.format |= textLimitEllipsis;
|
||||||
|
|
||||||
added.color = mp.color;
|
added.color = mp.color;
|
||||||
if (!mp.mergeWithPrevious)
|
if (!mp.mergeWithPrevious)
|
||||||
@ -1024,6 +1039,9 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
|
|||||||
added.resultModuleIndex = getResultModuleIndex(oe, li, mp);
|
added.resultModuleIndex = getResultModuleIndex(oe, li, mp);
|
||||||
setFixedWidth(added, indexPosToWidth, MLSubList, j, k);
|
setFixedWidth(added, indexPosToWidth, MLSubList, j, k);
|
||||||
added.xlimit = indexPosToWidthSrc[tuple<int, int, int>(MLSubList, j, k)];
|
added.xlimit = indexPosToWidthSrc[tuple<int, int, int>(MLSubList, j, k)];
|
||||||
|
added.useStrictWidth = mp.getLimitBlockWidth();
|
||||||
|
if (added.useStrictWidth)
|
||||||
|
added.format |= textLimitEllipsis;
|
||||||
|
|
||||||
if (last && mp.mergeWithPrevious) {
|
if (last && mp.mergeWithPrevious) {
|
||||||
last->doMergeNext = true;
|
last->doMergeNext = true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -95,12 +95,12 @@ const char *RowWrapper::raw_string(int ix) const {
|
|||||||
ResultBase::ResultBase(ConnectionWrapper *con, MYSQL_RES * res) : con(con), result(res) {
|
ResultBase::ResultBase(ConnectionWrapper *con, MYSQL_RES * res) : con(con), result(res) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ResultBase::ResultBase(ResultBase &r) : con(r.con) {
|
ResultBase::ResultBase(ResultBase &&r) : con(r.con) {
|
||||||
result = r.result;
|
result = r.result;
|
||||||
r.result = nullptr;
|
r.result = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ResultBase &ResultBase::operator=(ResultBase &r) {
|
const ResultBase &ResultBase::operator=(ResultBase &&r) {
|
||||||
con = r.con;
|
con = r.con;
|
||||||
if (result)
|
if (result)
|
||||||
mysql_free_result(result);
|
mysql_free_result(result);
|
||||||
|
|||||||
@ -55,8 +55,10 @@ namespace sqlwrapper {
|
|||||||
friend class QueryWrapper;
|
friend class QueryWrapper;
|
||||||
friend class RowWrapper;
|
friend class RowWrapper;
|
||||||
public:
|
public:
|
||||||
ResultBase(ResultBase &r);
|
ResultBase(ResultBase &&r);
|
||||||
const ResultBase &operator=(ResultBase &);
|
const ResultBase &operator=(ResultBase &&);
|
||||||
|
ResultBase(const ResultBase& r) = delete;
|
||||||
|
const ResultBase& operator=(const ResultBase&) = delete;
|
||||||
|
|
||||||
virtual ~ResultBase();
|
virtual ~ResultBase();
|
||||||
int field_num(const string &field);
|
int field_num(const string &field);
|
||||||
@ -69,11 +71,13 @@ namespace sqlwrapper {
|
|||||||
friend class RowWrapper;
|
friend class RowWrapper;
|
||||||
public:
|
public:
|
||||||
ResultWrapper() : ResultBase(nullptr, nullptr) {}
|
ResultWrapper() : ResultBase(nullptr, nullptr) {}
|
||||||
ResultWrapper(ResultWrapper &r) : ResultBase(r) {}
|
ResultWrapper(ResultWrapper &&r) : ResultBase(std::move(r)) {}
|
||||||
const ResultBase &operator=(ResultBase &r) {
|
ResultWrapper(const ResultWrapper& r) = delete;
|
||||||
ResultBase::operator=(r);
|
const ResultBase &operator=(ResultWrapper &&r) {
|
||||||
|
ResultBase::operator=(std::move(r));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
const ResultBase& operator=(const ResultBase& r) = delete;
|
||||||
|
|
||||||
//ResultWrapper(ResultWrapper &r);
|
//ResultWrapper(ResultWrapper &r);
|
||||||
//~ResultWrapper();
|
//~ResultWrapper();
|
||||||
@ -90,11 +94,13 @@ namespace sqlwrapper {
|
|||||||
friend class QueryWrapper;
|
friend class QueryWrapper;
|
||||||
friend class RowWrapper;
|
friend class RowWrapper;
|
||||||
public:
|
public:
|
||||||
ResUseWrapper(ResUseWrapper &r) : ResultBase(r) {}
|
ResUseWrapper(ResUseWrapper&& r) : ResultBase(std::move(r)) {}
|
||||||
const ResUseWrapper &operator=(ResUseWrapper &r) {
|
const ResUseWrapper& operator=(ResUseWrapper&& r) {
|
||||||
ResultBase::operator=(r);
|
ResultBase::operator=(std::move(r));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
ResUseWrapper(const ResUseWrapper& r) = delete;
|
||||||
|
const ResUseWrapper& operator=(const ResUseWrapper& r) = delete;
|
||||||
|
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
RowWrapper fetch_row();
|
RowWrapper fetch_row();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
MeOS - Orienteering Software
|
MeOS - Orienteering Software
|
||||||
Copyright (C) 2009-2021 Melin Software HB
|
Copyright (C) 2009-2022 Melin Software HB
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user