Ejemplo n.º 1
0
        public SystemTray(IMenuBar host, NotificationArea notificationArea)
        {
            PromotedIcons = new ObservableCollection <NotifyIcon>();

            InitializeComponent();

            _notificationArea = notificationArea;
            DataContext       = _notificationArea;
            Host = host;

            ((INotifyCollectionChanged)PinnedItems.Items).CollectionChanged   += PinnedItems_CollectionChanged;
            ((INotifyCollectionChanged)UnpinnedItems.Items).CollectionChanged += UnpinnedItems_CollectionChanged;

            if (Settings.Instance.SysTrayAlwaysExpanded)
            {
                PromotedItems.Visibility = Visibility.Collapsed;
                UnpinnedItems.Visibility = Visibility.Visible;
            }

            // Don't allow showing both the Windows TaskBar and the Cairo tray
            if (Settings.Instance.EnableSysTray && (Settings.Instance.EnableTaskbar || EnvironmentHelper.IsAppRunningAsShell) && _notificationArea.Handle == IntPtr.Zero)
            {
                _notificationArea.Initialize();
            }
        }
Ejemplo n.º 2
0
Archivo: MenuBar.cs Proyecto: M1C/Eto
 public MenuBar(Generator g)
     : base(g, typeof(IMenuBar))
 {
     //BindingContext = new BindingContext();
     inner = (IMenuBar)base.Handler;
     menuItems = new MenuItemCollection(this, inner);
 }
Ejemplo n.º 3
0
        public Clock(IMenuBar host)
        {
            InitializeComponent();

            _isPrimaryScreen = host.GetIsPrimaryDisplay();

            InitializeClock();
        }
        public override UserControl StartControl(IMenuBar host)
        {
            if (Settings.Instance.EnableMenuExtraActionCenter && EnvironmentHelper.IsWindows10OrBetter && !EnvironmentHelper.IsAppRunningAsShell)
            {
                return(new ActionCenter(host));
            }

            return(null);
        }
Ejemplo n.º 5
0
        public Search(ICairoApplication cairoApplication, IMenuBar host)
        {
            InitializeComponent();

            _cairoApplication = cairoApplication;
            _isPrimaryScreen  = host.GetIsPrimaryDisplay();

            SetupSearch();
        }
Ejemplo n.º 6
0
        public override UserControl StartControl(IMenuBar host)
        {
            if (!Settings.Instance.EnableMenuExtraLayoutSwitcher)
            {
                return(null);
            }

            _layoutSwitcher = new LayoutSwitcher();
            return(_layoutSwitcher);
        }
Ejemplo n.º 7
0
        public override UserControl StartControl(IMenuBar host)
        {
            if (Enabled)
            {
                return(null);
            }

            _volume = new Volume();
            return(_volume);
        }
Ejemplo n.º 8
0
        public override UserControl StartControl(IMenuBar host)
        {
            if (!Settings.Instance.EnableMenuExtraClock)
            {
                return(null);
            }

            _clock = new Clock(host);
            return(_clock);
        }
Ejemplo n.º 9
0
        public override UserControl StartControl(IMenuBar host)
        {
            if (!Settings.Instance.EnableMenuExtraSearch)
            {
                return(null);
            }

            _search = new Search(_cairoApplication, host);
            return(_search);
        }
Ejemplo n.º 10
0
        public override UserControl StartControl(IMenuBar host)
        {
            if (!Settings.Instance.EnableSysTray)
            {
                return(null);
            }

            _systemTray = new SystemTray(host, _notificationArea);
            return(_systemTray);
        }
Ejemplo n.º 11
0
        public ActionCenter(IMenuBar host)
        {
            InitializeComponent();

            _parentHwnd = host.GetHandle();
        }
 public abstract UserControl StartControl(IMenuBar host);
Ejemplo n.º 13
0
 public override UserControl StartControl(IMenuBar menuBar)
 {
     return(new WeatherMenu());
 }
Ejemplo n.º 14
0
 public MenuBarItemCollection(IMenuBar bar)
 {
     this.bar = bar;
 }
Ejemplo n.º 15
0
        public MainWindow()
        {
            InitializeComponent();
            Debug.WriteLine("Initializing UI objects.");

            #region Canvas

            Debug.WriteLine("Loading canvas...");
            this.canvas = new DefaultCanvas();
            this.toolStripContainer1.ContentPanel.Controls.Add((Control)this.canvas);

            #endregion


            #region Menubar

            Debug.WriteLine("Loading menubar...");
            this.menubar = new DefaultMenubar();
            this.Controls.Add((Control)this.menubar);

            DefaultMenuItem fileMenuItem = new DefaultMenuItem("File");
            this.menubar.AddMenuItem(fileMenuItem);

            DefaultMenuItem newMenuItem = new DefaultMenuItem("New");
            fileMenuItem.AddMenuItem(newMenuItem);
            fileMenuItem.AddSeparator();
            DefaultMenuItem exitMenuItem = new DefaultMenuItem("Exit");
            fileMenuItem.AddMenuItem(exitMenuItem);
            exitMenuItem.Click += new System.EventHandler(this.OnexitMenuItemClick);

            DefaultMenuItem editMenuItem = new DefaultMenuItem("Edit");
            this.menubar.AddMenuItem(editMenuItem);

            //Disini untuk membuat Default Menu item, ini tombol yang tempatnya di MenuBar
            //Dia akan melakukan perintah this.OnundoMenuItemClick
            //Coba find ini OnundoMenuItemClick
            //Ada di line 169
            DefaultMenuItem undoMenuItem = new DefaultMenuItem("Undo");
            editMenuItem.AddMenuItem(undoMenuItem);
            undoMenuItem.Click += new System.EventHandler(this.OnundoMenuItemClick);

            DefaultMenuItem redoMenuItem = new DefaultMenuItem("Redo");
            editMenuItem.AddMenuItem(redoMenuItem);
            redoMenuItem.Click += new System.EventHandler(this.OnredoMenuItemClick);

            DefaultMenuItem viewMenuItem = new DefaultMenuItem("View");
            this.menubar.AddMenuItem(viewMenuItem);

            DefaultMenuItem helpMenuItem = new DefaultMenuItem("Help");
            this.menubar.AddMenuItem(helpMenuItem);

            DefaultMenuItem aboutMenuItem = new DefaultMenuItem("About");
            helpMenuItem.AddMenuItem(aboutMenuItem);
            helpMenuItem.Click += new System.EventHandler(this.OnaboutMenuItemClick);

            #endregion

            #region Toolbox

            // Initializing toolbox
            Debug.WriteLine("Loading toolbox...");
            this.tool_box = new DefaultToolbox();
            this.toolStripContainer1.LeftToolStripPanel.Controls.Add((Control)this.tool_box);

            #endregion

            #region Tools

            // Initializing tools
            Debug.WriteLine("Loading tools...");
            //this.tool_box.AddTool(new SelectionTool());
            this.tool_box.AddSeparator();
            this.tool_box.AddTool(new LineTool());
            this.tool_box.AddTool(new DiamondTool());
            this.tool_box.AddTool(new RectangleTool());
            this.tool_box.AddTool(new ParallelogramTool());
            this.tool_box.AddTool(new OvalTool());
            this.tool_box.AddTool(new SelectionTool());
            //this.tool_box.AddTool(new StatefulLineTool());
            //this.tool_box.AddTool(new RectangleTool());
            this.tool_box.tool_selected += Toolbox_ToolSelected;

            #endregion

            #region Toolbar

            // Initializing toolbar
            Debug.WriteLine("Loading toolbar...");
            this.toolbar = new DefaultToolbar();
            this.toolStripContainer1.TopToolStripPanel.Controls.Add((Control)this.toolbar);

            //Nah Kita sekarang disini,
            //Di program utama dari program ini,
            //Kita butuh undo disini, jadi perlu dipanggil dulu undoCommand yang udah dibuat tadi,
            //Inisialisasinya kayak gini NamaKelas variableKelas = new NamaKelas(variableYangAkanDiKirim)
            //Nha dia akan ngirim variable this.canvas (Canvas yang sedang dipakai)
            //Kalau disini dia bakal muncul di Toolbar
            //Sebenarnya gausah di inisialisasi karena dicanvas sendiri sudah implement undoredo sejak ada di ICanvas
            //sehingga kalau manggil canvas maka udah bisa dipanggil undo yang udah dibuat tadi
            UndoCommand undoCmd = new UndoCommand(this.canvas);
            RedoCommand redoCmd = new RedoCommand(this.canvas);

            Undo toolItemUndo = new Undo();
            toolItemUndo.SetCommand(undoCmd);
            Redo toolItemRedo = new Redo();
            toolItemRedo.SetCommand(redoCmd);

            this.toolbar.AddToolbarItem(toolItemUndo);
            this.toolbar.AddSeparator();
            this.toolbar.AddToolbarItem(toolItemRedo);
            #endregion
        }
Ejemplo n.º 16
0
		protected MenuBar (Generator generator, Type type, bool initialize = true)
			: base (generator, type, initialize)
		{
			handler = (IMenuBar)base.Handler;
			menuItems = new MenuItemCollection (this, handler);
		}
Ejemplo n.º 17
0
 protected MenuBar(Generator generator, Type type, bool initialize = true)
     : base(generator, type, initialize)
 {
     handler   = (IMenuBar)base.Handler;
     menuItems = new MenuItemCollection(this, handler);
 }