//Constructor
        public Form_SplashScreen()
        {
            InitializeComponent();

            //ProgressBar Setup
            ProgressBar.Maximum = 100;
            ProgressBar.Step    = 1;
            ProgressBar.Value   = 0;

            //Animation Setup
            this.Opacity = 0.0f;

            m_animTimer          = new Timer();
            m_animTimer.Interval = 17; //ms
            m_animTimer.Tick    += AnimEvent;

            m_tweener               = new Tweener <float>();
            m_tweener.duration      = 0.3f; //second;
            m_tweener.tweenDelegate = delegate(ref float value)
            {
                value        = Tween.DoTween(0f, 1f, m_tweener.progress, m_tweener.type);
                this.Opacity = value;
            };

            m_tweener.Start();
            m_animTimer.Start();

            //Sequence Execution
            m_sequence = new Sequence();
            m_sequence.OnEachActionStart  = OnEachActionStart;
            m_sequence.OnEachActionFinish = OnEachActionFinish;
            m_sequence.OnSequenceFinish   = OnSequenceFinish;
            m_sequence.AddAction(delegate
            {
                //Initialize App
                App.Initialize();
            });
            m_sequence.AddAction(delegate
            {
                //Pinging Server
                Ping ping   = new Ping();
                m_pingReply = ping.Send(DB.ipString);
            });
            m_sequence.AddAction(delegate
            {
                //Testing Connection
                DBSql.Test();
            });
        }
Esempio n. 2
0
        public Form_Toast()
        {
            InitializeComponent();
            m_tweener = new Tweener <Vector2>();
            m_tweener.tweenDelegate = delegate(ref Vector2 val)
            {
                val.x         = Tween.DoTween(m_startPos.x, m_endPos.x, m_tweener.progress, m_tweener.type);
                val.y         = Tween.DoTween(m_startPos.y, m_endPos.y, m_tweener.progress, m_tweener.type);
                this.Location = val.ToPoint();
            };

            m_tweener.duration   = 0.3f;
            m_tweener.mode       = TweenMode.Once;
            m_tweener.type       = TweenType.EaseOutExpo;
            m_tweener.forceTween = true;

            m_timer          = new Timer();
            m_timer.Interval = 1;
            m_timer.Tick    += OnUpdate;
        }
        private void Initialize_OrderArea()
        {
            #region NavButton
            m_orderNavButtons = new CircleButtonControl[4];
            int len = m_orderNavButtons.Length;
            for (int i = 0; i < len; i++)
            {
                m_orderNavButtons[i] = new CircleButtonControl();
            }

            Order_NavButtonPart1.Controls.Add(m_orderNavButtons[0]);
            Order_NavButtonPart2.Controls.Add(m_orderNavButtons[1]);
            Order_NavButtonPart3.Controls.Add(m_orderNavButtons[2]);
            Order_NavButtonPart4.Controls.Add(m_orderNavButtons[3]);

            for (int i = 0; i < len; i++)
            {
                var ctrl = m_orderNavButtons[i];
                ctrl.Dock             = DockStyle.Fill;
                ctrl.OnButtonClicked += Event_OnOrderNavButtonClicked;
                ctrl.borderColor      = Color.White;
                ctrl.colorNormal      = Color.FromArgb(41, 51, 90);
                ctrl.colorHover       = Color.FromArgb(81, 102, 155);
                ctrl.colorPressed     = Color.FromArgb(29, 35, 65);
                CircleButton btn = null;
                switch (i)
                {
                case 0:
                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_Check;
                    btn.tag          = "Approve";
                    btn.tooltip      = "Approve Order";

                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_X;
                    btn.tag          = "Cancel";
                    btn.tooltip      = "Cancel Order";

                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_Declined;
                    btn.tag          = "Decline";
                    btn.tooltip      = "Decline Order";

                    break;

                case 1:
                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_Print;
                    btn.tag          = "Print";
                    btn.tooltip      = "Print";

                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_Table_Export;
                    btn.tag          = "Export";
                    btn.tooltip      = "Export";

                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_negosiasi;
                    btn.tag          = "Negosiasi";
                    btn.tooltip      = "Approve Order";
                    break;

                case 2:
                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_Filter_Filter;
                    btn.tag          = "Filter_Filter";
                    btn.tooltip      = "Filter";

                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_Filter_Cancel;
                    btn.tag          = "Filter_Cancel";
                    break;

                case 3:
                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_Arrow_Left;
                    btn.tag          = "PrevPage";
                    btn.tooltip      = "Previous Page";

                    btn = ctrl.AddButton();
                    btn.overlayImage = Resources.Icon_Arrow_Right;
                    btn.tag          = "NextPage";
                    btn.tooltip      = "Next Page";
                    break;
                }
            }
            #endregion

            #region SideBarButton
            m_orderSideBarButtons    = new CheckButton[5];
            m_orderSideBarButtons[0] = Order_SideBar_Button_All;
            m_orderSideBarButtons[1] = Order_SideBar_Button_Waiting;
            m_orderSideBarButtons[2] = Order_SideBar_Button_Canceled;
            m_orderSideBarButtons[3] = Order_SideBar_Button_Finished;
            m_orderSideBarButtons[4] = Order_SideBar_Button_Declined;

            m_orderSideBarButtons[0].Checked = true;
            len = m_orderSideBarButtons.Length;
            for (int i = 0; i < len; i++)
            {
                m_orderSideBarButtons[i].CheckedChanged += Event_OnOrderSideButtonChanged;
            }
            #endregion

            #region FilterPanel
            //Setup Animation
            m_orderFilterToggle               = new AnimBool <Size>();
            m_orderFilterToggle.valueStart    = new Size(214, 299);
            m_orderFilterToggle.valueEnd      = new Size(0, 0);
            m_orderFilterToggle.tweenDelegate = delegate(ref Size val) {
                var v = m_orderFilterToggle;
                val.Width              = (int)Tween.DoTween(v.valueStart.Width, v.valueEnd.Width, v.progress, v.setting.type);
                val.Height             = (int)Tween.DoTween(v.valueStart.Height, v.valueEnd.Height, v.progress, v.setting.type);
                Order_FilterPanel.Size = val;
                Console.WriteLine("Moving");
            };

            TweenSetting tw = m_orderFilterToggle.setting;
            tw.duration   = 0.3f;
            tw.forceTween = true;
            tw.mode       = TweenMode.Once;
            tw.type       = TweenType.EaseOutExpo;
            m_orderFilterToggle.setting = tw;
            #endregion

            Order_GridView.RowCellStyle += Event_OnOrderGridViewRowCellStyle;
            Order_GridView.DoubleClick  += OnGridDoubleClicked;
        }