Exemple #1
0
        public static IDraw DrawEnumPopup <TEnum>(this IDraw draw,
                                                  ref TEnum @enum,
                                                  string label      = null,
                                                  GUIStyle style    = null,
                                                  float?height      = null,
                                                  float?maxHeight   = null,
                                                  float?minHeight   = null,
                                                  bool?expandHeight = null,
                                                  float?width       = null,
                                                  float?maxWidth    = null,
                                                  float?minWidth    = null,
                                                  bool?expandWidth  = null)
            where TEnum : struct, IConvertible
        {
            var opts = LayoutOptionsCache.ExtractLayoutOptions(height,
                                                               maxHeight,
                                                               minHeight,
                                                               expandHeight,
                                                               width,
                                                               maxWidth,
                                                               minWidth,
                                                               expandWidth);

            EnumPopupDraw.Draw(ref @enum, label, style, opts);

            return(draw);
        }
Exemple #2
0
        public static IDraw Button(this IDraw draw,
                                   string buttonText,
                                   Action buttonAction,
                                   GUIStyle style    = null,
                                   Color?color       = null,
                                   bool lossFocus    = false,
                                   float?height      = null,
                                   float?maxHeight   = null,
                                   float?minHeight   = null,
                                   bool?expandHeight = null,
                                   float?width       = null,
                                   float?maxWidth    = null,
                                   float?minWidth    = null,
                                   bool?expandWidth  = null)
        {
            var opts = LayoutOptionsCache.ExtractLayoutOptions(height,
                                                               maxHeight,
                                                               minHeight,
                                                               expandHeight,
                                                               width,
                                                               maxWidth,
                                                               minWidth,
                                                               expandWidth);

            ButtonDraw.Draw(buttonText, buttonAction, style, opts, color, lossFocus);

            return(draw);
        }
Exemple #3
0
        public static IDraw TextField(this IDraw draw,
                                      ref string text,
                                      string label      = null,
                                      GUIStyle style    = null,
                                      float?height      = null,
                                      float?maxHeight   = null,
                                      float?minHeight   = null,
                                      bool?expandHeight = null,
                                      float?width       = null,
                                      float?maxWidth    = null,
                                      float?minWidth    = null,
                                      bool?expandWidth  = null)
        {
            var opts = LayoutOptionsCache.ExtractLayoutOptions(height,
                                                               maxHeight,
                                                               minHeight,
                                                               expandHeight,
                                                               width,
                                                               maxWidth,
                                                               minWidth,
                                                               expandWidth);

            TextFieldDraw.Draw(ref text, label, style, opts);

            return(draw);
        }
Exemple #4
0
        public static IDraw DrawStringsPopup(this IDraw draw,
                                             ref int selectedIndex,
                                             string[] displayedStrings,
                                             string label      = null,
                                             GUIStyle style    = null,
                                             float?height      = null,
                                             float?maxHeight   = null,
                                             float?minHeight   = null,
                                             bool?expandHeight = null,
                                             float?width       = null,
                                             float?maxWidth    = null,
                                             float?minWidth    = null,
                                             bool?expandWidth  = null)
        {
            var opts = LayoutOptionsCache.ExtractLayoutOptions(height,
                                                               maxHeight,
                                                               minHeight,
                                                               expandHeight,
                                                               width,
                                                               maxWidth,
                                                               minWidth,
                                                               expandWidth);

            StringsPopupDraw.Draw(ref selectedIndex, displayedStrings, label, style, opts);

            return(draw);
        }
Exemple #5
0
        public static IDraw DrawLabel(this IDraw draw,
                                      string label,
                                      GUIStyle style,
                                      float?height      = null,
                                      float?maxHeight   = null,
                                      float?minHeight   = null,
                                      bool?expandHeight = null,
                                      float?width       = null,
                                      float?maxWidth    = null,
                                      float?minWidth    = null,
                                      bool?expandWidth  = null)
        {
            if (label == null)
            {
                throw new ArgumentNullException(nameof(label));
            }

            var opts = LayoutOptionsCache.ExtractLayoutOptions(height,
                                                               maxHeight,
                                                               minHeight,
                                                               expandHeight,
                                                               width,
                                                               maxWidth,
                                                               minWidth,
                                                               expandWidth);

            LabelDraw.Draw(label, style, opts);

            return(draw);
        }
Exemple #6
0
        public static IDraw BeginVertical(this IDraw draw,
                                          GUIStyle style    = null,
                                          float?height      = null,
                                          float?maxHeight   = null,
                                          float?minHeight   = null,
                                          bool?expandHeight = null,
                                          float?width       = null,
                                          float?maxWidth    = null,
                                          float?minWidth    = null,
                                          bool?expandWidth  = null)
        {
            var opts = LayoutOptionsCache.ExtractLayoutOptions(height,
                                                               maxHeight,
                                                               minHeight,
                                                               expandHeight,
                                                               width,
                                                               maxWidth,
                                                               minWidth,
                                                               expandWidth);

            BeginVerticalDraw.Draw(style, opts);

            return(draw);
        }