Example #1
0
 public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
 {
     base.InitChildren(parent, host, MyButtonCallback);
     if (u0 != 0.0 || v0 != 0.0 || (u1 != 0.0 || v1 != 0.0))
     {
         Init(host, ImageSrc, u0, v0, u1, v1, over_u0, over_v0, over_u1, over_v1, down_u0, down_v0, down_u1, down_v1, disabled_u0, disabled_v0, disabled_u1, disabled_v1);
         SetGrowableWidth(leftbordersize_pixels, rightbordersize_pixels, minimum_width_pixels);
         SetGrowableHeight(topbordersize_pixels, bottombordersize_pixels, minimum_height_pixels);
     }
     else
     {
         if (!parent.IsComboBoxElement() && !parent.IsListBoxElement())
         {
             u0          = 896f;
             v0          = 192f;
             u1          = 959f;
             v1          = byte.MaxValue;
             over_u0     = 896f;
             over_v0     = 256f;
             over_u1     = 959f;
             over_v1     = 319f;
             down_u0     = 896f;
             down_v0     = 320f;
             down_u1     = 959f;
             down_v1     = 383f;
             disabled_u0 = 960f;
             disabled_v0 = 128f;
             disabled_u1 = 1023f;
             disabled_v1 = 191f;
             Init(host, "guicontrols", u0, v0, u1, v1, over_u0, over_v0, over_u1, over_v1, down_u0, down_v0, down_u1, down_v1, disabled_u0, disabled_v0, disabled_u1, disabled_v1);
         }
         SetGrowableWidth(4, 4, 12);
         SetGrowableHeight(4, 4, 12);
     }
 }
Example #2
0
        public override void InitChildren(Element2D parent, GUIHost host, ButtonCallback MyButtonCallback)
        {
            if (!parent.IsComboBoxElement() && !parent.IsListBoxElement() && (u0 == 0.0 && v0 == 0.0) && (u1 == 0.0 && v1 == 0.0))
            {
                SetToDefaultOptions(type_template);
            }

            base.InitChildren(parent, host, MyButtonCallback);
            if (parent.GetElementType() != ElementType.ComboBoxWidget)
            {
                SetCallback(MyButtonCallback);
            }

            SetGrowableWidth(16, 16, 48);
        }