]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied button aligment patch.
authorRobert Roebling <robert@roebling.de>
Mon, 26 Aug 2002 21:42:44 +0000 (21:42 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 26 Aug 2002 21:42:44 +0000 (21:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/button.cpp
src/gtk1/button.cpp

index fc88afb78903bb00dda6c05982e5b913b8cf5670..764cbde38f99dba762987daf9939ee7574148116 100644 (file)
@@ -107,6 +107,21 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 
     m_widget = gtk_button_new_with_label("");
 
+    float x_alignment = 0.5;
+    if (HasFlag(wxBU_LEFT))
+        x_alignment = 0.0;
+    else if (HasFlag(wxBU_RIGHT))
+        x_alignment = 1.0;
+
+    float y_alignment = 0.5;
+    if (HasFlag(wxBU_TOP))
+        y_alignment = 0.0;
+    else if (HasFlag(wxBU_BOTTOM))
+        y_alignment = 1.0;
+
+    gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)),
+                           x_alignment, y_alignment);
+                
     SetLabel( label );
 
     if (style & wxNO_BORDER)
index fc88afb78903bb00dda6c05982e5b913b8cf5670..764cbde38f99dba762987daf9939ee7574148116 100644 (file)
@@ -107,6 +107,21 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 
     m_widget = gtk_button_new_with_label("");
 
+    float x_alignment = 0.5;
+    if (HasFlag(wxBU_LEFT))
+        x_alignment = 0.0;
+    else if (HasFlag(wxBU_RIGHT))
+        x_alignment = 1.0;
+
+    float y_alignment = 0.5;
+    if (HasFlag(wxBU_TOP))
+        y_alignment = 0.0;
+    else if (HasFlag(wxBU_BOTTOM))
+        y_alignment = 1.0;
+
+    gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)),
+                           x_alignment, y_alignment);
+                
     SetLabel( label );
 
     if (style & wxNO_BORDER)