Example #1
0
        public Dialog(Bolt bolt, string Title,
                      ConsoleColor foreColor = ConsoleColor.White,
                      ConsoleColor backColor = ConsoleColor.Black) : base(bolt)
        {
            this.Title     = Title;
            this.backColor = backColor;
            this.foreColor = foreColor;

            Format(new Location(0, GUI.ScreenHeight / 3), new Size(GUI.ScreenWidth, GUI.ScreenHeight / 3));

            Focus();
        }
Example #2
0
 public CommandPanel(Bolt bolt) : base(bolt)
 {
     currentNotification = defaultNotification;
 }
Example #3
0
 public GraphicalInterface(Bolt bolt)
 {
     this.bolt = bolt;
 }
Example #4
0
 public StatusBar(Bolt bolt, string fileLocation) : base(bolt)
 {
     FileLocation = fileLocation;
 }
Example #5
0
 public Editor(Bolt bolt, CodeFile codeFile) : base(bolt)
 {
     this.codeFile          = codeFile;
     lines                  = new List <string>(codeFile.code.Split('\n'));
     bolt.CurrentlyUpdating = this;
 }
Example #6
0
 public InputManager(Bolt bolt)
 {
     this.bolt = bolt;
 }
Example #7
0
        /*
         * Controls;
         *  Exit: CTRL+C
         *  Save: CTRL+O (O for out)
         *  Exit and Save (CTRL+X)
         */

        public Bolt(string[] args)
        {
            string fileLocation = args[0];

            if (!fileLocation.Contains("/"))
            {
                fileLocation = Directory.GetCurrentDirectory() + "/" + fileLocation;
            }
            //Load parameters from command line arguments
            LoadParams(args);

            if (!DO_EXECUTE)
            {
                return;
            }

            if (!File.Exists(fileLocation))
            {
                File.Create(fileLocation).Close();
            }

            //Uncomment for file input information, aswell as; working directory.
            ///Console.WriteLine("DIR: " + Directory.GetCurrentDirectory());
            ///Console.WriteLine(fileLocation);
            ///return;

            instance = this;

            //TODO: check for NO_LOAD_CONFIG flag in command line args
            settings = new Settings();
            settings.LoadSettings(((OSInfo.OS_OSX || OSInfo.OS_WINDOWS) ? "/Users" : "/home") + $"/{Environment.UserName}/.boltrc");
            if (Settings.LOAD_FAILED)
            {
                Logger.LogError("Failed to load settings... Exiting.");
                return;
            }

            Console.Clear();

            GUI.Initialize(this);

            isRepository = Directory.Exists(fileLocation) && File.Exists(fileLocation);

            if (isRepository)
            {
                //Editing a directory (Repository)
                RootDirectory = new SubDirectory(fileLocation);
                RootDirectory.ScanDirectory();
            }
            else
            {
                //Editing a single file
                codeFile = new CodeFile(new SubDirectory(fileLocation), Path.GetFileName(fileLocation));
            }

            inputManager = new InputManager(this);

            //Console Initialization
            //Undone when CTRL+C is pressed in InputManager.cs
            Console.CursorVisible        = true;
            Console.TreatControlCAsInput = true;

            //Initialize Text Ballet (Bottom of screen)
            commandPanel = new CommandPanel(this);
            commandPanel.Format(new Location(0, GUI.ScreenHeight), new Size(GUI.ScreenWidth, 1));
            AddComponent(commandPanel);

            //Initialize Text/Code Editor
            editor = new Editor(this, codeFile);
            editor.Format(new Location(0, 0), new Size(GUI.ScreenWidth, GUI.ScreenHeight - 1));
            editor.Focus();
            AddComponent(editor);

            //Start the GUI Listener
            //this will raise an event when the console is resized.
            GUI.StartGUIEventListener();

            //Draw components to screen
            Refresh();

            inputManager.StartListener();
        }
Example #8
0
        private static readonly bool ENABLED = true;         //TURN TO FALSE FOR LOGGER.cs OUTPUT

        public static void Initialize(Bolt bolt)
        {
            GUI.bolt = bolt;
        }
Example #9
0
 public CodeEditor(Bolt bolt) : base(bolt)
 {
 }