Do not process Rank widget (don't use RankScoreFormatter); Plus other minimal changes to compile without '/std17++'
This commit is contained in:
parent
539a1a0fbb
commit
c5ddfd83ad
@ -53,7 +53,7 @@
|
||||
#include "RunnerDB.h"
|
||||
|
||||
int SportIdentCB(gdioutput *gdi, GuiEventType type, BaseInfo *data);
|
||||
shared_ptr<RankScoreFormatter> TabRunner::rankFormatter;
|
||||
//shared_ptr<RankScoreFormatter> TabRunner::rankFormatter;
|
||||
|
||||
TabRunner::TabRunner(oEvent *poe):TabBase(poe) {
|
||||
clearCompetitionData();
|
||||
@ -111,7 +111,8 @@ void TabRunner::enableControlButtons(gdioutput &gdi, bool enable, bool vacant)
|
||||
}
|
||||
|
||||
void TabRunner::selectRunner(gdioutput &gdi, pRunner r) {
|
||||
if (gdioutput* gdi_comments = getExtraWindow("comments", false); gdi_comments)
|
||||
gdioutput* gdi_comments = getExtraWindow("comments", false);
|
||||
if ( gdi_comments)
|
||||
gdi_comments->closeWindow();
|
||||
|
||||
if (!r) {
|
||||
@ -1426,10 +1427,12 @@ int TabRunner::runnerCB(gdioutput &gdi, GuiEventType type, BaseInfo* data) {
|
||||
}
|
||||
}
|
||||
else if (type==GUI_CLEAR) {
|
||||
if (gdioutput* gdi_settings = getExtraWindow("ecosettings", false); gdi_settings)
|
||||
gdioutput* gdi_settings = getExtraWindow("ecosettings", false);
|
||||
if ( gdi_settings)
|
||||
gdi_settings->closeWindow();
|
||||
|
||||
if (gdioutput* gdi_settings = getExtraWindow("comments", false); gdi_settings)
|
||||
/*gdioutput**/ gdi_settings = getExtraWindow("comments", false);
|
||||
if ( gdi_settings)
|
||||
gdi_settings->closeWindow();
|
||||
|
||||
if (runnerId>0 && currentMode == 0)
|
||||
@ -3261,18 +3264,24 @@ int TabRunner::addExtraFields(const oEvent &oe, gdioutput& gdi, oEvent::ExtraFie
|
||||
newLine();
|
||||
}
|
||||
|
||||
if (auto res = extraFields.find(oEvent::ExtraFields::DataA); res != extraFields.end()) {
|
||||
addLabel(L"#" + ensureEndingColon(res->second));
|
||||
gdi.addInput("DataA", L"", 8);
|
||||
colCount++;
|
||||
newLine();
|
||||
{
|
||||
auto res = extraFields.find(oEvent::ExtraFields::DataA);
|
||||
if (res != extraFields.end()) {
|
||||
addLabel(L"#" + ensureEndingColon(res->second));
|
||||
gdi.addInput("DataA", L"", 8);
|
||||
colCount++;
|
||||
newLine();
|
||||
}
|
||||
}
|
||||
|
||||
if (auto res = extraFields.find(oEvent::ExtraFields::DataB); res != extraFields.end()) {
|
||||
addLabel(L"#" + ensureEndingColon(res->second));
|
||||
gdi.addInput("DataB", L"", 8, nullptr);
|
||||
colCount++;
|
||||
newLine();
|
||||
{
|
||||
auto res = extraFields.find(oEvent::ExtraFields::DataB);
|
||||
if ( res != extraFields.end()) {
|
||||
addLabel(L"#" + ensureEndingColon(res->second));
|
||||
gdi.addInput("DataB", L"", 8, nullptr);
|
||||
colCount++;
|
||||
newLine();
|
||||
}
|
||||
}
|
||||
|
||||
if (extraFields.count(oEvent::ExtraFields::Nationality)) {
|
||||
@ -3289,15 +3298,19 @@ int TabRunner::addExtraFields(const oEvent &oe, gdioutput& gdi, oEvent::ExtraFie
|
||||
newLine();
|
||||
}
|
||||
|
||||
if (auto res = extraFields.find(oEvent::ExtraFields::TextA); res != extraFields.end()) {
|
||||
if (colCount > 0)
|
||||
colCount++;
|
||||
|
||||
newLine();
|
||||
{
|
||||
auto res = extraFields.find(oEvent::ExtraFields::TextA);
|
||||
if (res != extraFields.end()) {
|
||||
if (colCount > 0)
|
||||
colCount++;
|
||||
|
||||
addLabel(L"#" + ensureEndingColon(res->second));
|
||||
gdi.addInput("TextA", L"", 20);
|
||||
colCount = 2;
|
||||
newLine();
|
||||
|
||||
addLabel(L"#" + ensureEndingColon(res->second));
|
||||
gdi.addInput("TextA", L"", 20);
|
||||
colCount = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (colCount > 0)
|
||||
@ -3329,12 +3342,12 @@ void TabRunner::loadExtraFields(gdioutput& gdi, const oBase* r) {
|
||||
if (gdi.hasWidget("Phone"))
|
||||
gdi.setText("Phone", r ? r->getDCI().getString("Phone") : L"");
|
||||
|
||||
if (gdi.hasWidget("Rank")) {
|
||||
wstring out;
|
||||
if (r)
|
||||
out = rankFormatter->formatData(r);
|
||||
gdi.setText("Rank", out);
|
||||
}
|
||||
//if (gdi.hasWidget("Rank")) {
|
||||
// wstring out;
|
||||
// if (r)
|
||||
// out = rankFormatter->formatData(r);
|
||||
// gdi.setText("Rank", out);
|
||||
//}
|
||||
}
|
||||
|
||||
void TabRunner::saveExtraFields(gdioutput& gdi, oBase &r) {
|
||||
@ -3361,10 +3374,10 @@ void TabRunner::saveExtraFields(gdioutput& gdi, oBase &r) {
|
||||
if (gdi.hasWidget("Phone"))
|
||||
di.setString("Phone", gdi.getText("Phone"));
|
||||
|
||||
if (gdi.hasWidget("Rank")) {
|
||||
wstring out;
|
||||
rankFormatter->setData(&r, gdi.getText("Rank"), out, 0);
|
||||
}
|
||||
//if (gdi.hasWidget("Rank")) {
|
||||
// wstring out;
|
||||
// rankFormatter->setData(&r, gdi.getText("Rank"), out, 0);
|
||||
//}
|
||||
// di.setInt("Rank", gdi.getTextNo("Rank"));
|
||||
}
|
||||
|
||||
@ -3552,7 +3565,7 @@ void TabRunner::clearCompetitionData() {
|
||||
timeToFill = 0;
|
||||
ownWindow = false;
|
||||
listenToPunches = false;
|
||||
rankFormatter = make_shared<RankScoreFormatter>();
|
||||
//rankFormatter = make_shared<RankScoreFormatter>();
|
||||
}
|
||||
|
||||
void TabRunner::autoGrowCourse(gdioutput &gdi) {
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
class Table;
|
||||
struct AutoCompleteRecord;
|
||||
class RankScoreFormatter;
|
||||
//class RankScoreFormatter;
|
||||
|
||||
class TabRunner :
|
||||
public TabBase, AutoCompleteHandler
|
||||
@ -88,7 +88,7 @@ private:
|
||||
bool savePunchTime(pRunner r, gdioutput &gdi);
|
||||
|
||||
PrinterObject splitPrinter;
|
||||
static shared_ptr<RankScoreFormatter> rankFormatter;
|
||||
//static shared_ptr<RankScoreFormatter> rankFormatter;
|
||||
|
||||
void showRunnerReport(gdioutput &gdi);
|
||||
|
||||
|
||||
@ -263,7 +263,7 @@ oEvent::oEvent(gdioutput &gdi):oBase(0), gdibase(gdi)
|
||||
oRunnerData->addVariableCurrency("Taxable", "Skattad avgift");
|
||||
oRunnerData->addVariableInt("BirthYear", oDataContainer::oISDateOrYear, "RunnerBirthDate");
|
||||
oRunnerData->addVariableString("Bib", 8, "Nummerlapp").zeroSortPadding = 5;
|
||||
oRunnerData->addVariableInt("Rank", oDataContainer::oIS32, "Ranking", make_shared<RankScoreFormatter>());
|
||||
//oRunnerData->addVariableInt("Rank", oDataContainer::oIS32, "Ranking", make_shared<RankScoreFormatter>());
|
||||
|
||||
oRunnerData->addVariableDate("EntryDate", "Anm. datum");
|
||||
oRunnerData->addVariableInt("EntryTime", oDataContainer::oISTime, "Anm. tid", make_shared<AbsoluteTimeFormatter>("EntryTime"));
|
||||
@ -6801,13 +6801,16 @@ void oEvent::updateExtraFields(ExtraFieldContext context, const map<ExtraFields,
|
||||
continue;
|
||||
if (cc.first != context)
|
||||
spOut.push_back(w); // Not touched
|
||||
else if (auto res = fields.find(cc.second); res != fields.end()) {
|
||||
// Update definition
|
||||
wstring w2 = itow(encodeExtra(cc.first, cc.second));
|
||||
if (!res->second.empty())
|
||||
w2 += L";" + res->second;
|
||||
spOut.push_back(w2);
|
||||
used.insert(cc.second);
|
||||
else {
|
||||
auto res = fields.find(cc.second);
|
||||
if (res != fields.end()) {
|
||||
// Update definition
|
||||
wstring w2 = itow(encodeExtra(cc.first, cc.second));
|
||||
if (!res->second.empty())
|
||||
w2 += L";" + res->second;
|
||||
spOut.push_back(w2);
|
||||
used.insert(cc.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user