//new bool onMouseButtonUp(MouseEventArgs e)
        //{
        //    bool retVal = onMouseButtonUp(e);
        //    // When the widget or any of its child widgets receive the mouse up event,
        //    // hide the menu containing this list item.  This is performed in Menu::onMouseButtonUp
        //    e.handled = false;
        //    if(mParentWidget != null)
        //        mParentWidget.onMouseButtonUp(e);
        //    return retVal;
        //}

        //new bool onMouseEnters(MouseEventArgs e)
        //{
        //    e.widget = this;
        //    List parentList = (List)mParentWidget;

        //    parentList.highlightListItem(this);

        //    return onMouseEnters(e);
        //}

        //new bool onMouseLeaves(MouseEventArgs e)
        //{
        //    e.widget = this;
        //    List parentList = (List)mParentWidget;

        //    parentList.hideHighlight();

        //    return onMouseLeaves(e);
        //}

        void removeNStateButton()
        {
            if (mButton == null)
            {
                return;
            }

            _removeChildWidget(mButton);
            mButton = null;
        }
        public ListItem(string name, Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode, OverlayContainer overlayContainer, Widget ParentWidget) : base(name, dimensions, positionMode, sizeMode, "", overlayContainer, ParentWidget)
        {
            mImage      = null;
            mButton     = null;
            mWidgetType = Widget.WidgetType.QGUI_TYPE_LISTITEM;
            setCharacterHeight(1.0f);

            OnDeactivate    += new DeactivateEventHandler(ListItem_OnDeactivate);
            OnMouseEnter    += new MouseEnterEventHandler(ListItem_OnMouseEnter);
            OnMouseButtonUp += new MouseButtonUpEventHandler(ListItem_OnMouseButtonUp);
            OnMouseLeaves   += new MouseLeavesEventHandler(ListItem_OnMouseLeaves);
        }
Пример #3
0
        NStateButton _createNStateButton(string name, Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode)
        {
            NStateButton newNStateButton = new NStateButton(name, dimensions, positionMode, sizeMode, mChildrenContainer, this);

            newNStateButton.setZOrderOffset(1);
            if (!mVisible)
            {
                newNStateButton.hide();
            }
            _addChildWidget(newNStateButton);
            // update count
            ++mNumNStateButtons;

            return(newNStateButton);
        }
        public NStateButton addNStateButton(Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode)
        {
            if (mButton != null)
            {
                return(null);
            }

            mButton = new NStateButton(mInstanceName + ".NStateButton", dimensions, positionMode, sizeMode, mChildrenContainer, this);
            //Reemplzado por Manejo de Eventos //GDZ
            //mButton->addEventHandler(Widget::QGUI_EVENT_DEACTIVATED,&ListItem::evtHndlr_hideMenus,dynamic_cast<ListItem*>(this));
            //mButton->addEventHandler(Widget::QGUI_EVENT_MOUSE_BUTTON_UP,&ListItem::evtHndlr_hideMenus,dynamic_cast<ListItem*>(this));
            mButton.OnDeactivate    += new DeactivateEventHandler(mButton_OnDeactivate);
            mButton.OnMouseButtonUp += new MouseButtonUpEventHandler(mButton_OnMouseButtonUp);
            mButton.setZOrderOffset(1, false);
            if (!mVisible)
            {
                mButton.hide();
            }
            _addChildWidget(mButton);

            return(mButton);
        }