Beispiel #1
0
void CFileItem::SetActive(const bool active)
{
    if (active && !IsActive()) {
        wxASSERT(!GetChildrenCount(false));
        AddChild(new CStatusItem);
        flags |= flag_active;
    }
    else if (!active && IsActive()) {
        CQueueItem* pItem = GetChild(0, false);
        RemoveChild(pItem);
        flags &= ~flag_active;
    }
}
void
PackagesView::Clean()
{
    BView* view;
    while ((view = ChildAt(0))) {
        if (dynamic_cast<GroupView*>(view)
                || dynamic_cast<PackageCheckBox*>(view)) {
            RemoveChild(view);
            delete view;
        }
    }
    ScrollTo(0, 0);
}
void BrigadeClass::DisposeChildren (void)
	{
	Unit		e;

	while (element[0])
		{
		e = (Unit)vuDatabase->Find(element[0]);
		if (e)
			e->KillUnit();
		else
			RemoveChild(element[0]);
		}
	}
Beispiel #4
0
View::~View()
{
   while ( CountChildren() > 0 )
   {
      View *sam = RemoveChild(0);
      delete sam;
   }

   if ( m_popupMenu != NULL ) 
   {
	   m_popupMenu->Quit();
   }
}
CPUButton::CPUButton(BMessage *message)
	: BControl(message)
{
	fReplicant = true;

	/* We remove the dragger if we are in deskbar */
	if (CountChildren() > 1)
		RemoveChild(ChildAt(1));

	ResizeTo(CPUBUTTON_WIDTH, CPUBUTTON_HEIGHT);

	_InitData();
}
Beispiel #6
0
/** \brief FTP Remote View deconstructor.
 * This removes the m_pcDirChangedMsg object before destruction.
 */
RemoteIconView::~RemoteIconView()
{
	if( m_pcDirChangedMsg )
		delete( m_pcDirChangedMsg );
		
	if( m_pcFileContextMenu ) delete( m_pcFileContextMenu );
	if( m_pcDirContextMenu ) delete( m_pcDirContextMenu );
	
#if 0
	RemoveChild( m_pcStringView );
	delete( m_pcStringView );
#endif
}
Beispiel #7
0
void CFileItem::SetActive(const bool active)
{
	if (active && !m_active)
	{
		AddChild(new CStatusItem);
	}
	else if (!active && m_active)
	{
		CQueueItem* pItem = m_children.front();
		RemoveChild(pItem);
	}
	m_active = active;
}
Beispiel #8
0
void
BBox::DoLayout()
{
	// Bail out, if we shan't do layout.
	if (!(Flags() & B_SUPPORTS_LAYOUT))
		return;

	bool layouted = GetLayout() ? true : false;

	// If the user set a layout, let the base class version call its
	// hook. In case when we have BView as a label, remove it from child list
	// so it won't be layouted with the rest of views and add it again
	// after that.
	if (layouted) {
		if (fLabelView)
			RemoveChild(fLabelView);

		BView::DoLayout();

		if (fLabelView)
			AddChild(fLabelView, ChildAt(0));
		else
			return;
	}

	_ValidateLayoutData();

	// Even if the user set a layout, restore label view to it's
	// desired position.

	// layout the label view
	if (fLabelView) {
		fLabelView->MoveTo(fLayoutData->label_box.LeftTop());
		fLabelView->ResizeTo(fLayoutData->label_box.Size());
	}

	// If we have layout return here and do not layout the child
	if (layouted)
		return;

	// layout the child
	if (BView* child = _Child()) {
		BRect frame(Bounds());
		frame.left += fLayoutData->insets.left;
		frame.top += fLayoutData->insets.top;
		frame.right -= fLayoutData->insets.right;
		frame.bottom -= fLayoutData->insets.bottom;

		BLayoutUtils::AlignInFrame(child, frame);
	}
}
//-----------------------------------------------------------------------------
void THierarchyNode_Model::Link(std::string namePartChild, std::string namePartParent)
{
  THierarchyNode* pHNodeChild  = Get_private(namePartChild);
  THierarchyNode* pHNodeParent = Get_private(namePartParent);
  if( pHNodeChild==NULL ||
      pHNodeParent==NULL )
  {
    BL_FIX_BUG();
    return;
  }
  pHNodeChild->nameParent = namePartParent;
  RemoveChild(pHNodeParent,namePartChild);
  pHNodeParent->vecNameChild.push_back(namePartChild);
}
Beispiel #10
0
bool
Job::RemoveChild( Job* child )
{
	bool success;
	MyString whynot;
	success = RemoveChild( child, whynot );
	if( !success ) {
		debug_printf( DEBUG_QUIET,
					  "ERROR: RemoveChild( %s ) failed for node %s: %s\n",
                      child ? child->GetJobName() : "(null)",
                      this->GetJobName(), whynot.Value() );
	}
	return success;
}
Beispiel #11
0
	void AssetsFoldersTree::CopyData(const Actor& otherActor)
	{
		const AssetsFoldersTree& other = dynamic_cast<const AssetsFoldersTree&>(otherActor);

		Widget::CopyData(other);

		mFoldersTree = FindChildByType<Tree>();
		RemoveChild(FindChildByType<ContextMenu>());

		InitializeContext();

		RetargetStatesAnimations();
		SetLayoutDirty();
	}
Beispiel #12
0
BComboBox::~BComboBox()
{
	if (fPopupWindow && fPopupWindow->Lock())
		fPopupWindow->Quit();

	RemoveChild(fText);
	delete fText;

	if (fWinMovedFilter->Looper())
		fWinMovedFilter->Looper()->RemoveFilter(fWinMovedFilter);

	delete fWinMovedFilter;
	
}
Beispiel #13
0
void Listbox::RemoveItem(ListboxItem *item)
{
	if (!item)
	        return;
	unsigned int indexLast = item->index;
	unsigned int index = 0;

	if (item == active)
	{
		active = 0;
	}
	RemoveChild(item);
	delete item;
}
Beispiel #14
0
void Node::RemoveChild(Node* node)
{
    if (!node)
        return;
    
    for (Vector<SharedPtr<Node> >::Iterator i = children_.Begin(); i != children_.End(); ++i)
    {
        if (*i == node)
        {
            RemoveChild(i);
            return;
        }
    }
}
Beispiel #15
0
void FilterBar::RemoveFilter(Filter::Ptr const& filter)
{
  for (auto iter: filter_map_)
  {
    if (iter.first->id == filter->id)
    {
      FilterExpanderLabel* filter_view = iter.second;
      RemoveChild(filter_view);
      filter_map_.erase(filter_map_.find(iter.first));
      GetLayout()->RemoveChildObject(filter_view);
      break;
    }
  }
}
Beispiel #16
0
void
OverlayView::MessageReceived(BMessage *msg)
{
	switch (msg->what) {
		case B_SIMPLE_DATA: 
		{
			if (fReplicated)
				break;
			
			entry_ref ref;
			msg->FindRef("refs", &ref);
			BEntry entry(&ref);
			BPath path(&entry);

			delete fBitmap;
			fBitmap = BTranslationUtils::GetBitmap(path.Path());
			
			if (fBitmap != NULL) {
				if (fText != NULL) {
					RemoveChild(fText);
					fText = NULL;
				}
				
				BRect rect = fBitmap->Bounds();
				if (!fReplicated) {
					Window()->ResizeTo(rect.right, rect.bottom);
					Window()->Activate(true);
				}
				ResizeTo(rect.right, rect.bottom);
				Invalidate();
			}
			break;
		}
	    case B_ABOUT_REQUESTED:
	      	OverlayAboutRequested(); 
    		break; 
		case B_COLORS_UPDATED:
		{
			rgb_color color;
			if (msg->FindColor(ui_color_name(B_PANEL_TEXT_COLOR), &color)
					== B_OK)
				fText->SetFontAndColor(be_plain_font, B_FONT_ALL, &color);
			break;
		}
		default:
			BView::MessageReceived(msg);
			break;
	}
}
Beispiel #17
0
void suken::CScene::AddChild(CScene *_scene)
{
	if(focus){
		if( sceneChild != nullptr ){
			RemoveChild();
		}
		//フォーカスの移行
		this->SetFocus(false);
		_scene->SetFocus(true);
		//追加
		sceneChild = _scene;
	}else{
		WarningSK("現在有効ではないシーンに入れ子のシーンを追加することはできません(CScene::AddChild)");
	}
}
//-----------------------------------------------------------------------------
void THierarchyNode_Model::UnlinkFromParent(std::string namePart)
{
  THierarchyNode* pHNode = Get_private(namePart);
  if( pHNode==NULL )
  {
    BL_FIX_BUG();
    return;
  }

  THierarchyNode* pHNodeParent = Get_private(pHNode->nameParent);
  if( pHNodeParent )
    RemoveChild(pHNodeParent, namePart);

  pHNode->nameParent = "";
}
Beispiel #19
0
void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd,
                        uint32_t msg,
                        intptr_t wParam,
                        intptr_t lParam) {
  switch (msg) {
    case PNM_ADDCHILD:
      AddChild(pWnd);
      break;
    case PNM_REMOVECHILD:
      RemoveChild(pWnd);
      break;
    default:
      break;
  }
}
Beispiel #20
0
void
OutProtocolsConfigView::DetachedFromWindow()
{
	if (fConfigView == NULL)
		return;
	BMessage settings;
	if (fConfigView->Archive(&settings) != B_OK)
		return;
	fAccount->OutboundSettings().EditSettings() = settings;

	RemoveChild(fConfigView);
	delete fConfigView;
	fConfigView = NULL;
	unload_add_on(fImageID);
}
Beispiel #21
0
void CItem::RemoveUnknownItem()
{
	ASSERT(GetType() == IT_DRIVE);

	UpwardSetUndone();

	int i = FindUnknownItemIndex();
	ASSERT(i < GetChildrenCount());

	CItem *unknown = GetChild(i);

	UpwardAddSize(-unknown->GetSize());

	RemoveChild(i);
}
Beispiel #22
0
void CItem::RemoveFreeSpaceItem()
{
	ASSERT(GetType() == IT_DRIVE);

	UpwardSetUndone();

	int i = FindFreeSpaceItemIndex();
	ASSERT(i < GetChildrenCount());

	CItem *freespace = GetChild(i);

	UpwardAddSize(-freespace->GetSize());

	RemoveChild(i);
}
Beispiel #23
0
void MenuWindow::ToggleUserMenus(BMessage* message)
{
	if (! Valid()) {
		return;
	}
	
	void* pSrc;
	bool useFullMenus = false;
	
	if (message->FindPointer("source", &pSrc) == B_OK) {
		BCheckBox* pCheckBox = reinterpret_cast<BCheckBox*>(pSrc);
		useFullMenus = (pCheckBox->Value() == B_CONTROL_OFF);
	}
	
	if ((! useFullMenus) && m_bUsingFullMenuBar) {
		RemoveChild(m_pFullMenuBar);
		AddChild(m_pHiddenMenuBar);
		m_bUsingFullMenuBar = false;
	} else if (useFullMenus && (! m_bUsingFullMenuBar)) {
		RemoveChild(m_pHiddenMenuBar);
		AddChild(m_pFullMenuBar);
		m_bUsingFullMenuBar = true;
	}
}
Beispiel #24
0
bool ObjectBase::ChangeChildPosition(shared_ptr<ObjectBase> obj, unsigned int pos)
{
	unsigned int obj_pos = GetChildPosition(obj);

	if (obj_pos == GetChildCount() || pos >= GetChildCount())
		return false;

	if (pos == obj_pos)
		return true;

	// Procesamos el cambio de posición
	RemoveChild(obj);
	AddChild(pos,obj);
	return true;
}
Beispiel #25
0
//----------------------------------------------------------------------------------------------------------------
void UIObject::SetParent( TIUIObjectPtr ip_parent)
  {
  if(mp_parent != ip_parent)
    {
    auto parent_old = mp_parent;

    if(parent_old)
      parent_old->RemoveChild(this);

    mp_parent = ip_parent;

    if(ip_parent)
      ip_parent->AddChild(this);
    }
  }
Beispiel #26
0
	iWidget::~iWidget()
	{
		////////////////////////
		//Remove all children
		tWidgetListIt it = mlstChildren.begin();
		while(it != mlstChildren.end())
		{
			RemoveChild(*it);
			it = mlstChildren.begin();
		}
		
		////////////////////////////
		//Remove from parent
		if(mpParent) mpParent->RemoveChild(this);
	}
//------------------------------------------------------------------------------
void CIwLayoutElementNotebook::RemoveAll(bool EmptyOnly)
{
    int Page=0;
    while (Page<(int)m_Children.size())
    {
        if (m_Children[Page]->Query(ELEMENT_QUERY_CANNOTCLOSE) || m_Children[Page]->Query(ELEMENT_QUERY_NOICON))
            Page++;
        else if (EmptyOnly && !m_Children[Page]->Query(ELEMENT_QUERY_ISEMPTY))
            Page++;
        else
            RemoveChild(m_Children[Page],true);
    }

    Layout();
    m_Book->Refresh();
}
Beispiel #28
0
    void UpdatePane()
    {
        TRef<Pane> pPane;
        
        if (!m_mapPanes.Find(m_nValueCurrent, pPane))
            pPane = m_pPaneDefault;

        if (pPane != m_pPaneCurrent)
        {
            if (m_pPaneCurrent)
                RemoveChild(m_pPaneCurrent);
            if (pPane)
                InsertAtBottom(pPane);
            m_pPaneCurrent = pPane;
        }
    }
Beispiel #29
0
void UIShipObject::Clear()
{

	if( !m_HPSpriteList.empty() )
	{
		for( auto sprite : m_HPSpriteList )
		{
			if( sprite )
			{
				RemoveChild( sprite , false );
				SafeDelete( sprite );
			}
		}
		m_HPSpriteList.clear();
	}
}
ContainerLayerComposite::~ContainerLayerComposite()
{
  MOZ_COUNT_DTOR(ContainerLayerComposite);

  // We don't Destroy() on destruction here because this destructor
  // can be called after remote content has crashed, and it may not be
  // safe to free the IPC resources of our children.  Those resources
  // are automatically cleaned up by IPDL-generated code.
  //
  // In the common case of normal shutdown, either
  // LayerManagerComposite::Destroy(), a parent
  // *ContainerLayerComposite::Destroy(), or Disconnect() will trigger
  // cleanup of our resources.
  while (mFirstChild) {
    RemoveChild(mFirstChild);
  }
}