]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/win_gtk.c
bugfixes
[wxWidgets.git] / src / gtk / win_gtk.c
index dcd694df3fd1261b2dc65a40234456485e595fac..5f683d50c7bc5bd6e622b6e5de41103488e23a23 100644 (file)
@@ -10,7 +10,7 @@
 #include "wx/gtk/win_gtk.h"
 #include "gtk/gtksignal.h"
 #include "gtk/gtknotebook.h"
-#include "gtk/gtktable.h"
+#include "gtk/gtkscrolledwindow.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -156,7 +156,7 @@ gtk_myfixed_init (GtkMyFixed *myfixed)
 #endif
 
 #if (GTK_MINOR_VERSION > 0)
-    myfixed->shadow_type = GTK_SHADOW_NONE;
+    myfixed->shadow_type = GTK_MYSHADOW_NONE;
 #endif
 
     myfixed->children = NULL;
@@ -182,13 +182,13 @@ gtk_myfixed_scroll_set_adjustments (GtkMyFixed     *myfixed,
 }
 
 void 
-gtk_myfixed_set_shadow_type (GtkMyFixed    *myfixed,
-                            GtkShadowType  type)
+gtk_myfixed_set_shadow_type (GtkMyFixed      *myfixed,
+                            GtkMyShadowType  type)
 {
     g_return_if_fail (myfixed != NULL);
     g_return_if_fail (GTK_IS_MYFIXED (myfixed));
 
-    if ((GtkShadowType) myfixed->shadow_type != type)
+    if ((GtkMyShadowType) myfixed->shadow_type != type)
     {
         myfixed->shadow_type = type;
 
@@ -328,9 +328,9 @@ gtk_myfixed_set_size (GtkMyFixed    *myfixed,
 
             if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
            {
-                if ( ((child->width > 1) && (child->height > 1) && (GTK_WIDGET_REALIZED(widget))) ||
-                    /* I don't know why GtkTable is different */
-                    GTK_IS_TABLE(widget))
+                if ( (child->width > 1) && 
+                    (child->height > 1) && 
+                   !(GTK_WIDGET_REALIZED(widget) && GTK_IS_NOTEBOOK(widget)) )
                {
                     child_allocation.x = child->x;
                     child_allocation.y = child->y;
@@ -415,8 +415,21 @@ gtk_myfixed_realize (GtkWidget *widget)
     attributes.width = widget->allocation.width;
     attributes.height = widget->allocation.height;
 
-    if (myfixed->shadow_type != GTK_SHADOW_NONE)
+    if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
     {
+        /* no border, no changes to sizes */
+    } else
+    if (myfixed->shadow_type == GTK_MYSHADOW_THIN)
+    {
+        /* GTK_MYSHADOW_THIN == wxSIMPLE_BORDER */
+        attributes.x += 1;
+        attributes.y += 1;
+        attributes.width -= 2;
+        attributes.height -= 2;
+    } else
+    {
+        /* GTK_MYSHADOW_IN == wxSUNKEN_BORDER */
+        /* GTK_MYSHADOW_OUT == wxRAISED_BORDER */
         attributes.x += 2;
         attributes.y += 2;
         attributes.width -= 4;
@@ -511,8 +524,11 @@ gtk_myfixed_size_allocate (GtkWidget     *widget,
   
     widget->allocation = *allocation;
 #if (GTK_MINOR_VERSION > 0)
-    if (myfixed->shadow_type == GTK_SHADOW_NONE)
+    if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
         border = 0;
+    else
+    if (myfixed->shadow_type == GTK_MYSHADOW_THIN)
+        border = 1;
     else
         border = 2;
 #else
@@ -537,15 +553,15 @@ gtk_myfixed_size_allocate (GtkWidget     *widget,
         child = children->data;
         children = children->next;
  
-        /* please look at the text in wxWindow::DoSetSize() on why the
-           test GTK_WIDGET_REALIZED() has to be here */
         if (GTK_WIDGET_VISIBLE (child->widget))
         { 
+/*          please look at the text in wxWindow::DoSetSize() on why the
+            test GTK_WIDGET_REALIZED() has to be here   */
 /*          if (GTK_IS_NOTEBOOK(child->widget) && !GTK_WIDGET_REALIZED(child->widget))
             {
                gtk_widget_queue_resize( child->widget );
            }
-           else */
+           else  */
            {
                child_allocation.x = child->x;
                child_allocation.y = child->y;