Пример #1
0
    public virtual void OnGUI(int column)
    {
        object v = this.GetValue(column);

        if (v is string[])
        {
            string[] path = v as string[];
            EditorGUILayout.Popup(0, path, GUILayout.Width(150));
        }
        else if (v is List <Material> )
        {
            if (GUILayout.Button("Materials " + (v as List <Material>).Count, GUILayout.Width(150)))
            {
                PopupView.Show((v as List <Material>).ToArray());
            }
        }
        else if (v is List <string> )
        {
            if (GUILayout.Button("String " + (v as List <string>).Count, GUILayout.Width(150)))
            {
                PopupView.Show((v as List <string>).ToArray());
            }
        }
        else if (v is List <Shader> )
        {
            if (GUILayout.Button("Shaders " + (v as List <Shader>).Count, GUILayout.Width(150)))
            {
                PopupView.Show((v as List <Shader>).ToArray());
            }
        }
        else if (v is List <Text> )
        {
            if (GUILayout.Button("Texts " + (v as List <Text>).Count, GUILayout.Width(150)))
            {
                PopupView.Show((v as List <Text>).ToArray());
            }
        }
        else if (v is Object)
        {
            EditorGUILayout.ObjectField(this.GetValue(column) as Object, typeof(Object), GUILayout.Width(150));
        }
        else
        {
            GUIStyle style = new GUIStyle(GUI.skin.label)
            {
                alignment = TextAnchor.MiddleCenter
            };
            style.normal.textColor = this.GetColor(column);
            object obj = this.GetValue(column);
            if (obj != null)
            {
                EditorGUILayout.LabelField(this.GetValue(column).ToString(), style, GUILayout.Width(150));
            }
            else
            {
                EditorGUILayout.LabelField("", style, GUILayout.Width(150));
            }
            GUI.skin.label.normal.textColor = Color.white;
        }
    }
Пример #2
0
    public static void Show(object[] content)
    {
        PopupView view = EditorWindow.GetWindow <PopupView>();

        view.Show();
        view.Objs.Clear();
        view.Objs.AddRange(content);
        view.Process();
    }
Пример #3
0
        private void ShowPopupBtn_TouchUpInside(object sender, EventArgs e)
        {
            UIView alert = new UIView(new CGRect(0, 0, 100, 100));

            alert.BackgroundColor = UIColor.Red;

            PopupView view = PopupView.PopupViewWithContentView(alert);

            view.Show();
        }
Пример #4
0
        public static void PopupView(FormWindowState windowState = FormWindowState.Normal)
        {
            Cursor.Current = Cursors.WaitCursor;

            if (Application.OpenForms["PopupView"] == null)
            {
                PopupView action = new PopupView();
                action.Show();
            }
            else
            {
                {
                    Application.OpenForms["PopupView"].Activate();
                    Application.OpenForms["PopupView"].WindowState = windowState;
                    Application.OpenForms["PopupView"].Show();
                }
            }
        }
        private void CrearNewChart_Clicked(object sender, EventArgs e)
        {
            StackLayout sl = new StackLayout();

            popup1            = new PopupView();
            popup1.PopupStyle = PopupViewStyle.Basic;
            ((PopupBasicStyle)popup1.Element[0]).Title = "My Popup";
            popup1.Show();

            /*
             * StackLayout basePopup = new StackLayout();
             * CustomCheckBox check1 = new CustomCheckBox();
             * CustomCheckBox check2 = new CustomCheckBox();
             * CustomCheckBox check3 = new CustomCheckBox();
             *
             * check1.Text = "Option 1";
             * check2.Text = "Option 2";
             * check3.Text = "Option 3";
             *
             * check1.Pressed += Check_Pressed;
             * check2.Pressed += Check_Pressed;
             * check3.Pressed += Check_Pressed;
             *
             * basePopup.BackgroundColor = Color.White;
             * basePopup.WidthRequest = 300;
             * basePopup.HeightRequest = 200;
             * basePopup.Children.Add(new Label() { Text = "Hola" });
             * basePopup.Children.Add(check1);
             * basePopup.Children.Add(check3);
             * basePopup.Children.Add(check2);
             * basePopup.HorizontalOptions = LayoutOptions.Center;
             * basePopup.VerticalOptions = LayoutOptions.Center;
             *
             * popup.Content = basePopup;
             *
             * ;
             */
        }
Пример #6
0
        public async static void Show(
            UserControl viewToShow,
            UserControl toolbar,
            Brush accentPrimary,
            Brush accentSecondary,
            Brush foregroundTextBrush,
            Brush countdownBackgroundBrush,
            double timeToLive,
            Thickness margin,
            HorizontalAlignment horizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment verticalAlignment     = VerticalAlignment.Center,
            bool autoHide = false,
            double width  = 300,
            double height = 180,
            string button1ClickContent    = "",
            string button1ClickIdentifier = "",
            string button2ClickContent    = "",
            string button2ClickIdentifier = "",
            SumoNinjaMonkey.Framework.Controls.PopupView.eCalloutAlign calloutAlign = PopupView.eCalloutAlign.None,
            string button1MetroIcon   = "",
            double button1Rotation    = 0,
            string button2MetroIcon   = "",
            double button2Rotation    = 0,
            bool showPopupInnerBorder = true
            )
        {
            if (PopupService._rootControl != null)
            {
                DispatchedHandler invokedHandler = new DispatchedHandler(() =>
                {
                    if (PopupService._rootControl == null) //|| PopupService._rootControl.Visibility == Visibility.Visible)
                    {
                        //Move(viewToShow, margin, calloutAlign);

                        return;
                    }
                    PopupService._rootControl.Visibility = Visibility.Visible;
                    PopupView view = new PopupView(
                        viewToShow,
                        accentPrimary,
                        accentSecondary,
                        autoHide,
                        timeToLive,
                        button1ClickContent,
                        button1ClickIdentifier,
                        button2ClickContent,
                        button2ClickIdentifier,
                        width: width,
                        height: height,
                        button1MetroIcon: button1MetroIcon,
                        button1Rotation: button1Rotation,
                        button2MetroIcon: button2MetroIcon,
                        button2Rotation: button2Rotation,
                        toolbar: toolbar,
                        showInnerBorder: showPopupInnerBorder
                        );
                    view.ContentThickness    = new Thickness(0, 0, 0, 0);
                    view.HorizontalAlignment = horizontalAlignment;
                    view.VerticalAlignment   = verticalAlignment;
                    //view.Margin = margin;
                    view.BackgroundFill             = accentPrimary;
                    view.MessageTextForegroundColor = foregroundTextBrush;
                    view.CountdownBackgroundColor   = countdownBackgroundBrush;
                    view.Show(margin.Left, margin.Top);
                    view.CalloutAlign = calloutAlign;
                    view.OnClosing   += new EventHandler(PopupService.view_OnClosing);


                    PopupService._rootControl.Children.Add(view);
                });
                await PopupService._rootControl.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, invokedHandler);
            }
        }