]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/win_gtk.c
now supports wxCURSOR_BULLSEYE
[wxWidgets.git] / src / gtk1 / win_gtk.c
index a9552bd63b6cf7afa7feae898b9137c291905fc4..2038d6d3e53bad2251f036ba74a1936c68c9ecc2 100644 (file)
@@ -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;
 
@@ -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
@@ -594,9 +610,11 @@ gtk_myfixed_draw (GtkWidget    *widget,
   if (GTK_WIDGET_DRAWABLE (widget))
     {
       myfixed = GTK_MYFIXED (widget);
-      gtk_myfixed_paint (widget, area);
-
+      
       children = myfixed->children;
+      if (children)  /* mini optimisation */
+         gtk_myfixed_paint (widget, area);
+
       while (children)
        {
          child = children->data;
@@ -679,6 +697,9 @@ gtk_myfixed_remove (GtkContainer *container,
          
          gtk_widget_unparent (widget);
 
+          /* security checks */
+          g_return_if_fail (GTK_IS_WIDGET (widget));
+  
          myfixed->children = g_list_remove_link (myfixed->children, children);
          g_list_free (children);
          g_free (child);
@@ -686,6 +707,9 @@ gtk_myfixed_remove (GtkContainer *container,
          if (was_visible && GTK_WIDGET_VISIBLE (container))
            gtk_widget_queue_resize (GTK_WIDGET (container));
 
+          /* security checks */
+         g_return_if_fail (GTK_IS_WIDGET (widget));
+         
          break;
        }