예제 #1
0
파일: Bezel.cs 프로젝트: codecopy/core-1
        void Build()
        {
            Decorated    = false;
            AppPaintable = true;
            KeepAbove    = true;

            TypeHint = WindowTypeHint.Splashscreen;
            SetColormap();

            bezel_drawing_area = new BezelDrawingArea(controller, RenderTheme, false);
            bezel_drawing_area.Show();

            bezel_glass_results = bezel_drawing_area.Results;
            bezel_glass_window  = new BezelGlassWindow(bezel_glass_results);

            Add(bezel_drawing_area);

            pw = new PositionWindow(this, bezel_glass_window);

            Realized += delegate {
                GdkWindow.SetBackPixmap(null, false);
                GdkWindow.OverrideRedirect = true;
            };

            StyleSet += delegate {
                if (IsRealized)
                {
                    GdkWindow.SetBackPixmap(null, false);
                }
            };
        }
예제 #2
0
        public void TestResultsWindowIsBelowMainWindow()
        {
            Gtk.Window main    = new Gtk.Window("Test Main Window");
            Gtk.Window results = new Gtk.Window("Test Results Window");

            main.Resize(200, 100);
            results.Resize(200, 100);

            Gdk.Rectangle resultsOffset = new Gdk.Rectangle(0, 10, 0, 0);

            var positioner = new PositionWindow(main, results);

            positioner.UpdatePosition(10, Pane.First, resultsOffset);

            // Drain the event loop
            while (Gtk.Global.EventsPending)
            {
                Gtk.Main.Iteration();
            }

            int main_x, main_y;
            int results_x, results_y;

            main.GetPosition(out main_x, out main_y);
            results.GetPosition(out results_x, out results_y);
            Assert.Greater(results_y, main_y + 100);
        }
예제 #3
0
        public void TestSingleHeadPositionCalc()
        {
            var positioner        = new PositionWindow(null, null);
            var calculatePosition = positioner.GetType().GetMethod("CalculateBasePosition",
                                                                   System.Reflection.BindingFlags.NonPublic |
                                                                   System.Reflection.BindingFlags.Instance);

            // Single-head displays have an origin of (0,0)
            Gdk.Rectangle screen = new Gdk.Rectangle(0, 0, 1024, 768);
            // We only care about width and height here
            Gdk.Rectangle window = new Gdk.Rectangle(0, 0, 200, 100);

            object[]      parameters = new object[] { screen, window, new Gdk.Rectangle() };
            Gdk.Rectangle result     = (Gdk.Rectangle)calculatePosition.Invoke(positioner, parameters);

            Assert.AreEqual(412, result.X);
            Assert.AreEqual(267, result.Y);
        }
예제 #4
0
        private void PositionWindowList()
        {
            PositionWindow newPositionWindow = new PositionWindow();

            newPositionWindow.Show();
        }
예제 #5
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            ticks2 += 1;
            if (ticks2 > 15)
            {
                if (ServiceManager.isServiceRunning("W32Time"))
                {
                    WT.BackColor = Color.Green;
                }
                else
                {
                    WT.BackColor = Color.Red;
                }

                if (ServiceManager.isServiceRunning("Dimension4"))
                {
                    D4.BackColor = Color.Green;
                }
                else
                {
                    D4.BackColor = Color.Red;
                }

                ticks2 = 0;
                DateTime start = DateTime.Now;

                DateTime dn = GetNetworkTime(GovCheck.Checked);
                if (dn.ToString("yyyymmdd").Equals("18990101"))
                {
                    return;
                }
                if (dn < oldestDate)
                {
                    return;
                }

                if (!(DateTime.Now.ToString().Equals(dn.ToString())))
                {
                    if (AdminLabel.BackColor == Color.LightGreen)
                    {
                        if (checkBox1.Checked)
                        {
                            DateTime st = DateTime.Now;
                            label2.Text      = "Auto Sync: " + SetAC9HPSystemTime.SetTime(dn, LastTime);
                            label2.BackColor = Color.LightSeaGreen;
                            DateTime et = DateTime.Now;
                            TimeSpan ts = (et - st);
                            LastTime     = ts.Milliseconds;
                            MSLabel.Text = LastTime.ToString() + " ms";
                        }
                    }
                }

                //dock with flex helper app if its running.
                foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses())
                {
                    if (p.ProcessName.Equals("TouchRadio"))
                    {
                        try
                        {
                            if (FlexDock.Checked)
                            {
                                PositionWindow.Rect myrect = PositionWindow.getpos("TouchRadio");
                                this.Top  = myrect.Top - 200;
                                this.Left = myrect.Left;
                            }
                        }
                        catch (Exception ex)
                        { }
                    }
                }
            }
        }