Exemplo n.º 1
0
        private void _FillVGroupCont(List <_VertUnit> vunits)
        {
            m_VGCont.Clear();
            if (vunits.Count == 0)
            {
                return;
            }

            float sqrDistThres = m_VertDistThres * m_VertDistThres;

            _VertUnit guard = vunits[0];

            for (int i = 1; i < vunits.Count; ++i)
            {
                _VertUnit one  = vunits[i];
                Vector3   diff = guard.pos - one.pos;
                //Dbg.Log("dist: {0}<->{1}, {2:F6}", guard.idx, one.idx, diff.magnitude);
                if (Vector3.SqrMagnitude(diff) < sqrDistThres)
                {
                    VGroup grp = _ForceGetVGroup(guard);
                    _AddToVGroup(one.idx, grp); //add `one' into grp
                }
                else
                {
                    guard = one; //advance guard to `one'
                }
            }
        }
Exemplo n.º 2
0
        private void _AddToVGroup(int idx, VGroup grp)
        {
            Dbg.Assert(!m_VGCont.ContainsKey(idx), "OverlapChecker._AddToGroup: vert already in VGCont: {0}", idx);
            Dbg.Assert(!grp.Contains(idx), "OverlapChecker._AddToGroup: vert already in group: {0}", idx);

            m_VGCont.Add(idx, grp);
            grp.Add(idx);
        }
Exemplo n.º 3
0
 private static void DisposingSlot(object[] parameters)
 {
     if (null != _vbox)
     {
         _vbox.Dispose();
         _vbox = null;
     }
 }
Exemplo n.º 4
0
        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background

            _background = new RectShape
            {
                Left            = 0,
                Right           = 0,
                Top             = 0,
                Bottom          = 0,
                BackgroundColor = (Color)GetStyle("backgroundUpColor")
            };
            _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
            AddChild(_background);

            #endregion

            VGroup vGroup = new VGroup
            {
                Gap              = 10,
                HorizontalAlign  = HorizontalAlign.Center,
                VerticalAlign    = VerticalAlign.Middle,
                HorizontalCenter = 0,
                VerticalCenter   = 0,
                Right            = 10,
                Left             = 10,
                Top              = 10,
                Bottom           = 10,
            };
            AddChild(vGroup);

            #region Icon

            IconDisplay = new Image
            {
                MouseEnabled = false
            };
            vGroup.AddChild(IconDisplay);

            #endregion

            #region Label

            LabelDisplay = new Label
            {
                MouseEnabled = false,
                Multiline    = true,
                Color        = (Color)GetStyle("labelUpColor")
            };
            vGroup.AddChild(LabelDisplay);

            #endregion
        }
Exemplo n.º 5
0
        private VGroup _ForceGetVGroup(_VertUnit v)
        {
            int    idx = v.idx;
            VGroup grp = null;

            if (!m_VGCont.TryGetValue(idx, out grp))
            {
                grp = new VGroup();
                grp.Add(idx);
                m_VGCont.Add(idx, grp);
            }

            return(grp);
        }
Exemplo n.º 6
0
    private static VGroup WrapVBox(Component parent, params DisplayListMember[] children)
    {
        VGroup wrapper = new VGroup {
            HorizontalAlign = HorizontalAlign.Center
        };

        parent.AddChild(wrapper);

        foreach (DisplayListMember child in children)
        {
            wrapper.AddChild(child);
        }
        return(wrapper);
    }
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            int    index = dataGridMain.CurrentCell.RowIndex;
            string id    = dataGridMain.Rows[index].Cells[0].Value.ToString();
            VGroup group = new VGroup()
            {
                UserGroupID = id,
                Name        = ""
            };
            string queryString = group.GetQueryString <VGroup>();
            string url         = ApiRouting.GetUrl("", "", "usergroup", ApiFunction.DeleteById).ToString() + queryString;
            bool   confirm     = url.Detete <VGroup>();

            if (confirm)
            {
                MessageBox.Show("Delete Succesful", "Success");
                Init();
            }
        }
        /// <summary>
        /// 分组数据
        /// </summary>
        /// <param name="Group">分组条件</param>
        /// <param name="XmlType">补回情况/未完成说明</param>
        /// <returns></returns>
        List <DictionaryVmodel> FormartCounterData(VCounter counter, VGroup Group, string XmlType, string GroupStr, ref List <MonthlyReportDetail> Source)
        {
            List <DictionaryVmodel> result = new List <DictionaryVmodel>();

            List <MonthlyReportDetail> tempList = CalclateMissTargetdata(counter, Group.TargetIDs);

            string TitleName = MonthDescriptionTools(counter.Title, Group.TargetIDs, counter.Expression, tempList);

            DictionaryVmodel dictM = new DictionaryVmodel(TitleName, tempList);

            dictM.Mark             = "Data";
            dictM.GuoupID          = GroupStr;
            dictM.TargetGroupCount = Group.TargetIDs.Count();
            dictM.SystemName       = _System.SystemName;
            dictM.Value            = counter.Senquence.ToString();
            result.Add(dictM);

            return(result);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 分组数据
        /// </summary>
        /// <param name="Group">分组条件</param>
        /// <param name="XmlType">补回情况/未完成说明</param>
        /// <returns></returns>
        List <DictionaryVmodel> FormartVData(VGroup Group, string XmlType, string GroupStr)
        {
            List <DictionaryVmodel> result = new List <DictionaryVmodel>();

            //循环Group下的数据
            foreach (var counter in Group.CounterList.OrderBy(C => C.Senquence))
            {
                if (counter.SubCounterList != null && counter.SubCounterList.Count > 0)
                {
                    DictionaryVmodel dictC = new DictionaryVmodel(counter.Title, FormartCounterData(counter, Group, XmlType, GroupStr, ref VLastList));
                    dictC.Mark             = "Counter";
                    dictC.GuoupID          = GroupStr;
                    dictC.TargetGroupCount = 1;
                    dictC.SystemName       = _System.SystemName;
                    result.Add(dictC);
                }
                else
                {
                    result.AddRange(FormartCounterData(counter, Group, XmlType, GroupStr, ref VLastList));
                }
            }
            return(result);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 分组数据
        /// </summary>
        /// <param name="Group">分组条件</param>
        /// <param name="XmlType">补回情况/未完成说明</param>
        /// <returns></returns>
        List <DictionaryVmodel> FormartCounterData(VCounter counter, VGroup Group, string XmlType, string GroupStr, ref List <MonthlyReportDetail> Source)
        {
            List <DictionaryVmodel> result = new List <DictionaryVmodel>();

            if (counter.SubCounterList != null && counter.SubCounterList.Count > 0)
            {
                List <MonthlyReportDetail> subSource = Calclatedata(counter, Group.TargetIDs, ref Source);

                foreach (VCounter c in counter.SubCounterList)
                {
                    if (c.SubCounterList != null && c.SubCounterList.Count > 0)
                    {
                        DictionaryVmodel dictC = new DictionaryVmodel(c.Title, FormartCounterData(c, Group, XmlType, GroupStr, ref subSource));
                        dictC.Mark             = "Counter";
                        dictC.GuoupID          = GroupStr;
                        dictC.TargetGroupCount = 1;
                        dictC.SystemName       = _System.SystemName;
                        result.Add(dictC);
                    }
                    else
                    {
                        result.AddRange(FormartCounterData(c, Group, XmlType, GroupStr, ref subSource));
                    }
                }
            }
            else
            {
                DictionaryVmodel dictR = new DictionaryVmodel(counter.Title, Calclatedata(counter, Group.TargetIDs, ref Source));
                dictR.Mark             = "Data";
                dictR.GuoupID          = GroupStr;
                dictR.TargetGroupCount = 1;
                dictR.SystemName       = _System.SystemName;
                result.Add(dictR);
            }
            return(result);
        }
Exemplo n.º 11
0
    /// <summary>
    /// Note: Since Load could happen, if both scene containing OptionsToolbar, we wouldn't like to instantiate twice
    /// Thus we made 2 checks in for toolbar existance in this class
    /// </summary>
    protected override void CreateChildren()
    {
        if (HideInEditor && Application.isEditor)
        {
            return;
        }

        base.CreateChildren();

        if (null != _vbox)
        {
            return; // meaning toolbar created in the previous scene
        }
        _vbox = new VGroup
        {
            Right    = 10,
            MinWidth = 160,
            Gap      = 0
        };
        OptionsToolbarStage.Instance.AddChild(_vbox); // add to InspectorOverlayStage

        _options = new Options();
        _options.SetStyle("showBackground", true);
        _vbox.AddChild(_options);

        Button handle = new Button
        {
            StyleName    = "handle_horiz",
            FocusEnabled = false,
            PercentWidth = 100,
            ResizeWithStyleBackground = true,
            Text = "Options"
        };

        _vbox.AddChild(handle);

        handle.AddEventListener(MouseEvent.ROLL_OVER,
                                delegate(Event e)
        {
            if (handle == e.Target)
            {
                Show();
            }
            e.CancelAndStopPropagation();
        },
                                EventPhase.Capture | EventPhase.Target
                                );
        _vbox.AddEventListener(MouseEvent.ROLL_OVER, // deffering hide
                               delegate
        {
            if (null != _timer)
            {
                _timer.Reset();
                _timer.Stop();
            }
        },
                               EventPhase.Capture | EventPhase.Target
                               );
        _vbox.AddEventListener(MouseEvent.ROLL_OUT,
                               delegate(Event e)
        {
            if (_vbox == e.Target)
            {
                if (null == _timer)
                {
                    _timer = new Timer(1, 1);
                }
                _timer.Complete += delegate
                {
                    Hide();
                    _timer.Dispose();
                    _timer = null;
                };
                _timer.Start();
            }
            e.CancelAndStopPropagation();
        },
                               EventPhase.Capture | EventPhase.Target
                               );

        _vbox.ValidateNow(); // invoke measure

        float h = _options.Height;

        _vbox.Y   = -h;
        _hide.YTo = -h;
    }
Exemplo n.º 12
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        #region Title

        Label label = new TitleLabel {
            HorizontalCenter = 0, Top = 20, StyleName = "title", Text = "Panel demo"
        };
        AddChild(label);

        #endregion

        #region Scroller

        Scroller scroller = new Scroller
        {
            SkinClass = typeof(ScrollerSkin2),
            Left      = 0,
            Right     = 0,
            Top       = 0,
            Bottom    = 0,
        };
        //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On);
        //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On);
        AddChild(scroller);

        Group viewport = new Group();
        scroller.Viewport = viewport;

        #endregion

        #region HGroup

        HGroup hGroup = new HGroup {
            Gap = 10, HorizontalCenter = 0, VerticalCenter = 0
        };
        viewport.AddChild(hGroup);

        #endregion

        #region Panel 1

        Panel panel = new MyPanel
        {
            Width     = 360,
            Height    = 600,
            Icon      = ImageLoader.Instance.Load("Icons/shape_square_add"),
            Title     = "First panel",
            StyleName = "default"
        };
        hGroup.AddChild(panel);

        #endregion

        #region Panel 2

        panel = new MyPanel
        {
            //Width = 360,
            Height    = 600,
            SkinClass = typeof(PanelSkin2),
            Icon      = ImageLoader.Instance.Load("Icons/page_white_text"),
            Title     = "Second panel"
        };
        hGroup.AddChild(panel);

        //// NOTE: propagation of styles to skin still not implemented
        //// So, this won't work: panel.SetStyle("headerLabelColor", 0xffff00);
        //// This is a temporary solution:
        //panel.CreationCompleteHandler += delegate
        //{
        //Debug.Log("panel.Skin: " + panel.Skin);
        //panel.Skin.SetStyle("headerLabelColor", Color.yellow);
        //};

        #endregion

        #region Panel 2 skin switch

        VGroup vGroup = new VGroup();
        vGroup.Plugins.Add(new TabManager {
            ArrowsEnabled = true, UpDownArrowsEnabled = true
        });
        hGroup.AddChild(vGroup);

        Button button = new Button {
            Text = "Skin 1", Icon = Resources.Load <Texture>("Icons/skin"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100
        };
        button.Press += delegate
        {
            panel.SkinClass = typeof(PanelSkin);
            //((MyPanel)panel).CreateButtons();
        };
        vGroup.AddChild(button);

        button = new Button {
            Text = "Skin 2", Icon = Resources.Load <Texture>("Icons/skin"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100
        };
        button.Press += delegate
        {
            panel.SkinClass = typeof(PanelSkin2);
        };
        vGroup.AddChild(button);

        button = new Button {
            Text = "Skin 3", Icon = Resources.Load <Texture>("Icons/skin"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100
        };
        button.Press += delegate
        {
            panel.SkinClass = typeof(PanelSkin3);
        };
        vGroup.AddChild(button);

        button = new Button {
            Text = "Skin 4", Icon = Resources.Load <Texture>("Icons/skin"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100
        };
        button.Press += delegate
        {
            panel.SkinClass = typeof(PanelSkin4);
        };
        vGroup.AddChild(button);

        button = new Button {
            Text = "Add button", AutoRepeat = true, Icon = Resources.Load <Texture>("Icons/add"), SkinClass = typeof(ImageButtonSkin), PercentWidth = 100
        };

        /*button.Press += delegate
         * {
         *  ((MyPanel)panel).AddButton("Button");
         * };*/
        button.ButtonDown += delegate
        {
            ((MyPanel)panel).AddButton("Button");
        };
        vGroup.AddChild(button);

        #endregion
    }
Exemplo n.º 13
0
    private void SetupUpGui()
    {
        // Initialize the loaders
        GuiModule.Initialize(this);
//        NetModule.Initialize(this);

        TweenSharkUnity3D.Initialize(this);

        _guiStage = GlobalGui.GetInstance();

        _guiStage.AddChild(
            new Button(new Rect(20, 20, 100, 20), "BUTTON")
            .AddClickHandler(OnButtonInListClicked)
            );

        _guiStage.AddChild(
            _youtubeBox = new Box(new Rect(600, 50, 20, 20), "Youtube Search")
                          .SetAutoAdjustSize(true)
                          .AddChild(
                _searchField = new TextField(new Rect(0, 30, 400, 20))
                               .AddMouseOverHandler(e => Debug.Log("mouse over on SearchField"))
                               .AddMouseOutHandler(e => Debug.Log("mouse out on SearchField"))
                               .AddLeftMouseDownHandler(e => Debug.Log("Left mouse down on SearchField"))
                               .AddLeftMouseUpHandler(e => Debug.Log("Left mouse up on SearchField"))
                )

                          .AddChild(
                new Button(new Rect(480, 30, 100, 20), "Search")
                .AddClickHandler(OnButton1)
                .AddMouseOverHandler(e => Debug.Log("MouseOver search " + e.Target + " " + e.CurrentTarget))
                .AddMouseOutHandler(e => Debug.Log("MouseOut search " + e.Target + " " + e.CurrentTarget))
                )

                          .AddChild(
                new ScrollView(new Rect(0, 100, 580, 350))
                .AddChild(
                    _listView = new VGroup()
                                .AddChild(new Label(new Rect(0, 0, 100, 20), "Text1"))
                                .AddChild(new Label(new Rect(0, 30, 100, 20), "Text2"))
                                .AddChild(new Label(new Rect(0, 60, 100, 20), "Text3"))
                                .AddChild(new Label(new Rect(0, 90, 100, 20), "Text4"))
                                .AddChild(new Label(new Rect(0, 120, 100, 20), "Text5"))
                                .AddChild(new Label(new Rect(0, 150, 100, 20), "Text6"))
                                .AddChild(new Label(new Rect(0, 180, 100, 20), "Text7"))
                                .AddChild(new Label(new Rect(0, 210, 100, 20), "Text8"))
                                .AddChild(new Label(new Rect(0, 240, 100, 20), "Text9"))
                                .SetPadding(20)
                    )
                )
            );

        _listView
        .AddLeftMouseDownHandler(e => Debug.Log("Left mouse down on ListView"))
        .AddLeftMouseUpHandler(e => Debug.Log("Left mouse up on ListView"))
        .AddRightMouseDownHandler(e => Debug.Log("Right mouse down on ListView"))
        .AddRightMouseUpHandler(e => Debug.Log("Right mouse up on ListView"))
        .AddMiddleMouseDownHandler(e => Debug.Log("Middle mouse down on ListView"))
        .AddMiddleMouseUpHandler(e => Debug.Log("Middle mouse up on ListView"))
        ;


        if (_youtubeBox != null)
        {
            _guiStage.AddChild(
                new Button(new Rect(200, 20, 100, 20), "Start Tween")
                .AddClickHandler((e) =>
            {
                var random = new System.Random();
                var opt    = new TweenOps(Ease.OutQuad)
                             .PropTo("X", random.Next(800))
                             .PropTo("Y", random.Next(500))
                             .PropTo("PaddingTop", random.Next(100))
                ;
                TweenShark.To(_youtubeBox, 1f + random.Next(2), opt);

                opt = new TweenOps(Ease.InOutQuad)
                      .PropTo("_sbyte", 100)
                      .PropTo("_byte", 100)
                      .PropTo("_short", 100)
                      .PropTo("_ushort", 100)
                      .PropTo("_int", 100)
                      .PropTo("_uint", 100)
                      .PropTo("_long", 100)
                      .PropTo("_ulong", 100)
                      .PropTo("_float", 100)
                      .PropTo("_double", 100)
                ;

                TweenShark.To(_tweenedObject, 10, opt);
            })
                );

            _youtubeBox.AddClickHandler(onBox1Clicked);
        }

        _guiStage.AddClickHandler(onStageClick);
    }
Exemplo n.º 14
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        #region Controls

        Toolbar toolbar = new Toolbar();
        AddChild(toolbar);

        Button button = new Button
        {
            Text       = "Add data",
            SkinClass  = typeof(ImageButtonSkin),
            Icon       = ImageLoader.Instance.Load("Icons/star"),
            AutoRepeat = true
        };
        button.ButtonDown += delegate
        {
            _dataProvider.AddItem(
                new ExampleItem
            {
                FirstName      = "First" + _random.Next(1, 100),
                LastName       = "Last" + _random.Next(1, 100),
                Age            = _random.Next(1, 80),
                DrivingLicense = _random.Next(0, 2) == 1
            }
                );
        };
        toolbar.AddContentChild(button);

        #endregion

        #region Scroller

        Scroller scroller = new Scroller
        {
            SkinClass     = typeof(ScrollerSkin2),
            PercentWidth  = 100,
            PercentHeight = 100
        };
        //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On);
        //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On);
        AddChild(scroller);

        Group viewport = new Group
        {
            MouseEnabled = true,
            Layout       = new VerticalLayout
            {
                HorizontalAlign = HorizontalAlign.Left,
                PaddingLeft     = 10,
                PaddingRight    = 10,
                PaddingTop      = 10,
                PaddingBottom   = 10,
                Gap             = 10
            }
        };
        scroller.Viewport = viewport;

        #endregion

        #region Fill the data provider

        List <string> names = new List <string>
        {
            "Failure",
            "Teaches",
            "Success",
            "One",
            "Two",
            "Three",
            "Four",
            "Five",
            "Six"
        };

        List <object> source = new List <object>();
        foreach (var theName in names)
        {
            source.Add(
                new ExampleItem
            {
                FirstName      = theName,
                LastName       = theName,
                Age            = _random.Next(1, 10),
                DrivingLicense = _random.Next(0, 2) == 1
            }
                );
        }

        _dataProvider = new ArrayList(source);

        #endregion

        HGroup hGroup = new HGroup {
            PercentWidth = 100, PercentHeight = 100
        };
        viewport.AddChild(hGroup);

        #region Grid (header + list + footer)

        VGroup vGroup = new VGroup {
            PercentWidth = 100, PercentHeight = 100, Gap = 0
        };
        hGroup.AddChild(vGroup);

        #region Header

        /* Implement your own header logic here */

        /*HGroup header = new HGroup {PercentWidth = 100, Gap = 0};
         * vGroup.AddChild(header);
         *
         * for (int i = 0; i < 5; i++)
         * {
         *  Button btnCol = new Button // example header
         *  {
         *      Text = "Column " + (i + 1),
         *      ToggleMode = true,
         *      PercentWidth = 100
         *  };
         *  btnCol.Click += delegate(Event e)
         *  {
         *      // sort, filder and refresh (do list.DataProvider = list.DataProvider)
         *  };
         *  header.AddChild(btnCol);
         * }*/

        #endregion

        #region List

        List list = new List
        {
            Id            = "list1",
            PercentWidth  = 100,
            PercentHeight = 100,
            DataProvider  = _dataProvider,
            LabelField    = "FirstName", // this must be set due to list logic legacy (the field must exist in DTO)
            SkinClass     = typeof(ListSkin2),
            ItemRenderer  = new ItemRendererFactory <MyGridItemRenderer>()
        };
        vGroup.AddChild(list);

        #endregion

        #region Footer

        HGroup footer = new HGroup {
            PercentWidth = 100, Gap = 30, PaddingLeft = 10, PaddingRight = 10, PaddingTop = 10, PaddingBottom = 0
        };
        vGroup.AddChild(footer);

        _lblSum = new Label {
            Text = "Age sum: ", StyleName = "footer"
        };
        footer.AddChild(_lblSum);

        _lblNumberOfSelectedItems = new Label {
            Text = "Driving licenses: ", StyleName = "footer"
        };
        footer.AddChild(_lblNumberOfSelectedItems);

        UpdateFooter();

        #endregion

        #endregion

        #region Process renderer click

        AddEventListener(MyGridItemRenderer.ADD_BUTTON_CLICKED, delegate(Event e)
        {
            IItemRenderer itemRenderer = (IItemRenderer)e.Target;
            Alert.Show("Info", itemRenderer.Data.ToString(), AlertButtonFlag.Ok,
                       new AlertOption(AlertOptionType.HeaderIcon, (object)ImageLoader.Instance.Load("Icons/information")));
        });

        AddEventListener(MyGridItemRenderer.EDIT_BUTTON_CLICKED, delegate(Event e)
        {
            var editor = new ExamplePopupEditor {
                Title      = "Edit",
                Icon       = ImageLoader.Instance.Load("Icons/edit"),
                Data       = ((MyGridItemRenderer)e.Target).Data,
                CloseOnEsc = true
            };
            editor.AddEventListener(CloseEvent.CLOSE, delegate
            {
                PopupManager.Instance.RemovePopup(editor);
            });

            PopupManager.Instance.AddPopup(editor, true);
        });

        #endregion

        #region Process property change

        _dataProvider.AddEventListener(PropertyChangeEvent.PROPERTY_CHANGE, delegate(Event e)
        {
            //PropertyChangeEvent pce = (PropertyChangeEvent) e;
            //Debug.Log(pce.NewValue);
            UpdateFooter();
        });

        #endregion
    }
Exemplo n.º 15
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        TitleLabel titleLabel = new TitleLabel
        {
            StyleName        = "title",
            HorizontalCenter = 0,
            Top = 20
        };

        AddChild(titleLabel);

        new TextRotator
        {
            Delay = 5, // 5 seconds delay
            Lines = new[]
            {
                "Cursor Demo",
                "Created with eDriven.Gui",
                //"Author: Danko Kozar",
                "Cursor packages are loaded dynamically",
                "You can set the priority to each cursor operation"
            },
            Callback = delegate(string line) { titleLabel.Text = line; }
        }
        .Start();

        var buttonStyles = new Hashtable
        {
            { "cursor", "pointer" }
        };

        #region VBox

        var vbox = new VGroup
        {
            HorizontalCenter = 0,
            VerticalCenter   = 0,
            Gap = 10
        };
        AddChild(vbox);

        #endregion

        vbox.AddChild(new Label {
            Text = "Load cursor package:"
        });

        #region HBox

        var hbox = new HGroup();

        /*hbox.Click += delegate(Event e)
         * {
         *  var me = (MouseEvent)e;
         *  if (me.Target is Button)
         *      AudioPlayerMapper.GetDefault().PlaySound("button_click");
         * };*/
        vbox.AddChild(hbox);

        #endregion

        #region Cursor package 1

        var btnCursor1 = new Button
        {
            Text         = "Load cursor package 1",
            Icon         = (Texture)Resources.Load("Icons/drive_disk"),
            FocusEnabled = false,
            SkinClass    = typeof(ImageButtonSkin),
            Styles       = buttonStyles,
            MinWidth     = 200,
            MinHeight    = 120,
            ToggleMode   = true,
            Selected     = true
        };
        hbox.AddChild(btnCursor1);

        #endregion

        #region Cursor package 2

        var btnCursor2 = new Button
        {
            Text         = "Load cursor package 2",
            Icon         = (Texture)Resources.Load("Icons/drive_disk"),
            FocusEnabled = false,
            SkinClass    = typeof(ImageButtonSkin),
            Styles       = buttonStyles,
            MinWidth     = 200,
            MinHeight    = 120,
            ToggleMode   = true,
            Selected     = false
        };
        hbox.AddChild(btnCursor2);

        // button 1 press
        btnCursor1.Click += delegate
        {
            if (_selectedButton != 0)
            {
                AudioPlayerMapper.GetDefault().PlaySound("button_click");
            }

            _selectedButton = 0;
            DeferManager.Instance.Defer(delegate
            {
                btnCursor1.Selected = _selectedButton == 0;
                btnCursor2.Selected = _selectedButton == 1;
                CursorManager.Instance.LoadPackage("Cursors/antialiased-classic/package");
            }, 1);
        };

        // button 2 press
        btnCursor2.Click += delegate
        {
            if (_selectedButton != 1)
            {
                AudioPlayerMapper.GetDefault().PlaySound("button_click");
            }

            _selectedButton = 1;
            DeferManager.Instance.Defer(delegate
            {
                btnCursor1.Selected = _selectedButton == 0;
                btnCursor2.Selected = _selectedButton == 1;
                CursorManager.Instance.LoadPackage("Cursors/blueglass-vista/package");
            }, 1);
        };

        #endregion

        #region Spacer

        vbox.AddChild(new Spacer {
            Height = 30
        });

        #endregion

        vbox.AddChild(new Label {
            Text = "Hover cursor over buttons:"
        });

        TileGroup tileGroup = new TileGroup {
            PercentWidth = 100, RequestedRowCount = 2
        };
        vbox.AddChild(tileGroup);

        #region Crosshair

        var btnCrosshair = new Button
        {
            Text         = "Crosshair",
            Icon         = (Texture)Resources.Load("Icons/star"),
            SkinClass    = typeof(ImageButtonSkin),
            FocusEnabled = false,
            Styles       = new Hashtable {
                { "cursor", "crosshair" }
            },
            MinWidth  = 200,
            MinHeight = 120
        };
        tileGroup.AddChild(btnCrosshair);

        #endregion

        #region Move

        var btnMove = new Button
        {
            Text         = "Move",
            Icon         = (Texture)Resources.Load("Icons/star"),
            SkinClass    = typeof(ImageButtonSkin),
            FocusEnabled = false,
            Styles       = new Hashtable {
                { "cursor", "move" }
            },
            MinWidth  = 200,
            MinHeight = 120
        };
        tileGroup.AddChild(btnMove);

        #endregion

        #region Help

        var btnHelp = new Button
        {
            Text         = "Help",
            Icon         = (Texture)Resources.Load("Icons/star"),
            SkinClass    = typeof(ImageButtonSkin),
            FocusEnabled = false,
            Styles       = new Hashtable {
                { "cursor", "help" }
            },
            MinWidth  = 200,
            MinHeight = 120
        };
        tileGroup.AddChild(btnHelp);

        #endregion

        #region E-Resize

        var btnEResize = new Button
        {
            Text         = "E-Resize",
            Icon         = (Texture)Resources.Load("Icons/star"),
            SkinClass    = typeof(ImageButtonSkin),
            FocusEnabled = false,
            Styles       = new Hashtable {
                { "cursor", "e-resize" }
            },
            MinWidth  = 200,
            MinHeight = 120
        };
        tileGroup.AddChild(btnEResize);

        #endregion

        #region Spacer

        vbox.AddChild(new Spacer {
            Height = 30
        });

        #endregion

        vbox.AddChild(new Label {
            Text = "Click the button for a high-priority cursor:"
        });

        #region Cursor progress

        var btnProgress = new Button
        {
            Text         = "Show progress cursor (5 sec)",
            Icon         = (Texture)Resources.Load("Icons/star"),
            SkinClass    = typeof(ImageButtonSkin),
            FocusEnabled = false,
            Styles       = buttonStyles,
            MinWidth     = 200,
            MinHeight    = 120,
            PercentWidth = 100
        };
        btnProgress.Press += new eDriven.Core.Events.EventHandler(delegate
        {
            int id      = CursorManager.Instance.SetCursor("wait", 1);
            var t       = new Timer(5, 1);
            t.Complete += delegate
            {
                t.Dispose();
                CursorManager.Instance.RemoveCursor(id);
            };
            t.Start();
        });
        vbox.AddChild(btnProgress);

        #endregion
    }
Exemplo n.º 16
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            _rect = new RectShape(); //{ Left = 0, Right = 0, Top = 0, Bottom = 0 //};
            AddChild(_rect);

            _hGroup = new HGroup
            {
                PaddingLeft = 10, PaddingRight = 10, PaddingTop = 10, PaddingBottom = 10, Gap = 10
            };
            AddChild(_hGroup);

            // left group
            VGroup vGroup = new VGroup
            {
                VerticalAlign = VerticalAlign.Middle,
                Gap           = 10,
                PercentWidth  = 100,
                PercentHeight = 100
            };

            _hGroup.AddChild(vGroup);

            _image = new Image
            {
                Styles = ButtonStyles
            };
            _image.MouseDown += delegate
            {
                DispatchEvent(new Event("showImage", true)); // bubbling event
            };
            vGroup.AddChild(_image);

            LabelDisplay = new Label
            {
                Width = 150
            };
            //vGroup.AddChild(LabelDisplay);
            if (_text != string.Empty)
            {
                LabelDisplay.Text = _text;
            }

            // right group
            vGroup = new VGroup
            {
                VerticalAlign = VerticalAlign.Middle, Gap = 10, PercentWidth = 100, PercentHeight = 100
            };
            _hGroup.AddChild(vGroup);

            if (null == _buttonShow)
            {
                _buttonShow = new Button {
                    Text         = "Show",
                    PercentWidth = 100,
                    FocusEnabled = false,
                    SkinClass    = typeof(ImageButtonSkin),
                    Styles       = ButtonStyles,
                    Icon         = ImageLoader.Instance.Load("Icons/accept")
                };
                _buttonShow.ButtonDown += delegate
                {
                    DispatchEvent(new Event("showImage", true)); // bubbling!
                };
                vGroup.AddChild(_buttonShow);
            }

            if (null == _buttonRemove)
            {
                _buttonRemove = new Button
                {
                    Text         = "Remove",
                    PercentWidth = 100,
                    FocusEnabled = false,
                    SkinClass    = typeof(ImageButtonSkin),
                    Styles       = ButtonStyles,
                    Icon         = ImageLoader.Instance.Load("Icons/cancel")
                };
                _buttonRemove.ButtonDown += delegate
                {
                    var parentList = Owner as List;
                    if (null != parentList)
                    {
                        //Debug.Log("Removing at " + parentList.DataProvider.GetItemIndex(Data));
                        parentList.DataProvider.RemoveItemAt(parentList.DataProvider.GetItemIndex(Data));
                    }
                    else
                    {
                        Debug.LogError("Owner of item renderer is not a list");
                    }
                };
                vGroup.AddChild(_buttonRemove);
            }
        }
Exemplo n.º 17
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        #region Controls

        Toolbar toolbar = new Toolbar();
        AddChild(toolbar);

        Button button = new Button
        {
            Text       = "Add data",
            SkinClass  = typeof(ImageButtonSkin),
            Icon       = ImageLoader.Instance.Load("Icons/add"),
            AutoRepeat = true
        };
        button.ButtonDown += delegate
        {
            _dataProvider.AddItem("data " + _random.Next(1, 100));
        };
        toolbar.AddContentChild(button);

        #endregion

        #region Scroller

        Scroller scroller = new Scroller
        {
            SkinClass     = typeof(ScrollerSkin2),
            PercentWidth  = 100,
            PercentHeight = 100
        };
        //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On);
        //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On);
        AddChild(scroller);

        Group viewport = new Group
        {
            MouseEnabled = true,
            Layout       = new VerticalLayout
            {
                HorizontalAlign = HorizontalAlign.Left,
                PaddingLeft     = 10,
                PaddingRight    = 10,
                PaddingTop      = 10,
                PaddingBottom   = 10,
                Gap             = 10
            }
        };
        scroller.Viewport = viewport;
        //AddChild(viewport);

        #endregion

        #region Data controls

        List <object> source = new List <object> {
            "Failure", "Teaches", "Success", "One", "Two", "Three", "Four", "Five", "Six"
        };

        _dataProvider = new ArrayList(source);

        var factory = new ItemRendererFactory <DefaultItemRenderer>();

        /* LISTS */

        #region HGroup

        HGroup hGroup1 = new HGroup
        {
            PaddingLeft   = 10,
            PaddingRight  = 10,
            PaddingTop    = 10,
            PaddingBottom = 10,
            Gap           = 20
        };

        //hbox.SetStyle("showBackground", true);
        //hbox.SetStyle("backgroundColor", RgbColor.FromHex(0x004CFF).ToColor());
        viewport.AddChild(hGroup1);

        #endregion

        HGroup hGroup = new HGroup();
        viewport.AddChild(hGroup);

        /* DATA GROUPS */

        #region Data group 1

        hGroup1 = new HGroup
        {
            PaddingLeft   = 10,
            PaddingRight  = 10,
            PaddingTop    = 10,
            PaddingBottom = 10,
            Gap           = 50
        };
        hGroup.AddChild(hGroup1);

        DataGroup dataGroup = new DataGroup
        {
            Layout       = new VerticalLayout(),
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate(object item)
            {
                return(factory);
            }
        };
        hGroup1.AddChild(dataGroup);

        #endregion

        #region Data group 2

        hGroup1 = new HGroup
        {
            PaddingLeft   = 10,
            PaddingRight  = 10,
            PaddingTop    = 10,
            PaddingBottom = 10,
            Gap           = 50
        };
        hGroup.AddChild(hGroup1);

        dataGroup = new DataGroup
        {
            Layout = new TileLayout {
                RequestedColumnCount = 2
            },
            //Width = 200, Height = 200,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return(factory);
            }
            //ClipAndEnableScrolling = true
        };
        hGroup1.AddChild(dataGroup);

        #endregion

        #region Data group 3

        hGroup1 = new HGroup
        {
            PaddingLeft   = 10,
            PaddingRight  = 10,
            PaddingTop    = 10,
            PaddingBottom = 10,
            Gap           = 50
        };
        hGroup.AddChild(hGroup1);

        dataGroup = new DataGroup
        {
            Layout = new TileLayout {
                RequestedColumnCount = 4
            },
            //Width = 200, Height = 200,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return(factory);
            }
            //ClipAndEnableScrolling = true
        };
        hGroup1.AddChild(dataGroup);

        #endregion

        #endregion

        #region VGroup

        VGroup vgroup = new VGroup();
        hGroup.AddChild(vgroup);

        #endregion

        #region List 1

        List list = new List
        {
            //Layout = new TileLayout { RequestedColumnCount = 4 },
            Width        = 200,
            Height       = 200,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return(factory);
            }
        };
        vgroup.AddChild(list);

        #endregion

        #region List 2

        list = new List
        {
            //Layout = new TileLayout { RequestedColumnCount = 3 },
            Width        = 200,
            Height       = 245,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return(factory);
            }
        };
        vgroup.AddChild(list);

        #endregion

        #region List 3

        list = new List
        {
            Id           = "list3",
            Width        = 400,
            Height       = 600,
            DataProvider = _dataProvider,
            SkinClass    = typeof(ListSkin2),
            ItemRenderer = new ItemRendererFactory <BigItemRenderer>()
        };
        hGroup.AddChild(list);

        #endregion

        #region Process renderer click

        AddEventListener(BigItemRenderer.ADD_BUTTON_CLICKED, delegate(Event e)
        {
            BigItemRenderer itemRenderer = (BigItemRenderer)e.Target;
            Alert.Show("Info", itemRenderer.Data.ToString(), AlertButtonFlag.Ok,
                       new AlertOption(AlertOptionType.HeaderIcon, ImageLoader.Instance.Load("Icons/information")));
        });

        #endregion
    }
        /// <summary>
        /// Addition of existing trader info : Added By Apoorva Sharma 7/05/2018
        /// </summary>
        public void ModifyGrid()
        {
            try
            {
                Reset();
                bool NullCheckValue = NullCheck();
                if (NullCheckValue)
                {
                    TraderEntitlementModel oTEModel = new TraderEntitlementModel();

                    int index = TraderEntitlementCollection.IndexOf(TraderEntitlementCollection.Where(x => x.TraderId == VTraderId).FirstOrDefault());
                    if (TraderEntitlementCollection.Any(x => x.TraderId == VTraderId))
                    {
                        TraderEntitlementCollection.RemoveAt(index);
                    }
                    else
                    {
                        //    MessageBox.Show("Trader not found in Database", "!Warning!", MessageBoxButton.OK, MessageBoxImage.Error);
                    }

                    oTEModel.Branch           = VBranch.ToString();
                    oTEModel.TraderId         = VTraderId.ToString();
                    oTEModel.TraderIdSort     = Convert.ToInt32(oTEModel.TraderId);
                    oTEModel.TraderGroup      = VGroup.ToString();
                    oTEModel.ClientView       = ClientViewOnTrader.ToString();
                    oTEModel.ClientViewAT     = ViewClientOnLevel.ToString();
                    oTEModel.AuctionBlock     = AuctionBlock;
                    oTEModel.FourLBlock       = I4LBlock;
                    oTEModel.SixLBlock        = I6LBlock;
                    oTEModel.InstTradingBlock = InstitutionalTradingBlock;
                    oTEModel.ODDlotBlock      = OddLotBlock;
                    oTEModel.OrderRights      = OrderPlacementOutClientMaster.ToString();
                    oTEModel.BlockDealBlock   = BlockDealBlock;
                    oTEModel.NotApplicable    = NotApplicable;
                    oTEModel.Revert           = Revert;

                    TraderEntitlementCollection.Add(oTEModel);
                    TraderEntitlementCollection    = new ObservableCollection <TraderEntitlementModel>(TraderEntitlementCollection.OrderBy(i => i.TraderIdSort));
                    NewTraderEntitlementCollection = TraderEntitlementCollection;
                    RecordCount = TraderEntitlementCollection.Count();

                    oDataAccessLayer.OpenConnection((int)DataAccessLayer.ConnectionDB.TraderEntitlement);
                    str = @"UPDATE TRADER_ENTITLEMENT SET Branch = '" + VBranch + "', " +
                          "TraderGroup = '" + VGroup + "', " +
                          "TraderId = '" + VTraderId + "', " +
                          "ClientViewOnTraderTerminal = '" + ClientViewOnTrader + "' ," +
                          "OrderPlacementOutClientMaster = '" + OrderPlacementOutClientMaster + "', " +
                          "ViewClientOnLevel = '" + ViewClientOnLevel + "' ," +
                          "I4LBlock = '" + I4LBlock + "' ," +
                          "I6LBlock = '" + I6LBlock + "' ," +
                          "Filler = '" + "NA" + "' ," +
                          "AuctionBlock = '" + AuctionBlock + "' ," +
                          "BlockDealBlock = '" + BlockDealBlock + "' ," +
                          "OddLotBlock = '" + OddLotBlock + "' ," +
                          "InstitutionalTradingBlock = '" + InstitutionalTradingBlock + "' ," +
                          "NotApplicable = '" + NotApplicable + "' ," +
                          "RevertFromTrader = '" + Revert + "'" +
                          "WHERE TraderId = '" + VTraderId + "'";
                    int result = oDataAccessLayer.ExecuteNonQuery((int)ConnectionDB.TraderEntitlement, str, System.Data.CommandType.Text, null);
                    Replytxt = "Trader Modified";
                }
            }
            catch (Exception ex)
            {
                ExceptionUtility.LogError(ex);
            }
            finally
            {
                oDataAccessLayer.CloseConnection((int)DataAccessLayer.ConnectionDB.TraderEntitlement);
            }
        }
Exemplo n.º 19
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        /**
         * Note: this demo HAS the overall scroller, but the stage itself SEEMS not to scroll
         * That's because we pushed the scrolled 150 px from both right and bottom
         * so we could place additional scrollbars there.
         * */

        #region Scroller + viewport

        Scroller scroller = new Scroller
        {
            SkinClass = typeof(ScrollerSkin2),
            Left      = 10,
            Right     = 150,
            Top       = 10,
            Bottom    = 150
        };
        //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On);
        //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On);
        AddChild(scroller);

        Group viewport = new Group();
        scroller.Viewport = viewport;

        #endregion

        #region Horizontal scrollers

        HGroup hGroup = new HGroup {
            Gap = 10
        };
        viewport.AddChild(hGroup);

        VGroup hScrollers = new VGroup
        {
            PercentWidth = 100,
            Gap          = 10,
            Left         = 10,
            Right        = 150,
            Bottom       = 10
        };
        AddChild(hScrollers);

        HScrollBar hScroll = new HScrollBar
        {
            SkinClass    = typeof(HScrollBarSkin3),
            PercentWidth = 100,
            Maximum      = 600,
            Viewport     = viewport,
            MouseWheelScrollsHorizontally = true
        };
        hScrollers.AddChild(hScroll);

        hScroll = new HScrollBar
        {
            SkinClass    = typeof(HScrollBarSkin2),
            PercentWidth = 100,
            Maximum      = 600,
            Viewport     = viewport,
        };
        hScrollers.AddChild(hScroll);

        hScroll = new HScrollBar
        {
            PercentWidth = 100,
            Maximum      = 600,
            Viewport     = viewport,
        };
        hScrollers.AddChild(hScroll);

        #endregion

        #region Vertical scrollers

        HGroup vScrollers = new HGroup
        {
            PercentHeight = 100,
            Gap           = 10,
            Right         = 10,
            Top           = 10,
            Bottom        = 150
        };
        AddChild(vScrollers);

        VScrollBar vScroll = new VScrollBar
        {
            SkinClass = typeof(VScrollBarSkin3), PercentHeight = 100, Maximum = 600,
            Viewport  = viewport
        };
        vScrollers.AddChild(vScroll);

        vScroll = new VScrollBar
        {
            SkinClass     = typeof(VScrollBarSkin2),
            PercentHeight = 100,
            Maximum       = 600,
            Viewport      = viewport
        };
        vScrollers.AddChild(vScroll);

        vScroll = new VScrollBar
        {
            PercentHeight = 100,
            Maximum       = 600,
            Viewport      = viewport
        };
        vScrollers.AddChild(vScroll);

        #endregion

        #region Content

        VGroup vGroup = new VGroup
        {
            Id               = "vGroup",
            VerticalAlign    = VerticalAlign.Middle,
            HorizontalCenter = 0,
            VerticalCenter   = 0,
            PaddingLeft      = 10,
            PaddingRight     = 10,
            PaddingTop       = 10,
            PaddingBottom    = 10,
            Gap              = 10
        };

        vGroup.SetStyle("showBackground", true);
        vGroup.SetStyle("backgroundColor", Color.white);
        hGroup.AddChild(vGroup);

        HGroup hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        _btn = new Button
        {
            Text         = "Default button",
            FocusEnabled = false,
            Icon         = ImageLoader.Instance.Load("Icons/page_white_text"),
            MinWidth     = 200,
            MinHeight    = 150
        };
        /* Let's just add a panel to the bottom row on double-clicking this button */
        _btn.DoubleClick += delegate { AddPanel(); };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text         = "Default toggle",
            FocusEnabled = false,
            ToggleMode   = true,
            Selected     = true,
            Icon         = ImageLoader.Instance.Load("Icons/page_white_text")
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text         = "Styled button",
            SkinClass    = typeof(ButtonSkin2),
            FocusEnabled = false,
            Icon         = ImageLoader.Instance.Load("Icons/page_white_text"),
            MinWidth     = 200,
            MinHeight    = 150
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text         = "Styled toggle",
            SkinClass    = typeof(ButtonSkin2),
            FocusEnabled = false,
            ToggleMode   = true,
            Selected     = true,
            Icon         = ImageLoader.Instance.Load("Icons/page_white_text")
        };
        hgroup.AddChild(_btn);

        // nice buttons 1st row

        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        _btn = new Button
        {
            Text         = "Option 1",
            SkinClass    = typeof(ButtonSkin4),
            FocusEnabled = false,
            Icon         = ImageLoader.Instance.Load("IconsBig/arkshany-bookmarks"),
            MinWidth     = 200,
            MinHeight    = 200
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text         = "Option 2",
            SkinClass    = typeof(ButtonSkin4),
            FocusEnabled = false,
            Icon         = ImageLoader.Instance.Load("IconsBig/arkshany-bookmarks"),
            MinWidth     = 200,
            MinHeight    = 200
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text         = "Option 3",
            SkinClass    = typeof(ButtonSkin4),
            FocusEnabled = false,
            Icon         = ImageLoader.Instance.Load("IconsBig/arkshany-bookmarks"),
            MinWidth     = 200,
            MinHeight    = 200,
            ToggleMode   = true,
            Selected     = true
        };
        hgroup.AddChild(_btn);

        // nice buttons 2nd row

        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        _btn = new MyButton
        {
            Text         = "Option 1",
            SkinClass    = typeof(ButtonSkin5),
            FocusEnabled = false,
            Icon         = ImageLoader.Instance.Load("IconsBig/applications-games"),
            MinWidth     = 200,
            MinHeight    = 200
        };
        hgroup.AddChild(_btn);

        _btn = new MyButton2
        {
            Text         = "Option 2",
            SkinClass    = typeof(ButtonSkin5),
            FocusEnabled = false,
            Icon         = ImageLoader.Instance.Load("IconsBig/gconfeditor"),
            MinWidth     = 200,
            MinHeight    = 200
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text         = "Option 3 (disabled)",
            SkinClass    = typeof(ButtonSkin5),
            FocusEnabled = false,
            Icon         = ImageLoader.Instance.Load("IconsBig/gtk-floppy"),
            MinWidth     = 200,
            MinHeight    = 200,
            Enabled      = false
        };
        hgroup.AddChild(_btn);

        // new row
        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        // image
        var image = new Image
        {
            Texture = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        // panel 1
        _panel = new Panel
        {
            Title     = "Panel 1",
            MinWidth  = 200,
            MinHeight = 300
        };
        hgroup.AddChild(_panel);

        // panel 2
        _panel = new Panel
        {
            SkinClass = typeof(PanelSkin3),
            Title     = "Panel 2",
            MinWidth  = 200,
            MinHeight = 300
        };
        hgroup.AddChild(_panel);

        // panel 3
        _panel = new Panel
        {
            SkinClass = typeof(PanelSkin4),
            Title     = "Panel 3",
            MinWidth  = 200,
            MinHeight = 300
        };
        hgroup.AddChild(_panel);

        #endregion

        // new row (placeholder)
        _hgroup = new HGroup();
        vGroup.AddChild(_hgroup);
    }
Exemplo n.º 20
0
        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background image

            /* just in case that no image is visible */

            /*_background = new RectShape
             * {
             *  Left = 0,
             *  Right = 0,
             *  Top = 0,
             *  Bottom = 0
             * };
             * _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
             * AddChild(_background);*/

            /* Tiled image */
            _backgroundImage = new Image
            {
                Left    = 0,
                Right   = 0,
                Top     = 0,
                Bottom  = 0,
                Mode    = ImageMode.Tiled,
                Visible = true
            };
            AddChild(_backgroundImage);

            #endregion

            #region Icon + label group

            VGroup vGroup = new VGroup
            {
                Gap              = 10,
                HorizontalAlign  = HorizontalAlign.Center,
                VerticalAlign    = VerticalAlign.Middle,
                HorizontalCenter = 0,
                VerticalCenter   = 0,
                Right            = 10,
                Left             = 10,
                Top              = 10,
                Bottom           = 10,
            };
            AddChild(vGroup);

            #endregion

            #region Label

            LabelDisplay = new Label {
                MouseEnabled = false,
                Multiline    = true,
                Color        = (Color)GetStyle("labelUpColor")
            };
            vGroup.AddChild(LabelDisplay);

            #endregion

            #region Icon

            IconDisplay = new Image {
                MouseEnabled = false
            };
            vGroup.AddChild(IconDisplay);

            #endregion
        }
Exemplo n.º 21
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        VGroup vbox = new VGroup
        {
            Gap = 10,
            HorizontalCenter = 0, VerticalCenter = 0
        };

        AddChild(vbox);

        Button btn = new Button
        {
            Text      = "Button 1",
            Icon      = (Texture)Resources.Load("Icons/star"),
            SkinClass = typeof(ImageButtonSkin)
        };

        vbox.AddChild(btn);

        btn = new Button
        {
            Text      = "Button 2",
            Icon      = (Texture)Resources.Load("Icons/star"),
            StyleName = "button2",
            SkinClass = typeof(ImageButtonSkin)
        };
        vbox.AddChild(btn);

        btn = new Button
        {
            Text      = "Button 3",
            Icon      = (Texture)Resources.Load("Icons/star"),
            StyleName = "button3",
            SkinClass = typeof(ImageButtonSkin)
        };
        vbox.AddChild(btn);

        vbox.Click += delegate
        {
            Alert.Show(
                "Checking",
                "Are you sure you want to greet the world?",
                AlertButtonFlag.Yes | AlertButtonFlag.No,
                delegate(string action)
            {
                switch (action)
                {
                case "yes":
                    Alert.Show(
                        "Hello",
                        "Hello world!",
                        AlertButtonFlag.Ok,
                        new AlertOption(AlertOptionType.HeaderIcon, Resources.Load <Texture>("Icons/accept"))
                        );
                    break;

                case "no":
                    Alert.Show(
                        "Going to sleep",
                        "Good night.",
                        AlertButtonFlag.Ok,
                        new AlertOption(AlertOptionType.HeaderIcon, Resources.Load <Texture>("Icons/cancel"))
                        );
                    break;
                }
            },
                new AlertOption(AlertOptionType.HeaderIcon, Resources.Load <Texture>("Icons/information"))
                );
        };
    }
Exemplo n.º 22
0
 public bool GetVGroup(int vidx, out VGroup grp)
 {
     return(m_VGCont.TryGetValue(vidx, out grp));
 }
Exemplo n.º 23
0
        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background

            _background = new RectShape
            {
                Left            = 0,
                Right           = 0,
                Top             = 0,
                Bottom          = 0,
                BackgroundColor = (Color)GetStyle("backgroundColor")
            };
            _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
            AddChild(_background);

            /*_backgroundImage = new Image
             *                {
             *                    Left = 0,
             *                    Right = 0,
             *                    Top = 0,
             *                    Bottom = 0,
             *                    //Visible = false,
             *                    ScaleMode = ImageScaleMode.ScaleToFill
             *                };
             * AddChild(_backgroundImage);*/

            #endregion

            VGroup vGroup = new VGroup
            {
                Gap              = 10,
                HorizontalAlign  = HorizontalAlign.Center,
                VerticalAlign    = VerticalAlign.Middle,
                HorizontalCenter = 0,
                VerticalCenter   = 0,
                Right            = 10,
                Left             = 10,
                Top              = 10,
                Bottom           = 10,
            };
            AddChild(vGroup);

            #region Icon

            IconDisplay = new Image
            {
                MouseEnabled = false,
                //Visible = false,
                //IncludeInLayout = false
            };
            vGroup.AddChild(IconDisplay);

            #endregion

            #region Label

            LabelDisplay = new Label
            {
                MouseEnabled = false,
                //Visible = false,
                //IncludeInLayout = false
            };
            vGroup.AddChild(LabelDisplay);

            #endregion
        }
        public List <MonthlyReportDetail> FormatData(List <MonthlyReportDetail> ListMissTargetDetails, VGroup vGroup)
        {
            List <MonthlyReportDetail> lstDetailis = new List <MonthlyReportDetail>();
            ExpressionParser           _parser     = null;

            foreach (MonthlyReportDetail mrd in ListMissTargetDetails)
            {
                foreach (VCounter vcounter in vGroup.CounterList)
                {
                    C_Target cTarget = StaticResource.Instance.TargetList[mrd.SystemID].Where(p => p.ID == mrd.TargetID).FirstOrDefault();
                    if (cTarget != null)
                    {
                        if (cTarget.TargetName == vcounter.Title)
                        {
                            Hashtable bizContext = BizContextEngine.BizContextService.GetBizContext(ListMissTargetDetails.FindAll(p => p.CompanyID == mrd.CompanyID), "MonthlyReportDetail");
                            _parser = new ExpressionParser(bizContext);
                            //区分月累计算式与年累计算式。
                            if (_parser.CacluateCondition(vcounter.Expression))
                            {
                                lstDetailis.Add(mrd);
                            }
                        }
                    }
                }
            }

            return(lstDetailis);
        }
Exemplo n.º 25
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        #region Scroller and viewport

        Scroller scroller = new Scroller
        {
            SkinClass = typeof(ScrollerSkin2),
            Left      = 0,
            Right     = 0,
            Top       = 0,
            Bottom    = 0,
        };
        AddChild(scroller);

        Group viewport = new Group
        {
            Id     = "viewport",
            Layout = new AbsoluteLayout()
        };
        scroller.Viewport = viewport;

        Group g = new Group();
        viewport.AddChild(g);

        var image = new Image
        {
            Mode         = ImageMode.Tiled,
            TilingAnchor = Anchor.BottomRight,
            Texture      = (Texture)Resources.Load("stripes3"),
            Left         = 10,
            Right        = 10,
            Top          = 10,
            Bottom       = 10,
            Tooltip      = "Original size"
        };
        g.AddChild(image);

        #endregion

        #region VGroup

        VGroup vGroup = new VGroup
        {
            Id            = "vGroup",
            PaddingLeft   = 10,
            PaddingRight  = 10,
            PaddingTop    = 10,
            PaddingBottom = 10,
            Left          = 10,
            Right         = 10,
            Top           = 10,
            Bottom        = 10,
            Gap           = 10
        };
        g.AddChild(vGroup);

        #endregion

        #region Images

        var hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        image = new Image
        {
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2"),
            ScaleMode = ImageScaleMode.OriginalSize
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 600,
            Height    = 400,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2"),
            ScaleMode = ImageScaleMode.OriginalSize
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 300,
            Height    = 150,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2"),
            ScaleMode = ImageScaleMode.OriginalSize
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 150,
            Height    = 300,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2"),
            ScaleMode = ImageScaleMode.OriginalSize
        };
        hgroup.AddChild(image);

        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        image = new Image
        {
            Width     = 350,
            Height    = 200,
            ScaleMode = ImageScaleMode.ScaleToWidth,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 350,
            Height    = 200,
            ScaleMode = ImageScaleMode.ScaleToHeight,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 350,
            Height    = 200,
            ScaleMode = ImageScaleMode.ScaleToFit,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 350,
            Height    = 200,
            ScaleMode = ImageScaleMode.ScaleToFill,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 350,
            Height    = 200,
            ScaleMode = ImageScaleMode.StretchToFit,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        image = new Image
        {
            Width     = 200,
            Height    = 350,
            ScaleMode = ImageScaleMode.ScaleToWidth,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 200,
            Height    = 350,
            ScaleMode = ImageScaleMode.ScaleToHeight,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 200,
            Height    = 350,
            ScaleMode = ImageScaleMode.ScaleToFit,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 200,
            Height    = 350,
            ScaleMode = ImageScaleMode.ScaleToFill,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        image = new Image
        {
            Width     = 200,
            Height    = 350,
            ScaleMode = ImageScaleMode.StretchToFit,
            Texture   = (Texture)Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        #endregion

        #region Panels

        _panel = new Panel
        {
            Title     = "Panel 1",
            MinWidth  = 200,
            MinHeight = 350
        };
        hgroup.AddChild(_panel);

        _panel = new Panel
        {
            SkinClass = typeof(PanelSkin3),
            Title     = "Panel 2",
            MinWidth  = 200,
            MinHeight = 350
        };
        hgroup.AddChild(_panel);

        _panel = new Panel
        {
            SkinClass = typeof(PanelSkin4),
            Title     = "Panel 3",
            MinWidth  = 200,
            MinHeight = 350
        };
        hgroup.AddChild(_panel);

        #endregion
    }
Exemplo n.º 26
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        #region Top label

        Label label = new TitleLabel {
            HorizontalCenter = 0, Top = 20, StyleName = "title"
        };
        AddChild(label);

        new TextRotator
        {
            Delay = 5, // 5 seconds delay
            Lines = new[]
            {
                "Loading Mask Demo",
                "Created with eDriven.Gui"
                //"Author: Danko Kozar"
            },
            Callback = delegate(string line) { label.Text = line; }
        }
        .Start();

        #endregion

        #region VBox

        VGroup vbox = new VGroup
        {
            HorizontalCenter = 0,
            VerticalCenter   = 0,
            HorizontalAlign  = HorizontalAlign.Center,
            Gap = 20
        };
        AddChild(vbox);

        #endregion

        HGroup hbox = new HGroup {
            Gap = 20, VerticalAlign = VerticalAlign.Middle
        };
        vbox.AddChild(hbox);

        // 3 example mask, just for fun
        hbox.AddChild(new LoadingMaskAnimator {
            Width = 250, Height = 100, Message = "Loading something..."
        });
        hbox.AddChild(new LoadingMaskAnimator {
            Width = 250, Height = 150, Message = "Loading something else..."
        });
        hbox.AddChild(new LoadingMaskAnimator {
            Width = 250, Height = 200, Message = "And yet something else..."
        });

        //vbox.AddChild(new Spacer {Height = 40});

        hbox = new HGroup {
            Gap = 20, VerticalAlign = VerticalAlign.Middle
        };
        vbox.AddChild(hbox);

        // create 3 buttons
        CreateButton(hbox);
        CreateButton(hbox);
        CreateButton(hbox);

        Button btn = new Button
        {
            Text         = @"Click to show a global mask for 3 seconds",
            Icon         = Resources.Load <Texture>("IconsBig/oxyblue-address-book-new"),
            SkinClass    = typeof(ButtonSkin5),
            Left         = 100,
            Top          = 100,
            Width        = 250,
            Height       = 250,
            FocusEnabled = false
        };
        btn.Click += new EventHandler(delegate
        {
            int count = 0;

            GlobalLoadingMask.Show("");

            Timer t = new Timer(1, 3)
            {
                TickOnStart = true
            };
            t.Tick += delegate
            {
                GlobalLoadingMask.SetMessage(string.Format("Masking... {0} seconds", count));
                count++;
            };
            t.Complete += delegate { GlobalLoadingMask.Hide(); };
            t.Start();
        });
        vbox.AddChild(btn);
    }
Exemplo n.º 27
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        #region Controls

        Toolbar toolbar = new Toolbar();
        AddChild(toolbar);

        Button button = new Button
        {
            Text       = "Add data",
            SkinClass  = typeof(ImageButtonSkin),
            Icon       = ImageLoader.Instance.Load("Icons/add"),
            AutoRepeat = true
        };
        button.ButtonDown += delegate
        {
            _dataProvider.AddItem("data " + _random.Next(1, 100));
        };
        toolbar.AddContentChild(button);

        #endregion

        #region Scroller

        Scroller scroller = new Scroller
        {
            SkinClass     = typeof(ScrollerSkin2),
            PercentWidth  = 100,
            PercentHeight = 100
        };
        //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On);
        //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On);
        AddChild(scroller);

        Group viewport = new Group
        {
            MouseEnabled = true,
            Layout       = new VerticalLayout
            {
                HorizontalAlign = HorizontalAlign.Left,
                PaddingLeft     = 10,
                PaddingRight    = 10,
                PaddingTop      = 10,
                PaddingBottom   = 10,
                Gap             = 10
            }
        };
        scroller.Viewport = viewport;

        #endregion

        List <object> source = new List <object> {
            "Failure", "Teaches", "Success", "One", "Two", "Three", "Four", "Five", "Six"
        };

        _dataProvider = new ArrayList(source);

        HGroup hGroup = new HGroup();
        viewport.AddChild(hGroup);

        //List<object> source = new List<object> {"Failure", "Teaches", "Success", "One", "Two", "Three", "Four", "Five", "Six"};

        var factory = new ItemRendererFactory <DefaultItemRenderer>();

        VGroup vGroup = new VGroup {
            PercentHeight = 100
        };
        hGroup.AddChild(vGroup);

        HGroup hGroup2 = new HGroup
        {
            PercentWidth = 100
        };
        vGroup.AddChild(hGroup2);

        /* LISTS */

        #region List 1

        List list = new List
        {
            Id = "list1",
            //Layout = new TileLayout { RequestedColumnCount = 4 },
            Width        = 200, Height = 200,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return(factory);
            }
        };
        hGroup2.AddChild(list);

        #endregion

        #region List 2

        list = new List
        {
            Id = "list2",
            //Layout = new TileLayout { RequestedColumnCount = 3 },
            Width        = 200, Height = 245,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return(factory);
            }
        };
        hGroup2.AddChild(list);

        #endregion

        #region List 3

        list = new List
        {
            Id           = "list3",
            Width        = 400,
            Height       = 600,
            DataProvider = _dataProvider,
            SkinClass    = typeof(ListSkin2),
            ItemRenderer = new ItemRendererFactory <BigItemRenderer>()
        };
        hGroup.AddChild(list);

        #endregion

        vGroup.AddChild(new Spacer {
            PercentHeight = 100
        });

        #region Drop down lists

        VGroup vGroup2 = new VGroup();
        vGroup.AddChild(vGroup2);

        DropDownList dropDownList1 = new DropDownList
        {
            DataProvider = _dataProvider
        };
        vGroup2.AddChild(dropDownList1);

        DropDownList dropDownList2 = new DropDownList
        {
            Width        = 200,
            DataProvider = _dataProvider,
            Prompt       = "Pick an item"
        };
        vGroup2.AddChild(dropDownList2);

        DropDownList dropDownList3 = new DropDownList
        {
            Width        = 200,
            SkinClass    = typeof(DropDownListSkin2),
            DataProvider = _dataProvider/*,
                                         * SelectedIndex = 0*/
        };
        vGroup2.AddChild(dropDownList3);

        ComboBox comboBox = new ComboBox
        {
            Width        = 200,
            DataProvider = _dataProvider/*,
                                         * SelectedIndex = 0*/
        };
        vGroup2.AddChild(comboBox);

        vGroup2.Plugins.Add(new TabManager
        {
            TabChildren = new List <DisplayListMember> {
                dropDownList1, dropDownList2, dropDownList3, comboBox
            }
        });

        #endregion

        #region Process renderer click

        AddEventListener(BigItemRenderer.ADD_BUTTON_CLICKED, delegate(Event e)
        {
            BigItemRenderer itemRenderer = (BigItemRenderer)e.Target;
            Alert.Show("Info", itemRenderer.Data.ToString(), AlertButtonFlag.Ok,
                       new AlertOption(AlertOptionType.HeaderIcon, ImageLoader.Instance.Load("Icons/information")));
        });

        #endregion
    }
        /// <summary>
        /// Addition of new trader info :Added By Apoorva Sharma 7/05/2018
        /// </summary>
        private void ModelCreation()
        {
            try
            {
                Reset();
                bool NullCheckValue = NullCheck();
                if (NullCheckValue)
                {
                    TraderEntitlementModel oTEModel = new TraderEntitlementModel();
                    oTEModel.Branch           = VBranch?.ToString();
                    oTEModel.TraderId         = VTraderId?.ToString();
                    oTEModel.TraderIdSort     = Convert.ToInt32(oTEModel.TraderId);
                    oTEModel.TraderGroup      = VGroup?.ToString();
                    oTEModel.ClientView       = ClientViewOnTrader?.ToString();
                    oTEModel.ClientViewAT     = ViewClientOnLevel?.ToString();
                    oTEModel.AuctionBlock     = AuctionBlock;
                    oTEModel.FourLBlock       = I4LBlock;
                    oTEModel.SixLBlock        = I6LBlock;
                    oTEModel.InstTradingBlock = InstitutionalTradingBlock;
                    oTEModel.ODDlotBlock      = OddLotBlock;
                    oTEModel.OrderRights      = OrderPlacementOutClientMaster.ToString();;
                    oTEModel.BlockDealBlock   = BlockDealBlock;
                    oTEModel.NotApplicable    = NotApplicable;
                    oTEModel.Revert           = Revert;
                    //check short traderid duplication case
                    if (SelectedTraderADDUpdate == "Add")
                    {
                        if (TraderEntitlementCollection.Count > 0)
                        {
                            if (TraderEntitlementCollection.Any(x => x.TraderId == VTraderId))
                            {
                                Replytxt = "The TraderId Already exist";
                                return;
                            }
                            else
                            {
                                ModifyFlag = false;
                                TraderEntitlementCollection.Add(oTEModel);

                                oDataAccessLayer.OpenConnection((int)DataAccessLayer.ConnectionDB.TraderEntitlement);

                                str = @"INSERT INTO TRADER_ENTITLEMENT(Branch, TraderGroup,
                                   TraderId,
                                   ClientViewOnTraderTerminal,
                                   OrderPlacementOutClientMaster,
                                   ViewClientOnLevel,
                                   I4LBlock,
                                   I6LBlock,
                                   Filler,
                                   AuctionBlock,
                                   BlockDealBlock,
                                   OddLotBlock,
                                   InstitutionalTradingBlock,
                                   NotApplicable,
                                   RevertFromTrader) VALUES( " + "'" + oTEModel.Branch + "'," + "'" + oTEModel.TraderGroup + "'," + "'" + oTEModel.TraderId + "'," + "'" + oTEModel.ClientView + "'," + "'" + oTEModel.OrderRights + "'," + "'" + oTEModel.ClientViewAT + "'," + "'" + oTEModel.FourLBlock + "'," + "'" + oTEModel.SixLBlock + "'," + "'" + "NA" + "'," + "'" + oTEModel.AuctionBlock + "'," + "'" + oTEModel.BlockDealBlock + "'," + "'" + oTEModel.ODDlotBlock + "'," + "'" + oTEModel.InstTradingBlock + "'," + "'" + oTEModel.NotApplicable + "'," + "'" + oTEModel.Revert + "'); ";

                                int result = oDataAccessLayer.ExecuteNonQuery((int)ConnectionDB.TraderEntitlement, str, System.Data.CommandType.Text, null);
                                Replytxt = "Trader added successfully";
                            }
                        }
                    }
                    else if (SelectedTraderADDUpdate == "Modify")
                    {
                        ModifyGrid();
                    }
                    //else if(TraderEntitlementCollection.Count==0)
                    // TraderEntitlementCollection.Add(oTEModel);
                    TraderEntitlementCollection    = new ObservableCollection <TraderEntitlementModel>(TraderEntitlementCollection.OrderBy(i => i.TraderIdSort));
                    NewTraderEntitlementCollection = TraderEntitlementCollection;
                    RecordCount = TraderEntitlementCollection.Count;
                    //MasterSharedMemory.oDataAccessLayer.OpenConnection((int)DataAccessLayer.ConnectionDB.Masters);
                    //int result = MasterSharedMemory.oDataAccessLayer.ExecuteNonQuery((int)ConnectionDB.Mastersstr, System.Data.CommandType.Text, null);
                    //TODO:  insert and update in db
                }
            }

            catch (Exception ex)
            {
                ExceptionUtility.LogError(ex);
            }
            finally
            {
                oDataAccessLayer.CloseConnection((int)DataAccessLayer.ConnectionDB.TraderEntitlement);
            }
        }