]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xforms_helpers.C
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / xforms_helpers.C
index b55ee03351f9799872196fed8e604b3095ee3b10..1fe3d7bac36af3c6fae890f01bf066bd2de2bac7 100644 (file)
 #include "support/filetools.h"
 #include "support/lstrings.h" // frontStrip, strip
 
-#include <algorithm>
 #include <fstream>
-#include <vector>
 
 #include FORMS_H_LOCATION
+#include "combox.h"
 
 using std::ofstream;
 using std::pair;
 using std::vector;
+using std::make_pair;
 
 bool isActive(FL_OBJECT * ob)
 {
        return ob && ob->active > 0;
 }
 
+std::pair<string, string> parse_shortcut(string const & str)
+{
+       string::size_type i = str.find_first_of("&");
+       if (i == string::npos || i == str.length() - 1)
+               return make_pair(str, string());
+
+       // FIXME: handle &&
+
+       string::value_type c = str[i + 1];
+       return make_pair(str.substr(0, i) + str.substr(i + 1),
+                        string("#") + c);
+}
+
 
 // A wrapper for the xforms routine, but this one accepts uint args
 unsigned long fl_getmcolor(int i,
@@ -119,6 +132,10 @@ string const getString(FL_OBJECT * ob, int line)
                        tmp = fl_get_choice_item_text(ob, line);
                break;
 
+       case FL_COMBOX:
+               tmp = fl_get_combox_text(ob);
+               break;
+
        default:
                lyx::Assert(0);
        }
@@ -160,7 +177,7 @@ void updateWidgetsFromLengthString(FL_OBJECT * input, FL_OBJECT * choice,
                fl_set_choice_text(choice, default_unit.c_str());
        } else {
                updateWidgetsFromLength(input, choice,
-                               LyXLength(str), default_unit);
+                                       LyXLength(str), default_unit);
        }
 }