@@ -2969,10 +2969,9 @@ void options::CreatePanel_Advanced(size_t parent, int border_size,
29692969 OpenGLSizer->Add (pOpenGL, inputFlags);
29702970 pOpenGL->Enable (!g_bdisable_opengl && g_Platform->IsGLCapable ());
29712971
2972- wxButton * bOpenGL = new wxButton (m_ChartDisplayPage, ID_OPENGLOPTIONS,
2973- _ (" OpenGL Options" ) + " ..." );
2972+ auto * bOpenGL = new wxButton (m_ChartDisplayPage, ID_OPENGLOPTIONS,
2973+ _ (" OpenGL Options" ) + " ..." );
29742974 OpenGLSizer->Add (bOpenGL, inputFlags);
2975- bOpenGL->Enable (!g_bdisable_opengl && g_Platform->IsGLCapable ());
29762975
29772976 pOpenGL->Connect (wxEVT_COMMAND_CHECKBOX_CLICKED,
29782977 wxCommandEventHandler (options::OnGLClicked), NULL , this );
@@ -3309,10 +3308,9 @@ With a higher value, the same zoom level shows a more detailed chart."));
33093308 pOpenGL->Disable ();
33103309#endif
33113310
3312- wxButton * bOpenGL = new wxButton (m_ChartDisplayPage, ID_OPENGLOPTIONS,
3313- _ (" Options" ) + " ..." );
3311+ auto * bOpenGL = new wxButton (m_ChartDisplayPage, ID_OPENGLOPTIONS,
3312+ _ (" Options" ) + " ..." );
33143313 OpenGLSizer->Add (bOpenGL, inputFlags);
3315- bOpenGL->Enable (!g_bdisable_opengl && g_Platform->IsGLCapable ());
33163314
33173315 // spacer
33183316 itemBoxSizerUI->Add (0 , border_size * 3 );
@@ -6303,6 +6301,8 @@ void options::SetInitialSettings() {
63036301 pInlandEcdis->SetValue (g_bInlandEcdis);
63046302#ifdef ocpnUSE_GL
63056303 pOpenGL->SetValue (g_bopengl);
6304+ if (auto * w = wxWindow::FindWindowById (ID_OPENGLOPTIONS))
6305+ w->Enable (pOpenGL->IsChecked ());
63066306#endif
63076307 if (pSmoothPanZoom) pSmoothPanZoom->SetValue (g_bsmoothpanzoom);
63086308 pCBTrueShow->SetValue (g_bShowTrue);
@@ -6912,6 +6912,8 @@ void options::OnWaypointRangeRingSelect(wxCommandEvent& event) {
69126912void options::OnGLClicked (wxCommandEvent& event) {
69136913 // if (!g_bTransparentToolbarInOpenGLOK)
69146914 // pTransparentToolbar->Enable(!pOpenGL->GetValue());
6915+ if (auto * w = wxWindow::FindWindowById (ID_OPENGLOPTIONS))
6916+ w->Enable (pOpenGL->IsChecked ());
69156917}
69166918
69176919void options::OnOpenGLOptions (wxCommandEvent& event) {
0 commit comments