Esempio n. 1
0
 // Sets the given width to all the parts in the border
 public void setWidth(FlexibleFloat value)
 {
     top.width=	value;
     right.width=	value;
     bottom.width=	value;
     left.width=	value;
 }
Esempio n. 2
0
 public Margin(FlexibleFloat pmTop, FlexibleFloat pmRight, FlexibleFloat pmBottom, FlexibleFloat pmLeft)
 {
     top=	pmTop;
     right=	pmRight;
     bottom=	pmBottom;
     left=	pmLeft;
 }
Esempio n. 3
0
        public Margin(string text)
        {
            // Variables
            string[]	splits=	text.Split(" \t	\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            switch(splits.Length)
            {
                case 1:
                    top=	new FlexibleFloat(splits[0]);
                    right=	new FlexibleFloat(splits[0]);
                    bottom=	new FlexibleFloat(splits[0]);
                    left=	new FlexibleFloat(splits[0]);
                    break;
                case 2:
                    top=	new FlexibleFloat(splits[0]);
                    right=	new FlexibleFloat(splits[1]);
                    bottom=	new FlexibleFloat(splits[0]);
                    left=	new FlexibleFloat(splits[1]);
                    break;
                case 3:
                    top=	new FlexibleFloat(splits[0]);
                    right=	new FlexibleFloat(splits[1]);
                    bottom=	new FlexibleFloat(splits[2]);
                    left=	new FlexibleFloat(splits[1]);
                    break;
                case 4:
                    top=	new FlexibleFloat(splits[0]);
                    right=	new FlexibleFloat(splits[1]);
                    bottom=	new FlexibleFloat(splits[2]);
                    left=	new FlexibleFloat(splits[3]);
                    break;
                default:
                    top=	new FlexibleFloat(0f, FlexFloatType.px);
                    right=	new FlexibleFloat(0f, FlexFloatType.px);
                    bottom=	new FlexibleFloat(0f, FlexFloatType.px);
                    left=	new FlexibleFloat(0f, FlexFloatType.px);
                    break;
            }
        }
Esempio n. 4
0
 public CssStyle()
 {
     color=	new Color(0, 0, 0);
     background=	new Background();
     border=	new Border();
     clear=	FloatType.none;
     display=	Display.inline;
     _float=	FloatType.none;
     height=	new FlexibleFloat(0f, FlexFloatType.px);
     margin=	new Margin(0f, 0f, 0f, 0f);
     padding=	new Padding(0f, 0f, 0f, 0f);
     width=	new FlexibleFloat(100f, FlexFloatType.percentage);
     letterSpacing=	new FlexibleFloat(FlexibleFloat.letterSpacingNormal, FlexFloatType.px);
     lineHeight=	new FlexibleFloat(FlexibleFloat.lineHeightNormal, FlexFloatType.px);
     textAlign=	TextAlignment.left;
     textIndex=	new FlexibleFloat(0f, FlexFloatType.px);
     textTransform=	TextTransform.none;
     whiteSpace=	WhiteSpace.normal;
     wordSpacing=	new FlexibleFloat(FlexibleFloat.wordSpacingNormal, FlexFloatType.px);
     textDecoration=	TextDecoration.none;
     font=	new Sdx.Font("arial", 14);
     listStyle=	new ListStyle();
 }
Esempio n. 5
0
 // Loads in the css style given the css code
 public void applyCssCode(CssCode code)
 {
     for(int i= 0; i< code.size; i++)
     {
         switch(code.names.items[i].ToLower())
         {
             case "color":	color=	new Color(code.values.items[i]);	break;
             case "background-color":	backgroundColor=	new Color(code.values.items[i]);	break;
             case "width":	width=	new FlexibleFloat(code.values.items[i]);	break;
             case "height":	height=	new FlexibleFloat(code.values.items[i]);	break;
             case "margin":	margin=	new Margin(code.values.items[i]);	break;
             case "margin-top":	marginTop=	new FlexibleFloat(code.values.items[i]);	break;
             case "margin-right":	marginRight=	new FlexibleFloat(code.values.items[i]);	break;
             case "margin-bottom":	marginBottom=	new FlexibleFloat(code.values.items[i]);	break;
             case "margin-left":	marginLeft=	new FlexibleFloat(code.values.items[i]);	break;
             case "padding":	padding=	new Padding(code.values.items[i]);	break;
             case "padding-top":	paddingTop=	new FlexibleFloat(code.values.items[i]);	break;
             case "padding-right":	paddingRight=	new FlexibleFloat(code.values.items[i]);	break;
             case "padding-bottom":	paddingBottom=	new FlexibleFloat(code.values.items[i]);	break;
             case "padding-left":	paddingLeft=	new FlexibleFloat(code.values.items[i]);	break;
             case "display":
                 switch(code.values.items[i].ToLower())
                 {
                     case "none":	display=	Display.none;	break;
                     case "block":	display=	Display.block;	break;
                     case "inline":	display=	Display.inline;	break;
                     case "inline-block":	display=	Display.inlineBlock;	break;
                 }
                 break;
         }
     }
 }
Esempio n. 6
0
 public Margin(FlexibleFloat all)
     : this(all, all, all, all)
 {
 }
Esempio n. 7
0
 public Margin(FlexibleFloat tb, FlexibleFloat rl)
     : this(tb, rl, tb, rl)
 {
 }
Esempio n. 8
0
 public Margin(FlexibleFloat pmTop, FlexibleFloat rl, FlexibleFloat pmBottom)
     : this(pmTop, rl, pmBottom, rl)
 {
 }
Esempio n. 9
0
 public Padding(FlexibleFloat all)
     : this(all, all, all, all)
 {
 }
Esempio n. 10
0
 public Padding(FlexibleFloat tb, FlexibleFloat rl)
     : this(tb, rl, tb, rl)
 {
 }
Esempio n. 11
0
 public Padding(FlexibleFloat pmTop, FlexibleFloat rl, FlexibleFloat pmBottom)
     : this(pmTop, rl, pmBottom, rl)
 {
 }
Esempio n. 12
0
 public FlexiblePoint(FlexibleFloat pmX, FlexibleFloat pmY)
 {
     x=	pmX;
     y=	pmY;
 }