private void InitSettings()
        {
            mySettings = new SettingsStore();

            Rectangle R = Screen.PrimaryScreen.WorkingArea;

            mySettings.WindowLocationDefault = new Point(R.Right - mySettings.WindowSizeDefault.Width - 20,
                                                         R.Bottom - mySettings.WindowSizeDefault.Height);

            //mySettings.ClearAll(); // test defaults
            mySettings.LoadAll();
        }
示例#2
0
 void CursorIndicator_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (m != null)
     {
         m.MouseEvent -= m_MouseEvent;
     }
     if (s != null)
     {
         s.settingChanged -= settingChanged;
     }
     m = null;
     s = null;
 }
        private TweenLabel Init(Form form, SettingsStore s)
        {
            PrintDebug("revive");
            if (settings == null)
            {
                settings = s;
                settings.settingChanged += settingChanged;
                this.TextChanged        += TweenLabel_TextChanged;
                this.Font           = settings.LabelFont;
                this.ForeColor      = settings.TextColor;
                this.DoubleBuffered = true;
            }

            return(this);
        }
示例#4
0
        public CursorIndicator(IMouseRawEventProvider m, SettingsStore s)
        {
            InitializeComponent();

            this.m      = m;
            this.s      = s;
            FormClosed += CursorIndicator_FormClosed;

            NativeMethodsSWP.SetWindowTopMost(this.Handle);
            SetFormStyles();

            m.MouseEvent     += m_MouseEvent;
            Paint            += CursorIndicator_Paint;
            s.settingChanged += settingChanged;

            BackColor       = Color.Lavender;
            TransparencyKey = Color.Lavender;
        }
        public KeystrokesDisplay(IKeystrokeEventProvider k, SettingsStore s)
        {
            InitializeComponent();

            this.k = k;
            this.k.KeystrokeEvent += k_KeystrokeEvent;

            this.settings = s;
            this.settings.settingChanged += settingChanged;

            this.settings.OnSettingChangedAll();

            this.TopMost      = true;
            this.FormClosing += Form1_FormClosing;

            addWelcomeInfo();

            NativeMethodsSWP.SetWindowTopMost(this.Handle);
            ActivateDisplayOnlyMode(true);

            if (settings.EnableWindowFade)
            {
                Opacity    = 0;
                FadeStatus = FadeStatuses.Hidden;
            }
            else
            {
                Opacity    = 1;
                FadeStatus = FadeStatuses.Visible;
            }

            settings.settingChanged += (SettingsChangedEventArgs e) =>
            {
                if (settings.EnableWindowFade && tweenLabels.Count == 0 && Opacity > 0)
                {
                    FadeOut();
                }
                else
                {
                    Opacity    = 1;
                    FadeStatus = FadeStatuses.Visible;
                }
            };
        }
示例#6
0
        public KeystrokesDisplay(IKeystrokeEventProvider k, SettingsStore s)
        {
            InitializeComponent();

            this.k = k;
            this.k.KeystrokeEvent += k_KeystrokeEvent;

            this.settings = s;
            this.settings.settingChanged += settingChanged;

            this.settings.OnSettingChangedAll();

            this.TopMost      = true;
            this.FormClosing += Form1_FormClosing;

            addWelcomeInfo();

            NativeMethodsSWP.SetWindowTopMost(this.Handle);
            ActivateDisplayOnlyMode(true);
        }
示例#7
0
        public ButtonIndicator(IMouseRawEventProvider m, SettingsStore s)
        {
            InitializeComponent();

            this.m      = m;
            this.s      = s;
            FormClosed += CursorIndicator_FormClosed;

            HideMouseIfNoButtonPressed();

            NativeMethodsSWP.SetWindowTopMost(this.Handle);
            SetFormStyles();

            m.MouseEvent                 += m_MouseEvent;
            s.settingChanged             += settingChanged;
            DoubleClickIconTimer.Tick    += leftDoubleClickIconTimeout_Tick;
            DoubleClickIconTimer.Interval = 750;

            WheelIconTimer.Interval = 750;
            WheelIconTimer.Tick    += WheelIconTimer_Tick;

            BackColor       = Color.Lavender;
            TransparencyKey = Color.Lavender;
        }