+ // Very crude way to get styles
+ long style;
+ wxString s, restype;
+ restype = res->GetType();
+ style = res->GetStyle();
+
+ s = "\t\t\t\t<style>";
+
+ // Common styles for all controls
+ if (style & wxSIMPLE_BORDER)
+ s += "wxSIMPLE_BORDER|";
+ if (style & wxSUNKEN_BORDER)
+ s += "wxSUNKEN_BORDER|";
+ if (style & wxSIMPLE_BORDER)
+ s += "wxSIMPLE_BORDER|";
+ if (style & wxDOUBLE_BORDER)
+ s += "wxDOUBLE_BORDER|";
+ if (style & wxRAISED_BORDER)
+ s += "wxRAISED_BORDER|";
+ if (style & wxTRANSPARENT_WINDOW)
+ s += "wxTRANSPARENT_WINDOW|";
+ if (style & wxWANTS_CHARS)
+ s += "wxWANTS_CHARS|";
+ if (style & wxNO_FULL_REPAINT_ON_RESIZE)
+ s += "wxNO_FULL_REPAINT_ON_RESIZE|";
+
+ if (restype == "wxDialog")
+ {
+ if (style & wxDIALOG_MODAL)
+ s += "wxDIALOG_MODAL|";
+ if (style & wxDEFAULT_DIALOG_STYLE)
+ s += "wxDEFAULT_DIALOG_STYLE|";
+ if (style & wxDIALOG_MODELESS)
+ s += "wxDIALOG_MODELESS|";
+ if (style & wxNO_3D)
+ s += "wxNO_3D|";
+ if (style & wxTAB_TRAVERSAL)
+ s += "wxTAB_TRAVERSAL|";
+ if (style & wxWS_EX_VALIDATE_RECURSIVELY)
+ s += "wxWS_EX_VALIDATE_RECURSIVELY|";
+ if (style & wxSTAY_ON_TOP)
+ s += "wxSTAY_ON_TOP|";
+ if (style & wxCAPTION)
+ s += "wxCAPTION|";
+ if (style & wxTHICK_FRAME)
+ s += "wxTHICK_FRAME|";
+ if (style & wxRESIZE_BOX)
+ s += "wxRESIZE_BOX|";
+ if (style & wxRESIZE_BORDER)
+ s += "wxRESIZE_BORDER|";
+ if (style & wxSYSTEM_MENU)
+ s += "wxSYSTEM_MENU|";
+ if (style & wxCLIP_CHILDREN)
+ s += "wxCLIP_CHILDREN|";
+ }
+
+ if (restype == "wxPanel")
+ {
+ if (style & wxCLIP_CHILDREN)
+ s += "wxCLIP_CHILDREN|";
+ if (style & wxNO_3D)
+ s += "wxNO_3D|";
+ if (style & wxTAB_TRAVERSAL)
+ s += "wxTAB_TRAVERSAL|";
+ if (style & wxWS_EX_VALIDATE_RECURSIVELY)
+ s += "wxWS_EX_VALIDATE_RECURSIVELY|";
+ }
+
+ if (restype == "wxComboBox")
+ {
+ if (style & wxCB_SORT)
+ s += "wxCB_SORT|";
+ if (style & wxCB_SIMPLE)
+ s += "wxCB_SIMPLE|";
+ if (style & wxCB_READONLY)
+ s += "wxCB_READONLY|";
+ if (style & wxCB_DROPDOWN)
+ s += "wxCB_DROPDOWN|";
+ }
+
+ if (restype == "wxGauge")
+ {
+ if (style & wxGA_HORIZONTAL)
+ s += "wxGA_HORIZONTAL|";
+ if (style & wxGA_VERTICAL)
+ s += "wxGA_VERTICAL|";
+ if (style & wxGA_PROGRESSBAR)
+ s += "wxGA_PROGRESSBAR|";
+ // windows only
+ if (style & wxGA_SMOOTH)
+ s += "wxGA_SMOOTH|";
+ }
+
+ if (restype == "wxRadioButton")
+ {
+ if (style & wxRB_GROUP)
+ s += "wxRB_GROUP|";
+ }
+
+ if (restype == "wxStaticText")
+ {
+ if (style & wxST_NO_AUTORESIZE)
+ s += "wxST_NO_AUTORESIZEL|";
+ }
+
+ if (restype == "wxRadioBox")
+ {
+ if (style & wxRA_HORIZONTAL)
+ s += "wxRA_HORIZONTAL|";
+ if (style & wxRA_SPECIFY_COLS)
+ s += "wxRA_SPECIFY_COLS|";
+ if (style & wxRA_SPECIFY_ROWS)
+ s += "wxRA_SPECIFY_ROWS|";
+ if (style & wxRA_VERTICAL)
+ s += "wxRA_VERTICAL|";
+ }
+
+ if (restype == "wxListBox")
+ {
+ if (style & wxLB_SINGLE)
+ s += "wxLB_SINGLE|";
+ if (style & wxLB_MULTIPLE)
+ s += "wxLB_MULTIPLE|";
+ if (style & wxLB_EXTENDED)
+ s += "wxLB_EXTENDED|";
+ if (style & wxLB_HSCROLL)
+ s += "wxLB_HSCROLL|";
+ if (style & wxLB_ALWAYS_SB)
+ s += "wxLB_ALWAYS_SB|";
+ if (style & wxLB_NEEDED_SB)
+ s += "wxLB_NEEDED_SB|";
+ if (style & wxLB_SORT)
+ s += "wxLB_SORT|";
+ }
+
+ if (restype == "wxTextCtrl")
+ {
+ if (style & wxTE_PROCESS_ENTER)
+ s += "wxTE_PROCESS_ENTER|";
+ if (style & wxTE_PROCESS_TAB)
+ s += "wxTE_PROCESS_TAB|";
+ if (style & wxTE_MULTILINE)
+ s += "wxTE_MULTILINE|";
+ if (style & wxTE_PASSWORD)
+ s += "wxTE_PASSWORD|";
+ if (style & wxTE_READONLY)
+ s += "wxTE_READONLY|";
+ if (style & wxHSCROLL)
+ s += "wxHSCROLL|";
+ }
+
+
+ if (restype == "wxScrollBar")
+ {
+ if (style & wxSB_HORIZONTAL)
+ s += "wxSB_HORIZONTAL|";
+ if (style & wxSB_VERTICAL)
+ s += "wxSB_VERTICAL|";
+ }
+
+ int l;
+ l = s.Length();
+ // No styles defined
+ if (l == 11)
+ return _T("");
+ // Trim off last |
+ s = s.Truncate(l - 1);
+
+ s += "</style>\n";
+ return s;