Inheritance: IMessageFilter
Ejemplo n.º 1
0
        public Root()
        {
            SetDefaultPens();
            SetDefaultConfig();
            ReadOptions("pens.ini");
            ReadOptions("config.ini");

            trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add("About...", OnAbout);
            trayMenu.MenuItems.Add("Options...", OnOptions);
            trayMenu.MenuItems.Add("-");
            trayMenu.MenuItems.Add("Exit", OnExit);

            Size size = SystemInformation.SmallIconSize;

            trayIcon                    = new NotifyIcon();
            trayIcon.Text               = "gInk";
            trayIcon.ContextMenu        = trayMenu;
            trayIcon.Visible            = true;
            trayIcon.MouseClick        += TrayIcon_Click;
            trayIcon.BalloonTipText     = "Snapshot saved. Click here to browse snapshots.";
            trayIcon.BalloonTipClicked += TrayIcon_BalloonTipClicked;
            SetTrayIconColor();

            SetHotkey();

            TestMessageFilter mf = new TestMessageFilter(this);

            Application.AddMessageFilter(mf);

            FormCollection = null;
            FormDisplay    = null;
        }
Ejemplo n.º 2
0
        public int CurrentPen = 1;          // defaut pen

        public Root()
        {
            SetDefaultPens();
            SetDefaultConfig();
            ReadOptions("pens.ini");
            ReadOptions("config.ini");

            trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add("About", OnAbout);
            trayMenu.MenuItems.Add("Pen Settings", OnPenSetting);
            trayMenu.MenuItems.Add("-");
            trayMenu.MenuItems.Add("Exit", OnExit);

            Size size = SystemInformation.SmallIconSize;

            trayIcon      = new NotifyIcon();
            trayIcon.Text = "gInk";
            if (WhiteTrayIcon)
            {
                trayIcon.Icon = new Icon(gInk.Properties.Resources.icon_white, size);
            }
            else
            {
                trayIcon.Icon = new Icon(gInk.Properties.Resources.icon_red, size);
            }
            trayIcon.ContextMenu = trayMenu;
            trayIcon.Visible     = true;
            trayIcon.MouseClick += TrayIcon_Click;

            int modifier = 0;

            if (Hotkey_Control)
            {
                modifier |= 0x2;
            }
            if (Hotkey_Alt)
            {
                modifier |= 0x1;
            }
            if (Hotkey_Shift)
            {
                modifier |= 0x4;
            }
            if (Hotkey_Win)
            {
                modifier |= 0x8;
            }
            if (modifier != 0)
            {
                RegisterHotKey(IntPtr.Zero, 0, modifier, Hotkey);
            }

            TestMessageFilter mf = new TestMessageFilter(this);

            Application.AddMessageFilter(mf);

            FormCollection = null;
            FormDisplay    = null;
        }
Ejemplo n.º 3
0
        public string SnapshotFileFullPath = "";         // used to record the last snapshot file name, to select it when the balloon is clicked

        public Root()
        {
            for (int p = 0; p < MaxPenCount; p++)
            {
                Hotkey_Pens[p] = new Hotkey();
            }

            trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add(Local.MenuEntryAbout + "...", OnAbout);
            trayMenu.MenuItems.Add(Local.MenuEntryOptions + "...", OnOptions);
            trayMenu.MenuItems.Add("-");
            trayMenu.MenuItems.Add(Local.MenuEntryExit, OnExit);

            SetDefaultPens();
            SetDefaultConfig();
            ReadOptions("pens.ini");
            ReadOptions("config.ini");
            ReadOptions("hotkeys.ini");

            Size size = SystemInformation.SmallIconSize;

            trayIcon                    = new NotifyIcon();
            trayIcon.Text               = "gInk";
            trayIcon.ContextMenu        = trayMenu;
            trayIcon.Visible            = true;
            trayIcon.MouseClick        += TrayIcon_Click;
            trayIcon.BalloonTipText     = Local.NotificationSnapshot;
            trayIcon.BalloonTipClicked += TrayIcon_BalloonTipClicked;
            SetTrayIconColor();

            SetHotkey();

            TestMessageFilter mf = new TestMessageFilter(this);

            Application.AddMessageFilter(mf);

            FormCollection = null;
            FormDisplay    = null;
        }
Ejemplo n.º 4
0
Archivo: Root.cs Proyecto: geovens/gInk
		public int CurrentPen = 1;  // defaut pen

		public Root()
		{
			SetDefaultPens();
			SetDefaultConfig();
			ReadOptions("pens.ini");
			ReadOptions("config.ini");

			trayMenu = new ContextMenu();
			trayMenu.MenuItems.Add("About", OnAbout);
			trayMenu.MenuItems.Add("Pen Configurations", OnPenSetting);
			trayMenu.MenuItems.Add("Options", OnOptions);
			trayMenu.MenuItems.Add("-");
			trayMenu.MenuItems.Add("Exit", OnExit);

            Size size = SystemInformation.SmallIconSize;
            trayIcon = new NotifyIcon();
			trayIcon.Text = "gInk";
			if (WhiteTrayIcon)
				trayIcon.Icon = new Icon(gInk.Properties.Resources.icon_white, size);
			else
				trayIcon.Icon = new Icon(gInk.Properties.Resources.icon_red, size);
			trayIcon.ContextMenu = trayMenu;
			trayIcon.Visible = true;
			trayIcon.MouseClick += TrayIcon_Click;

			int modifier = 0;
			if (Hotkey_Control) modifier |= 0x2;
			if (Hotkey_Alt) modifier |= 0x1;
			if (Hotkey_Shift) modifier |= 0x4;
			if (Hotkey_Win) modifier |= 0x8;
			if (modifier != 0)
				RegisterHotKey(IntPtr.Zero, 0, modifier, Hotkey);

			TestMessageFilter mf = new TestMessageFilter(this);
			Application.AddMessageFilter(mf);

			FormCollection = null;
			FormDisplay = null;
		}
Ejemplo n.º 5
0
        public int CurrentPen = 1;          // defaut pen

        public Root()
        {
            SetDefaultPens();
            SetDefaultConfig();
            ReadOptions("pens.ini");
            ReadOptions("config.ini");

            trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add("About", OnAbout);
            trayMenu.MenuItems.Add("Pen Configurations", OnPenSetting);
            trayMenu.MenuItems.Add("Options", OnOptions);
            trayMenu.MenuItems.Add("-");
            trayMenu.MenuItems.Add("Exit", OnExit);

            Size size = SystemInformation.SmallIconSize;

            trayIcon      = new NotifyIcon();
            trayIcon.Text = "gInk";
            if (WhiteTrayIcon)
            {
                trayIcon.Icon = new Icon("icon_white.ico");
            }
            else
            {
                trayIcon.Icon = new Icon("icon_red.ico");
            }
            trayIcon.ContextMenu        = trayMenu;
            trayIcon.Visible            = true;
            trayIcon.MouseClick        += TrayIcon_Click;
            trayIcon.BalloonTipText     = "Snapshot saved. Click here to browse snapshots.";
            trayIcon.BalloonTipClicked += TrayIcon_BalloonTipClicked;


            int modifier = 0;

            if (Hotkey_Control)
            {
                modifier |= 0x2;
            }
            if (Hotkey_Alt)
            {
                modifier |= 0x1;
            }
            if (Hotkey_Shift)
            {
                modifier |= 0x4;
            }
            if (Hotkey_Win)
            {
                modifier |= 0x8;
            }
            if (modifier != 0)
            {
                RegisterHotKey(IntPtr.Zero, 0, modifier, Hotkey);
            }

            TestMessageFilter mf = new TestMessageFilter(this);

            Application.AddMessageFilter(mf);

            FormCollection = null;
            FormDisplay    = null;
        }