protected void initHandlers()
        {
            this.AddButton.Click    += OnAddButtonClick;
            this.DeleteButton.Click += OnDeleteButtonClick;

            this.OpenBracketComboBox.SelectionChanged  += onChange;
            this.CloseBracketComboBox.SelectionChanged += onChange;
            this.OperatorComboBox.SelectionChanged     += onChange;


            this.CommentTextBlock.TextChanged += OnCommentChange;
            this.CommentPopup.Opened          += OnCommentPopupOpened;

            this.CommentButton.Checked   += OnComment;
            this.NoCommentButton.Checked += OnComment;

            this.ShowDetailsButton.Click += OnShowDetails;
            this.HideDetailsButton.Click += OnHideDetails;

            this.Arg1Label.GotFocus           += OnGotFocus;
            this.AddButton.GotFocus           += OnGotFocus;
            this.DeleteButton.GotFocus        += OnGotFocus;
            this.OpenBracketComboBox.GotFocus += OnGotFocus;
            this.OperatorComboBox.GotFocus    += OnGotFocus;
            this.CommentTextBlock.GotFocus    += OnGotFocus;
            this.ShowDetailsButton.GotFocus   += OnGotFocus;

            this.Arg1Label.MouseDown           += OnMouseDown;
            this.AddButton.MouseDown           += OnMouseDown;
            this.DeleteButton.MouseDown        += OnMouseDown;
            this.OpenBracketComboBox.MouseDown += OnMouseDown;
            this.OperatorComboBox.MouseDown    += OnMouseDown;
            this.CommentTextBlock.MouseDown    += OnMouseDown;
            this.ShowDetailsButton.MouseDown   += OnMouseDown;

            this.LoopCalutedValue.Activated                    += OnActivate;
            this.LoopCalutedValue.ChangeEventHandler           += onChange;
            this.LoopCalutedValue.filterScopePanel.Changed     += onChange;
            this.LoopCalutedValue.filterScopePanel.ItemChanged += OnFilterScopeChanged;
            this.LoopCalutedValue.periodPanel.Changed          += onChange;
            this.LoopCalutedValue.periodPanel.ItemChanged      += OnPeriodChanged;
            this.LoopCalutedValue.periodPanel.ItemDeleted      += OnPeriodDeleted;
            this.LoopCalutedValue.filterScopePanel.ItemDeleted += OnFilterScopeDeleted;
            this.LoopCalutedValue.CellMeasurePanel.Added       += OnCellMeasureChanged;
            this.LoopCalutedValue.CellMeasurePanel.Updated     += OnCellMeasureChanged;
        }
Beispiel #2
0
        public Label(string name, Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode, string material, OverlayContainer overlayContainer, Widget ParentWidget)
            : base(name, dimensions, positionMode, sizeMode, material, overlayContainer, ParentWidget)
        {
            mWidgetType = Widget.WidgetType.QGUI_TYPE_LABEL;

            mOverlayElement = createPanelOverlayElement(mInstanceName + ".Background", mPixelDimensions, "");
            mOverlayContainer.AddChild(mOverlayElement);
            mOverlayElement.Show();
            setMaterial(mWidgetMaterial);

            mCharacterHeight = 0.8f;
            mTextWidget      = new Text(mInstanceName + ".Text", new Vector3(0, 0, mCharacterHeight), QGuiMetricsMode.QGUI_GMM_RELATIVE, QGuiMetricsMode.QGUI_GMM_RELATIVE, mChildrenContainer, this);
            mTextWidget.setZOrderOffset(1, false);
            _addChildWidget(mTextWidget);

            mHorizontalAlignment = GuiHorizontalAlignment.GHA_CENTER;
            mVerticalAlignment   = GuiVerticalAlignment.GVA_CENTER;

            OnActivate += new ActivateEventHandler(Label_OnActivate);
        }
        public Window(string name, Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode, string material, Widget parentWidget) : base(name, dimensions, positionMode, sizeMode, material, null, parentWidget)
        {
            mTitleBar       = null;
            mTitleBarHidden = false;


            mWidgetType     = Widget.WidgetType.QGUI_TYPE_WINDOW;
            mOverlay        = OverlayManager.Singleton.Create(mInstanceName + ".Overlay");
            mOverlay.ZOrder = 0;
            mOverlay.Show();
            mZOrderValues.Add(0);

            // mChildrenContainer already created in Widget constructor
            mTitleBarContainer = createOverlayContainer(mInstanceName + ".TitleBarContainer", "");

            mOverlay.Add2D(mOverlayContainer);
            mChildrenContainer.AddChildImpl(mTitleBarContainer);

            mOverlayContainer.Show();
            mChildrenContainer.Show();
            mTitleBarContainer.Show();

            // Create TitleBar - tradition titlebar dimensions: across the top of the window
            Vector4 defaultTitleBarDimensions = new Vector4(0f, 0f, 1f, 0.05f / getSize(QGuiMetricsMode.QGUI_GMM_ABSOLUTE).y);

            mTitleBar = new TitleBar(mInstanceName + ".Titlebar", defaultTitleBarDimensions, QGuiMetricsMode.QGUI_GMM_RELATIVE, QGuiMetricsMode.QGUI_GMM_RELATIVE, mWidgetMaterial + ".titlebar", mTitleBarContainer, this);
            mTitleBar.enableDragging(true);
            mTitleBar.setDraggingWidget(this);
            mTitleBar.getTextWidget().enableDragging(true);
            mTitleBar.getTextWidget().setDraggingWidget(this);
            mTitleBar.setZOrderOffset(1);
            _addChildWidget(mTitleBar);

            // Now that mOverlayContainer has been created (via _init() function) we can create the borders
            _createBorders();

            OnActivate += new ActivateEventHandler(Window_OnActivate);
        }
Beispiel #4
0
        /** Constructor
         *  @param
         *      name The name to be given to the widget (must be unique).
         *  @param
         *      dimensions The x Position, y Position, width, and height of the widget.
         *  @param
         *      positionMode The GuiMetricsMode for the values given for the position. (absolute/relative/pixel)
         *  @param
         *      sizeMode The GuiMetricsMode for the values given for the size. (absolute/relative/pixel)
         *  @param
         *      material Ogre material defining the widget image.
         *  @param
         *      overlayContainer associates the internal OverlayElement with a specified zOrder.
         *  @param
         *      parentWidget parent widget which created this widget.
         */
        public Panel(string name, Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode, string material, OverlayContainer overlayContainer, Widget parentWidget)
            : base(name, dimensions, positionMode, sizeMode, material, overlayContainer, parentWidget)
        {
            mAutoNameWidgetCounter = 0;
            mNumButtons            = 0;
            mNumComboBoxes         = 0;
            mNumImages             = 0;
            mNumLabels             = 0;
            mNumLists         = 0;
            mNumMenus         = 0;
            mNumNStateButtons = 0;
            mNumPanels        = 0;
            mNumProgressBars  = 0;
            mNumTextBoxes     = 0;
            mNumTrackBars     = 0;

            mWidgetType = WidgetType.QGUI_TYPE_PANEL;
            mZOrderValues.Clear();

            if (overlayContainer == null)
            {
                mOverlayContainer = createOverlayContainer(mInstanceName + ".OverlayContainer", "");
                mOverlayContainer.AddChildImpl(mChildrenContainer);

                mOverlayContainer.Show();
                mChildrenContainer.Show();
            }

            mOverlayElement = createPanelOverlayElement(mInstanceName + ".Background", mPixelDimensions, "");
            mOverlayContainer.AddChild(mOverlayElement);
            mOverlayElement.Show();
            setMaterial(mWidgetMaterial);

            OnActivate   += new ActivateEventHandler(Panel_OnActivate);
            OnDeactivate += new DeactivateEventHandler(Panel_OnDeactivate);
        }