コード例 #1
0
        private void LoadWidget(WidgetType type)
        {
            if (Application.OpenForms["Options"] == null)
            {
                activeWidget = true;

                SetTrayIcon(type);

                switch (type)
                {
                case WidgetType.EyeDropper:
                    globalCursor.Change(@"%systemroot%\Cursors\cross_i.cur");
                    var eyedropper = new EyeDropper();
                    eyedropper.Show();
                    ((IAbrovinkWidget)eyedropper).isClosing += CleanUpWidget;
                    break;

                case WidgetType.Ruler:
                    globalCursor.Change(@"%systemroot%\Cursors\cross_i.cur");
                    var ruler = new Ruler();
                    ruler.isClosing += CleanUpWidget;
                    break;

                default:
                    break;
                }
            }
        }
コード例 #2
0
ファイル: VFXColorField.cs プロジェクト: vault51/Graphics
        void OnEyeDropperMove(TimerState state)
        {
            Color pickerColor = EyeDropper.GetPickedColor();

            if (pickerColor != GetValue())
            {
                SetValue(pickerColor.linear);
            }
        }
コード例 #3
0
ファイル: VFXColorField.cs プロジェクト: vault51/Graphics
        void OnEyeDropperStart(MouseDownEvent e)
        {
            if (EyeDropper.IsOpened)
            {
                return;
            }

            this.m_InitialColor = m_Value;
            EyeDropper.Start(OnGammaColorChanged);
            m_EyeDropperScheduler = this.schedule.Execute(OnEyeDropperMove).Every(10).StartingIn(10).Until(this.ShouldStopWatchingEyeDropper);
        }
コード例 #4
0
 void OnEyeDropperStart(MouseDownEvent e)
 {
     EyeDropper.Start(OnGammaColorChanged);
     m_EyeDropperScheduler = this.schedule.Execute(OnEyeDropperMove).Every(10).StartingIn(10);
     m_EyeDropper.UnregisterCallback <MouseDownEvent>(OnEyeDropperStart);
 }