]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xform_helpers.C
try this for distinguishing inner and outer tabs
[lyx.git] / src / frontends / xforms / xform_helpers.C
index 3bea5a68b63b43169877d92431d4aac94275f32c..92462f435ff5a1c0c62b0fcc0f2a7b8c8a308cef 100644 (file)
@@ -5,13 +5,14 @@
 
 #include FORMS_H_LOCATION
 
+#include <fstream> // ofstream
+#include <vector>
+
 #ifdef __GNUG_
 #pragma implementation
 #endif
 
-#include <vector>
 #include "xform_helpers.h"
-#include <fstream> // ofstream
 #include "lyxlex.h"
 #include "filedlg.h" // LyXFileDlg
 #include "support/FileInfo.h"
@@ -24,10 +25,10 @@ using std::pair;
 using std::vector;
 
 // Take a string and add breaks so that it fits into a desired label width, w
-string formatted( string const & sin, int w, int size, int style )
+string formatted(string const & sin, int w, int size, int style)
 {
        string sout;
-       if (sin.empty() ) return sout;
+       if (sin.empty()) return sout;
 
        // break sin up into a vector of individual words
        vector<string> sentence;
@@ -69,35 +70,35 @@ string formatted( string const & sin, int w, int size, int style )
 }
 
 
-string const browseFile( string const & filename,
-                        string const & title,
-                        string const & pattern, 
-                        pair<string,string> const & dir1,
-                        pair<string,string> const & dir2 )
+string const browseFile(string const & filename,
+                       string const & title,
+                       string const & pattern, 
+                       pair<string,string> const & dir1,
+                       pair<string,string> const & dir2)
 {
        string lastPath = ".";
-       if( !filename.empty() ) lastPath = OnlyPath(filename);
+       if (!filename.empty()) lastPath = OnlyPath(filename);
 
        LyXFileDlg fileDlg;
 
-       if( !dir1.second.empty() ) {
-               FileInfo fileInfo( dir1.second );
-               if( fileInfo.isOK() && fileInfo.isDir() )
-                       fileDlg.SetButton( 0, dir1.first, dir1.second );
+       if (!dir1.second.empty()) {
+               FileInfo fileInfo(dir1.second);
+               if (fileInfo.isOK() && fileInfo.isDir())
+                       fileDlg.SetButton(0, _(dir1.first), dir1.second);
        }
 
-       if( !dir2.second.empty() ) {
-               FileInfo fileInfo( dir2.second );
-               if( fileInfo.isOK() && fileInfo.isDir() )
-                   fileDlg.SetButton( 1, dir2.first, dir2.second );
+       if (!dir2.second.empty()) {
+               FileInfo fileInfo(dir2.second);
+               if (fileInfo.isOK() && fileInfo.isDir())
+                   fileDlg.SetButton(1, _(dir2.first), dir2.second);
        }
 
        bool error = false;
        string buf;
        do {
-               string p = fileDlg.Select(title,
+               string p = fileDlg.Select(_(title),
                                          lastPath,
-                                         pattern, filename );
+                                         pattern, OnlyFilename(filename));
 
                if (p.empty()) return p;
 
@@ -121,7 +122,6 @@ string const browseFile( string const & filename,
 // sorted by hand to prevent LyXLex from complaining on read().
 static
 keyword_item xformTags[] = {
-//     { "\\gui_active_tab", FL_LIGHTER_COL1 },
        { "\\gui_background", FL_COL1 },
        { "\\gui_buttonbottom", FL_BOTTOM_BCOL },
        { "\\gui_buttonleft", FL_LEFT_BCOL },