Ejemplo n.º 1
0
        private static void SetBitIf <T, U> (ref T style, U bit, WindowButton value)
        {
            var ustyle = style.To <uint>();
            var ubit   = bit.To <uint>();

            style = (value != 0 ? ustyle | ubit : ustyle & ~ubit).To <T>();
        }
Ejemplo n.º 2
0
        public Menu()
        {
            InitializeComponent();
            SettingsButton.Text("Settings");
            HistoryButton.Text("History");
            BookmarksButton.Text("Bookmarks");
            DownloadsButton.Text("Downloads");
            ExtensionsButton.Text("Extensions");
            WindowButton.Text("New window");
            FullscreenButton.Text("Fullscreen");
            ScreenButton.Text("Take screenshot");
            DevButton.Text("Developer tools");
            IncognitoButton.Text("Incognito");

            SettingsButton.ImageSource("settings.png");
            HistoryButton.ImageSource("history.png");
            BookmarksButton.ImageSource("bookmarks.png");
            DownloadsButton.ImageSource("download.png");
            ExtensionsButton.ImageSource("extension.png");
            WindowButton.ImageSource(("window.png"));
            FullscreenButton.ImageSource("fullscreen.png");
            ScreenButton.ImageSource("screen.png");
            DevButton.ImageSource("dev.png");
            IncognitoButton.ImageSource("privacy.png");
        }
Ejemplo n.º 3
0
    private void createNewWindow(string pictureIndex, int spriteIndex)
    {
        GameObject    go   = Instantiate(windowPrefab, mainScreen.transform);
        RectTransform rect = go.GetComponent <RectTransform>();

        rect.localPosition = Vector2.zero;
        rect.anchorMin     = ImgPrePos[preposIndex]._anchorMin;
        rect.anchorMax     = ImgPrePos[preposIndex]._anchorMax;
        rect.offsetMin     = Vector2.zero;
        rect.offsetMax     = Vector2.zero;
        Image[] imgs = go.GetComponentsInChildren <Image>();
        foreach (Image img in imgs)
        {
            if (img.name == "InternPicture")
            {
                img.sprite = resources._datas[pictureIndex].getshowPicIndex(spriteIndex)._normalImg;
            }
        }
        WindowButton winbtn = go.GetComponentInChildren <WindowButton>();

        winbtn.controler = this;
        winbtn.idPic     = pictureIndex;
        winbtn.subIndex  = spriteIndex;
        go.transform.SetAsLastSibling();
        SidePanel.transform.SetAsLastSibling();
        if (picShow[picShowIndex] != null)
        {
            Destroy(picShow[picShowIndex]);
        }
        picShow[picShowIndex] = go;
        ++picShowIndex;
        picShowIndex = picShowIndex % maxPicShow;
        ++preposIndex;
        preposIndex = preposIndex % ImgPrePos.Length;
    }
Ejemplo n.º 4
0
        private static void print(EOsType type)
        {
            IButton button = null;
            IText   text   = null;

            switch (type)
            {
            case EOsType.Window:
                button = new WindowButton();
                text   = new WindowText();
                break;

            case EOsType.Mac:
                button = new MacButton();
                text   = new MacText();
                break;
            }

            button.click_Button();
            text.text_Description();
        }
Ejemplo n.º 5
0
        public override void OnApplyTemplate()
        {
            this.closeButton = this.GetTemplateChild("PART_ButtonBar_CloseButton") as WindowButton;
            if (this.closeButton != null)
            {
                this.closeButton.Click += CloseWindow;
            }

            this.maximizeButton = this.GetTemplateChild("PART_ButtonBar_MaximizeButton") as WindowButton;
            if (this.maximizeButton != null)
            {
                this.maximizeButton.Click += ToggleMaximizeWindow;
            }

            this.minimizeButton = this.GetTemplateChild("PART_ButtonBar_MinimizeButton") as WindowButton;
            if (this.minimizeButton != null)
            {
                this.minimizeButton.Click += ToggleMinimizeWindow;
            }

            this.Tumblr = this.GetTemplateChild("PART_Tumblr") as Image;
        }
Ejemplo n.º 6
0
        public override void OnApplyTemplate()
        {
            _closeButton = GetTemplateChild("PART_ButtonBar_CloseButton") as WindowButton;
            if (_closeButton != null)
            {
                _closeButton.Click += CloseWindow;
            }

            _maximizeButton = GetTemplateChild("PART_ButtonBar_MaximizeButton") as WindowButton;
            if (_maximizeButton != null)
            {
                _maximizeButton.Click += ToggleMaximizeWindow;
            }

            _minimizeButton = GetTemplateChild("PART_ButtonBar_MinimizeButton") as WindowButton;
            if (_minimizeButton != null)
            {
                _minimizeButton.Click += ToggleMinimizeWindow;
            }

            Tumblr = GetTemplateChild("PART_Tumblr") as Image;
        }
Ejemplo n.º 7
0
 public static void SetWindowButtons(Window d, WindowButton value)
 {
     d.SetValue(WindowButtonsProperty, value);
 }
Ejemplo n.º 8
0
 public WindowClosedByUserEventArgs(WindowButton dialogButton)
 {
     this.Button = dialogButton;
 }
Ejemplo n.º 9
0
 public WindowClosedByUserEventArgs(WindowButton dialogButton)
 {
     this.Button = dialogButton;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Handles the click event of the cancel button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnCancelButtonClick(object sender, RoutedEventArgs e)
 {
     if (this.ShowAsDialog)
     {
         this.DialogResult = false;
     }
     else
     {
         this._windowResult = WindowButton.No;
         this.Close();
     }
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Handles the click event of the accept button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnAcceptButtonClick(object sender, RoutedEventArgs e)
        {
            var args = new CancelEventArgs();

            this.RaiseDialogValidateOperations(args);

            if (!args.Cancel)
            {
                if (this.ShowAsDialog)
                {
                    this.DialogResult = true;
                }
                else
                {
                    this._windowResult = WindowButton.Yes;

                    this.Close();
                }
            }
        }