3 #ifndef XFORMSHELPERS_H
4 #define XFORMSHELPERS_H
12 /// Set an FL_OBJECT to activated or deactivated
13 void setEnabled(FL_OBJECT *, bool enable);
15 /// Take a string and add breaks so that it fits into a desired label width, w
16 string formatted(string const &label, int w,
17 int=FL_NORMAL_SIZE, int=FL_NORMAL_STYLE);
19 /// Given an fl_choice, create a vector of its entries
20 std::vector<string> const getVectorFromChoice(FL_OBJECT *);
22 /// Given an fl_browser, create a vector of its entries
23 std::vector<string> const getVectorFromBrowser(FL_OBJECT *);
25 /// Given input and choice widgets, create a string such as "1cm"
26 string getLengthFromWidgets(FL_OBJECT * input, FL_OBJECT * choice);
28 /// Given a string such as "1cm", set the input and choice widgets.
29 void updateWidgetsFromLengthString(FL_OBJECT * input, FL_OBJECT * choice,
32 /// struct holding xform-specific colors
33 struct XformsColor : public NamedColor {
35 XformsColor() : NamedColor(), colorID(0) {}
36 static bool read(string const &);
37 static bool write(string const &);
41 /** Some functions that perform some quite detailed tests to ascertain whether
42 the directory or file is readable or writeable. If not, then an error
43 message is placed in error_message. */
47 static bool WriteableDir(string const & dir);
49 static bool ReadableDir(string const & dir);
51 static bool WriteableFile(string const & file);
53 static bool ReadableFile(string const & file);
55 static string const & ErrorMessage() { return error_message; }
58 static string error_message;
60 #endif // XFORMSHELPERS_H