Ejemplo n.º 1
0
        public Button(string PATH, DirectoryNode NODE) : base("Square", Vector2.Zero, Vector2.Zero)
        {
            path = PATH;
            node = NODE;
            name = path.Substring(path.LastIndexOf("\\") + 1, path.Length - 1 - path.LastIndexOf("\\"));
            ID   = Globals.nrOfButtons;
            Globals.nrOfButtons++;
            color = new Color(50, 50, 50, 80);
            text  = new EText(Globals.SystemFont, name, new Vector2(20, 92), new Vector2(0.5f, 0.5f), Color.White);
            size  = node.size;
            if (size > 1073741824 * 0.5)
            {
                size     = size / 1073741824;
                sizeUnit = " GB";
            }
            else if (size > 1048576 * 0.5)
            {
                size     = size / 1048576;
                sizeUnit = " MB";
            }
            else if (size > 1024 * 0.5)
            {
                size     = size / 1024;
                sizeUnit = " KB";
            }
            else
            {
                sizeUnit = " B";
            }
            string sizeStr = size.ToString();

            try
            {
                sizeTxt = new EText(Globals.SystemFont, sizeStr.Substring(0, sizeStr.LastIndexOf(".") + 3) + sizeUnit, new Vector2(650, 92), new Vector2(0.5f, 0.5f), Color.White);
            }
            catch
            {
                sizeTxt = new EText(Globals.SystemFont, sizeStr + sizeUnit, new Vector2(650, 92), new Vector2(0.5f, 0.5f), Color.White);
            }
            persentage = (float)node.size / (float)Globals.currentNode.size * 100;
            string persentStr = persentage.ToString();

            if (persentStr.Length > 4)
            {
                persentStr = persentStr.Substring(0, persentStr.LastIndexOf(".") + 3) + " %";
            }
            else
            {
                persentStr = persentStr + " %";
            }
            percentTxt = new EText(Globals.SystemFont, persentStr, new Vector2(550, 92), new Vector2(0.5f, 0.5f), Color.White);
        }
Ejemplo n.º 2
0
        public EventContentLine(int index, EventEditor parent)
        {
            this.index  = index;
            this.parent = parent;
            indexText   = new EText().Content(index.ToString()).RelativeSize(false).Width(20);
            nameField   = new ETextInputField().RelativeSize(true).OnInputUpdate((ETextInputField f, string val) => { parent.cfg.events[this.index] = val; nameText.Content(val); });
            nameText    = new EText().Content(parent.cfg.events[index]).RelativeSize(true);

            editButton       = new EButton().RelativeSize(false).Width(80).OnClicked((EButton b) => { parent.BeginEdit(index); }) + new EText().Content("edit");
            editFinishButton = new EButton().RelativeSize(false).Width(50).OnClicked((EButton b) => { parent.FinishEdit(); }) + new EText().Content("finish");
            deleteButton     = new EButton().RelativeSize(false).Width(30).OnClicked((EButton b) => { parent.RemoveEvent(index); }) + new EText().Content("x");

            children.Add(new EHorizontalLayout() + indexText + nameText + editButton);
            children.Add(new EHorizontalLayout() + indexText + nameField + editFinishButton + deleteButton);
            children.Add(new EHorizontalLayout() + indexText + nameText);
            this.OnConstruct(parent);
        }
Ejemplo n.º 3
0
 public OpenFolderButton() : base("Square", new Vector2(Globals.screenWidth / 2 - 20, 20), new Vector2(Globals.screenWidth - 55, 30))    //55s
 {
     color = new Color(50, 50, 50, 80);
     text  = new EText(Globals.SystemFont, "", new Vector2(20, 12), new Vector2(0.5f, 0.5f), Color.White);
     cdbtn = new ChangeDirButton();
 }
Ejemplo n.º 4
0
    // ========================================================================== //

    /* public - [Do] Function
     * 외부 객체가 호출(For External class call)*/

    public void DoEditText(EText eText, string strText)
    {
        _mapText[eText].text = strText;
    }