示例#1
0
QgsMessageBar::QgsMessageBar( QWidget *parent )
    : QFrame( parent )
    , mCurrentItem( nullptr )
{
  QPalette pal = palette();
  pal.setBrush( backgroundRole(), pal.window() );
  setPalette( pal );
  setAutoFillBackground( true );
  setFrameShape( QFrame::StyledPanel );
  setFrameShadow( QFrame::Plain );

  mLayout = new QGridLayout( this );
  mLayout->setContentsMargins( 9, 1, 9, 1 );
  setLayout( mLayout );

  mCountProgress = new QProgressBar( this );
  mCountStyleSheet = QString( "QProgressBar { border: 1px solid rgba(0, 0, 0, 75%);"
                              " border-radius: 2px; background: rgba(0, 0, 0, 0);"
                              " image: url(:/images/themes/default/%1) }"
                              "QProgressBar::chunk { background-color: rgba(0, 0, 0, 30%); width: 5px; }" );

  mCountProgress->setStyleSheet( mCountStyleSheet.arg( QStringLiteral( "mIconTimerPause.png" ) ) );
  mCountProgress->setObjectName( QStringLiteral( "mCountdown" ) );
  mCountProgress->setFixedSize( 25, 14 );
  mCountProgress->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
  mCountProgress->setTextVisible( false );
  mCountProgress->setRange( 0, 5 );
  mCountProgress->setHidden( true );
  mLayout->addWidget( mCountProgress, 0, 0, 1, 1 );

  mItemCount = new QLabel( this );
  mItemCount->setObjectName( QStringLiteral( "mItemCount" ) );
  mItemCount->setToolTip( tr( "Remaining messages" ) );
  mItemCount->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
  mLayout->addWidget( mItemCount, 0, 2, 1, 1 );

  mCloseMenu = new QMenu( this );
  mCloseMenu->setObjectName( QStringLiteral( "mCloseMenu" ) );
  mActionCloseAll = new QAction( tr( "Close all" ), this );
  mCloseMenu->addAction( mActionCloseAll );
  connect( mActionCloseAll, SIGNAL( triggered() ), this, SLOT( clearWidgets() ) );

  mCloseBtn = new QToolButton( this );
  mCloseMenu->setObjectName( QStringLiteral( "mCloseMenu" ) );
  mCloseBtn->setToolTip( tr( "Close" ) );
  mCloseBtn->setMinimumWidth( 40 );
  mCloseBtn->setStyleSheet(
    "QToolButton { background-color: rgba(0, 0, 0, 0); }"
    "QToolButton::menu-button { background-color: rgba(0, 0, 0, 0); }" );
  mCloseBtn->setCursor( Qt::PointingHandCursor );
  mCloseBtn->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconClose.svg" ) ) );
  mCloseBtn->setIconSize( QSize( 18, 18 ) );
  mCloseBtn->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
  mCloseBtn->setMenu( mCloseMenu );
  mCloseBtn->setPopupMode( QToolButton::MenuButtonPopup );
  connect( mCloseBtn, SIGNAL( clicked() ), this, SLOT( popWidget() ) );
  mLayout->addWidget( mCloseBtn, 0, 3, 1, 1 );

  mCountdownTimer = new QTimer( this );
  mCountdownTimer->setInterval( 1000 );
  connect( mCountdownTimer, SIGNAL( timeout() ), this, SLOT( updateCountdown() ) );

  connect( this, SIGNAL( widgetAdded( QgsMessageBarItem* ) ), this, SLOT( updateItemCount() ) );
  connect( this, SIGNAL( widgetRemoved( QgsMessageBarItem* ) ), this, SLOT( updateItemCount() ) );

  // start hidden
  setVisible( false );
}
示例#2
0
bool CSGTTV::MovieEndMsg(CMovieEndMsg *msg) {
	setVisible(false);
	return true;
}
void LLCallFloater::updateSession()
{
	LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel();
	if (voice_channel)
	{
		LL_DEBUGS("Voice") << "Current voice channel: " << voice_channel->getSessionID() << LL_ENDL;

		if (mSpeakerManager && voice_channel->getSessionID() == mSpeakerManager->getSessionID())
		{
			LL_DEBUGS("Voice") << "Speaker manager is already set for session: " << voice_channel->getSessionID() << LL_ENDL;
			return;
		}
		else
		{
			mSpeakerManager = NULL;
		}
	}

	const LLUUID& session_id = voice_channel ? voice_channel->getSessionID() : LLUUID::null;

	LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id);
	if (im_session)
	{
		mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id);
		switch (im_session->mType)
		{
		case IM_NOTHING_SPECIAL:
		case IM_SESSION_P2P_INVITE:
			mVoiceType = VC_PEER_TO_PEER;

			if (!im_session->mOtherParticipantIsAvatar)
			{
				mVoiceType = VC_PEER_TO_PEER_AVALINE;
			}
			break;
		case IM_SESSION_CONFERENCE_START:
		case IM_SESSION_GROUP_START:
		case IM_SESSION_INVITE:
			if (gAgent.isInGroup(session_id))
			{
				mVoiceType = VC_GROUP_CHAT;
			}
			else
			{
				mVoiceType = VC_AD_HOC_CHAT;				
			}
			break;
		default:
			llwarning("Failed to determine voice call IM type", 0);
			mVoiceType = VC_GROUP_CHAT;
			break;
		}
	}

	if (NULL == mSpeakerManager)
	{
		// By default show nearby chat participants
		mSpeakerManager = LLLocalSpeakerMgr::getInstance();
		LL_DEBUGS("Voice") << "Set DEFAULT speaker manager" << LL_ENDL;
		mVoiceType = VC_LOCAL_CHAT;
	}

	updateTitle();

	// Hide "Leave Call" button for nearby chat
	bool is_local_chat = mVoiceType == VC_LOCAL_CHAT;
	getChildView("leave_call_btn_panel")->setVisible( !is_local_chat);

	refreshParticipantList();
	updateAgentModeratorState();

	// Show floater for voice calls & only in CONNECTED to voice channel state
	if (!is_local_chat &&
	    voice_channel &&
	    LLVoiceChannel::STATE_CONNECTED == voice_channel->getState())
	{
		LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
		bool show_me = !(im_floater && im_floater->getVisible());
		if (show_me) 
		{
			setVisible(true);
		}
	}

// [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
	mAvatarList->setRlvCheckShowNames(is_local_chat);
// [/RLVa:KB]
}
示例#4
0
void Console::draw( gfx::Engine& painter )
{
  if( !font().isValid() )
  {
    Widget::draw( painter );
    return;
  }

  if( visible() )															// render only if the console is visible
  {
    if( toggle_visible_ != NONE )
    {
      if( toggle_visible_ == DOWNLIGTH )
      {
        if (_opacity > 5) _opacity -= 9;
        else setVisible(false);
        _d->dirty = true;
      }
      else
      {
        if (_opacity < 0xff)	_opacity += 3;
        else toggle_visible_ = NONE;
        _d->dirty = true;
      }
    }

    Rect textRect, shellRect;										//we calculate where the message log shall be printed and where the prompt shall be printed
    calculatePrintRects(textRect,shellRect);

    if(_d->dirty)
    {
      Decorator::drawLines(_d->bg, ColorList::red, relativeRect().lines());
      _d->bg.fill(ColorList::blue);

      unsigned int maxLines, lineHeight;											//now, render the messages
      int fontHeight=0;
      if (!calculateLimits(maxLines,lineHeight,fontHeight))
      {
        return;
      }

      Rect lineRect( textRect.left(),						//calculate the line rectangle
                     textRect.top(),
                     textRect.right(),
                     textRect.bottom() + lineHeight);

      for (unsigned int index = 0; index < console_messages_.size(); index++)
      {
        unsigned int rindex = (_d->curIndex + index) % console_messages_.size();
        const std::string& line = console_messages_[rindex];
        font().draw(_d->bg, line, lineRect.lefttop(), false, false);
        lineRect += Point(0, lineHeight);						//update line rectangle
      }

      std::string shellText = "$>" + currentCommand_;

      font().draw( _d->bg, shellText, shellRect.lefttop(), false, false);	//draw the prompt string

      _d->dirty = false;
      _d->bg.update();
      _d->bg.setAlpha(_opacity/3*2);
    }

    painter.draw( _d->bg, absoluteRect().lefttop() );

    if( DateTime::elapsedTime() % 700 < 350 )
    {
      NColor color = ColorList::white;
      color.setAlpha(_opacity/2);
      painter.fillRect( color, Rect(0, 0, _d->commandCursorWidth,shellRect.height()*0.8)
                        +absoluteRect().leftbottom() + Point(_d->commandTextSize.width(), -shellRect.height()) );
    }
  }

  Widget::draw( painter );
}
/*virtual*/
void LLPanelVolumePulldown::onTopLost()
{
	setVisible(FALSE);
}
示例#6
0
bool CNrpBrowserWindow::OnEvent(const SEvent& event)
{
	if( !IsVisible )
		return false;

	switch(event.EventType)
	{
	case EET_MOUSE_INPUT_EVENT:
	{
		core::position2di absPos(event.MouseInput.X, event.MouseInput.Y);
		core::position2di mousePos = absPos - _image->getAbsolutePosition().UpperLeftCorner;

		switch(event.MouseInput.Event)
		{
		case EMIE_LMOUSE_PRESSED_DOWN:
			HTMLEngine::Instance().MouseDown(mousePos.X, mousePos.Y);
		break;

		case EMIE_LMOUSE_LEFT_UP:
			HTMLEngine::Instance().MouseUp(mousePos.X, mousePos.Y);
		break;
		
		case EMIE_MOUSE_WHEEL:
			HTMLEngine::Instance().ScrollByLines( event.MouseInput.Wheel > 0 ? -1 : 1 );
		break;

		case EMIE_MOUSE_MOVED:
			HTMLEngine::Instance().MouseMoved( mousePos.X, mousePos.Y );
		break;
		}

		if( _image->getRelativePosition().isPointInside( mousePos) )
			return true;
	}
	break;

	case EET_GUI_EVENT:
	{
		if( event.GUIEvent.EventType == EGET_BUTTON_CLICKED && event.GUIEvent.Caller == buttons_[ BTNE_CLOSE ] )
		{
			setVisible( false );
			return true;
		}

		if( event.GUIEvent.EventType == EGET_ELEMENT_LEFT && event.GUIEvent.Caller == _image )
		{
			HTMLEngine::Instance().SetFocus( false );
			return true;
		}
	}
	break;

	case EET_KEY_INPUT_EVENT:
	{
		if (event.KeyInput.PressedDown)
			HTMLEngine::Instance().KeyPress(event.KeyInput.Key);
	}
	break;

	default:
		{
			int k=0;
		}
	break;
	}

	return CNrpWindow::OnEvent( event );
}
示例#7
0
void SeekWidget::setAutoHide(const bool &autoHide)
{
    _autoHide = autoHide;

    setVisible(!_autoHide);
}
示例#8
0
//! Hide the item
void QwtPolarItem::hide()
{
    setVisible( false );
}
示例#9
0
void PopupMenu::handleLink(const std::string &link)
{
    Being *being = actorSpriteManager->findBeing(mBeingId);

    // Talk To action
    if (link == "talk" && being && being->canTalk())
    {
        being->talkTo();
    }

    // Trade action
    else if (link == "trade" && being &&
             being->getType() == ActorSprite::PLAYER)
    {
        Net::getTradeHandler()->request(being);
        tradePartnerName = being->getName();
    }
    // Attack action
    else if (link == "attack" && being)
    {
        player_node->attack(being, true);
    }
    else if (link == "whisper" && being)
    {
        chatWindow->addInputText("/w \"" + being->getName() + "\" ");
    }
    else if (link == "unignore" && being &&
             being->getType() == ActorSprite::PLAYER)
    {
        player_relations.setRelation(being->getName(), PlayerRelation::NEUTRAL);
    }

    else if (link == "ignore" && being &&
             being->getType() == ActorSprite::PLAYER)
    {
        player_relations.setRelation(being->getName(), PlayerRelation::IGNORED);
    }

    else if (link == "disregard" && being &&
             being->getType() == ActorSprite::PLAYER)
    {
        player_relations.setRelation(being->getName(), PlayerRelation::DISREGARDED);
    }

    else if (link == "friend" && being &&
             being->getType() == ActorSprite::PLAYER)
    {
        player_relations.setRelation(being->getName(), PlayerRelation::FRIEND);
    }
    // Guild action
    else if (link == "guild" && being &&
             being->getType() == ActorSprite::PLAYER)
    {
        player_node->inviteToGuild(being);
    }

    // Pick Up Floor Item action
    else if ((link == "pickup") && mFloorItem)
    {
        player_node->pickUp(mFloorItem);
    }

    // Look To action
    else if (link == "look")
    {
    }

    else if (link == "activate")
    {
        assert(mItem);
        if (mItem->isEquippable())
        {
            if (mItem->isEquipped())
                mItem->doEvent(Event::DoUnequip);
            else
                mItem->doEvent(Event::DoEquip);
        }
        else
        {
            mItem->doEvent(Event::DoUse);
        }
    }
    else if (link == "chat")
    {
        if (mItem)
            chatWindow->addItemText(mItem->getInfo().getName());
        else if (mFloorItem)
            chatWindow->addItemText(mFloorItem->getInfo().getName());
    }

    else if (link == "split")
    {
        ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit,
                             inventoryWindow, mItem);
    }

    else if (link == "drop")
    {
        ItemAmountWindow::showWindow(ItemAmountWindow::ItemDrop,
                             inventoryWindow, mItem);
    }

    else if (link == "store")
    {
        ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd,
                             inventoryWindow, mItem);
    }

    else if (link == "retrieve")
    {
        ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, mWindow,
                                     mItem);
    }

    else if (link == "party" && being &&
             being->getType() == ActorSprite::PLAYER)
    {
        Net::getPartyHandler()->invite(being);
    }

    else if (link == "name" && being)
    {
        const std::string &name = being->getName();
        chatWindow->addInputText(name);
    }

    else if (link == "admin-kick" &&
             being &&
             (being->getType() == ActorSprite::PLAYER ||
              being->getType() == ActorSprite::MONSTER))
    {
        Net::getAdminHandler()->kick(being->getId());
    }

    // Unknown actions
    else if (link != "cancel")
    {
        logger->log("PopupMenu: Warning, unknown action '%s'", link.c_str());
    }

    setVisible(false);

    mBeingId = 0;
    mFloorItem = NULL;
    mItem = NULL;
}
示例#10
0
void SellDialog::init()
{
    setWindowName("Sell");
    setResizable(true);
    setCloseButton(true);
    setStickyButtonLock(true);
    setMinWidth(260);
    setMinHeight(220);
    setDefaultSize(260, 230, ImageRect::CENTER);

    // Create a ShopItems instance, that is aware of duplicate entries.
    mShopItems = new ShopItems(true);

    mShopItemList = new ShopListBox(this, mShopItems, mShopItems);
    mShopItemList->postInit();
    mShopItemList->setProtectItems(true);
    mScrollArea = new ScrollArea(mShopItemList,
        getOptionBool("showbackground"), "sell_background.xml");
    mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);

    mSlider = new Slider(1.0);

    mQuantityLabel = new Label(this, strprintf(
        "%d / %d", mAmountItems, mMaxItems));
    mQuantityLabel->setAlignment(gcn::Graphics::CENTER);
    // TRANSLATORS: sell dialog label
    mMoneyLabel = new Label(this, strprintf(_("Price: %s / Total: %s"),
                                      "", ""));

    // TRANSLATORS: sell dialog button
    mIncreaseButton = new Button(this, _("+"), "inc", this);
    // TRANSLATORS: sell dialog button
    mDecreaseButton = new Button(this, _("-"), "dec", this);
    // TRANSLATORS: sell dialog button
    mSellButton = new Button(this, _("Sell"), "presell", this);
    // TRANSLATORS: sell dialog button
    mQuitButton = new Button(this, _("Quit"), "quit", this);
    // TRANSLATORS: sell dialog button
    mAddMaxButton = new Button(this, _("Max"), "max", this);

    mDecreaseButton->adjustSize();
    mDecreaseButton->setWidth(mIncreaseButton->getWidth());

    mIncreaseButton->setEnabled(false);
    mDecreaseButton->setEnabled(false);
    mSellButton->setEnabled(false);
    mSlider->setEnabled(false);

    mShopItemList->setDistributeMousePressed(false);
    mShopItemList->setPriceCheck(false);
    mShopItemList->addSelectionListener(this);
    mShopItemList->setActionEventId("sell");
    mShopItemList->addActionListener(this);

    mSlider->setActionEventId("slider");
    mSlider->addActionListener(this);

    ContainerPlacer placer;
    placer = getPlacer(0, 0);

    placer(0, 0, mScrollArea, 8, 5).setPadding(3);
    placer(0, 5, mDecreaseButton);
    placer(1, 5, mSlider, 3);
    placer(4, 5, mIncreaseButton);
    placer(5, 5, mQuantityLabel, 2);
    placer(7, 5, mAddMaxButton);
    placer(0, 6, mMoneyLabel, 8);
    placer(6, 7, mSellButton);
    placer(7, 7, mQuitButton);

    Layout &layout = getLayout();
    layout.setRowHeight(0, Layout::AUTO_SET);

    center();
    loadWindowState();

    instances.push_back(this);
    setVisible(true);
    enableVisibleSound(true);
}
示例#11
0
//! Show the item
void QwtPolarItem::show()
{
    setVisible( true );
}
void CertInfoControl::onViewCertificateChain ()
{
    setVisible(true);
}
示例#13
0
void Brave::showNextLevelItem()
{
	auto goItem = this->_menu->getChildByTag(2);
	goItem->setVisible(true);
	goItem->runAction(RepeatForever::create(Blink::create(1, 1)));
}
/*!
  \class RWidgetResizer
  Create a new RReportWidget resize manager. A resize manager show 8 circle on
  widget that user can drag them to resize the widget
*/
QReportWidgetResizer::QReportWidgetResizer(QGraphicsScene *parent) :
    QObject(),
    parentScene(parent),
    //_parent( 0 ),
    m_scale(1)
{
    resizerTL = new QReportResizeHandle(0, 0, CIRCLER);
    resizerT  = new QReportResizeHandle(0, 0, CIRCLER);
    resizerTR = new QReportResizeHandle(0, 0, CIRCLER);
    resizerL  = new QReportResizeHandle(0, 0, CIRCLER);
    resizerR  = new QReportResizeHandle(0, 0, CIRCLER);
    resizerBL = new QReportResizeHandle(0, 0, CIRCLER);
    resizerB  = new QReportResizeHandle(0, 0, CIRCLER);
    resizerBR = new QReportResizeHandle(0, 0, CIRCLER);

    /*parent->addItem( resizerTL );
    parent->addItem( resizerT  );
    parent->addItem( resizerTR );
    parent->addItem( resizerL  );
    parent->addItem( resizerR  );
    parent->addItem( resizerBL );
    parent->addItem( resizerB  );
    parent->addItem( resizerBR );*/

    handles.append(resizerTL);
    handles.append(resizerT);
    handles.append(resizerTR);
    handles.append(resizerL);
    handles.append(resizerR);
    handles.append(resizerBL);
    handles.append(resizerB);
    handles.append(resizerBR);

    resizerTL->setPen(QPen(Qt::black));

    setVisible(false);

    resizerTL->setCursor(Qt::SizeFDiagCursor);
    resizerT->setCursor(Qt::SizeVerCursor);
    resizerTR->setCursor(Qt::SizeBDiagCursor);
    resizerL->setCursor(Qt::SizeHorCursor);
    resizerR->setCursor(Qt::SizeHorCursor);
    resizerBL->setCursor(Qt::SizeBDiagCursor);
    resizerB->setCursor(Qt::SizeVerCursor);
    resizerBR->setCursor(Qt::SizeFDiagCursor);

    resizerT->setResizeDirection(::Top);
    resizerL->setResizeDirection(::Left);
    resizerR->setResizeDirection(::Right);
    resizerB->setResizeDirection(::Bottom);

    resizerTR->setResizeDirection(::Top    | ::Right);
    resizerTL->setResizeDirection(::Top    | ::Left);
    resizerBR->setResizeDirection(::Bottom | ::Right);
    resizerBL->setResizeDirection(::Bottom | ::Left);

    for (int i = 0; i < handles.count(); i++) {
        /*QRadialGradient gradient( CIRCLER, CIRCLER, 270);
        gradient.setColorAt(0, QColor::fromRgb(128, 128, 255) );
        gradient.setColorAt(1, QColor::fromRgb(255, 255, 255) );
        handles.at( i )->setBrush( QBrush(gradient) );*/

        handles.at(i)->setBrush(QBrush(Qt::white));
        parent->addItem(handles.at(i));

        connect(handles.at(i), SIGNAL(moving(QPointF)),
                this,          SLOT(handleMoving(QPointF)));

        connect(handles.at(i), SIGNAL(moved()),
                this,          SIGNAL(resized()));

    }//for
}
GuiElement* GuiElement::hide()
{
    setVisible(false);
    return this;
}
示例#16
0
void StelDialog::close()
{
	setVisible(false);
}
GuiElement* GuiElement::show()
{
    setVisible(true);
    return this;
}
void LLFloaterChatterBox::onClose(bool app_quitting)
{
	setVisible(FALSE);
	gSavedSettings.setBOOL("ShowCommunicate", FALSE);
}
示例#19
0
//! called if an event happened.
bool CGUIMessageBox::OnEvent(const SEvent& event)
{
	if (isEnabled())
	{
		SEvent outevent;
		outevent.EventType = EET_GUI_EVENT;
		outevent.GUIEvent.Caller = this;
		outevent.GUIEvent.Element = 0;

		switch(event.EventType)
		{
		case EET_KEY_INPUT_EVENT:

			if (event.KeyInput.PressedDown)
			{
				switch (event.KeyInput.Key)
				{
				case IRR_KEY_RETURN:
					if (OkButton)
					{
						OkButton->setPressed(true);
						Pressed = true;
					}
					break;
				case IRR_KEY_Y:
					if (YesButton)
					{
						YesButton->setPressed(true);
						Pressed = true;
					}
					break;
				case IRR_KEY_N:
					if (NoButton)
					{
						NoButton->setPressed(true);
						Pressed = true;
					}
					break;
				case IRR_KEY_ESCAPE:
					if (Pressed)
					{
						// cancel press
						if (OkButton) OkButton->setPressed(false);
						if (YesButton) YesButton->setPressed(false);
						if (NoButton) NoButton->setPressed(false);
						Pressed = false;
					}
					else
					if (CancelButton)
					{
						CancelButton->setPressed(true);
						Pressed = true;
					}
					else
					if (CloseButton && CloseButton->isVisible())
					{
						CloseButton->setPressed(true);
						Pressed = true;
					}
					break;
				default: // no other key is handled here
					break;
				}
			}
			else
			if (Pressed)
			{
				if (OkButton && event.KeyInput.Key == IRR_KEY_RETURN)
				{
					setVisible(false);	// this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
					Environment->setFocus(0);
					outevent.GUIEvent.EventType = EGET_MESSAGEBOX_OK;
					Parent->OnEvent(outevent);
					remove();
					return true;
				}
				else
				if ((CancelButton || CloseButton) && event.KeyInput.Key == IRR_KEY_ESCAPE)
				{
					setVisible(false);	// this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
					Environment->setFocus(0);
					outevent.GUIEvent.EventType = EGET_MESSAGEBOX_CANCEL;
					Parent->OnEvent(outevent);
					remove();
					return true;
				}
				else
				if (YesButton && event.KeyInput.Key == IRR_KEY_Y)
				{
					setVisible(false);	// this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
					Environment->setFocus(0);
					outevent.GUIEvent.EventType = EGET_MESSAGEBOX_YES;
					Parent->OnEvent(outevent);
					remove();
					return true;
				}
				else
				if (NoButton && event.KeyInput.Key == IRR_KEY_N)
				{
					setVisible(false);	// this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
					Environment->setFocus(0);
					outevent.GUIEvent.EventType = EGET_MESSAGEBOX_NO;
					Parent->OnEvent(outevent);
					remove();
					return true;
				}
			}
			break;
		case EET_GUI_EVENT:
			if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED)
			{
				if (event.GUIEvent.Caller == OkButton)
				{
					setVisible(false);	// this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
					Environment->setFocus(0);
					outevent.GUIEvent.EventType = EGET_MESSAGEBOX_OK;
					Parent->OnEvent(outevent);
					remove();
					return true;
				}
				else
				if (event.GUIEvent.Caller == CancelButton ||
					event.GUIEvent.Caller == CloseButton)
				{
					setVisible(false);	// this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
					Environment->setFocus(0);
					outevent.GUIEvent.EventType = EGET_MESSAGEBOX_CANCEL;
					Parent->OnEvent(outevent);
					remove();
					return true;
				}
				else
				if (event.GUIEvent.Caller == YesButton)
				{
					setVisible(false);	// this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
					Environment->setFocus(0);
					outevent.GUIEvent.EventType = EGET_MESSAGEBOX_YES;
					Parent->OnEvent(outevent);
					remove();
					return true;
				}
				else
				if (event.GUIEvent.Caller == NoButton)
				{
					setVisible(false);	// this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
					Environment->setFocus(0);
					outevent.GUIEvent.EventType = EGET_MESSAGEBOX_NO;
					Parent->OnEvent(outevent);
					remove();
					return true;
				}
			}
			break;
		default:
			break;
		}
	}

	return CGUIWindow::OnEvent(event);
}
void LLFloaterMyFriends::onClose(bool app_quitting)
{
	setVisible(FALSE);
}
示例#21
0
void Console::toggleVisible()											//! toggle the visibility of the console
{
   setVisible( (toggle_visible_ == NONE && visible())
                ? false
                : toggle_visible_ != UPLIGTH );
}
示例#22
0
void TabBar::setForceHidden(bool hidden)
{
    m_forceHidden = hidden;
    setVisible(!m_forceHidden);
}
示例#23
0
int
FileAssociation::handleEvent (mxEvent *event)
{
	if (event->event != mxEvent::Action)
		return 0;

	switch (event->action)
	{
	case IDC_EXTENSION:
	{
		int index = cExtension->getSelectedIndex ();
		if (index >= 0)
			setAssociation (index);
	}
	break;

	case IDC_ACTION1:
	case IDC_ACTION2:
	case IDC_ACTION3:
	case IDC_ACTION4:
	{
		leProgram->setEnabled (rbAction[0]->isChecked ());
		bChooseProgram->setEnabled (rbAction[0]->isChecked ());

		int index = cExtension->getSelectedIndex ();
		if (index >= 0)
			d_associations[index].association = event->action - IDC_ACTION1;
		
	}
	break;

	case IDC_PROGRAM:
	{
		int index = cExtension->getSelectedIndex ();
		if (index >= 0)
			strcpy (d_associations[index].program, leProgram->getLabel ());
	}
	break;

	case IDC_CHOOSEPROGRAM:
	{
		const char *ptr = mxGetOpenFileName (this, 0, "*.exe");
		if (ptr)
		{
			leProgram->setLabel (ptr);

			int index = cExtension->getSelectedIndex ();
			if (index >= 0)
				strcpy (d_associations[index].program, leProgram->getLabel ());
		}
	}
	break;

	case IDC_OK:
		saveAssociations ();

	case IDC_CANCEL:
		setVisible (false);
		break;
	}

	return 1;
}
示例#24
0
void TabBar::tabInserted(int index)
{
    Q_UNUSED(index)

    setVisible(!(count() == 1 && m_hideTabBarWithOneTab));
}
示例#25
0
文件: MainWindow.cpp 项目: opamp/gat2
void MainWindow::changeVisible(){
    setVisible(!this->isVisible());
};
// Initialize the dialog widgets and connect the signals/slots
void SatellitesDialog::createDialogContent()
{
	ui->setupUi(dialog);
	ui->tabs->setCurrentIndex(0);
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
	        this, SLOT(retranslate()));

	// Settings tab / updates group
	connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int)));
	connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateTLEs()));
	connect(GETSTELMODULE(Satellites), SIGNAL(updateStateChanged(Satellites::UpdateState)), this, SLOT(updateStateReceiver(Satellites::UpdateState)));
	connect(GETSTELMODULE(Satellites), SIGNAL(tleUpdateComplete(int, int, int)), this, SLOT(updateCompleteReceiver(int, int, int)));
	connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int)));
	refreshUpdateValues(); // fetch values for last updated and so on
	// if the state didn't change, setUpdatesEnabled will not be called, so we force it
	setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState());

	updateTimer = new QTimer(this);
	connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues()));
	updateTimer->start(7000);

	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));

	// Settings tab / General settings group
	connect(ui->labelsGroup, SIGNAL(toggled(bool)), StelApp::getInstance().getGui()->getGuiActions("actionShow_Satellite_Labels"), SLOT(setChecked(bool)));
	connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), GETSTELMODULE(Satellites), SLOT(setLabelFontSize(int)));
	connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));
	connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings()));

	// Settings tab / orbit lines group
	ui->orbitLinesGroup->setChecked(GETSTELMODULE(Satellites)->getOrbitLinesFlag());
	ui->orbitSegmentsSpin->setValue(Satellite::orbitLineSegments);
	ui->orbitFadeSpin->setValue(Satellite::orbitLineFadeSegments);
	ui->orbitDurationSpin->setValue(Satellite::orbitLineSegmentDuration);

	connect(ui->orbitLinesGroup, SIGNAL(toggled(bool)), GETSTELMODULE(Satellites), SLOT(setOrbitLinesFlag(bool)));
	connect(ui->orbitSegmentsSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams()));
	connect(ui->orbitFadeSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams()));
	connect(ui->orbitDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams()));


	// Satellites tab
	filterProxyModel = new QSortFilterProxyModel(this);
	filterProxyModel->setSourceModel(satellitesModel);
	filterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
	ui->satellitesList->setModel(filterProxyModel);
	connect(ui->lineEditSearch, SIGNAL(textEdited(QString)),
	        filterProxyModel, SLOT(setFilterWildcard(QString)));
	
	QItemSelectionModel* selectionModel = ui->satellitesList->selectionModel();
	connect(selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
	        this, SLOT(updateSelectedInfo(QModelIndex,QModelIndex)));
	connect(ui->satellitesList, SIGNAL(doubleClicked(QModelIndex)),
	        this, SLOT(handleDoubleClick(QModelIndex)));
	connect(ui->groupsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(listSatelliteGroup(int)));
	connect(ui->saveSatellitesButton, SIGNAL(clicked()), this, SLOT(saveSatellites()));
	connect(ui->removeSatellitesButton, SIGNAL(clicked()), this, SLOT(removeSatellites()));
	connectSatelliteGuiForm();
	
	importWindow = new SatellitesImportDialog();
	connect(ui->addSatellitesButton, SIGNAL(clicked()),
	        importWindow, SLOT(setVisible()));
	connect(importWindow, SIGNAL(satellitesAccepted(TleDataList)),
	        this, SLOT(addSatellites(TleDataList)));

	// Sources tab
	connect(ui->sourceList, SIGNAL(currentTextChanged(const QString&)), ui->sourceEdit, SLOT(setText(const QString&)));
	connect(ui->sourceEdit, SIGNAL(editingFinished()), this, SLOT(sourceEditingDone()));
	connect(ui->deleteSourceButton, SIGNAL(clicked()), this, SLOT(deleteSourceRow()));
	connect(ui->addSourceButton, SIGNAL(clicked()), this, SLOT(addSourceRow()));

	// About tab
	setAboutHtml();

	updateGuiFromSettings();

}
示例#27
0
bool EquipInfoView::initWithBrokenEquip(int itemId,int count,int nextCount){
    bool ret = true;
    CCLoadSprite::doResourceByCommonIndex(11, true);
    CCLoadSprite::doResourceByCommonIndex(7, true);
    setCleanFunction([](){
        CCLoadSprite::doResourceByCommonIndex(11, false);
        CCLoadSprite::doResourceByCommonIndex(7, false);
    });
    
    if (PopupBaseView::init()) {
        setIsHDPanel(true);
        CCBLoadFile("EquipInfoView",this,this);
        CCSize size=CCDirector::sharedDirector()->getWinSize();
        setContentSize(size);
        //隐藏分解
        m_disNode->setVisible(false);
        m_propertyNode->setVisible(true);
        this->m_type = 1;
        this->m_itemId = itemId;
        this->m_itemCount = count;
        this->m_itemNextCount = nextCount;
        
        auto frame = CCLoadSprite::loadResource("btn_01.png");
        auto graySpr = CCLoadSprite::createSprite("btn_01.png");
        auto lbl = CCLabelIF::create();
        if (CCCommonUtils::isIosAndroidPad()) {
            graySpr->setScaleX(390.0/graySpr->getContentSize().width);
            graySpr->setScaleY(145.0/graySpr->getContentSize().height);
            CCCommonUtils::setSpriteGray(graySpr, true);
            m_mateBtn->getParent()->addChild(graySpr);
            lbl->setColor(ccGRAY);
            lbl->setFontSize(40);
            m_mateBtn->getParent()->addChild(lbl);
            lbl->setString(_lang("119028"));
        }
        else {
            graySpr->setScaleX(195.0/graySpr->getContentSize().width);
            graySpr->setScaleY(78.0/graySpr->getContentSize().height);
            CCCommonUtils::setSpriteGray(graySpr, true);
            m_mateBtn->getParent()->addChild(graySpr);
            lbl->setColor(ccGRAY);
            lbl->setFontSize(20);
            m_mateBtn->getParent()->addChild(lbl);
            lbl->setString(_lang("119028"));
        }
        
        auto &eInfo = EquipmentController::getInstance()->EquipmentInfoMap[m_itemId];
        m_nameLabel->setString(_lang("119051"));
        std::string strName = _lang(eInfo.name);
        if (CCCommonUtils::isIosAndroidPad()) {
            m_msg1Label->setFontSize(40);
        }
        else
            m_msg1Label->setFontSize(20);
        m_name1Label->setString(strName);
        m_msg2Label->setString(_lang("108730"));//说明
        m_desLabel->setVisible(true);
        m_desLabel->setString(_lang(eInfo.des));
        m_nodeEndLine->setPositionY(-180);
        m_msg1Label->setPositionY(-220);
        if (eInfo.color == GOLDEN){
            m_mateBtn->setEnabled(false);
            graySpr->setVisible(true);
            lbl->setVisible(true);
            m_msg1Label->setVisible(true);
            m_msg1Label->setString(_lang("121987"));
        }
        else if(m_itemCount < 1) // 数量不足
        {
            m_mateBtn->setEnabled(false);
            graySpr->setVisible(true);
            lbl->setVisible(true);
            m_msg1Label->setVisible(true);
            m_msg1Label->setString(_lang("119080"));
        }
        else
        {
            graySpr->setVisible(false);
            lbl->setVisible(false);
            m_mateBtn->setEnabled(true);
            m_msg1Label->setVisible(false);
        }
        
        string iconPath = CCCommonUtils::getIcon(CC_ITOA(m_itemId));
        string bgPath = CCCommonUtils::getToolBgByColor(eInfo.color);
        
        auto icon = CCLoadSprite::createSprite(iconPath.c_str(), true,CCLoadSpriteType_EQUIP);
        if (CCCommonUtils::isIosAndroidPad()) {
            CCCommonUtils::setSpriteMaxSize(icon, 200, true);
        }
        else
            CCCommonUtils::setSpriteMaxSize(icon, 100, true);
        auto bg = CCLoadSprite::createSprite(bgPath.c_str());
        if (CCCommonUtils::isIosAndroidPad()) {
            CCCommonUtils::setSpriteMaxSize(bg, 200, true);
        }
        else
            CCCommonUtils::setSpriteMaxSize(bg, 100, true);
        m_picNode->addChild(bg);
        m_picNode->addChild(icon);
        
        CCCommonUtils::setButtonTitle(m_mateBtn, _lang("119028").c_str());
        CCCommonUtils::setButtonTitle(m_destroyBtn, _lang("119052").c_str());
        
        m_destroyBtn->setPreferredSize(CCSize(200, 80));
        m_destroyBtn->setPosition(ccp(-120,-283));
        m_mateBtn->setPreferredSize(CCSize(200, 80));
        m_mateBtn->setPosition(ccp(120,-283));
        if (CCCommonUtils::isIosAndroidPad()) {
            m_mateBtn->setPosition(ccp(180,-480));
            m_destroyBtn->setPosition(ccp(-180,-480));
            m_desLabel->setPositionY(-200);
        }
        graySpr->setPosition(m_mateBtn->getPosition());
        lbl->setPosition(m_mateBtn->getPosition());
    }
    return ret;
}
示例#28
0
void Label::componentVisibilityChanged (Component& component)
{
    setVisible (component.isVisible());
}
示例#29
0
CharCreateDialog::CharCreateDialog(Window *parent, int slot):
    Window(_("Create Character"), true, parent),
    mSlot(slot)
{
    mPlayer = new Player(0, 0, NULL);
    mPlayer->setGender(GENDER_MALE);

    ResourceManager *resman = ResourceManager::getInstance();
    mBackGround = resman->getImage("graphics/elektrik/gui_login_window.png");

    gcn::Label *girisLabel = new gcn::Label(_("-=KARAKTER OLUŞTUR=-"));
    girisLabel->setPosition(150,140);
    girisLabel->setFont(font_bas_b_1_16);
    girisLabel->setForegroundColor(gcn::Color(0xaa,0xbb,0xcc));
    girisLabel->adjustSize();
    add(girisLabel);

    int numberOfHairColors = ColorDB::size();

    srand((unsigned)time(0));
    mHairStyle = rand() % mPlayer->getNumOfHairstyles();
    mHairColor = rand() % numberOfHairColors;
    updateHair();

    mNameField = new TextField("");
    mNameLabel = new Label(_("Name:"));
    // TRANSLATORS: This is a narrow symbol used to denote 'next'.
    // You may change this symbol if your language uses another.
    mNextHairColorButton = new Button(_(">"), "nextcolor", this);
    // TRANSLATORS: This is a narrow symbol used to denote 'previous'.
    // You may change this symbol if your language uses another.
    mPrevHairColorButton = new Button(_("<"), "prevcolor", this);
    mHairColorLabel = new Label(_("Hair color:"));
    mNextHairStyleButton = new Button(_(">"), "nextstyle", this);
    mPrevHairStyleButton = new Button(_("<"), "prevstyle", this);
    mHairStyleLabel = new Label(_("Hair style:"));
    mCreateButton = new Button(_("Create"), "create", this);
    mCancelButton = new Button(_("Cancel"), "cancel", this);
    mMale = new RadioButton(_("Male"), "gender");
    mFemale = new RadioButton(_("Female"), "gender");

    // Default to a Male character
    mMale->setSelected(true);

    mMale->setActionEventId("gender");
    mFemale->setActionEventId("gender");

    mMale->addActionListener(this);
    mFemale->addActionListener(this);

    mPlayerBox = new PlayerBox(mPlayer);

    mPlayerBox->setWidth(74);

    mNameField->setActionEventId("create");
    mNameField->addActionListener(this);

    mAttributesLeft = new Label(strprintf(_("Please distribute %d points"), 99));

    int w = 200;
    int h = 330;


    ContainerPlacer place;
    place = getPlacer(5,15);
    place(0,0,mNameLabel);
    place(1,0,mNameField,2);
    place = getPlacer(5,16);
    place(0,0,mHairColorLabel);
    place(1,0,mPrevHairColorButton);
    place(2,0,mPlayerBox,1,10).setPadding(3);
    place(3,0,mNextHairColorButton);
    place(0,1,mHairStyleLabel);
    place(1,1,mPrevHairStyleButton);
    place(3,1,mNextHairStyleButton);
    reflowLayout(350,335);

    mCreateButton->setPosition(200,345);
    mCancelButton->setPosition(260,345);
    mCancelButton->setWidth(mCreateButton->getWidth());

    add(mPlayerBox);
    add(mNameField);
    add(mNameLabel);
    add(mNextHairColorButton);
    add(mPrevHairColorButton);
    add(mHairColorLabel);
    add(mNextHairStyleButton);
    add(mPrevHairStyleButton);
    add(mHairStyleLabel);
    add(mCreateButton);
    add(mCancelButton);
//    add(mAttributesLeft);
//    add(mMale);
//    add(mFemale);

    setSize(573,507);
    center();
    setVisible(true);
    mNameField->requestFocus();
}
示例#30
0
 void DeleteHandle::setHoverMode( bool isHover )
 {
     setVisible( isHover );
     m_isHover = isHover;
 }