Beispiel #1
0
void wxWizardSizer::HidePages()
{
    for ( wxSizerItemList::compatibility_iterator node = GetChildren().GetFirst();
          node;
          node = node->GetNext() )
    {
        wxSizerItem * const item = node->GetData();
        if ( item->IsWindow() )
            item->GetWindow()->wxWindowBase::Show(false);
    }
}
Beispiel #2
0
void Bin::HandleAdd( const Widget::Ptr& child ) {
	Container::HandleAdd( child );

	if( GetChildren().size() > 1 ) {
#ifdef SFGUI_DEBUG
		std::cerr << "SFGUI warning: Only one widget can be added to a Bin." << std::endl;
#endif

		Remove( child );
	}
}
Beispiel #3
0
Task::TaskSet * CTaskModel::GetAllChildren(Task::TaskSet *pKids)
{
	int start = pKids->GetCount();
	pKids = GetChildren(pKids);
	int end = pKids->GetCount();
	for(int i = start; i < end; i++)
	{
		(*pKids)[i].GetAllChildren(pKids);
	}
	return pKids;
}
Beispiel #4
0
Array<SceneObject*> Scene::GetWholeSceneObjects() {
    Array<SceneObject*> sceneObjects(GetChildren());
    for (int i = 0; i < sceneObjects.GetSize(); ++i) {
        Array<SceneObject*> children(sceneObjects[i]->GetChildren());
        for (auto it = children.Begin(); it != children.End(); ++it) {
            sceneObjects.PushBack(*it);
        }
    }

    return sceneObjects;
}
Beispiel #5
0
void CategoryList::ReCreateScrollBars()
{
	int clientHeight = GetClientSize().GetHeight();
	int maxY = clientHeight;
	for(wxWindowList::Node * node = GetChildren().GetFirst(); node; node = node->GetNext())
	{
		maxY  = wxMax(maxY, node->GetData()->GetPosition().y+node->GetData()->GetSize().GetHeight());
	}
	maxY += (maxY <= clientHeight ? 0 : 5);
	SetScrollbar(wxVERTICAL, 0, clientHeight, maxY);
}
  static void ComputeStudyCounters(DicomMap& result,
                                   ServerContext& context,
                                   const std::string& study,
                                   const DicomMap& query)
  {
    ServerIndex& index = context.GetIndex();

    std::list<std::string> series;
    index.GetChildren(series, study);
    
    if (query.HasTag(DICOM_TAG_NUMBER_OF_STUDY_RELATED_SERIES))
    {
      result.SetValue(DICOM_TAG_NUMBER_OF_STUDY_RELATED_SERIES,
                      boost::lexical_cast<std::string>(series.size()), false);
    }

    if (query.HasTag(DICOM_TAG_MODALITIES_IN_STUDY))
    {
      std::set<std::string> values;
      ExtractTagFromMainDicomTags(values, index, DICOM_TAG_MODALITY, series, ResourceType_Series);
      StoreSetOfStrings(result, DICOM_TAG_MODALITIES_IN_STUDY, values);
    }

    if (!query.HasTag(DICOM_TAG_NUMBER_OF_STUDY_RELATED_INSTANCES) &&
        !query.HasTag(DICOM_TAG_SOP_CLASSES_IN_STUDY))
    {
      return;
    }

    std::list<std::string> instances;
    GetChildren(instances, index, series);

    if (query.HasTag(DICOM_TAG_NUMBER_OF_STUDY_RELATED_INSTANCES))
    {
      result.SetValue(DICOM_TAG_NUMBER_OF_STUDY_RELATED_INSTANCES,
                      boost::lexical_cast<std::string>(instances.size()), false);
    }

    if (query.HasTag(DICOM_TAG_SOP_CLASSES_IN_STUDY))
    {
      if (Configuration::GetGlobalBoolParameter("AllowFindSopClassesInStudy", false))
      {
        std::set<std::string> values;
        ExtractTagFromInstances(values, context, DICOM_TAG_SOP_CLASS_UID, instances);
        StoreSetOfStrings(result, DICOM_TAG_SOP_CLASSES_IN_STUDY, values);
      }
      else
      {
        result.SetValue(DICOM_TAG_SOP_CLASSES_IN_STUDY, "", false);
        LOG(WARNING) << "The handling of \"SOP Classes in Study\" (0008,0062) "
                     << "in C-FIND requests is disabled";
      }
    }
  }
// Sets the main checkbox status, and enables/disables all child controls
// bound to the StaticBox accordingly.
void CheckedStaticBox::SetValue(bool val)
{
    wxWindowList &list = GetChildren();

    for (wxWindowList::iterator iter = list.begin(); iter != list.end(); ++iter) {
        wxWindow *current = *iter;
        if (current != &ThisToggle)
            current->Enable(val);
    }
    ThisToggle.SetValue(val);
}
Beispiel #8
0
void SeqScanPlan::SetParameterValues(std::vector<common::Value *> *values) {
  LOG_TRACE("Setting parameter values in Sequential Scan");
  auto predicate = predicate_with_params_->Copy();
  expression::ExpressionUtil::ConvertParameterExpressions(
      predicate, values, GetTable()->GetSchema());
  SetPredicate(predicate);

  for (auto &child_plan : GetChildren()) {
    child_plan->SetParameterValues(values);
  }
}
Beispiel #9
0
void
CGameObject::UpdateAndDraw( unsigned long in_Time )
{
	vUpdateBeforeChildren( in_Time );
	std::vector< CGameObject* >& rChildren = GetChildren();
	for( std::vector< CGameObject* >::iterator It = rChildren.begin(); It!=rChildren.end(); ++It )
	{
		(*It)->UpdateAndDraw( in_Time );
	}
	vUpdateAfterChildren();
}
Beispiel #10
0
bool wxRibbonPanel::HideExpanded()
{
    if(m_expanded_dummy == NULL)
    {
        if(m_expanded_panel)
        {
            return m_expanded_panel->HideExpanded();
        }
        else
        {
            return false;
        }
    }

    // Move children back to original panel
    // NB: Children iterators not used as behaviour is not well defined
    // when iterating over a container which is being emptied
    while(!GetChildren().IsEmpty())
    {
        wxWindow *child = GetChildren().GetFirst()->GetData();
        child->Reparent(m_expanded_dummy);
        child->Hide();
    }

    // Move sizer back
    if(GetSizer())
    {
        wxSizer* sizer = GetSizer();
        SetSizer(NULL, false);
        m_expanded_dummy->SetSizer(sizer);
    }

    m_expanded_dummy->m_expanded_panel = NULL;
    m_expanded_dummy->Realize();
    m_expanded_dummy->Refresh();
    wxWindow *parent = GetParent();
    Destroy();
    parent->Destroy();

    return true;
}
Beispiel #11
0
void CControl::SetLayerId( size_t layerid )
{
    m_uLayerID = layerid;
    for ( auto child : GetChildren() )
    {
        CControl* pChild = ( CControl*) child;
        if ( pChild )
        {
            pChild->SetLayerId( m_uLayerID + 1 );
        }
    }
}
    std::string SEXPR::AsString( size_t aLevel )
    {
        std::string result;

        if( IsList() )
        {
            if( aLevel != 0 )
            {
                result = "\n";
            }

            result.append( aLevel* 4, ' ' );
            aLevel++;
            result += "(";

            SEXPR_VECTOR const* list = GetChildren();

            for( std::vector<SEXPR *>::const_iterator it = list->begin(); it != list->end(); ++it )
            {
                result += (*it)->AsString( aLevel );

                if( it != list->end() - 1 )
                {
                    result += " ";
                }
            }
            result += ")";

            aLevel--;
        }
        else if( IsString() )
        {
            result += "\"" + GetString() + "\"";
        }
        else if( IsSymbol() )
        {
            result += GetSymbol();
        }
        else if( IsInteger() )
        {
            std::stringstream out;
            out << GetInteger();
            result += out.str();
        }
        else if( IsDouble() )
        {
            std::stringstream out;
            out << std::setprecision( 16 ) << GetDouble();
            result += out.str();
        }

        return result;
    }
Beispiel #13
0
bool wxRibbonPanel::Layout()
{
    if(IsMinimised())
    {
        // Children are all invisible when minimised
        return true;
    }

    // TODO: Delegate to a sizer

    // Common case of no sizer and single child taking up the entire panel
    if(GetChildren().GetCount() == 1)
    {
        wxWindow* child = GetChildren().Item(0)->GetData();
        wxPoint position;
        wxClientDC dc(this);
        wxSize size = m_art->GetPanelClientSize(dc, this, GetSize(), &position);
        child->SetSize(position.x, position.y, size.GetWidth(), size.GetHeight());
    }
    return true;
}
/// Create a clone of this and children
ctConfiguration* ctConfiguration::DeepClone()
{
    ctConfiguration* newItem = Clone();

    for ( wxObjectList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() )
    {
        ctConfiguration* child = (ctConfiguration*) node->GetData();
        ctConfiguration* newChild = child->DeepClone();
        newItem->AddChild(newChild);
    }
    return newItem;
}
Beispiel #15
0
inline double ConcatSequence::GetDuration () {

	 double duration = 0.;

	vector<Module*> children = GetChildren();

	for (RepIter r=begin(); r<end(); ++r)
		for (unsigned int j=0; j<children.size() ; ++j)
			duration += children[j]->GetDuration();

	m_duration = duration;
	DEBUG_PRINT("  ConcatSequence::GetDuration() of " << GetName() << " calculates  duration = " << duration << endl;)
Beispiel #16
0
void TopMenuItem::Render(const Camera& curCamera)
{
	menu_DrawQuad(0.f, 0.f, m_w, m_h, 1.f);
	float x =  kHSpace; 
	float y = m_h - kVSpace;

	for(int i = 0, c = GetChildren().size(); i < c; ++i)	
	{
		auto child = GetChildren()[i];
		float titlew,titleh;
		child->GetTitleDims(titlew, titleh);
		const Color* col = (GetPos() == i) ? &kTextSelColor : &kTextColor;
		if(child->HasFlag(MENUSTATE_Active)) col = &kTextActiveColor;
		child->DrawTitle(x, y, *col);
		x += 2.f * kHSpace + titlew;
	}

	for(auto child: GetChildren())
		if(child->HasFlag(MENUSTATE_Active))
			child->Render(curCamera);
}
Beispiel #17
0
		Core::SCOM::ComPtr<IResource> CFolder::FindChild(const std::string &name)
		{
			Core::SCOM::ComPtr<IResource> chld;
			GetChildren();
			for(size_t i = 0; i < mChildren.size(); ++i)
			{
				boost::filesystem::path p(mChildren[i]->FullPath());
				if(p.filename() == name)
					chld = mChildren[i];
			}
			return chld;
		}
Beispiel #18
0
bool CanalConfigWizard::Run()
{
    wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
    while ( node ) {
        wxWizardPage* startPage = wxDynamicCast( node->GetData(), wxWizardPage );
        if ( startPage ) return RunWizard( startPage );
        node = node->GetNext();
    }

    return false;

}
Beispiel #19
0
size_t CategoryList::GetCategoryCount()
{
	size_t result(0);
	for(wxWindowList::Node * node = GetChildren().GetFirst(); node; node = node->GetNext())
	{
		if(node->GetData()->IsKindOf(CLASSINFO(CategoryButton)))
		{
			result++;
		}
	}
	return result;
}
Beispiel #20
0
void InsertPlan::VisitParameters(
    codegen::QueryParametersMap &map, std::vector<peloton::type::Value> &values,
    const std::vector<peloton::type::Value> &values_from_user) {
  if (GetChildren().size() == 0) {
    auto *schema = target_table_->GetSchema();
    auto columns_num = schema->GetColumnCount();

    for (uint32_t i = 0; i < values_.size(); i++) {
      auto value = values_[i];
      auto column_id = i % columns_num;
      map.Insert(expression::Parameter::CreateConstParameter(
                     value.GetTypeId(), schema->AllowNull(column_id)),
                 nullptr);
      values.push_back(value);
    }
  } else {
    PELOTON_ASSERT(GetChildren().size() == 1);
    auto *plan = const_cast<planner::AbstractPlan *>(GetChild(0));
    plan->VisitParameters(map, values, values_from_user);
  }
}
Beispiel #21
0
void wxWindowDFB::InvalidateDfbSurface()
{
    m_surface = NULL;

    // surfaces of the children are subsurfaces of this window's surface,
    // so they must be invalidated as well:
    wxWindowList& children = GetChildren();
    for ( wxWindowList::iterator i = children.begin(); i != children.end(); ++i )
    {
        (*i)->InvalidateDfbSurface();
    }
}
Beispiel #22
0
hash_t InsertPlan::Hash() const {
  auto type = GetPlanNodeType();
  hash_t hash = HashUtil::Hash(&type);

  hash = HashUtil::CombineHashes(hash, GetTable()->Hash());
  if (GetChildren().size() == 0) {
    auto bulk_insert_count = GetBulkInsertCount();
    hash = HashUtil::CombineHashes(hash, HashUtil::Hash(&bulk_insert_count));
  }

  return HashUtil::CombineHashes(hash, AbstractPlan::Hash());
}
Beispiel #23
0
Duration
ParallelTimeline::GetNaturalDurationCore (Clock *clock)
{
	TimelineCollection *collection = GetChildren ();
	Duration d = Duration::Automatic;
	TimeSpan duration_span = 0;
	Timeline *timeline;
	
	int count = collection->GetCount ();

	if (count == 0)
		return Duration::FromSeconds (0);
	
	for (int i = 0; i < count; i++) {
		timeline = collection->GetValueAt (i)->AsTimeline ();
		
		Duration duration = timeline->GetNaturalDuration (clock);
		if (duration.IsAutomatic())
			continue;
		
		if (duration.IsForever())
			return Duration::Forever;
		
		TimeSpan span = duration.GetTimeSpan ();
		
		RepeatBehavior *repeat = timeline->GetRepeatBehavior ();
		if (repeat->IsForever())
			return Duration::Forever;
		
		if (repeat->HasCount ())
			span = (TimeSpan) (span * repeat->GetCount ());
		
		if (timeline->GetAutoReverse ())
			span *= 2;

		// If we have duration-base repeat behavior, 
		// clamp/up our span to that.
		if (repeat->HasDuration ())
			span = repeat->GetDuration ();
		
		if (span != 0)
			span = (TimeSpan)(span / timeline->GetSpeedRatio());

		span += timeline->GetBeginTime ();

		if (duration_span <= span) {
			duration_span = span;
			d = Duration (duration_span);
		}
	}

	return d;
}
AForm* AApplication::GetMainForm()
{
	if( m_pMainForm && !m_pMainForm->IsDestroyed() ) 
		return m_pMainForm;
	int i,iCount = GetChildren()->GetCount();
	for(i=0;i<iCount;i++)
	{
		AComponent* p = dynamic_cast<AControl*>(GetChildren()->GetItem(i));
		if( p != NULL )
		{
			AForm* pForm = (AForm *)p->ToClass( _T("Form") );
			if( pForm != NULL )
			{
				if( pForm->IsDestroyed() == false )
				m_pMainForm = pForm;
				break;
			}
		}
	}

	return m_pMainForm;
}
void CTrieHolder::PrintChildren(size_t NodeNo) const
{
    printf("%" PRISZT, NodeNo);

    if (m_Nodes[NodeNo].m_FailureFunction != -1)
        printf(" failure(%i) ", m_Nodes[NodeNo].m_FailureFunction);
    printf(" -> ");

    size_t i=0;
    size_t Count =  GetChildrenCount(NodeNo);
    for (; i<Count; i++) {
        const CTrieRelation& p = GetChildren(NodeNo)[i];
        SymbolInformationType::const_iterator it = m_pSymbolInformation->find(p.m_RelationChar);
        assert (it != m_pSymbolInformation->end());
        printf("%i %s,", p.m_ChildNo, it->second.c_str());
    };

    printf("\n");

    for (; i<Count; i++)
        PrintChildren(GetChildren(NodeNo)[i].m_ChildNo);
};
Beispiel #26
0
void BdayFrame::showHelp()
{
  wxWindowList & wnds = GetChildren();
  for ( wxWindowList::iterator it = wnds.begin(); it != wnds.end(); ++it )
    if ( ( *it )->IsKindOf(CLASSINFO(wxFrame)) )
      if ( ((wxFrame *)( *it ))->GetTitle().IsSameAs(HelpFrame::defaultTitle) )
      {
        ( *it )->Raise();
        return;
      }
  HelpFrame * frame = new HelpFrame(this);
  frame->Show(true);
}
void CSystemControlModel::Resize()
{
  int width = 0;  
  for (auto child : GetChildren()) {
    width = MAX(child->GetRect().GetWidth(), width);
  }
  width += 15;

  int height = CalcHeight();

	rect.Right() = rect.Left() + width;
	rect.Bottom() = rect.Top() + height;
}
Beispiel #28
0
wxString wxXmlNode::GetNodeContent() const
{
    wxXmlNode *n = GetChildren();

    while (n)
    {
        if (n->GetType() == wxXML_TEXT_NODE ||
            n->GetType() == wxXML_CDATA_SECTION_NODE)
            return n->GetContent();
        n = n->GetNext();
    }
    return wxEmptyString;
}
Beispiel #29
0
Clock *
TimelineGroup::AllocateClock ()
{
	clock = new ClockGroup (this);
	TimelineCollection *collection = GetChildren ();

	int count = collection->GetCount ();
	for (int i = 0; i < count; i++)
		((ClockGroup*)clock)->AddChild (collection->GetValueAt (i)->AsTimeline ()->AllocateClock ());

	AttachCompletedHandler ();
	return clock;
}
Beispiel #30
0
void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel )
{
    // output attributes first if they exist
    for( XATTR* attr = (XATTR*) GetAttributes();  attr;  attr = (XATTR*) attr->GetNext() )
    {
        out->Print( 0, " (%s %s)",
                    TO_UTF8( attr->GetName() ),
                    out->Quotew( attr->GetValue() ).c_str() );
    }

    // we only expect to have used one of two types here:
    switch( GetType() )
    {
    case wxXML_ELEMENT_NODE:

        // output children if they exist.
        for( XNODE* kid = (XNODE*) GetChildren();  kid;  kid = (XNODE*) kid->GetNext() )
        {
            if( kid->GetType() != wxXML_TEXT_NODE )
            {
                if( kid == GetChildren() )
                    out->Print( 0, "\n" );
                kid->Format( out, nestLevel+1 );
            }
            else
            {
                kid->Format( out, 0 );
            }
        }
        break;

    case wxXML_TEXT_NODE:
        out->Print( 0, " %s", out->Quotew( GetContent() ).c_str() );
        break;

    default:
        ;   // not supported
    }
}