Пример #1
0
    private static void HandleUiimagewidgetEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uiimagewidgetcode")
            {
                AtomicMain.AppLog("UIImageWidget support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uiimagewidget.cs", widget.GetParent());
            }
            if (widget.GetId() == "uiimagewidgetlayout")
            {
                AtomicMain.AppLog("UIImageWidget support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uiimagewidget.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "imagecolor")
            {
                AtomicMain.AppLog("UIImageWidget action : " + widget.GetId() + " was pressed ");
                UIImageWidget img1 = (UIImageWidget)widget.FindWidget("imagewidgetdemo");
                img1.SetImage("Textures/HSV21.png");
            }
            if (widget.GetId() == "imagenewbuild")
            {
                AtomicMain.AppLog("UIImageWidget action : " + widget.GetId() + " was pressed ");
                UIImageWidget img1 = (UIImageWidget)widget.FindWidget("imagewidgetdemo");
                img1.SetImage("Textures/newbuilddetected_header.jpg");
            }
        }
    }
Пример #2
0
    private static void HandleUiclicklabelEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uiclicklabelcode")
            {
                AtomicMain.AppLog("UIClickLabel support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uiclicklabel.cs", widget.GetParent());
            }
            if (widget.GetId() == "uiclicklabellayout")
            {
                AtomicMain.AppLog("UIClickLabel support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uiclicklabel.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "somecheck")
            {
                AtomicMain.AppLog("UIClickLabel event : " + widget.GetId() + " was pressed, state = " + widget.GetValue().ToString());
            }
            if (widget.GetId() == "someradio")
            {
                AtomicMain.AppLog("UIClickLabel event : " + widget.GetId() + " was pressed, state = " + widget.GetValue().ToString());
            }
        }
    }
Пример #3
0
    private static void HandleUisceneviewEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uisceneviewcode")
            {
                AtomicMain.AppLog("UISceneView support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uisceneview.cs", widget.GetParent());
            }
            if (widget.GetId() == "uisceneviewlayout")
            {
                AtomicMain.AppLog("UISceneView support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uisceneview.ui.txt", widget.GetParent());
            }
        }
        if (widget.GetId() == "UISceneViewDemo")
        {
            AtomicMain.AppLog("UISceneView event : " + widget.GetId() + " got event= " + AtomicMain.EventReport((int)ev.Type));
        }
    }
Пример #4
0
    private static void HandleUipromptwindowEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uipromptwindowcode")
            {
                AtomicMain.AppLog("UIPromptWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uipromptwindow.cs", widget.GetParent());
            }
            if (widget.GetId() == "uipromptwindowlayout")
            {
                AtomicMain.AppLog("UIPromptWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uipromptwindow.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "stringfinder")
            {
                AtomicMain.AppLog("UIPromptWindow action : " + widget.GetId() + " was pressed ");
                UIWidget       someview = (UIWidget  )widget.GetView();
                UIPromptWindow windowp  = new  UIPromptWindow(someview, widget.GetId());
                windowp.SubscribeToEvent <UIPromptCompleteEvent> (windowp, HandlePromptCompleteEvent);
                windowp.Show("WindowTitle", "Message in window", "preset value", 0, 0, 0);
            }
        }
    }
Пример #5
0
    private static void HandleUicolorwheelEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uicolorwheelcode")
            {
                AtomicMain.AppLog("UIColorWheel support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uicolorwheel.cs", widget.GetParent());
            }
            if (widget.GetId() == "uicolorwheellayout")
            {
                AtomicMain.AppLog("UIColorWheel support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uicolorwheel.ui.txt", widget.GetParent());
            }
        }
        else if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED)
        {
            if (widget.GetId() == "colorwheeldemo")
            {
                UIColorWheel cwx = (UIColorWheel)widget; // collect click color info
                if (!cwx.Equals(null))
                {
                    AtomicMain.AppLog("UIColorWheel event : " + widget.GetId() + " hue = " + cwx.GetHue().ToString() + " saturation = " + cwx.GetSaturation().ToString());
                }
            }
        }
    }
Пример #6
0
    private static void HandleUieditfieldEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uieditfieldcode")
            {
                AtomicMain.AppLog("UIEditField support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uieditfield.cs", widget.GetParent());
            }
            if (widget.GetId() == "uieditfieldlayout")
            {
                AtomicMain.AppLog("UIEditField support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uieditfield.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "editfieldadd")
            {
                AtomicMain.AppLog("UIEditField action : " + widget.GetId() + " was pressed ");
                UIEditField ef1 = (UIEditField)widget.FindWidget("editfieldmulti");
                if (!ef1.Equals(null))
                {
                    var    cache = GetSubsystem <ResourceCache>();
                    File   filex = cache.GetFile("Scenes/layout_uieditfield.ui.txt");
                    String textx = filex.ReadText();
                    filex.Close();
                    ef1.SetText(textx);
                }
            }
            if (widget.GetId() == "editfieldclr")
            {
                AtomicMain.AppLog("UIEditField action : " + widget.GetId() + " was pressed ");
                UIEditField ef1 = (UIEditField)widget.FindWidget("editfieldmulti");
                if (!ef1.Equals(null))
                {
                    ef1.SetText("");
                }
            }
        }
        else
        {
            if (widget.GetId() == "editfieldsingle")
            {
                UIEditField efx = (UIEditField)widget;
                AtomicMain.AppLog("UIEditField event : " + widget.GetId() + " text = `" + efx.GetText() + "` event type = " + AtomicMain.EventReport((int)ev.Type));
            }
            if (widget.GetId() == "editfieldmulti")
            {
                UIEditField efx = (UIEditField)widget;
                AtomicMain.AppLog("UIEditField event : " + widget.GetId() + " text = `" + efx.GetText() + "` event type = " + AtomicMain.EventReport((int)ev.Type));
            }
        }
    }
Пример #7
0
    private static void HandleUipulldownmenuEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uipulldownmenucode")
            {
                AtomicMain.AppLog("UIPulldownMenu support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uipulldownmenu.cs", widget.GetParent());
            }
            if (widget.GetId() == "uipulldownmenulayout")
            {
                AtomicMain.AppLog("UIPulldownMenu support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uipulldownmenu.ui.txt", widget.GetParent());
            }
        }
        else if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED)
        {
            if (widget.GetId() == "FileMenu")
            {
                UIPulldownMenu pdm = (UIPulldownMenu)widget;
                if (!pdm.Equals(null))
                {
                    AtomicMain.AppLog("UIPulldownMenu event : " + widget.GetId() + " selected entry = " + pdm.GetSelectedId());
                }
            }
            if (widget.GetId() == "EditMenu")
            {
                UIPulldownMenu pdm = (UIPulldownMenu)widget;
                if (!pdm.Equals(null))
                {
                    AtomicMain.AppLog("UIPulldownMenu event : " + widget.GetId() + " selected entry = " + pdm.GetSelectedId());
                }
            }
            if (widget.GetId() == "ViewMenu")
            {
                UIPulldownMenu pdm = (UIPulldownMenu)widget;
                if (!pdm.Equals(null))
                {
                    AtomicMain.AppLog("UIPulldownMenu event : " + widget.GetId() + " selected entry = " + pdm.GetSelectedId());
                }
            }
            if (widget.GetId() == "HelpMenu")
            {
                UIPulldownMenu pdm = (UIPulldownMenu)widget;
                if (!pdm.Equals(null))
                {
                    AtomicMain.AppLog("UIPulldownMenu event : " + widget.GetId() + " selected entry = " + pdm.GetSelectedId());
                }
            }
        }
    }
Пример #8
0
    private static void HandleUicolorwidgetEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uicolorwidgetcode")
            {
                AtomicMain.AppLog("UIColorWidget support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uicolorwidget.cs", widget.GetParent());
            }
            if (widget.GetId() == "uicolorwidgetlayout")
            {
                AtomicMain.AppLog("UIColorWidget support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uicolorwidget.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "uicolorwidgetred")
            {
                AtomicMain.AppLog("UIColorWidget action : " + widget.GetId() + " was pressed ");
                UIColorWidget clw = (UIColorWidget)widget.FindWidget("colorwidgetdemo");
                if (!clw.Equals(null))
                {
                    clw.SetColorString("#FF1111");
                }
            }
            if (widget.GetId() == "uicolorwidgetgreen")
            {
                AtomicMain.AppLog("UIColorWidget action : " + widget.GetId() + " was pressed ");
                UIColorWidget clw = (UIColorWidget)widget.FindWidget("colorwidgetdemo");
                if (!clw.Equals(null))
                {
                    clw.SetColorString("#11FF11");
                }
            }
            if (widget.GetId() == "uicolorwidgetblue")
            {
                AtomicMain.AppLog("UIColorWidget action : " + widget.GetId() + " was pressed ");
                UIColorWidget clw = (UIColorWidget)widget.FindWidget("colorwidgetdemo");
                if (!clw.Equals(null))
                {
                    clw.SetColorString("#1111FF");
                }
            }
        }
    }
Пример #9
0
    private static void HandleUimenuwindowEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;
        string   refid  = (string)ev.RefID;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uimenuwindowcode")
            {
                AtomicMain.AppLog("UIMenuWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uimenuwindow.cs", widget.GetParent());
            }
            if (widget.GetId() == "uimenuwindowlayout")
            {
                AtomicMain.AppLog("UIMenuWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uimenuwindow.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "uimenuwindowpush")
            {
                AtomicMain.AppLog("UIMenuWindow action : " + widget.GetId() + " was pressed ");
                UIMenuWindow     mymenuwindow = new UIMenuWindow(widget, "MenuWindowDemo");
                UIMenuItemSource mis          = new UIMenuItemSource();
                mis.AddItem(new UIMenuItem("UISelectItem1", "item1"));
                mis.AddItem(new UIMenuItem("UISelectItem2", "item2", "Ctrl+C"));
                mis.AddItem(new UIMenuItem("UISelectItem3", "item3", "Ctrl+A", "DuckButton"));
                mis.AddItem(new UIMenuItem("UISelectItem4", "item4", "Ctrl+O", "LogoAtomic"));
                int xx = widget.GetX() + (widget.GetWidth() / 2);
                int yy = widget.GetY() + (widget.GetHeight() / 2);
                mymenuwindow.SubscribeToEvent <WidgetEvent> (mymenuwindow, HandleUimenuwindowEvent);
                mymenuwindow.Show(mis, xx, yy);
            }

            if (widget.GetId() == "MenuWindowDemo")
            {
                AtomicMain.AppLog("UIMenuWindow event : " + widget.GetId() + " and " + refid + " was selected ");
            }
        }
        else
        {
            if (widget.GetId() == "MenuWindowDemo")
            {
                AtomicMain.AppLog("UIMenuWindow event : " + widget.GetId() + " refid=" + refid + " event type=" + AtomicMain.EventReport((int)ev.Type));
            }
        }
    }
Пример #10
0
    private static void HandleAllTabcontainerEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }

        if (widget.GetId() == "UITabContainerDemo" && ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_TAB_CHANGED)
        {
            UITabContainer tcx = (UITabContainer)widget;   // check the focus & stuff, or it gets a little spammy
            AtomicMain.AppLog("UITabContainer event : " + widget.GetId() + " UI_EVENT_TYPE_TAB_CHANGED to " + tcx.GetCurrentPage().ToString()
                              + " id: " + tcx.GetCurrentPageWidget().GetId());
        }
    }
Пример #11
0
    private static void HandleUiradiobuttonEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uiradiobuttoncode")
            {
                AtomicMain.AppLog("UIRadioButton support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uiradiobutton.cs", widget.GetParent());
            }
            if (widget.GetId() == "uiradiobuttonlayout")
            {
                AtomicMain.AppLog("UIRadioButton support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uiradiobutton.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "demoradio")
            {
                AtomicMain.AppLog("UIRadioButton event : " + widget.GetId() + " was pressed, state = " + widget.GetValue().ToString());
            }

            if (widget.GetId() == "radioset")
            {
                UIWidget demochk = widget.FindWidget("demoradio");
                if (!demochk.Equals(null))
                {
                    demochk.SetValue(1);
                    AtomicMain.AppLog("UIRadioButton action : " + widget.GetId() + " was pressed, set state to 1");
                }
            }
            if (widget.GetId() == "radiounset")
            {
                UIWidget demochk = widget.FindWidget("demoradio");
                if (!demochk.Equals(null))
                {
                    demochk.SetValue(0);
                    AtomicMain.AppLog("UIRadioButton action : " + widget.GetId() + " was pressed, set state to 0");
                }
            }
        }
    }
Пример #12
0
    private static void HandleUiinlineselectEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uiinlineselectcode")
            {
                AtomicMain.AppLog("UIInlineSelect support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uiinlineselect.cs", widget.GetParent());
            }
            if (widget.GetId() == "uiinlineselectlayout")
            {
                AtomicMain.AppLog("UIInlineSelect support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uiinlineselect.ui.txt", widget.GetParent());
            }
        }
        else if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED)
        {
            if (widget.GetId() == "inlineselectdemo")
            {
                UIInlineSelect ils = (UIInlineSelect)widget;
                if (!ils.Equals(null))
                {
                    AtomicMain.AppLog("UIInlineSelect event : " + widget.GetId() + " changed value to " + ils.GetValue().ToString());
                }
            }
            if (widget.GetId() == "ilsstep")
            {
                UISlider steps = (UISlider)widget;
                if (!steps.Equals(null))
                {
                    UIInlineSelect ils = (UIInlineSelect)widget.FindWidget("inlineselectdemo");
                    if (!ils.Equals(null))
                    {
                        ils.SetStepSize(steps.GetValue());
                    }
                    AtomicMain.AppLog("UIInlineSelect event : " + widget.GetId() + " step size changed to " + steps.GetValue().ToString());
                }
            }
        }
    }
Пример #13
0
    private static void HandleAllScrollcontainerEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }

        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED)
        {
            if (widget.GetId() == "scrollbardemo")
            {
                AtomicMain.AppLog("UIScrollBar action : " + widget.GetId() + " changed value to " + widget.GetValue().ToString());
            }
        }
    }
    private static void HandleAllSelectdropdownEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }

        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED)
        {
            if (widget.GetId() == "selectdropdowndemo")
            {
                AtomicMain.AppLog("UISelectDropdown event : " + widget.GetId() + " changed value to " + widget.GetText());
            }
        }
    }
Пример #15
0
    private static void HandleUitexturewidgetEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uitexturewidgetcode")
            {
                AtomicMain.AppLog("UITextureWidget support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uitexturewidget.cs", widget.GetParent());
            }
            if (widget.GetId() == "uitexturewidgetlayout")
            {
                AtomicMain.AppLog("UITextureWidget support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uitexturewidget.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "uitexturewidgetch1")
            {
                AtomicMain.AppLog("UITextureWidget support : " + widget.GetId() + " was pressed ");
                var             cache = GetSubsystem <ResourceCache>();
                UITextureWidget tw    = (UITextureWidget)widget.FindWidget("UITextureWidgetDemo");
                tw.SetTexture(cache.GetResource <Texture2D>("Textures/newbuilddetected_header.jpg"));
            }
            if (widget.GetId() == "uitexturewidgetch2")
            {
                AtomicMain.AppLog("UITextureWidget support : " + widget.GetId() + " was pressed ");
                var             cache = GetSubsystem <ResourceCache>();
                UITextureWidget tw    = (UITextureWidget)widget.FindWidget("UITextureWidgetDemo");
                tw.SetTexture(cache.GetResource <Texture2D>("Textures/HSV21.png"));
            }
            if (widget.GetId() == "uitexturewidgetch3")
            {
                AtomicMain.AppLog("UITextureWidget support : " + widget.GetId() + " was pressed ");
                var             cache = GetSubsystem <ResourceCache>();
                UITextureWidget tw    = (UITextureWidget)widget.FindWidget("UITextureWidgetDemo");
                tw.SetTexture(cache.GetResource <Texture2D>("Textures/planet.jpg"));
            }
        }
    }
Пример #16
0
    private static void HandleUibuttonEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uibuttoncode")
            {
                AtomicMain.AppLog("UIButton support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uibutton.cs", widget.GetParent());
            }
            if (widget.GetId() == "uibuttonlayout")
            {
                AtomicMain.AppLog("UIButton support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uibutton.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "demobutton")
            {
                AtomicMain.AppLog("UIButton action : " + widget.GetId() + " was pressed ");
            }
            if (widget.GetId() == "buttonducky")
            {
                AtomicMain.AppLog("UIButton action : " + widget.GetId() + " was pressed ");
            }
            if (widget.GetId() == "buttonready")
            {
                AtomicMain.AppLog("UIButton action : " + widget.GetId() + " was pressed ");
            }
            if (widget.GetId() == "buttonatomic")
            {
                AtomicMain.AppLog("UIButton action : " + widget.GetId() + " was pressed ");
            }
            if (widget.GetId() == "buttongreen")
            {
                AtomicMain.AppLog("UIButton action : " + widget.GetId() + " was pressed ");
            }
        }
    }
    private static void HandleUifontdescriptionEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uifontdescriptioncode")
            {
                AtomicMain.AppLog("UIFontdescription support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uifontdescription.cs", widget.GetParent());
            }
            if (widget.GetId() == "uifontdescriptionlayout")
            {
                AtomicMain.AppLog("UIFontdescription support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uifontdescription.ui.txt", widget.GetParent());
            }
        }
        else if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED)
        {
            if (widget.GetId() == "fontstep")
            {
                UISlider uis = (UISlider)widget;
                if (!uis.Equals(null))
                {
                    UITextField       mytext = (UITextField)widget.FindWidget("changetext");
                    UIFontDescription myfont = new UIFontDescription();
                    int mysize = (int)uis.GetValue();
                    myfont.SetSize(mysize);
                    myfont.SetId("Vera");
                    mytext.SetFontDescription(myfont);
                    mytext.SetText("Size " + mysize);
                    AtomicMain.AppLog("UIFontdescription action : " + widget.GetId() + " step size changed to " + mysize);
                }
            }
        }
    }
Пример #18
0
    private static void HandleUifinderwindowEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uifinderwindowcode")
            {
                AtomicMain.AppLog("UIFinderWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uifinderwindow.cs", widget.GetParent());
            }
            if (widget.GetId() == "uifinderwindowlayout")
            {
                AtomicMain.AppLog("UIFinderWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uifinderwindow.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "filefinder")
            {
                AtomicMain.AppLog("UIFinderWindow action : " + widget.GetId() + " was pressed ");
                UIWidget       someview = (UIWidget)widget.GetView();
                UIFinderWindow windowf  = new UIFinderWindow(someview, widget.GetId());
                windowf.SubscribeToEvent <UIFinderCompleteEvent> (windowf, HandleFinderCompleteEvent);
                windowf.FindFile("Find a File", "", 0, 0, 0);
            }
            if (widget.GetId() == "folderfinder")
            {
                AtomicMain.AppLog("UIFinderWindow action : " + widget.GetId() + " was pressed ");
                UIWidget       someview = (UIWidget)widget.GetView();
                UIFinderWindow windowd  = new UIFinderWindow(someview, widget.GetId());
                windowd.SubscribeToEvent <UIFinderCompleteEvent> (windowd, HandleFinderCompleteEvent);
                windowd.FindPath("Find a Folder", "", 0, 0, 0);
            }
        }
    }
Пример #19
0
    private static void HandleUiskinimageEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uiskinimagecode")
            {
                AtomicMain.AppLog("UISkinImage support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uiskinimage.cs", widget.GetParent());
            }
            if (widget.GetId() == "uiskinimagelayout")
            {
                AtomicMain.AppLog("UISkinImage support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uiskinimage.ui.txt", widget.GetParent());
            }
        }
    }
Пример #20
0
    private static void HandleUisectionEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uisectioncode")
            {
                AtomicMain.AppLog("UISection support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uisection.cs", widget.GetParent());
            }
            if (widget.GetId() == "uisectionlayout")
            {
                AtomicMain.AppLog("UISection support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uisection.ui.txt", widget.GetParent());
            }
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED)
        {
            UIWidget demo1 = widget.FindWidget("UISectionDemo");  // event comes in on child widget!
            if (demo1.IsAncestorOf(widget))
            {
                AtomicMain.AppLog("UISection event : " + demo1.GetId() + " changed to value = " + demo1.GetValue().ToString());
            }

            UIWidget demo2 = widget.FindWidget("UISection2Demo");
            if (demo2.IsAncestorOf(widget))
            {
                AtomicMain.AppLog("UISection event : " + demo2.GetId() + " changed to value = " + demo2.GetValue().ToString());
            }
        }
    }
Пример #21
0
    private static void HandleUitabcontainerEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;
        string   refid  = (string)ev.RefID;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uitabcontainercode")
            {
                AtomicMain.AppLog("UITabContainer support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uitabcontainer.cs", widget.GetParent());
            }
            if (widget.GetId() == "uitabcontainerlayout")
            {
                AtomicMain.AppLog("UITabContainer support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uitabcontainer.ui.txt", widget.GetParent());
            }


            if (widget.GetId() == "uitabcontainerremove")
            {
                AtomicMain.AppLog("UITabContainer action : " + widget.GetId() + " was pressed ");
                UITabContainer tcx     = (UITabContainer)widget.FindWidget("UITabContainerDemo");
                int            current = tcx.GetCurrentPage();
                tcx.DeletePage(current);
            }
            if (widget.GetId() == "uitabcontaineradd")
            {
                AtomicMain.AppLog("UITabContainer action : " + widget.GetId() + " was pressed ");
                UITabContainer tcx = (UITabContainer)widget.FindWidget("UITabContainerDemo");
                tcx.AddTabPageFile("New File", "Scenes/sheet.ui.txt");
            }
            if (widget.GetId() == "uitabcontainermake")
            {
                AtomicMain.AppLog("UITabContainer action : " + widget.GetId() + " was pressed ");
                var            cache = GetSubsystem <ResourceCache>();
                UITabContainer tcx   = (UITabContainer)widget.FindWidget("UITabContainerDemo");
                UILayout       lo    = new UILayout();
                lo.SetLayoutConfig("YAGAC");     // YACAC!
                UIEditField myeditfield = new UIEditField();
                myeditfield.SetGravity(UI_GRAVITY.UI_GRAVITY_ALL);
                myeditfield.SetMultiline(true);
                File   filex = cache.GetFile("Components/code_uitabcontainer.cs");
                String textx = filex.ReadText();
                filex.Close();
                myeditfield.SetText(textx);
                UIFontDescription myfont = new UIFontDescription();  // put in a coder font
                myfont.SetSize(16);
                myfont.SetId("Vera");
                myeditfield.SetFontDescription(myfont);
                lo.AddChild(myeditfield);
                tcx.AddTabPageWidget("New Code", lo);
            }
            if (widget.GetId() == "uitabcontainerundock")
            {
                AtomicMain.AppLog("UITabContainer action : " + widget.GetId() + " was pressed ");
                UITabContainer tcx     = (UITabContainer)widget.FindWidget("UITabContainerDemo");
                int            current = tcx.GetCurrentPage();
                tcx.UndockPage(current);
            }
            if (widget.GetId() == "uitabcontainerredock")
            {
                AtomicMain.AppLog("UITabContainer action : " + widget.GetId() + " was pressed ");
                UITabContainer tcx = (UITabContainer)widget.FindWidget("UITabContainerDemo");
                if (!tcx.DockWindow("tab1"))
                {
                    if (!tcx.DockWindow("tab2"))
                    {
                        if (!tcx.DockWindow("tab3"))
                        {
                            if (!tcx.DockWindow("New File"))
                            {
                                if (!tcx.DockWindow("New Code"))
                                {
                                    AtomicMain.AppLog("UITabContainer action : no more windows to dock.");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Пример #22
0
    private static void HandleUimenuitemEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;
        string   refid  = (string)ev.RefID;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uimenuitemcode")
            {
                AtomicMain.AppLog("UIMenuItem support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uimenuitem.cs", widget.GetParent());
            }
            if (widget.GetId() == "uimenuitemlayout")
            {
                AtomicMain.AppLog("UIMenuItem support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uimenuitem.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "uimenuitempush")
            {
                UIMenuWindow mymenuwindow = new UIMenuWindow(widget, "MenuItemDemo");
                int          xx           = widget.GetX() + (widget.GetWidth() / 2);
                int          yy           = widget.GetY() + (widget.GetHeight() / 2);
                mymenuwindow.SubscribeToEvent <WidgetEvent> (mymenuwindow, HandleUimenuitemEvent);
                mymenuwindow.Show(mis, xx, yy);
            }

            if (widget.GetId() == "MenuItemDemo")
            {
                AtomicMain.AppLog("UIMenuItem event : " + widget.GetId() + " and " + refid + " was selected ");
            }

            if (widget.GetId() == "uimi1")
            {
                AtomicMain.AppLog("UIMenuItem action : " + widget.GetId() + " was pressed ");
                mis.AddItem(new UIMenuItem("New UIMenuItem"));
            }
            if (widget.GetId() == "uimi2")
            {
                AtomicMain.AppLog("UIMenuItem action : " + widget.GetId() + " was pressed ");
                mis.AddItem(new UIMenuItem("Newer UIMenuItem", "neweritem"));
            }
            if (widget.GetId() == "uimi3")
            {
                AtomicMain.AppLog("UIMenuItem action : " + widget.GetId() + " was pressed ");
                mis.AddItem(new UIMenuItem("A Duck", "aduck", "", "DuckButton"));
            }
            if (widget.GetId() == "uimi4")
            {
                AtomicMain.AppLog("UIMenuItem action : " + widget.GetId() + " was pressed ");
                mis.AddItem(new UIMenuItem("Atomic!", "atomic", "", "LogoAtomic"));
            }
            if (widget.GetId() == "uimi5")
            {
                AtomicMain.AppLog("UIMenuItem action : " + widget.GetId() + " was pressed ");
                mis.Clear();
            }
        }
    }
Пример #23
0
    private static void HandleUiselectitemEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;
        string   refid  = (string)ev.RefID;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uiselectitemcode")
            {
                AtomicMain.AppLog("UISelectItem support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uiselectitem.cs", widget.GetParent());
            }
            if (widget.GetId() == "uiselectitemlayout")
            {
                AtomicMain.AppLog("UISelectItem support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uiselectitem.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "UISelectItemList")
            {
                AtomicMain.AppLog("UISelectItem event : " + widget.GetId() + " and " + refid + " was selected ");
            }

            if (widget.GetId() == "uisi1")
            {
                AtomicMain.AppLog("UISelectItem action : " + widget.GetId() + " was pressed ");
                UISelectList slist = (UISelectList)widget.FindWidget("UISelectItemList");
                sis.AddItem(new UISelectItem("New UISelectItem"));
                slist.SetSource(sis);
            }
            if (widget.GetId() == "uisi2")
            {
                AtomicMain.AppLog("UISelectItem action : " + widget.GetId() + " was pressed ");
                UISelectList slist = (UISelectList)widget.FindWidget("UISelectItemList");
                sis.AddItem(new UISelectItem("Newer UISelectItem", "neweritem"));
                slist.SetSource(sis);
            }
            if (widget.GetId() == "uisi3")
            {
                AtomicMain.AppLog("UISelectItem action : " + widget.GetId() + " was pressed ");
                UISelectList slist = (UISelectList)widget.FindWidget("UISelectItemList");
                sis.AddItem(new UISelectItem("A Duck", "aduck", "DuckButton"));
                slist.SetSource(sis);
            }
            if (widget.GetId() == "uisi4")
            {
                AtomicMain.AppLog("UISelectItem action : " + widget.GetId() + " was pressed ");
                UISelectList slist = (UISelectList)widget.FindWidget("UISelectItemList");
                sis.AddItem(new UISelectItem("Atomic!", "atomic", "LogoAtomic"));
                slist.SetSource(sis);
            }
            if (widget.GetId() == "uisi5")
            {
                AtomicMain.AppLog("UISelectItem action : " + widget.GetId() + " was pressed ");
                UISelectList slist = (UISelectList)widget.FindWidget("UISelectItemList");
                sis.Clear();
                slist.SetSource(sis);
            }
        }
    }
Пример #24
0
    private static void HandleUiwindowEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uiwindowcode")
            {
                AtomicMain.AppLog("UIWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uiwindow.cs", widget.GetParent());
            }
            if (widget.GetId() == "uiwindowlayout")
            {
                AtomicMain.AppLog("UIWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uiwindow.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "windowdemo")
            {
                AtomicMain.AppLog("UIWindow action : " + widget.GetId() + " was pressed ");
                UIView   someview = widget.GetView();
                UIWindow window   = new UIWindow();
                window.SetSettings(UI_WINDOW_SETTINGS.UI_WINDOW_SETTINGS_DEFAULT);
                window.SetText("UIWindow demo (a login dialog)");
                window.Load("Scenes/login_dialog.ui.txt");
                window.ResizeToFitContent();
                someview.AddChild(window);
                window.Center();
                UIWidget login = window.GetWidget("login");
                login.SubscribeToEvent <WidgetEvent> (login, HandleUiwindowEvent);
                UIWidget cancel = window.GetWidget("cancel");
                cancel.SubscribeToEvent <WidgetEvent> (cancel, HandleUiwindowEvent);
            }
            if (widget.GetId() == "login")
            {
                AtomicMain.AppLog("UIWindow action : " + widget.GetId() + " was pressed ");
                UIWindow mywindow = (UIWindow)AtomicMain.FindTheWindowParent(widget);
                if (!mywindow.Equals(null))
                {
                    mywindow.Close();
                }
            }
            if (widget.GetId() == "cancel")
            {
                AtomicMain.AppLog("UIWindow action : " + widget.GetId() + " was pressed ");
                UIWindow mywindow = (UIWindow)AtomicMain.FindTheWindowParent(widget);
                if (!mywindow.Equals(null))
                {
                    mywindow.Close();
                }
            }
            if (widget.GetId() == "windowdemo1")
            {
                AtomicMain.AppLog("UIWindow action : " + widget.GetId() + " was pressed ");
                UIView   someview = widget.GetView();
                UIWindow window   = new UIWindow();
                window.SetSettings(UI_WINDOW_SETTINGS.UI_WINDOW_SETTINGS_DEFAULT);
                window.SetText("UIWindow demo (a table)");
                window.Load("Scenes/sheet.ui.txt");
                window.ResizeToFitContent();
                someview.AddChild(window);
                window.Center();
            }
        }
    }
Пример #25
0
    private static void HandleUilayoutEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "go_layout_config")    // its LAYOUT-O-MATIC time.
            {
                AtomicMain.AppLog("UILayout action : " + widget.GetId() + " was pressed, its LAYOUT-O-MATIC time");
                UIView   someview = widget.GetView();
                UIWindow window   = new UIWindow();
                window.SetSettings(UI_WINDOW_SETTINGS.UI_WINDOW_SETTINGS_DEFAULT);
                window.SetText("LAYOUT-O-MATIC(tm)");
                window.Load("Scenes/view_layout.ui.txt");
                window.ResizeToFitContent();
                someview.AddChild(window);

                UIWidget okbutt = window.GetWidget("ok");
                okbutt.SubscribeToEvent <WidgetEvent> (okbutt, HandleUilayoutEvent);

                var lox = new AtomicEngine.Vector <AtomicEngine.UIWidget>();
                window.SearchWidgetClass("TBRadioButton", lox);
                for (var ii = 0; ii < lox.Size; ii++)
                {
                    lox[ii].SubscribeToEvent <WidgetEvent> (lox [ii], HandleUilayoutEvent);
                }
            }
            if (widget.GetId() == "ok")
            {
                UIWindow mywindow = (UIWindow)AtomicMain.FindTheWindowParent(widget);
                if (!mywindow.Equals(null))
                {
                    mywindow.Close();
                }
            }
            if (widget.GetId() == "set_ax")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(0, 'X');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_ay")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(0, 'Y');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }

            if (widget.GetId() == "set_sza")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(1, 'A');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_szg")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(1, 'G');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_szp")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(1, 'P');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }


            if (widget.GetId() == "set_posc")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(2, 'C');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_posg")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(2, 'G');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_posl")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(2, 'L');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_posr")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(2, 'R');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }

            if (widget.GetId() == "set_dista")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(3, 'A');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_distg")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(3, 'G');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_distp")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(3, 'P');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }

            if (widget.GetId() == "set_dpc")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(4, 'C');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_dpl")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(4, 'L');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
            if (widget.GetId() == "set_dpr")
            {
                UILayout      targetl = (UILayout)widget.FindWidget("target_layout"); // who to operate on.
                UIRadioButton setla   = (UIRadioButton)widget;                        // who we are
                if (!targetl.Equals(null) && !setla.Equals(null))
                {
                    if (setla.GetValue() == 1)
                    {
                        ReplaceChar(4, 'R');
                        targetl.SetLayoutConfig(layoutomaticstr);
                    }
                }
            }
        }
    }
Пример #26
0
 private static void HandlePromptCompleteEvent(UIPromptCompleteEvent ev)
 {
     AtomicMain.AppLog("UIPromptWindow event : the window " + ev.Title
                       + " file was " + ev.Selected + ", the button pressed was " + ev.Reason);
 }
    private static void HandleUimessagewindowEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;
        string   refid  = (string)ev.RefID;

        if (widget.Equals(null))
        {
            return;
        }
        UIWidget mylayout = (UIWidget)widget.FindWidget("pageuimessagewindow");

        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uimessagewindowcode")
            {
                AtomicMain.AppLog("UIMessageWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uimessagewindow.cs", widget.GetParent());
            }
            if (widget.GetId() == "uimessagewindowlayout")
            {
                AtomicMain.AppLog("UIMessageWindow support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uimessagewindow.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "msgnone")
            {
                AtomicMain.AppLog("UIMessageWindow support : " + widget.GetId() + " was pressed ");
                UIMessageWindow mess1 = new UIMessageWindow(mylayout, "mymess1");
                mess1.Show("MessageWindow - NONE", "this is a MessageWindow - None button", (UI_MESSAGEWINDOW_SETTINGS)0, false, 0, 0);
            }
            if (widget.GetId() == "msgok")
            {
                AtomicMain.AppLog("UIMessageWindow support : " + widget.GetId() + " was pressed ");
                UIMessageWindow mess2 = new UIMessageWindow(mylayout, "mymess2");
                mess2.SubscribeToEvent <WidgetEvent> (mess2, HandleUimessagewindowEvent);
                mess2.Show("MessageWindow - OK", "this is a MessageWindow - OK button", UI_MESSAGEWINDOW_SETTINGS.UI_MESSAGEWINDOW_SETTINGS_OK, false, 0, 0);
            }
            if (widget.GetId() == "msgkcancel")
            {
                AtomicMain.AppLog("UIMessageWindow support : " + widget.GetId() + " was pressed ");
                UIMessageWindow mess3 = new UIMessageWindow(mylayout, "mymess3");
                mess3.SubscribeToEvent <WidgetEvent> (mess3, HandleUimessagewindowEvent);
                mess3.Show("MessageWindow - OK CANCEL", "this is a MessageWindow - OK CANCEL buttons", UI_MESSAGEWINDOW_SETTINGS.UI_MESSAGEWINDOW_SETTINGS_OK_CANCEL, false, 0, 0);
            }
            if (widget.GetId() == "msgyesno")
            {
                AtomicMain.AppLog("UIMessageWindow support : " + widget.GetId() + " was pressed ");
                UIMessageWindow mess4 = new UIMessageWindow(mylayout, "mymess4");
                mess4.SubscribeToEvent <WidgetEvent> (mess4, HandleUimessagewindowEvent);
                mess4.Show("MessageWindow - YES NO", "this is a MessageWindow - YES NO buttons", UI_MESSAGEWINDOW_SETTINGS.UI_MESSAGEWINDOW_SETTINGS_YES_NO, false, 0, 0);
            }

            if (refid == "TBMessageWindow.ok")
            {
                AtomicMain.AppLog("UIMessageWindow event : " + refid + " closed the UIMessageWindow");
            }
            if (refid == "TBMessageWindow.cancel")
            {
                AtomicMain.AppLog("UIMessageWindow event : " + refid + " closed the UIMessageWindow");
            }
            if (refid == "TBMessageWindow.yes")
            {
                AtomicMain.AppLog("UIMessageWindow event : " + refid + " closed the UIMessageWindow");
            }
            if (refid == "TBMessageWindow.no")
            {
                AtomicMain.AppLog("UIMessageWindow event : " + refid + " closed the UIMessageWindow");
            }
        }
        else
        {
            AtomicMain.AppLog("UIMessageWindow event : " + widget.GetId() + " event type = " + AtomicMain.EventReport((int)ev.Type));
        }
    }
Пример #28
0
    private static void HandleUiselectlistEvent(WidgetEvent ev)
    {
        UIWidget widget = (UIWidget)ev.Target;
        string   refid  = (string)ev.RefID;

        if (widget.Equals(null))
        {
            return;
        }
        if (ev.Type == UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
        {
            if (widget.GetId() == "uiselectlistcode")
            {
                AtomicMain.AppLog("UISelectList support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Components/code_uiselectlist.cs", widget.GetParent());
            }
            if (widget.GetId() == "uiselectlistlayout")
            {
                AtomicMain.AppLog("UISelectList support : " + widget.GetId() + " was pressed ");
                AtomicMain.ViewCode("Scenes/layout_uiselectlist.ui.txt", widget.GetParent());
            }

            if (widget.GetId() == "UISelectListDemo")
            {
                AtomicMain.AppLog("UISelectList event : " + widget.GetId() + " and " + refid + " was selected ");
            }

            if (widget.GetId() == "selectlistadd")
            {
                AtomicMain.AppLog("UISelectList action : " + widget.GetId() + " was pressed ");
                UISelectList slist = (UISelectList)widget.FindWidget("UISelectListDemo");
                slist.AddItem(slist.GetNumItems(), "New Entry");
            }
            if (widget.GetId() == "selectlistdel")
            {
                AtomicMain.AppLog("UISelectList action : " + widget.GetId() + " was pressed ");
                UISelectList slist = (UISelectList)widget.FindWidget("UISelectListDemo");
                int          si    = (int)slist.GetValue(); // this is the selected index
                slist.DeleteItem(si);
            }
            if (widget.GetId() == "selectlistdelall")
            {
                AtomicMain.AppLog("UISelectList action : " + widget.GetId() + " was pressed ");
                UISelectList slist = (UISelectList)widget.FindWidget("UISelectListDemo");
                slist.DeleteAllItems();
            }
            if (widget.GetId() == "selectlistnew")
            {
                AtomicMain.AppLog("UISelectList action : " + widget.GetId() + " was pressed ");
                UISelectList       slist = (UISelectList)widget.FindWidget("UISelectListDemo");
                UISelectItemSource sis   = new UISelectItemSource();
                sis.AddItem(new UISelectItem("list 1", "list1", "LogoAtomic"));
                sis.AddItem(new UISelectItem("list 2", "list2", ""));
                sis.AddItem(new UISelectItem("list 3", "list3", ""));
                sis.AddItem(new UISelectItem("list 4", "list4", ""));
                sis.AddItem(new UISelectItem("list 5", "list5", ""));
                sis.AddItem(new UISelectItem("list 6", "list6", ""));
                slist.SetSource(sis);
            }
        }
    }