MeOS version 3.8.1290 RC2

This commit is contained in:
Erik Melin 2022-02-19 09:02:10 +01:00
parent 62a69d2e1f
commit 39114f894b
171 changed files with 811 additions and 688 deletions

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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;
for(it_int=varint.begin(); it_int!=varint.end(); it_int++) {
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)) {
*(it_int->data32) = val;
@ -1031,7 +1031,7 @@ bool MeosSQL::storeData(oDataInterface odi, const RowWrapper &row, unsigned long
}
}
else {
__int64 val = row[it_int->name].ulonglong();
__int64 val = row[(const char*)it_int->name].ulonglong();
__int64 oldVal = *(it_int->data64);
if (val != oldVal) {
memcpy(it_int->data64, &val, 8);
@ -1049,7 +1049,7 @@ bool MeosSQL::storeData(oDataInterface odi, const RowWrapper &row, unsigned long
odi.getVariableString(varstring);
list<oVariableString>::iterator 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()))
updated = true;
}
@ -1822,12 +1822,12 @@ OpFailStatus MeosSQL::storeRunner(const RowWrapper &row, oRunner &r,
if (rid>0) {
pRunner pr = oe->getRunner(rid, 0);
if (pr==0) {
oRunner or(oe, rid);
or.setImplicitlyCreated();
oRunner oR(oe, rid);
oR.setImplicitlyCreated();
if (allowSubRead)
success = min(success, syncRead(true, &or, false, readCourseCard));
if (!or.isRemoved()) {
pr = oe->addRunner(or , false);
success = min(success, syncRead(true, &oR, false, readCourseCard));
if (!oR.isRemoved()) {
pr = oe->addRunner(oR , false);
addedFromDatabase(pr);
}
else {
@ -1931,18 +1931,18 @@ OpFailStatus MeosSQL::storeTeam(const RowWrapper &row, oTeam &t,
if (rns[k]>0) {
pRns[k] = oe->getRunner(rns[k], 0);
if (!pRns[k]) {
oRunner or(oe, rns[k]);
or.setImplicitlyCreated();
oRunner oR(oe, rns[k]);
oR.setImplicitlyCreated();
if (allowSubRead)
success = min(success, syncRead(true, &or, readRecursive, readRecursive));
success = min(success, syncRead(true, &oR, readRecursive, readRecursive));
if (or.sName.empty()) {
or.sName = L"@AutoCorrection";
or.getRealName(or.sName, or.tRealName);
if (oR.sName.empty()) {
oR.sName = L"@AutoCorrection";
oR.getRealName(oR.sName, oR.tRealName);
}
if (!or.isRemoved()) {
pRns[k] = oe->addRunner(or , false);
if (!oR.isRemoved()) {
pRns[k] = oe->addRunner(oR , false);
addedFromDatabase(pRns[k]);
assert(pRns[k] && !pRns[k]->changed);
}
@ -3262,10 +3262,10 @@ bool MeosSQL::syncListRunner(oEvent *oe)
st = opStatusOK;
}
else {
oRunner or(oe, Id);
or.setImplicitlyCreated();
st = syncRead(true, &or, false, false);
r = oe->addRunner(or, false);
oRunner oR(oe, Id);
oR.setImplicitlyCreated();
st = syncRead(true, &oR, false, false);
r = oe->addRunner(oR, false);
}
}
updateCounters(st, counter, modified, oe->sqlRunners, maxCounterRunner);
@ -4259,9 +4259,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
checkAgainstDB("oControl", bmap, needUpdate);
for (auto id : needUpdate) {
if (!id.second) {
oControl or(oe, id.first);
or.setImplicitlyCreated();
auto c = oe->addControl(or);
oControl oR(oe, id.first);
oR.setImplicitlyCreated();
auto c = oe->addControl(oR);
if (c != nullptr)
syncRead(true, c);
}
@ -4275,9 +4275,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
checkAgainstDB("oCourse", bmap, needUpdate);
for (auto id : needUpdate) {
if (!id.second) {
oCourse or(oe, id.first);
or.setImplicitlyCreated();
auto c = oe->addCourse(or);
oCourse oR(oe, id.first);
oR.setImplicitlyCreated();
auto c = oe->addCourse(oR);
if (c != nullptr)
syncRead(true, c);
}
@ -4291,9 +4291,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
checkAgainstDB("oClass", bmap, needUpdate);
for (auto id : needUpdate) {
if (!id.second) {
oClass or(oe, id.first);
or .setImplicitlyCreated();
auto c = oe->addClass(or);
oClass oR(oe, id.first);
oR.setImplicitlyCreated();
auto c = oe->addClass(oR);
if (c != nullptr)
syncRead(true, c);
}
@ -4307,9 +4307,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
checkAgainstDB("oClub", bmap, needUpdate);
for (auto id : needUpdate) {
if (!id.second) {
oClub or(oe, id.first);
or.setImplicitlyCreated();
auto c = oe->addClub(or);
oClub oR(oe, id.first);
oR.setImplicitlyCreated();
auto c = oe->addClub(oR);
if (c != nullptr)
syncRead(true, c);
}
@ -4323,9 +4323,9 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
checkAgainstDB("oCard", bmap, needUpdate);
for (auto id : needUpdate) {
if (!id.second) {
oCard or (oe, id.first);
or .setImplicitlyCreated();
auto c = oe->addCard(or );
oCard oR(oe, id.first);
oR.setImplicitlyCreated();
auto c = oe->addCard(oR);
if (c != nullptr)
syncRead(true, c);
}
@ -4339,10 +4339,10 @@ bool MeosSQL::checkConsistency(oEvent *oe, bool force) {
checkAgainstDB("oRunner", bmap, needUpdate);
for (auto id : needUpdate) {
if (!id.second) {
oRunner or (oe, id.first);
or .setImplicitlyCreated();
syncRead(true, &or );
oe->addRunner(or , false);
oRunner oR(oe, id.first);
oR.setImplicitlyCreated();
syncRead(true, &oR);
oe->addRunner(oR, false);
}
else {
id.second->counter = 0;

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
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);
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
void setDefaultDB();

View File

@ -4,7 +4,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -95,19 +95,19 @@ struct PrinterObject {
bool onlyChanged;
struct DATASET {
int pWidth_mm;
int pHeight_mm;
double pMgBottom;
double pMgTop;
double pMgRight;
double pMgLeft;
int pWidth_mm = 0;
int pHeight_mm = 0;
double pMgBottom = 0.0;
double pMgTop = 0.0;
double pMgRight = 0.0;
double pMgLeft = 0.0;
int MarginX;
int MarginY;
int PageX;
int PageY;
double Scale;
bool LastPage;
int MarginX = 0;
int MarginY = 0;
int PageX = 0;
int PageY = 0;
double Scale = 0.0;
bool LastPage = false;
} ds;
void operator=(const PrinterObject &po);

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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)
problems.push_back(pc->getName() + L"-" + pc2->getName());
}
problems.begin();
}
}
@ -1330,11 +1329,24 @@ void RunnerDB::refreshRunnerTableData(Table &table) {
int runnerId;
bool found = false;
pRunner r = nullptr;
if (rdb[k].extId != 0)
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) {
pRunner r = oe->getRunner(runnerId, 0);
if (r == nullptr)
r = oe->getRunner(runnerId, 0);
row->updateCell(cellEntryIndex, cellEdit, r ? r->getClass(true) : L"");
}
else if (!found && row->getCellType(cellEntryIndex) == cellEdit) {
@ -1414,8 +1426,18 @@ void oDBRunnerEntry::addTableRow(Table &table) const {
int runnerId;
bool found = false;
pRunner cr = nullptr;
if (rn.extId != 0)
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)
table.setTableProp(Table::CAN_DELETE|Table::CAN_INSERT|Table::CAN_PASTE);
@ -1426,8 +1448,9 @@ void oDBRunnerEntry::addTableRow(Table &table) const {
if (!found)
table.set(row++, it, TID_ENTER, L"@+", false, cellAction);
else {
pRunner r = oe->getRunner(runnerId, 0);
table.set(row++, it, TID_ENTER, r ? r->getClass(true) : L"", false, cellEdit);
if (cr == nullptr)
cr = oe->getRunner(runnerId, 0);
table.set(row++, it, TID_ENTER, cr ? cr->getClass(true) : L"", false, cellEdit);
}
}

View File

@ -11,7 +11,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -33,7 +33,7 @@
const int baseNameLength = 64;
const int baseNameLengthUTF = 96;
constexpr int64_t cardIdConstant = 100000000000L;
//Has 0-clearing constructor. Must not contain any
//dynamic data etc.
struct RunnerDBEntryV1 {
@ -139,7 +139,7 @@ public:
void setNameUTF(const char *name);
const wchar_t *RunnerWDBEntry::getNameCstr() const;
const wchar_t *getNameCstr() const;
wstring getGivenName() const;
wstring getFamilyName() const;

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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
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
//solution as it means that no ports have to be opened at all.
TCHAR szDevices[65535];
@ -1970,48 +1962,8 @@ void SportIdent::EnumrateSerialPorts(list<int> &ports)
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);
}
}
}

View File

@ -13,7 +13,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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) {
wstring oldMachineName = getMachineName();
machineName = gdi.getText("MachineName");
wstring newMachineName = getMachineName();
oe.getMachineContainer().rename(getTypeString(), oldMachineName, newMachineName);
}
void AutoMachine::status(gdioutput &gdi) {
@ -665,18 +668,18 @@ bool TabAuto::loadPage(gdioutput &gdi, bool showSettingsLast)
return true;
}
void AutoMachine::settingsTitle(gdioutput &gdi, char *title) {
void AutoMachine::settingsTitle(gdioutput &gdi, const char *title) {
gdi.fillDown();
gdi.dropLine(0.5);
gdi.addString("", fontMediumPlus, title).setColor(colorDarkBlue);
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.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)
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 (!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 {
SICard sic(ConvertedTimeStatus::Hour24);

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -67,9 +67,9 @@ private:
protected:
bool editMode;
void settingsTitle(gdioutput &gdi, char *title);
void settingsTitle(gdioutput &gdi, const char *title);
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 {
return false;
@ -81,6 +81,8 @@ public:
}
virtual void loadMachine(oEvent &oe, const wstring &name) {
if (name != L"default")
machineName = name;
}
// Return true to auto-remove

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
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 pursuitDialog(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, const wstring &firstStart);

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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.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.popX();
@ -2412,7 +2412,7 @@ void TabCompetition::loadAboutPage(gdioutput &gdi) const
gdi.dropLine(1.5);
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.addStringUT(10, "The database connection used is MySQL++\nCopyright "
"(c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by MySQL AB,"

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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" ||
bi.id == "FullScreen" || bi.id == "FullScreenLive") {
gdioutput *gdi_new;
gdioutput *gdi_new = nullptr;
TabList *tl_new = this;
if (!ownWindow) {
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);
}
else if (bi.id=="SavePS") {
const char *ctype = (char *)gdi.getData("Type");
saveExtraLines(*oe, ctype, gdi);
string ctype;
gdi.getData("Type", ctype);
saveExtraLines(*oe, ctype.c_str(), gdi);
if (gdi.hasWidget("SplitAnalysis")) {
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.fillDown();
char *ctype = type == Splits ? "SPExtra" : "EntryExtra";
const char *ctype = type == Splits ? "SPExtra" : "EntryExtra";
customTextLines(oe, ctype, gdi);
if (type == Splits) {

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -51,6 +51,7 @@
#include "autocomplete.h"
constexpr bool addTestPort = false;
void tabForceSync(gdioutput& gdi, pEvent oe);
TabSI::TabSI(oEvent *poe):TabBase(poe), activeSIC(ConvertedTimeStatus::Unknown) {
editCardData.tabSI = this;
@ -74,6 +75,7 @@ TabSI::TabSI(oEvent *poe):TabBase(poe), activeSIC(ConvertedTimeStatus::Unknown)
inputId = 0;
printErrorShown = false;
NC = 8;
splitPrinter.onlyChanged = false;
}
TabSI::~TabSI(void)
@ -117,6 +119,22 @@ int SportIdentCB(gdioutput *gdi, int type, void *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)
{
if (type == GUI_BUTTON) {
@ -150,11 +168,29 @@ int TabSI::siCB(gdioutput &gdi, int type, void *data)
gdi.fillRight();
auto addSoundWidget = [&gdi, this](const wchar_t *name, SND type, const wstring &label) {
int itype = int(type);
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.addButton("BrowseSound", "Bläddra...", SportIdentCB).setExtra(name);
gdi.addButton("TestSound", "Testa", SportIdentCB).setExtra(int(type));
gdi.addButton("BrowseSound", "Bläddra...", SportIdentCB).setExtra(itype);
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.popX();
};
@ -193,15 +229,26 @@ int TabSI::siCB(gdioutput &gdi, int type, void *data)
wstring file = gdi.browseForOpen(ext, L"wav");
if (!file.empty()) {
wchar_t *type = bi.getExtra();
string name = gdioutput::narrow(type);
gdi.setText(name, file);
SND iType = SND(bi.getExtraInt());
gdi.setText("SoundFile", file, false, int(iType));
string name = typeFromSndType(iType);
oe->setProperty(name.c_str(), file);
}
}
else if (bi.id == "SoundOK" || bi.id == "SoundNotOK" ||
bi.id == "SoundLeader" || bi.id == "SoundAction") {
oe->setProperty(bi.id.c_str(), bi.text);
else if (bi.id.substr(0, 6) == "DoPlay") {
SND itype = SND(bi.getExtraInt());
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") {
oe->setProperty("PlaySound", 1);
@ -1623,6 +1670,11 @@ int TabSI::siCB(gdioutput &gdi, int type, void *data)
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) {
DWORD loaded;
@ -3174,6 +3226,7 @@ void TabSI::generateStartInfo(gdioutput &gdi, const oRunner &r) {
void TabSI::printerSetup(gdioutput &gdi)
{
gdi.printSetup(splitPrinter);
splitPrinter.onlyChanged = false;
}
void TabSI::checkMoreCardsInQueue(gdioutput &gdi) {
@ -3865,7 +3918,7 @@ void TabSI::showRegisterHiredCards(gdioutput &gdi) {
gdi.fillDown();
oe->synchronizeList(oListId::oLPunchId);
auto &hiredCards = oe->getHiredCards();
auto hiredCards = oe->getHiredCards();
for (int i : hiredCards) {
gdi.addStringUT(0, itos(i)).setExtra(i).setHandler(getResetHiredCardHandler());
}
@ -4375,17 +4428,32 @@ void TabSI::playReadoutSound(SND type) {
case SND::NotOK:
fn = oe->getPropertyString("SoundNotOK", L"");
res = 52;
if (fn == L"none") {
fn = oe->getPropertyString("SoundAction", L"");
res = 53;
}
break;
case SND::Leader:
fn = oe->getPropertyString("SoundLeader", L"");
res = 51;
if (fn == L"none") {
fn = oe->getPropertyString("SoundOK", L"");
res = 50;
}
break;
case SND::ActionNeeded:
fn = oe->getPropertyString("SoundAction", L"");
res = 53;
if (fn == L"none") {
fn = oe->getPropertyString("SoundNotOK", L"");
res = 52;
}
break;
}
if (fn == L"none")
return;
if (checkedSound.count(fn) || (!fn.empty() && fileExists(fn))) {
playSoundFile(fn);
checkedSound.insert(fn);

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -75,6 +75,8 @@ private:
ActionNeeded
};
string typeFromSndType(SND s);
set<wstring> checkedSound;
void playReadoutSound(SND type);

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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) {
RECT rc;
gdi.getWindowsPosition(rc);
settings.insert(make_pair("left", itow(rc.left)));
settings.insert(make_pair("right", itow(rc.right)));
settings.insert(make_pair("top", itow(rc.top)));
settings.insert(make_pair("bottom", itow(rc.bottom)));
settings.insert(make_pair("left", itow(int(rc.left))));
settings.insert(make_pair("right", itow(int(rc.right))));
settings.insert(make_pair("top", itow(int(rc.top))));
settings.insert(make_pair("bottom", itow(int(rc.bottom))));
for (auto clsId : classesToWatch) {
pClass cls = oe->getClass(clsId);

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -28,18 +28,13 @@
#include "meos.h"
#include "TimeStamp.h"
#include <algorithm>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#include "meos_util.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
const __int64 minYearConstant = 2014 - 1601;
constexpr __int64 minYearConstant = 2014 - 1601;
TimeStamp::TimeStamp()
{
@ -129,9 +124,9 @@ string TimeStamp::getStampStringN() const
FILETIME &ft = *(FILETIME*)&ft64;
SYSTEMTIME st;
FileTimeToSystemTime(&ft, &st);
if (st.wYear > 2021 || st.wYear < 2009) {
st.wYear = 2021;
int y = getThisYear();
if (st.wYear > y || st.wYear < 2009) {
st.wYear = y;
st.wDay = 1;
st.wMonth = 1;
st.wHour = 2;

View File

@ -10,7 +10,7 @@
#endif // _MSC_VER > 1000
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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;
return true;
}
void AnimationData::takeOverInternal(shared_ptr<AnimationData> &other) {
void AnimationData::takeOverInternal(const shared_ptr<AnimationData> &other) {
pages.swap(other->pages);
width = other->width;
height = other->height;

View File

@ -2,7 +2,7 @@
/************************************************************************
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
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<AnimationData> delayedTakeOver;
void takeOverInternal(shared_ptr<AnimationData> &other);
void takeOverInternal(const shared_ptr<AnimationData> &other);
void threadRender(gdioutput *gdi, size_t sp, int delay);
public:
@ -58,7 +58,7 @@ public:
~AnimationData();
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);
};

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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;
if (modifedAutoComplete && size_t(currentIx) < data.size()) {
for (size_t k = 0; k < items.size(); k++) {

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -65,7 +65,7 @@ public:
}
void paint(HDC hDC);
void setData(vector<AutoCompleteRecord> &items);
void setData(const vector<AutoCompleteRecord> &items);
void click(int x, int y);
void show();

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -7,7 +7,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -46,7 +46,7 @@ class ProgressWindow;
class Download {
private:
volatile unsigned hThread;
volatile uintptr_t hThread;
volatile bool doExit;
//HWND hProgress;

View File

@ -1263,7 +1263,7 @@ Zooma ut (Ctrl + '-') = Zoom out (Ctrl + '-')
[Bevaka] = [Watch]
[Flytta ner] = [Move down]
[Bort] = [Remove]
[Klassens bana] = [From Class]
[Klassens bana] = [From class]
[Uppdaterad anmälan] = [Updated entry]
[VARNING] ingen/okänd = [VARNING] none/unknown
[Å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: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: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:9373 = Give one or more control numbers (SI codes) used by this control.\nExample: 31, 32, 33.
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 = 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: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.
@ -1531,7 +1531,7 @@ Mappnamnet får inte vara tomt = Folder name cannot be empty
Onlineresultat = Online Results
Packa stora filer (zip) = Compress large files (zip)
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
Spara på disk = Save to disk
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
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
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

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -44,23 +44,23 @@ enum gdiFonts {
formatIgnore = 1000,
};
const int pageNewPage=100;
//const int pageReserveHeight=101;
const int pagePageInfo=102;
const int pageNewChapter = 103;
constexpr int pageNewPage=100;
constexpr int pagePageInfo=102;
constexpr int pageNewChapter = 103;
const int textRight=256;
const int textCenter=512;
const int timerCanBeNegative=1024;
const int breakLines=2048;
const int fullTimeHMS = 4096;
const int timeWithTenth = 1<<13;
const int timeSeconds = 1<<14;
const int timerIgnoreSign = 1<<15;
const int Capitalize = 1<<16;
const int absolutePosition = 1 << 17;
const int skipBoundingBox = 1 << 18;
const int hiddenText = 1 << 19;
constexpr int textRight=256;
constexpr int textCenter=512;
constexpr int timerCanBeNegative=1024;
constexpr int breakLines=2048;
constexpr int fullTimeHMS = 4096;
constexpr int timeWithTenth = 1<<13;
constexpr int timeSeconds = 1<<14;
constexpr int timerIgnoreSign = 1<<15;
constexpr int Capitalize = 1<<16;
constexpr int absolutePosition = 1 << 17;
constexpr int skipBoundingBox = 1 << 18;
constexpr int hiddenText = 1 << 19;
constexpr int textLimitEllipsis = 1 << 20;
enum GDICOLOR {
colorBlack = RGB(0, 0, 0),

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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)
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) {
@ -1471,7 +1471,7 @@ LRESULT CALLBACK GetMsgProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
LPARAM res = CallWindowProc(lbi->originalProc, hWnd, iMsg, wParam, lParam);
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) {
ListBoxInfo *other = lbi->lbiSync;
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)
SendMessage(it->hWnd, LB_SETSEL, 1, -1);
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);
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);
}
return;
@ -1573,12 +1573,12 @@ void gdioutput::getSelection(const string &id, set<int> &selection) {
for(it=LBI.begin(); it != LBI.end(); ++it){
if (it->id==id && !it->IsCombo) {
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++){
int s=SendMessage(it->hWnd, LB_GETSEL, i, 0);
LRESULT s=SendMessage(it->hWnd, LB_GETSEL, i, 0);
if (s) {
int d=SendMessage(it->hWnd, LB_GETITEMDATA, i, 0);
selection.insert(d);
LRESULT d=SendMessage(it->hWnd, LB_GETITEMDATA, i, 0);
selection.insert(int(d));
}
}
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) {
if (it->id==id) {
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);
it->data2Index[data] = index;
it->data2Index[data] = int(index);
}
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);
it->data2Index[data] = index;
it->data2Index[data] = int(index);
}
return true;
}
@ -1709,9 +1709,9 @@ bool gdioutput::addItem(const string &id, const vector< pair<wstring, size_t> >
it->data2Index.clear();
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);
it->data2Index[items[k].second] = index;
it->data2Index[items[k].second] = int(index);
}
}
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);
it->data2Index.clear();
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);
it->data2Index[items[k].second] = index;
it->data2Index[items[k].second] = int(index);
}
}
return true;
@ -1738,10 +1738,10 @@ void gdioutput::filterOnData(const string &id, const unordered_set<int> &filter)
}
else {
const HWND &hWnd = it->hWnd;
int count = SendMessage(hWnd, LB_GETCOUNT, 0, 0);
for (int ix = count - 1; ix>=0; ix--) {
int ret = SendMessage(hWnd, LB_GETITEMDATA, ix, 0);
if (ret != LB_ERR && filter.count(ret) == 0)
LRESULT count = SendMessage(hWnd, LB_GETCOUNT, 0, 0);
for (intptr_t ix = count - 1; ix>=0; ix--) {
LRESULT ret = SendMessage(hWnd, LB_GETITEMDATA, ix, 0);
if (ret != LB_ERR && filter.count(int(ret)) == 0)
SendMessage(hWnd, LB_DELETESTRING, ix, 0);
}
return;
@ -1804,14 +1804,14 @@ void ListBoxInfo::copyUserData(ListBoxInfo &dest) const {
bool gdioutput::getSelectedItem(ListBoxInfo &lbi) {
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) {
wchar_t bf[256];
GetWindowText(lbi.hWnd, bf, 256);
lbi.text=bf;
lbi.data=-1;
lbi.index=index;
lbi.index=int(index);
return false;
}
lbi.data=SendMessage(lbi.hWnd, CB_GETITEMDATA, index, 0);
@ -1820,13 +1820,13 @@ bool gdioutput::getSelectedItem(ListBoxInfo &lbi) {
lbi.text=bf;
}
else {
int index=SendMessage(lbi.hWnd, LB_GETCURSEL, 0, 0);
LRESULT index=SendMessage(lbi.hWnd, LB_GETCURSEL, 0, 0);
if (index==LB_ERR)
return false;
lbi.data=SendMessage(lbi.hWnd, LB_GETITEMDATA, index, 0);
lbi.index=index;
lbi.index=int(index);
TCHAR bf[1024];
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) {
if (lbi.id == id) {
if (lbi.IsCombo) {
return SendMessage(lbi.hWnd, CB_GETCOUNT, 0, 0);
return (int)SendMessage(lbi.hWnd, CB_GETCOUNT, 0, 0);
}
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){
if (it->id==id) {
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) {
return SendMessage(it->hWnd, CB_GETITEMDATA, ix, 0);
return (int)SendMessage(it->hWnd, CB_GETITEMDATA, ix, 0);
}
return -1;
}
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) {
return SendMessage(it->hWnd, LB_GETITEMDATA, ix, 0);
return (int)SendMessage(it->hWnd, LB_GETITEMDATA, ix, 0);
}
return -1;
}
@ -1895,10 +1895,10 @@ bool gdioutput::selectItemByData(const char *id, int data)
return true;
}
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++) {
int ret = SendMessage(it->hWnd, CB_GETITEMDATA, m, 0);
LRESULT ret = SendMessage(it->hWnd, CB_GETITEMDATA, m, 0);
if (ret == data) {
SendMessage(it->hWnd, CB_SETCURSEL, m, 0);
it->data = data;
@ -1924,9 +1924,9 @@ bool gdioutput::selectItemByData(const char *id, int data)
return true;
}
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++) {
int ret = SendMessage(it->hWnd, LB_GETITEMDATA, m, 0);
LRESULT ret = SendMessage(it->hWnd, LB_GETITEMDATA, m, 0);
if (ret == data) {
SendMessage(it->hWnd, LB_SETCURSEL, m, 0);
@ -1962,7 +1962,7 @@ bool gdioutput::selectItemByIndex(const char *id, int index) {
}
else {
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->originalIdx = data;
TCHAR bf[1024];
@ -1985,7 +1985,7 @@ bool gdioutput::selectItemByIndex(const char *id, int index) {
}
else {
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->originalIdx = data;
@ -2018,7 +2018,7 @@ bool gdioutput::autoGrow(const char *id) {
for(it=LBI.begin(); it != LBI.end(); ++it){
if (it->id==id) {
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++) {
wchar_t bf[1024];
if (SendMessage(it->hWnd, CB_GETLBTEXT, m, LPARAM(bf))!=CB_ERR) {
@ -2026,7 +2026,6 @@ bool gdioutput::autoGrow(const char *id) {
calcStringSize(TI, hDC);
size = max<int>(size, TI.textRect.right - TI.textRect.left);
}
m++;
}
ReleaseDC(hWndTarget, hDC);
@ -2041,15 +2040,15 @@ bool gdioutput::autoGrow(const char *id) {
return false;
}
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++) {
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 (it->lastTabStop == 0)
TI.text = bf;
else {
int pos = len;
auto pos = len;
while(pos > 0) {
if (bf[pos-1] == '\t') {
break;
@ -2122,7 +2121,7 @@ void gdioutput::processButtonMessage(ButtonInfo &bi, WPARAM wParam)
cmd = "press(\"" + bi.id + "\", \"" + narrow(bi.getExtra()) + "\"); //" + toUTF8(bi.text);
}
else {
int arg = int(bi.extra);
int arg = int((size_t)bi.extra);
if (arg > 1000000 || arg < -1000000 || arg == 0)
cmd = "press(\"" + bi.id + "\"); //" + toUTF8(bi.text);
else
@ -2205,7 +2204,7 @@ void gdioutput::processEditMessage(InputInfo &bi, WPARAM wParam)
void gdioutput::processComboMessage(ListBoxInfo &bi, WPARAM wParam)
{
WORD hwParam = HIWORD(wParam);
int index;
LRESULT index;
switch (hwParam) {
case CBN_SETFOCUS:
currentFocus = bi.hWnd;
@ -2322,7 +2321,7 @@ void gdioutput::keyCommand(KeyCommandCode code) {
void gdioutput::processListMessage(ListBoxInfo &bi, WPARAM wParam)
{
WORD hwParam = HIWORD(wParam);
int index;
LRESULT index;
switch (hwParam) {
case LBN_SETFOCUS:
@ -3118,7 +3117,8 @@ void gdioutput::clearPage(bool autoRefresh, bool keepToolbar) {
CurrentX = scaleLength(40);
CurrentY = scaleLength(START_YP);
SX = CurrentX;
SY = CurrentY;
OffsetX = 0;
OffsetY = 0;
@ -3206,14 +3206,14 @@ BaseInfo &gdioutput::getBaseInfo(const char *id) const {
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 *bptr=bf;
for(list<InputInfo>::const_iterator it=II.begin();
it != II.end(); ++it){
if (it->id==id){
if (it->id==id && it->matchExtra(requireExtraMatch)){
int len=GetWindowTextLength(it->hWnd);
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();
it != LBI.end(); ++it){
if (it->id==id && it->IsCombo){
if (it->id==id && it->IsCombo && it->matchExtra(requireExtraMatch)){
if (!it->writeLock) {
GetWindowText(it->hWnd, bf, 1024);
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();
it != TL.end(); ++it){
if (it->id==id) {
if (it->id==id && it->matchExtra(requireExtraMatch)) {
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();
it != II.end(); ++it) {
if (it->id==id) {
for (auto it = II.begin(); it != II.end(); ++it) {
if (it->id == id && it->matchExtra(requireExtraMatch)) {
bool oldWR = it->writeLock;
it->writeLock = true;
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();
it != LBI.end(); ++it) {
if (it->id==id && it->IsCombo) {
for (auto it = LBI.begin(); it != LBI.end(); ++it) {
if (it->id == id && it->IsCombo && it->matchExtra(requireExtraMatch)) {
SetWindowText(it->hWnd, text.c_str());
it->text = 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();
it != BI.end(); ++it) {
if (it->id==id) {
for (auto it = BI.begin(); it != BI.end(); ++it) {
if (it->id == id && it->matchExtra(requireExtraMatch)) {
SetWindowText(it->hWnd, text.c_str());
it->text = text;
return &*it;
}
}
for(list<TextInfo>::iterator it=TL.begin();
it != TL.end(); ++it){
if (it->id==id) {
for (auto it = TL.begin(); it != TL.end(); ++it) {
if (it->id == id && it->matchExtra(requireExtraMatch)) {
RECT rc = it->textRect;
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 *pd = (void *)(data);
void *pd = (void *)(size_t(data));
setData(id, pd);
}
@ -3433,7 +3429,7 @@ bool gdioutput::getData(const string &id, DWORD &data) const
list<DataStore>::const_iterator it;
for(it=DataInfo.begin(); it != DataInfo.end(); ++it){
if (it->id==id){
data=DWORD(it->data);
data=DWORD(size_t(it->data));
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;
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);
hit = true;
}
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);
hit = true;
}
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);
if (it->isCheckbox) {
string tid = "T" + it->id;
@ -4247,19 +4243,23 @@ void gdioutput::RenderString(TextInfo &ti, HDC hDC)
}
}
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;
if (ti.format&textRight) {
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) {
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 {
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;
}
@ -5633,7 +5633,7 @@ wstring gdioutput::browseForFolder(const wstring &folderStart, const wchar_t *de
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)
@ -5664,8 +5664,8 @@ ToolInfo &gdioutput::addToolTip(const string &tipId, const wstring &tip, HWND hW
if (hWnd != 0) {
ti.uFlags = TTF_IDISHWND;
info.id = int(hWnd);
ti.uId = (UINT) hWnd;
info.id = uintptr_t(hWnd);
ti.uId = (UINT_PTR) hWnd;
}
else {
ti.uFlags = TTF_SUBCLASS;
@ -6900,7 +6900,7 @@ string gdioutput::dbSelect(const string &id, int data) {
if (!IsWindowEnabled(it->hWnd))
throw meosException("Selection " + id + " is not active.");
if (it->multipleSelection) {
map<int,int>::const_iterator res = it->data2Index.find(data);
auto res = it->data2Index.find(data);
if (res != it->data2Index.end())
SendMessage(it->hWnd, LB_SETSEL, true, res->second);
else
@ -7137,7 +7137,7 @@ DWORD gdioutput::selectColor(wstring &def, DWORD input) {
return -1;
}
void gdioutput::setAnimationMode(shared_ptr<AnimationData> &data) {
void gdioutput::setAnimationMode(const shared_ptr<AnimationData> &data) {
if (animationData && animationData->takeOver(data))
return;
animationData = data;

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -174,7 +174,7 @@ protected:
struct FucusInfo {
bool wasTabbed;
HWND hWnd;
FucusInfo() : wasTabbed(false), hWnd(false) {}
FucusInfo() : wasTabbed(false), hWnd(0) {}
FucusInfo(HWND wnd) : wasTabbed(false), hWnd(wnd) {}
};
@ -365,7 +365,7 @@ public:
DWORD getBGColor2() const;
const wstring &getBGImage() const;
void setAnimationMode(shared_ptr<AnimationData> &mode);
void setAnimationMode(const shared_ptr<AnimationData> &mode);
void setAutoScroll(double speed);
void getAutoScroll(double &speed, double &pos) const;
@ -533,11 +533,13 @@ public:
BaseInfo *setInputFocus(const string &id, bool select=false);
InputInfo *getInputFocus();
void enableInput(const char *id, bool acceptMissing = false) {setInputStatus(id, true, acceptMissing);}
void disableInput(const char *id, bool acceptMissing = false) {setInputStatus(id, false, acceptMissing);}
void setInputStatus(const char *id, bool status, bool acceptMissing = false);
void setInputStatus(const string &id, bool status, bool acceptMissing = false)
{setInputStatus(id.c_str(), status, acceptMissing);}
void enableInput(const char *id, bool acceptMissing = false,
int requireExtraMatch = -1) {setInputStatus(id, true, acceptMissing, requireExtraMatch);}
void disableInput(const char *id, bool acceptMissing = false,
int requireExtraMatch = -1) {setInputStatus(id, false, acceptMissing, requireExtraMatch);}
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 setData(const string &id, DWORD data);
@ -611,7 +613,7 @@ public:
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 {
return getBaseInfo(id.c_str());
@ -642,7 +644,7 @@ public:
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) {
return setText(narrow(id), text, update);
}

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -35,6 +35,10 @@ protected:
bool dataString;
public:
bool matchExtra(int requireExtraMatch) const {
return requireExtraMatch == -1 || requireExtraMatch == getExtraInt();
}
bool hasEventHandler() const {
return handler != 0;
}
@ -168,8 +172,8 @@ public:
wstring text;
wstring font;
int xp;
int yp;
int xp = -1;
int yp = -1;
int format;
DWORD color;
@ -179,8 +183,8 @@ public:
int absPrintY;
bool hasTimer;
DWORD zeroTime;
DWORD timeOut;
DWORD zeroTime = -1;
DWORD timeOut = 0;
bool hasCapture;
GUICALLBACK callBack;
@ -328,10 +332,10 @@ private:
bool isEditControl;
bool writeLock;
wstring original;
int originalIdx;
size_t originalIdx;
bool ignoreCheck; // True if changed-state should be ignored
map<int, int> data2Index;
map<size_t, int> data2Index;
// Synchronize with other list box
WNDPROC originalProc;
@ -428,7 +432,7 @@ struct ToolInfo {
string name;
TOOLINFOW ti;
wstring tip;
int id;
uintptr_t id;
};

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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;
}
GeneralResultCtr::GeneralResultCtr(wstring &file, const shared_ptr<DynamicResult> &ptrIn) {
GeneralResultCtr::GeneralResultCtr(const wstring &file, const shared_ptr<DynamicResult> &ptrIn) {
ptr = ptrIn;
name = ptrIn->getName(false);
tag = ptrIn->getTag();

View File

@ -2,7 +2,7 @@
/************************************************************************
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
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(wstring &file, const shared_ptr<DynamicResult> &ptr);
GeneralResultCtr(const wstring &file, const shared_ptr<DynamicResult> &ptr);
GeneralResultCtr() {}
~GeneralResultCtr();

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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) {
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);
for (int m = 0; m < period; m++)
pc->addStageCourse(leg, coursePattern[(patternStart + m)%period][leg], -1);
@ -2501,12 +2501,12 @@ pRunner IOF30Interface::readPerson(gdioutput &gdi, const xmlobject &person) {
if (!r) {
if ( pid > 0) {
oRunner or(&oe, pid);
r = oe.addRunner(or, true);
oRunner oR(&oe, pid);
r = oe.addRunner(oR, true);
}
else {
oRunner or(&oe);
r = oe.addRunner(or, true);
oRunner oR(&oe);
r = oe.addRunner(oR, true);
}
}
@ -2560,7 +2560,7 @@ pClub IOF30Interface::readOrganization(gdioutput &gdi, const xmlobject &xclub, b
if (clubId)
pc = oe.getClubCreate(clubId, name);
if (!pc) return false;
if (!pc) return nullptr;
}
else {
pc = new oClub(&oe, clubId);

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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);
}
int editListCB(gdioutput* gdi, int type, void* data);
void ListEditor::show(gdioutput &gdi) {
gdi.setRestorePoint("BeginListEdit");
@ -396,6 +398,13 @@ int ListEditor::editList(gdioutput &gdi, int type, BaseInfo &data) {
}*/
}
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());
getPosFromId(id, 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);
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);
bool force = saveListPost(gdi, mlp);
if (!gdi.hasData("NoRedraw") || force) {
gdi.restore("BeginListEdit", false);
@ -819,6 +780,60 @@ int ListEditor::editList(gdioutput &gdi, int type, BaseInfo &data) {
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 {
if (MetaList::isResultModuleOutput(newType)) {
int leg = gdi.getTextNo("Leg");
@ -891,9 +906,13 @@ void ListEditor::updateType(int iType, gdioutput & gdi) {
void ListEditor::checkUnsaved(gdioutput &gdi) {
if (gdi.hasData("IsEditing")) {
if (gdi.isInputChanged("")) {
gdi.setData("NoRedraw", 1);
gdi.sendCtrlMessage("Apply");
if (gdi.hasData("CurrentId")) {
DWORD id;
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")) {
@ -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:");
int maxX = gdi.getCX();
gdi.popX();
gdi.dropLine(3);
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.addItem("Fonts", fonts);
gdi.selectItemByData("Fonts", currentFont);
int maxX = gdi.getCX();
maxX = max(maxX, gdi.getCX());
gdi.popX();
gdi.dropLine(3);

View File

@ -2,7 +2,7 @@
/************************************************************************
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
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);
void updateType(int iType, gdioutput &gdi);
bool saveListPost(gdioutput &gdi, MetaListPost &mlp);
ButtonInfo &addButton(gdioutput &gdi, const MetaListPost &mlp, int x, int y,
int lineIx, int ix) const;

View File

@ -1,6 +1,6 @@
/********************i****************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
#pragma once
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -4,6 +4,8 @@
#include "meos_util.h"
#include "xmlparser.h"
#include "gdioutput.h"
#include "TabAuto.h"
int MachineContainer::AbstractMachine::getInt(const string &v) const {
return _wtoi(getString(v).c_str());
}
@ -20,7 +22,7 @@ vector<int> MachineContainer::AbstractMachine::getVectorInt(const string &v) con
vector<wstring> sp;
split(s, L",", sp);
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());
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) {
wstring &r = props[name];
for (int j = 0; j < v.size(); j++) {
for (size_t j = 0; j < v.size(); j++) {
if (j == 0)
r = itow(v[j]);
else
@ -66,7 +68,7 @@ namespace {
string encode(const string &in) {
string out;
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] == '%') {
out.push_back('%');
if (in[j] == '|')
@ -85,14 +87,14 @@ namespace {
string decode(const string &in) {
string out;
out.reserve(in.length());
for (int j = 0; j < in.length(); j++) {
for (size_t j = 0; j < in.length(); j++) {
if (in[j] == '%') {
j++;
if (j < in.length()) {
if (in[j] == '1')
out.push_back('|');
else if (in[j] == '2')
out.push_back('§');
out.push_back('$');
else if (in[j] == '3')
out.push_back('%');
}
@ -168,8 +170,19 @@ void MachineContainer::save(xmlparser &data) {
void MachineContainer::load(const string &data) {
vector<string> 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];
if (AutoMachine::getType(type) == Machines::Unknown)
continue;
wstring tag = gdioutput::fromUTF8(decode(parts[j + 1]));
auto res = machines.emplace(make_pair(type, tag), MachineContainer::AbstractMachine());
if (res.second)
@ -200,3 +213,13 @@ string MachineContainer::save() {
}
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);
}
}
}

View File

@ -64,6 +64,8 @@ public:
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) {
auto &m = machines[make_pair(type, name)];
m.clear();

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -118,7 +118,7 @@ HWND hMainTab=NULL;
list<TabObject> *tabList = nullptr;
void scrollVertical(gdioutput *gdi, int yInc, HWND hWnd);
static int currentFocusIx = 0;
static size_t currentFocusIx = 0;
void resetSaveTimer() {
if (autoTask)

View File

@ -169,7 +169,7 @@ BEGIN
VALUE "FileDescription", "meos"
VALUE "FileVersion", "3.8.0.1"
VALUE "InternalName", "meos"
VALUE "LegalCopyright", "Copyright © 2007-2021"
VALUE "LegalCopyright", "Copyright © 2007-2022"
VALUE "OriginalFilename", "meos.exe"
VALUE "ProductName", " meos"
VALUE "ProductVersion", "3.8.0.1"

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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(),
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();
}

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -25,10 +25,7 @@
class meosException : public std::exception {
wstring wideMessage;
static const char *narrow(const wstring &msg) {
static string nmsg(msg.begin(), msg.end());
return nmsg.c_str();
}
static const char *narrow(const wstring& msg);
public:
meosException(const wstring &wmsg) : std::exception(narrow(wmsg)), wideMessage(wmsg) {

View File

@ -29,7 +29,6 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{B854EF2A-2BB7-4D62-B08B-96BD64B347E8}</ProjectGuid>
<RootNamespace>meos</RootNamespace>
<WindowsTargetPlatformVersion>5.01</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='test|Win32'" Label="Configuration">
@ -68,7 +67,7 @@
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -218,13 +217,14 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\Release/meos.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<PrecompiledHeaderOutputFile>.\x64/meos.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>./x64/Release/</AssemblerListingLocation>
<ObjectFileName>./x64/Release/</ObjectFileName>
<ProgramDataBaseFileName>./x64/Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>4091;4267</DisableSpecificWarnings>
<BrowseInformation>false</BrowseInformation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -235,13 +235,14 @@
<OutputFile>$(TargetPath)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>./lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>.\Release/meos.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>./x64/Release/meos.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<DataExecutionPrevention>false</DataExecutionPrevention>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<SetChecksum>true</SetChecksum>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
@ -328,9 +329,9 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\Debug/meos.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<AssemblerListingLocation>./x64/Debug/</AssemblerListingLocation>
<ObjectFileName>./x64/Debug/</ObjectFileName>
<ProgramDataBaseFileName>./x64/Debug/</ProgramDataBaseFileName>
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
@ -344,18 +345,17 @@
</ResourceCompile>
<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>
<OutputFile>.\Debug/meos.exe</OutputFile>
<OutputFile>./x64/Debug/meos.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>./lib_db;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/meos.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>./x64/Debug/meos.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<AdditionalOptions>/FORCE:MULTIPLE %(AdditionalOptions)</AdditionalOptions>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -25,17 +25,17 @@
//ABCDEFGHIJKLMNO
int getMeosBuild() {
string revision("$Rev: 1103 $");
string revision("$Rev: 1116 $");
return 174 + atoi(revision.substr(5, string::npos).c_str());
}
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);
}
wstring getBuildType() {
return L"Beta II"; // No parantheses (...)
return L"RC2"; // No parantheses (...)
}
wstring getMajorVersion() {
@ -68,38 +68,7 @@ wstring getMeosCompectVersion() {
void getSupporters(vector<wstring> &supp, vector<wstring> &developSupp)
{
supp.emplace_back(L"Tjalve IF");
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");
developSupp.emplace_back(L"Almby IK, Örebro");//2019--
supp.emplace_back(L"Ligue PACA");
supp.emplace_back(L"SC vebr-sport");
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"Hans Wilhelmsson, Säffle OK");
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());
}

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by
@ -41,8 +41,6 @@
extern oEvent *gEvent;
const int MAXLISTPARAMID = 10000000;
using namespace tr1;
class PositionVer2 {
struct Block {
@ -170,7 +168,7 @@ public:
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;
string bestName;
@ -188,7 +186,10 @@ public:
}
}
}
if (bestName.empty())
return false;
addAlignWith(bestName, newName, width, indent, false);
return true;
}
@ -202,7 +203,7 @@ public:
}
int get(const string &name, double scale) const {
auto &r = pmap.find(name);
auto r = pmap.find(name);
if (r != pmap.end())
return int(blocks[r->second.first][r->second.second].getPos() * scale);
return 0;
@ -213,7 +214,7 @@ public:
}
int getOriginalPos(const string &name, double scale) const {
auto &r = pmap.find(name);
auto r = pmap.find(name);
if (r != pmap.end())
return int(blocks[r->second.first][r->second.second].getOriginalPos() * scale);
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)));
kk++;
}
if (mp.limitWidth && mp.blockWidth > 0)
width = gdi.scaleLength(mp.blockWidth);
else
width = li.getMaxCharWidth(oe, gdi, par.selection, typeFormats, font,
oPrintPost::encodeFont(fontFaces[i].font,
fontFaces[i].scale).c_str(),
@ -763,9 +766,11 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
}
else {
if (mp.alignType == lAlignNext)
pos.addAlignNext(label, width, mp.minimalIndent);
if (mp.alignType == lAlignNext) {
if (!pos.addAlignNext(label, width, mp.minimalIndent))
pos.add(label, width, mp.minimalIndent, mp.packPrevious);
//pos.alignNext(label, width, mp.alignBlock);
}
else if (mp.alignType == lString) {
if (stringLabelMap.count(mp.alignWithText) == 0) {
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;
if (!mp.mergeWithPrevious)
base = &added;
added.useStrictWidth = mp.getLimitBlockWidth();
if (added.useStrictWidth)
added.format |= textLimitEllipsis;
if (last && mp.mergeWithPrevious) {
//last->mergeWith = &added;
@ -926,6 +934,10 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
if (!mp.mergeWithPrevious)
base = &added;
added.useStrictWidth = mp.getLimitBlockWidth();
if (added.useStrictWidth)
added.format |= textLimitEllipsis;
if (last && mp.mergeWithPrevious) {
//last->mergeWith = &added;
last->doMergeNext = true;
@ -969,6 +981,9 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
added.resultModuleIndex = getResultModuleIndex(oe, li, mp);
setFixedWidth(added, indexPosToWidth, 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;
if (!mp.mergeWithPrevious)
@ -1024,6 +1039,9 @@ void MetaList::interpret(oEvent *oe, const gdioutput &gdi, const oListParam &par
added.resultModuleIndex = getResultModuleIndex(oe, li, mp);
setFixedWidth(added, indexPosToWidth, 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) {
last->doMergeNext = true;

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -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(ResultBase &r) : con(r.con) {
ResultBase::ResultBase(ResultBase &&r) : con(r.con) {
result = r.result;
r.result = nullptr;
}
const ResultBase &ResultBase::operator=(ResultBase &r) {
const ResultBase &ResultBase::operator=(ResultBase &&r) {
con = r.con;
if (result)
mysql_free_result(result);

View File

@ -55,8 +55,10 @@ namespace sqlwrapper {
friend class QueryWrapper;
friend class RowWrapper;
public:
ResultBase(ResultBase &r);
const ResultBase &operator=(ResultBase &);
ResultBase(ResultBase &&r);
const ResultBase &operator=(ResultBase &&);
ResultBase(const ResultBase& r) = delete;
const ResultBase& operator=(const ResultBase&) = delete;
virtual ~ResultBase();
int field_num(const string &field);
@ -69,11 +71,13 @@ namespace sqlwrapper {
friend class RowWrapper;
public:
ResultWrapper() : ResultBase(nullptr, nullptr) {}
ResultWrapper(ResultWrapper &r) : ResultBase(r) {}
const ResultBase &operator=(ResultBase &r) {
ResultBase::operator=(r);
ResultWrapper(ResultWrapper &&r) : ResultBase(std::move(r)) {}
ResultWrapper(const ResultWrapper& r) = delete;
const ResultBase &operator=(ResultWrapper &&r) {
ResultBase::operator=(std::move(r));
return *this;
}
const ResultBase& operator=(const ResultBase& r) = delete;
//ResultWrapper(ResultWrapper &r);
//~ResultWrapper();
@ -90,11 +94,13 @@ namespace sqlwrapper {
friend class QueryWrapper;
friend class RowWrapper;
public:
ResUseWrapper(ResUseWrapper &r) : ResultBase(r) {}
const ResUseWrapper &operator=(ResUseWrapper &r) {
ResultBase::operator=(r);
ResUseWrapper(ResUseWrapper&& r) : ResultBase(std::move(r)) {}
const ResUseWrapper& operator=(ResUseWrapper&& r) {
ResultBase::operator=(std::move(r));
return *this;
}
ResUseWrapper(const ResUseWrapper& r) = delete;
const ResUseWrapper& operator=(const ResUseWrapper& r) = delete;
operator bool() const;
RowWrapper fetch_row();

View File

@ -1,6 +1,6 @@
/************************************************************************
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
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/************************************************************************
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
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