summaryrefslogtreecommitdiff
path: root/src/wx/wx_util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-09 20:35:39 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-09 20:35:39 +0100
commit89115db77729a2c99f1a09ff6a461720e16f889e (patch)
treee528ec014b820d4e0efa28893dcee91cd76ee618 /src/wx/wx_util.cc
parentf8ad440cf187c517b7800f3efdfc0954025c4422 (diff)
parentd2ff6a6b0256e256b6df416f280c846072f7682f (diff)
Merge master.
Diffstat (limited to 'src/wx/wx_util.cc')
-rw-r--r--src/wx/wx_util.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index 5691d341a..c5887e17d 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -35,21 +35,37 @@ using namespace boost;
* @param s Sizer to add to.
* @param p Parent window for the wxStaticText.
* @param t Text for the wxStaticText.
+ * @param left true if this label is a `left label'; ie the sort
+ * of label which should be right-aligned on OS X.
* @param prop Proportion to pass when calling Add() on the wxSizer.
*/
wxStaticText *
-add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, int prop)
+add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, bool left, int prop)
{
+ int flags = wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT;
+#ifdef __WXOSX__
+ if (left) {
+ flags |= wxALIGN_RIGHT;
+ t += wxT (":");
+ }
+#endif
wxStaticText* m = new wxStaticText (p, wxID_ANY, t);
- s->Add (m, prop, wxALIGN_CENTER_VERTICAL | wxALL, 6);
+ s->Add (m, prop, flags, 6);
return m;
}
wxStaticText *
-add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, wxGBPosition pos, wxGBSpan span)
+add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, bool left, wxGBPosition pos, wxGBSpan span)
{
+ int flags = wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT;
+#ifdef __WXOSX__
+ if (left) {
+ flags |= wxALIGN_RIGHT;
+ t += wxT (":");
+ }
+#endif
wxStaticText* m = new wxStaticText (p, wxID_ANY, t);
- s->Add (m, pos, span, wxALIGN_CENTER_VERTICAL | wxALL, 6);
+ s->Add (m, pos, span, flags);
return m;
}