25 #ifndef _N0183_DLG_CTX_FACTORY_H__
26 #define _N0183_DLG_CTX_FACTORY_H__
30 #include <wx/string.h>
33 #include "SendToGpsDlg.h"
34 #include "model/comm_n0183_output.h"
36 static bool ConfirmOverwrite() {
37 int r = OCPNMessageBox(NULL, _(
"Overwrite Garmin device route number 1?"),
39 wxOK | wxCANCEL | wxICON_QUESTION);
46 dlg_ctx.set_value = [dialog](
int v) {
47 if (!dialog || !dialog->GetProgressGauge())
return;
48 dialog->GetProgressGauge()->SetValue(v);
49 dialog->GetProgressGauge()->Refresh();
50 dialog->GetProgressGauge()->Update();
52 dlg_ctx.set_range = [dialog](
int r) {
53 if (!dialog || !dialog->GetProgressGauge())
return;
54 dialog->GetProgressGauge()->SetRange(r); };
55 dlg_ctx.pulse = [dialog](void) {
56 if (!dialog || !dialog->GetProgressGauge())
return;
57 dialog->GetProgressGauge()->Pulse(); };
59 [dialog](
const std::string& s) { dialog->SetMessage(wxString(s)); };
60 dlg_ctx.confirm_overwrite = []() {
return ConfirmOverwrite(); };
Route "Send to GPS..." Dialog Definition.
General purpose GUI support.