Example #1
0
        public MainWindow(string path = "settings.txt")
        {
            optionsPath = path;
            InitializeComponent();

            dataReader tempReader = new dataReader();

            tempReader.deserialize();
            todoItems = tempReader.todoItems;
            options   = tempReader.options;


            KeyHook.RegisterHotKey(options.ActivateOverlay);
            KeyHook.RegisterHotKey(options.CycleOverlayTabs);
            KeyHook.RegisterHotKey(options.OverlayKey1);
            KeyHook.RegisterHotKey(options.OverlayKey2);
            KeyHook.RegisterHotKey(options.OverlayKey3);

            KeyHook.KeyPressed += new EventHandler <KeyPressedEventArgs>(GB_KeyPressed);

            SWinitTab();
            CDinitTab();
            TDinitTab();

            TDupdate();

            Clocks.SelectedIndex = (int)options.defaultTab;
            ShowInTaskbar        = !options.hideTaskbarIcon;

            overlay = new Overlay(options);

            overlayUpdate.Tick    += new EventHandler(renderOverlay);
            overlayUpdate.Interval = 40;
            overlayUpdate.Start();
        }
Example #2
0
        public void UpdateSettings(PermOptions op)
        {
            BackColor = op.OverlayBackColor;
            ForeColor = op.OverlayForeColor;

            MainBrush = new SolidBrush(ForeColor);
            MainPen   = new Pen(ForeColor, 1);
            Opacity   = op.OverlayOptacy;

            DefaultTab = ((int)op.defaultTab <= 1 ? (Overlay.Tabs)op.defaultTab + 1 : Overlay.Tabs.Clock);
        }
Example #3
0
        public Overlay(PermOptions op = null)
        {
            InitializeComponent();

            Display.Image = new Bitmap(this.Width, this.Height);

            UpdateSettings(op != null ? op : new PermOptions());
            CurTab = DefaultTab;

            this.Activate(hidden);
        }
Example #4
0
        private void ReloadData_Click(object sender, EventArgs e)
        {
            dataReader tempReader = new dataReader();

            tempReader.deserialize();
            todoItems = tempReader.todoItems;
            options   = tempReader.options;

            SWinitTab();
            CDinitTab();
            TDinitTab();

            TDupdate();

            ShowInTaskbar = !options.hideTaskbarIcon;
        }
Example #5
0
        public OptionsDiag(PermOptions op = null)
        {
            InitializeComponent();


            if (op != null)
            {
                options = op;
            }
            else
            {
                options = new PermOptions();
            }

            chkStartup.Checked         = options.startOnStartup;
            chkHideTaskbarIcon.Checked = options.hideTaskbarIcon;

            DefaultTab.SelectedIndex   = (int)options.defaultTab;
            OverlayForeColor.BackColor = options.OverlayForeColor;
            OverlayBckCol.BackColor    = options.OverlayBackColor;
            OptacySlider.Value         = (int)(options.OverlayOptacy * 100);
            OptacyLabl.Text            = string.Format("Optacy: {0}%", OptacySlider.Value);
        }
Example #6
0
        public void applyOptions(PermOptions po)
        {
            options = po;

            //run on startup or not.
            RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

            if (options.startOnStartup)
            {
                registryKey.SetValue("TimeUtilities", Application.ExecutablePath);
            }
            else if (!options.startOnStartup && registryKey.GetValue("TimeUtilities") != null)
            {
                registryKey.DeleteValue("TimeUtilities");
            }

            ShowInTaskbar = !options.hideTaskbarIcon;
            overlay.UpdateSettings(options);
            this.Show();

            dumpOptions();

            //TODO doMore stuff Here
        }