Exemplo n.º 1
0
        public WindowSidebar()
        {
            PInvokeUtils.RECT rc = new PInvokeUtils.RECT();

            var flags = SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_ALPHA |
                        SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_MAIN |
                        SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_ENABLE_DEBUG |
                        SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_TOOL;
            var wnd = this;

            wnd.CreateWindow(rc, flags);
            wnd.Title = Consts.AppName;

            var deleg = new WindowDelegate();

            wnd._nsview.Window.Delegate  = deleg;
            wnd._nsview.Window.Level     = NSWindowLevel.Floating;
            wnd._nsview.Window.StyleMask = wnd._nsview.Window.StyleMask & ~NSWindowStyle.Resizable;

            // Create status bar item
            _sItem       = NSStatusBar.SystemStatusBar.CreateStatusItem(26);
            _sItem.Image = NSImage.FromStream(File.OpenRead(NSBundle.MainBundle.ResourcePath + @"/drop.png"));
            //_sItem.AlternateImage = NSImage.FromStream(File.OpenRead(NSBundle.MainBundle.ResourcePath + @"/icon_menubarX2.png"));
            _sItem.Image.Template = true;
            _sItem.Action         = new ObjCRuntime.Selector("OnIconClick");
            _sItem.Target         = deleg;
        }
Exemplo n.º 2
0
        public WindowSidebar()
        {
            var frm = NSScreen.MainScreen.VisibleFrame;

            PInvokeUtils.RECT rc = new PInvokeUtils.RECT()
            {
                right  = 670,
                bottom = (int)frm.Height - 50
            };

            var flags = SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_ALPHA |
                        SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_MAIN |
                        SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_ENABLE_DEBUG |
                        SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_TOOL;
            var wnd = this;

            wnd.CreateWindow(rc, flags);
            wnd.Title = Consts.AppName;

            var deleg = new WindowDelegate();

            wnd._nsview.Window.Delegate = deleg;
            wnd._nsview.Window.Level    = NSWindowLevel.Floating;

            // Create status bar item
            _sItem                = NSStatusBar.SystemStatusBar.CreateStatusItem(25);
            _sItem.Image          = NSImage.FromStream(File.OpenRead(NSBundle.MainBundle.ResourcePath + @"/drop.png"));
            _sItem.Image.Template = true;
            _sItem.Action         = new ObjCRuntime.Selector("OnIconClick");
            _sItem.Target         = deleg;
            _sItem.HighlightMode  = true;
        }