Description: Modifications to src/MyTab.cpp
 Fix spelling error: 'Strenght' instead of 'Strength'
Author: Morten Kjeldgaard <mok@bioxray.au.dk>
Author: Graham Inggs <ginggs@debian.org>
Last-Update: 2021-10-04

--- a/src/MyTab.cpp
+++ b/src/MyTab.cpp
@@ -28,7 +28,7 @@
 // GEOM TAB
 ////////////
 
-enum{ ID_SetBallnstick=500, ID_SetSpacefill, ID_SetLicorice,
+static enum { ID_SetBallnstick=500, ID_SetSpacefill, ID_SetLicorice,
       ID_SetLicoriceRadius, ID_SetBallnstickRadius, 
       
       ID_SetBallnstickSmoothcolor,ID_SetBallnstickBicolor, ID_SetBallnstickConstantcolor,
@@ -93,7 +93,8 @@
 static wxCheckBox  *buttonSetHetatm;
 
 static wxSlider *sliderLicorice, *sliderBallnstick,
-                *sliderSetBaseColor , *sliderShineSize,
+              //*sliderSetBaseColor ,
+                *sliderShineSize,
                 *sliderAwaren , 
                 *sliderSetBgbrightness,
                 *sliderLightBase, *sliderLighting, *sliderAO,
@@ -114,49 +115,49 @@
 const int NPreset=15;
 static wxButton* preset[NPreset];
 
-static char* presetFile[NPreset] = {
-  "presets//real.preset",
-  "presets//real2.preset",
-  "presets//direct.preset",
-  
-  "presets//illustr.preset",
-  "presets//illustr_new.preset",
-  "presets//illustr_motm.preset",
-
-  "presets//qutemol1.preset",
-  "presets//qutemol2.preset",
-  "presets//qutemol3.preset",
-  
-  "presets//coolb.preset",
-  "presets//coold.preset",
-  "presets//borders_cool.preset",
-  
-  "presets//sem.preset",
-  "presets//sem2.preset",
-  "presets//shape.preset",
+static const char* presetFile[NPreset] = {
+  "real.preset",
+  "real2.preset",
+  "direct.preset",
+
+  "illustr.preset",
+  "illustr_new.preset",
+  "illustr_motm.preset",
+
+  "qutemol1.preset",
+  "qutemol2.preset",
+  "qutemol3.preset",
+
+  "coolb.preset",
+  "coold.preset",
+  "borders_cool.preset",
+
+  "sem.preset",
+  "sem2.preset",
+  "shape.preset",
 };
 
 
-static wxString presetName[NPreset]={
-  _T("Realistic\n1"),
-  _T("Realistic\n2"),
-  _T("Direct\nLight Only"),
-  
-  _T("Illustr-\native 1"),
-  _T("Illustr-\native 2"),
-  _T("Molecule of\nthe Month"),
-
-  _T("Mixed 1"),
-  _T("Mixed 2"),
-  _T("Mixed 3"),
-  
-  _T("Cool\n(bright)"),
-  _T("Cool\n(dark)"),
-  _T("Cool\nborders"),
-  
-  _T("Simulated\nS.E.M. 1"),
-  _T("Simulated\nS.E.M. 2"),
-  _T("Shape\nPerception"),
+static const char* presetName[NPreset]={
+  "Realistic 1",
+  "Realistic 2",
+  "Direct\nLight Only",
+
+  "Illustr-\native 1",
+  "Illustr-\native 2",
+  "Molecule of\nthe Month",
+
+  "Mixed 1",
+  "Mixed 2",
+  "Mixed 3",
+
+  "Cool\n(bright)",
+  "Cool\n(dark)",
+  "Cool\nborders",
+
+  "Simulated\nS.E.M. 1",
+  "Simulated\nS.E.M. 2",
+  "Shape\nPerception"
 };
 
 static bool presetEndOfLine[NPreset] = {
@@ -490,9 +491,9 @@
   default:
     int pid=id-ID_FirstPreset;
     if ( (pid>=0) && (pid<NPreset) ) {
-#ifdef __DARWIN__
-			wxString presetPath = wxStandardPaths::Get().GetResourcesDir() + "/" + presetFile[pid];
-			if (!cgSettings.Load( presetPath.c_str() )) {
+#ifndef _WIN32
+      wxString presetPath = _T(PKGDATADIR"/presets/") + wxString::FromAscii(presetFile[pid]);
+      if (!cgSettings.Load( (const char *)presetPath.ToAscii() )) {
 #else
       if (!cgSettings.Load( presetFile[pid] )) {
 #endif			
@@ -815,11 +816,16 @@
 wxString noNewLine(wxString x){
   static wxString res;
   res.Clear();
-  for (int i=0; i<x.Length(); i++){
-    if ((x[i]=='-')&&(x[i+1]=='\n')) i++;
-    else 
-    if (x[i]=='\n') res.sprintf("%s ",res.ToAscii());
-    else res.sprintf("%s%c",res.ToAscii(),x[i]);
+
+  for (int i=0; i< (int)x.Length(); i++){
+    if ((x[i]=='-')&&(x[i+1]=='\n')) {
+      i++; i++;
+    }
+    if (x[i] != '\n') {
+      res.Append(x[i]);
+    } else {
+      res.Append(' ');
+    }
   }
   return res;
 }
@@ -828,10 +834,10 @@
                                                  /*wxNO_FULL_REPAINT_ON_RESIZE |*/ wxCLIP_CHILDREN | wxTAB_TRAVERSAL)
 {
   
-  int i;
+  //int i;
   
   bool thinButtons=false;
-#ifdef __DARWIN__
+#ifndef _WIN32
   thinButtons=true; // unsupported newlines in wxButtons under MAC! :(
 #endif
 
@@ -846,11 +852,20 @@
     else butSize= wxSize(70,50);
     
     for (int i=0; i<NPreset; i++) {
+      printf ("presetname: %s\n", presetName[i]);
+      /*
       preset[i]=new wxButton(this, ID_FirstPreset + i, 
-        thinButtons?noNewLine(presetName[i]):presetName[i], 
+			     thinButtons? noNewLine(wxString::FromAscii(presetName[i])):wxString::FromAscii(presetName[i]),
         wxDefaultPosition); //, butSize );
+      */
+      preset[i] = new wxButton(this,
+			       ID_FirstPreset + i,
+			       noNewLine(wxString::FromAscii(presetName[i])),
+			       wxDefaultPosition);
+
       preset[i]->SetMinSize(butSize);
-      if (presetName[i]==wxEmptyString) preset[i]->Show(false);
+      //if (presetName[i]==wxEmptyString) preset[i]->Show(false);
+      if (!presetName[i]) preset[i]->Show(false);
       if (thinButtons) {
         if (!subSizer) subSizer=new wxBoxSizer(wxHORIZONTAL);
         subSizer->Add( preset[i], 1, wxALIGN_CENTER|wxEXPAND|wxALL,4 );
@@ -1016,7 +1031,7 @@
     sizer->Add(5,5,0); // spacer
     sizer->Add(newAutoCheckBox( 
        this,ID_SetHetatm,
-        _T("Show 'HET' atmos"), 
+        _T("Show 'HET' atoms"),
         &(geoSettings.showHetatm),
         buttonSetHetatm, textSetHetatm,
         AUTO_TEXT_ON_RIGHT
@@ -1144,7 +1159,7 @@
     
     sizerDB->Add(newAutoSlider( 
         this, ID_SetFog,
-        _T("Strenght:"), 
+        _T("Strength:"),
         &(cgSettings.P_fog)
       ), 0 , wxALIGN_RIGHT );
 
@@ -1161,7 +1176,7 @@
 
     sizerHA->Add(newAutoSlider( 
         this, ID_SetHaloStr,
-        _T("Strenght:"), 
+        _T("Strength:"),
         &(cgSettings.P_halo_str),
         sliderHaloStr, textHaloStr
       ), 0 , wxALIGN_RIGHT );
