Exemplo n.º 1
0
void Frame::disable()
{
	enabled = false;
	disableEvents();
	onDisable();
	
	// Tell each widget that the frame changed
	typedef std::deque<Widget *> WidgetTraversal;
	WidgetTraversal widgets;
	widgets.push_back(rootWidget);

	while (!widgets.empty())
	{
		Widget *currWidget = widgets.front();
		widgets.pop_front();

		currWidget->onLeavingFrame();

		const Widget::WidgetPool &childWidgets = currWidget->getChildWidgets();
		for (Widget::WidgetPool::const_iterator it = childWidgets.begin();
			 it != childWidgets.end();
			 it++)
		{
			Widget *currChildWidget = *it;
			widgets.push_back(currChildWidget);
		}
	}
}
Exemplo n.º 2
0
void OculusDisplay::reset()
{
  rviz::Display::reset();
  if ( oculus_ )
  {
    onDisable();
    onEnable();
  }
}
Exemplo n.º 3
0
void GameObject::disable()
{
	if (isEnable)
	{
		onSleep();
		onDisable();
	}
	isEnable = false;
	isAwake = false;
}
Exemplo n.º 4
0
void Node::disable() {
    if(mIsEnabled) {
        mIsEnabled = false;

        for(auto iter = mChildren.begin(); iter != mChildren.end(); ++iter) {
            iter->second->disable();
        }

        for(auto iter = mComponents.begin(); iter != mComponents.end(); ++iter) {
            iter->second->disable();
        }

        onDisable();
    }
}
Exemplo n.º 5
0
void Locator::provide(ServiceType type, BaseService *service)
{
	std::string verb("Provided new");

	// delete old
	auto old = getInstance().services[type];
	if (old != nullptr)
	{
		verb = "Replaced";
		old->onDisable();
		delete old;
	}

	getInstance().services[type] = service;
	service->onEnable();
	Logger::logDebug(format("%1% service for service '%2%'", verb, serviceToString(type)));
}
Exemplo n.º 6
0
void Display::disable( bool force )
{
  if ( !enabled_ && !force )
  {
    return;
  }

  enabled_ = false;

  onDisable();

  if (StatusPropertyPtr status = status_property_.lock())
  {
    status->disable();
  }

  state_changed_(this);
}
Exemplo n.º 7
0
OverlayTextDisplay::~OverlayTextDisplay()
{
    onDisable();
    //delete overlay_;
    delete update_topic_property_;
    delete overtake_color_properties_property_;
    delete overtake_position_properties_property_;
    delete top_property_;
    delete left_property_;
    delete width_property_;
    delete height_property_;
    delete text_size_property_;
    delete line_width_property_;
    delete bg_color_property_;
    delete bg_alpha_property_;
    delete fg_color_property_;
    delete fg_alpha_property_;
    delete font_property_;
}
Exemplo n.º 8
0
	GUIWindow::GUIWindow() : doubleClickTimer(0), strechState(0)
	{
		//Set size
		setSize(minSize);

		//Header bar
		header = new GUIRectangle(-1);
		header->setParent(this);
		header->setPositionLocal(0, size.y);
		header->setColor(headerBackgroundColor);
		header->setStringColor(headerStringColor);
		header->setJustification(GUIRECT_TEXT_JUSTIFICATION_LEFT);
		header->setStringSize(applicationData->GUITextSize + 2);
		header->setDepth(getDepth() + 1);

		//Exit button
		exit = new GUIRectangle(-2);
		exit->setParent(this);
		exit->setPositionLocal(size.x - EXIT_WIDTH, size.y);
		exit->setSize(EXIT_WIDTH, header->getHeight());
		exit->setID(1);
		exit->setColor(exitBackgroundColor);
		exit->setString("X");
		exit->setStringColor(exitStringColor);
		exit->setJustification(GUIRECT_TEXT_JUSTIFICATION_CENTER);
		exit->setDepth(getDepth() + 1);

		//Strech background rectangle
		strech = new GUIRectangle();
		strech->setParent(this);
		strech->setPositionLocal(-strechWidth, -strechWidth);
		strech->disableState(GUIRECT_HOVER_COLOR);
		strech->setDepth(getDepth() - 1);

		//State
		disableBit(state, GUIRECT_HOVER_COLOR);
		disableBit(state, GUIRECT_OPEN);
		onDisable();

		limitWithinMainWindow();
	}
Exemplo n.º 9
0
void Widget::setEnabled(bool state)
{
  if (state) {
    if (this->flags & JI_DISABLED) {
      this->flags &= ~JI_DISABLED;
      invalidate();

      onEnable();
    }
  }
  else {
    if (!(this->flags & JI_DISABLED)) {
      getManager()->freeWidget(this); // Free from the manager

      this->flags |= JI_DISABLED;
      invalidate();

      onDisable();
    }
  }
}
 Plotter2DDisplay::~Plotter2DDisplay()
 {
   onDisable();
   // delete update_topic_property_;
   // delete buffer_length_property_;
   // delete fg_color_property_;
   // delete bg_color_property_;
   // delete fg_alpha_property_;
   // delete bg_alpha_property_;
   // delete top_property_;
   // delete left_property_;
   // delete width_property_;
   // delete height_property_;
   // delete line_width_property_;
   // delete show_border_property_;
   // delete auto_color_change_property_;
   // delete max_color_property_;
   // delete update_interval_property_;
   // delete show_caption_property_;
   // delete text_size_property_;
   // delete min_value_property_;
   // delete max_value_property_;
   // delete auto_color_change_property_;
 }
 OverlayMenuDisplay::~OverlayMenuDisplay()
 {
   onDisable();
   delete update_topic_property_;
 }
Exemplo n.º 12
0
void Container::setEnability(bool tar){
	m_bIsEnabled = tar;
	if(!m_bIsEnabled) onDisable();
	else onNormal();
}