KoOasisSettings::Items KoOasisSettings::NamedMap::entry(const QString& entryName) const
{
    KoXmlElement entry;
    forEachElement(entry, m_element) {
        if (entry.localName() == "config-item-map-entry" &&
                entry.namespaceURI() == m_settings->m_configNsUri &&
                entry.attributeNS(m_settings->m_configNsUri, "name", QString()) == entryName) {
            return Items(entry, m_settings);
        }
    }
    return Items(KoXmlElement(), m_settings);
}
示例#2
0
文件: Liw.cpp 项目: loguntsov/liw
CTruba * CGeoPoint::GetTrubaOfMinHil(void)
{
    if (SegmentBefore->Count==0) return NULL;
    double x=100000000;CTruba *Tr=NULL;
    for(int i=0;i<SegmentBefore->Count;i++)
    {
        if (Items(i)->Truba->ZHEnd<x)
        {
            x=Items(i)->Truba->ZHEnd;Tr=Items(i)->Truba;
        }
    }
    return Tr;
}
KoOasisSettings::Items KoOasisSettings::itemSet(const QString& itemSetName) const
{
    KoXmlElement e;
    forEachElement(e, m_settingsElement) {
        if (e.localName() == "config-item-set" &&
                e.namespaceURI() == m_configNsUri &&
                e.attributeNS(m_configNsUri, "name", QString()) == itemSetName) {
            return Items(e, this);
        }
    }

    return Items(KoXmlElement(), this);
}
KoOasisSettings::Items KoOasisSettings::IndexedMap::entry(int entryIndex) const
{
    int i = 0;
    KoXmlElement entry;
    forEachElement(entry, m_element) {
        if (entry.localName() == "config-item-map-entry" &&
                entry.namespaceURI() == m_settings->m_configNsUri) {
            if (i == entryIndex)
                return Items(entry, m_settings);
            else
                ++i;
        }
    }
    return Items(KoXmlElement(), m_settings);
}
示例#5
0
void NetListView::FrameResized(float width, float height)
{
	BListView::FrameResized(width, height);
	//Ensure the bevel on the right is drawn properly
	if(width < oldWidth)
		oldWidth = width;
	PushState();
	BRect invalRect(oldWidth, 0, oldWidth, height);
	ConvertFromParent(&invalRect);
	BRegion lineRegion(invalRect);
	ConstrainClippingRegion(&lineRegion);
	Draw(invalRect);
	oldWidth = width;
	PopState();
	
	//Do word wrapping
	BFont curFont;
	GetFont(&curFont);
	float itemWidth = Bounds().Width();
	float wrapWidth = (itemWidth - 6)/curFont.Size();
	for(int itemNum = 0; itemNum < CountItems(); itemNum++)
	{
		NetListItem* item = (NetListItem*)(Items()[itemNum]);
		item->SetWidth(itemWidth);
		item->CalcWordWrap(wrapWidth);
	}
	//DoForEach(UpdateItem, (void*)this);
	Invalidate();
	
	BListView::FrameResized(width, height);
}
示例#6
0
/***********************************************************
 * DeleteItem
 ***********************************************************/
void
HListView::DeleteItem(int32 index) {
	HListItem* item = cast_as(RemoveItem(index), HListItem);
	fPointerList.RemoveItem(item);
	delete item;

	HApp* app = cast_as(be_app, HApp);
	bool queue;

	int32 max_transfer;
	app->Prefs()->GetData("queue", &queue);
	app->Prefs()->GetData("max_transfer", &max_transfer);

	if (queue) {
		int32 num_task = max_transfer - CountDownloadingItems();
		if (num_task > 0) {
			int32 count = CountItems();
			HListItem** items = (HListItem**)Items();
			for (int32 i = 0; i < count; i++) {
				item = items[i];
				if (!item->IsStarted() && item->State() != T_FINISHED && item->State() != T_NOTFOUND) {
					item->Start();
					num_task--;
				}
				if (num_task <= 0)
					break;
			}
		}
	}
}
示例#7
0
void RPG_PlayerUIDialog_Touch::OnActivate()
{
  RPG_PlayerUIDialog::OnActivate();

  // Position skill button controls
  {
    VDlgControlBase *skillButtons = Items().FindItem(VGUIManager::GetID("ID_HUD_SkillButtonsLeft"));
    VASSERT(skillButtons);
    if(skillButtons)
      skillButtons->SetPosition(skillButtons->GetPosition().x, (GetSize().y - skillButtons->GetSize().y) / 2);
  }
  {
    VDlgControlBase *skillButtons = Items().FindItem(VGUIManager::GetID("ID_HUD_SkillButtonsRight"));
    VASSERT(skillButtons);
    if(skillButtons)
      skillButtons->SetPosition((GetSize().x - skillButtons->GetSize().x), (GetSize().y - skillButtons->GetSize().y) / 2);
  }
}
示例#8
0
文件: Liw.cpp 项目: loguntsov/liw
void CGeoPoint::DeleteBefore(CGeoSegment *Seg)
{
    for(int i=0;i<SegmentBefore->Count;i++)
        if(Items(i)==Seg)
        {
            SegmentBefore->Delete(i);
            break;
        }
}
示例#9
0
int main()
{
    std::vector<Items> vt(10);

    vt.push_back(Items(8.2,2.8, 3));
    for (int i = 0; i < 10; i++)
        vt[i].ShowItems();

    return 0;
}
示例#10
0
void FbExportParentData::Sort(FbModel & model)
{
	m_items.Sort(ComareFiles);
	size_t count = Count(model);
	for (size_t i = 0; i < count; i++) {
		FbModelData * data = Items(model, i);
		FbExportParentData * child = wxDynamicCast(data, FbExportParentData);
		if (child) child->Sort(model);
	}
}
示例#11
0
int WINAPI SetFindList( HANDLE hPlugin, PluginPanelItem * PanelItems, int ItemsNumber )
{
  far_assert( Plugin != NULL );

  FarPluginPanelItems Items( PanelItems, ItemsNumber );

  bool Result = Plugin->SetFindList( hPlugin, &Items );

  return Result ? TRUE : FALSE;
}
示例#12
0
int WINAPI GetVirtualFindData( HANDLE hPlugin, PluginPanelItem ** ppPanelItems, PINT pItemsNumber, LPCSTR Path )
{
  far_assert( Plugin != NULL );
  FarPluginPanelItems Items( 16 );

  bool Result = Plugin->GetVirtualFindData( hPlugin, &Items, Path );

  *pItemsNumber = Items.Count();
  *ppPanelItems = Items.Detach();

  return Result ? TRUE : FALSE;
}
示例#13
0
void SceneViewerMainMenu::OnInitDialog()
{
  SetVisible(true);
  m_bLoadNewScene = false;

  m_pSceneList = (VListControl *)Items().FindItem(VGUIManager::GetID("SCENE_LIST"));
  VASSERT(m_pSceneList);

  m_pLoadButton = static_cast<VPushButton*>(Items().FindItem(VGUIManager::GetID("LOAD_SCENE_BUTTON")));
  m_pContinueButton = static_cast<VPushButton*>(Items().FindItem(VGUIManager::GetID("CONTINUE_BUTTON")));
  // Don't assert if buttons not available - not needed on all platforms

  // On mobile we select to load -> thus no preselection should happen
#ifdef _VISION_MOBILE
  bool autoSelect = m_pSceneList->Items().Count() == 1; // if only one choice, just take it
#else
  bool autoSelect = true;
#endif
  if (autoSelect)
      m_pSceneList->SetSelectionIndex(0);
}
示例#14
0
bool	TRoss::ReadConfig()
{
	string Config;
	{
		FILE* fp = fopen (ConfigFile, "rb");
		if (!fp) return false;
		char buffer[1024];
		while (fgets(buffer,1024, fp))
			Config+=buffer;
		fclose (fp);
	};

	StringTokenizer lines(Config.c_str(), "\n\r");
	while (lines())
	{
		string Line = lines.val();
		Trim(Line);
		if (Line.empty()) continue;
		StringTokenizer Items(Line.c_str(), " \t\n\r");

		string Field = Items.next_token();
		string Value = Items.next_token();
		if (Field.empty() || Value.empty()) return  false;
		if (Field == "MaxNumDom")
		{
			m_MaxNumDom = atoi(Value.c_str()); 
			if (		(m_MaxNumDom != 3) 
					&&	(m_MaxNumDom != 10) 
				)
				return false;
		}
		else
		if (Field == "MaxMeanNum")
		{
			int u = atoi(Value.c_str()); 
			if (		(u < 1) 
					||	(u > 15) 
				)
				return false;
			m_MaxMeanNum = u;
		}
		else
		if (Field == "DictName")
		{
			m_DictName = Value;
		}
		else
			return false;
	};

	return true;
};
示例#15
0
/***********************************************************
 * CountDownloadingItems
 ***********************************************************/
int32
HListView::CountDownloadingItems() {
	int32 result = 0;
	int32 count = CountItems();
	HListItem** items = (HListItem**)Items();
	for (int32 i = 0; i < count; i++) {
		HListItem* item = items[i];
		if (!item)
			continue;
		if (item->IsStarted())
			result++;
	}
	return result;
}
示例#16
0
void FbExportParentData::GetFiles(FbModel & model, FbConvertArray & files) const
{
	size_t count = Count(model);
	for (size_t i = 0; i < count; i++) {
		FbModelData * data = Items(model, i);
		FbExportChildData * child = wxDynamicCast(data, FbExportChildData);
		if (child) {
			files.Add(new FbConvertItem(child->GetBook(), child->GetPath(model)));
		} else {
			FbExportParentData * folder = wxDynamicCast(data, FbExportParentData);
			if (folder) folder->GetFiles(model, files);
		}
	}
}
示例#17
0
void DataStmtEngine::CreateArrayElementExprInitializer(ArrayElementExpr *E,
                                                       Expr *Parent) {
  auto Target = dyn_cast<VarExpr>(E->getTarget());
  if(!Target)
    return VisitExpr(E);
  if(CheckVar(Target))
    return;

  auto VD = Target->getVarDecl();
  auto ATy = VD->getType()->asArrayType();
  auto ElementType = ATy->getElementType();

  uint64_t ArraySize;
  if(!ATy->EvaluateSize(ArraySize, Context))
    return VisitExpr(E);

  SmallVector<Expr*, 32> Items(ArraySize);
  if(VD->hasInit()) {
    assert(isa<ArrayConstructorExpr>(VD->getInit()));
    auto InsertPoint = cast<ArrayConstructorExpr>(VD->getInit())->getItems();
    for(uint64_t I = 0; I < ArraySize; ++I)
      Items[I] = InsertPoint[I];
  } else {
    for(uint64_t I = 0; I < ArraySize; ++I)
      Items[I] = nullptr;
  }

  uint64_t Offset;
  if(!E->EvaluateOffset(Context, Offset, &ImpliedDoEvaluator))
    return VisitExpr(E);

  ExprResult Val;
  if(Parent) {
    if(auto SE = dyn_cast<SubstringExpr>(Parent)) {
       Val = CreateSubstringExprInitializer(SE, ElementType);
    } else if(auto ME = dyn_cast<MemberExpr>(Parent)) {
      if(Offset < Items.size()) {
        const TypeConstructorExpr *Init = Items[Offset]? cast<TypeConstructorExpr>(Items[Offset]) : nullptr;
        Val = CreateMemberExprInitializer(ME, Init);
      }
    } else llvm_unreachable("invalid expression");
  } else Val = getAndCheckAnyValue(ElementType, E);

  if(Val.isUsable() && Offset < Items.size()) {
    Items[Offset] = Val.get();
    VD->setInit(ArrayConstructorExpr::Create(Context, Val.get()->getLocation(),
                                             Items, VD->getType()));
  }
}
示例#18
0
int
set_menu_opts(MENU *m, int opt)
{
	ITEM **ip;

	if (m) {
		if (Posted(m)) {
			return (E_POSTED);
		}

		/* Check to see if the ROWMAJOR option is changing.  If so, */
		/* set top and current to 0. */
		if ((opt & O_ROWMAJOR) != RowMajor(m)) {
			Top(m) = 0;
			Current(m) = IthItem(m, 0);
			(void) set_menu_format(m, FRows(m), FCols(m));
		}

		/* if O_NONCYCLIC option changed, set bit to re-link items */
		if ((opt & O_NONCYCLIC) != (Mopt(m) & O_NONCYCLIC)) {
			SetLink(m);
		}

		Mopt(m) = opt;
		if (OneValue(m) && Items(m)) {
			for (ip = Items(m); *ip; ip++) {
				/* Unset values if selection not allowed. */
				Value(*ip) = FALSE;
			}
		}
		_scale(m);		/* Redo sizing information */
	} else {
		Mopt(Dfl_Menu) = opt;
	}
	return (E_OK);
}
示例#19
0
	inline bool operator ==(const Selection& other)
		{
			if (other.CountItems() == CountItems()) {
				int32* items = Items();
				int32* otherItems = other.Items();
				for (int32 i = 0; i < CountItems(); i++) {
					if (items[i] != otherItems[i])
						return false;
					items++;
					otherItems++;
				}
				return true;
			} else
				return false;
		}
示例#20
0
int
free_menu(MENU *m)
{
	if (!m) {
		return (E_BAD_ARGUMENT);
	}
	if (Posted(m)) {
		return (E_POSTED);
	}
	if (Items(m)) {
		_disconnect(m);
	}
	free(m);
	return (E_OK);
}
void CellMLAnnotationViewMetadataEditDetailsWidget::updateGui(iface::cellml_api::CellMLElement *pElement,
                                                              const bool &pUpdateItemsGui)
{
    // Keep track of the CellML element

    mElement = pElement;

    // Update the add term button, depending on whether the direct term is
    // already associated with the CellML element

    if (mTermIsDirect) {
        QStringList termInformation = mTerm.split("/");

        if (mQualifierIndex < CellMLSupport::CellMLFileRdfTriple::LastBioQualifier)
            mAddTermButton->setEnabled(!mCellMLFile->rdfTripleExists(mElement,
                                                                     CellMLSupport::CellMLFileRdfTriple::BioQualifier(mQualifierIndex+1),
                                                                     termInformation[0], termInformation[1]));
        else
            mAddTermButton->setEnabled(!mCellMLFile->rdfTripleExists(mElement,
                                                                     CellMLSupport::CellMLFileRdfTriple::ModelQualifier(mQualifierIndex-CellMLSupport::CellMLFileRdfTriple::LastBioQualifier+1),
                                                                     termInformation[0], termInformation[1]));
    } else {
        mAddTermButton->setEnabled(false);
    }

    // Update our items' GUI, if required

    if (pUpdateItemsGui)
        updateItemsGui(Items(), QString(), !mTermIsDirect);

    // Enable or disable the add buttons for our retrieved terms, depending on
    // whether they are already associated with the CellML element

    for (int row = 0; mGridLayout->itemAtPosition(++row, 0);) {
        QPushButton *addButton = qobject_cast<QPushButton *>(mGridLayout->itemAtPosition(row, 3)->widget());

        Item item = mItemsMapping.value(addButton);

        if (mQualifierIndex < CellMLSupport::CellMLFileRdfTriple::LastBioQualifier)
            addButton->setEnabled(!mCellMLFile->rdfTripleExists(mElement,
                                                                CellMLSupport::CellMLFileRdfTriple::BioQualifier(mQualifierIndex+1),
                                                                item.resource, item.id));
        else
            addButton->setEnabled(!mCellMLFile->rdfTripleExists(mElement,
                                                                CellMLSupport::CellMLFileRdfTriple::ModelQualifier(mQualifierIndex-CellMLSupport::CellMLFileRdfTriple::LastBioQualifier+1),
                                                                item.resource, item.id));
    }
}
示例#22
0
文件: WXmList.C 项目: juddy/edcde
//-----------------------------------------------------------------------------
// Replace a string in the list with one which has the desired font
Boolean
WXmList::ChangeItemFont( int pos, char* newtag )
{
   int count = ItemCount();
   if( count < pos ) {
      return FALSE;
   }	
	
   XmStringTable ListStrings =  Items();

   if( pos == 0 ){ // Zero indicates the last element
      pos = count;
   }
   WXmString OldString( ListStrings[pos-1] );
   WXmString NewString(OldString.CopyUsingFont(newtag));
   ReplaceItemsPos((XmString*)&NewString, 1, 1);
   return TRUE;
} // WXmList::ChangeItemFont( WXmList* pList, int pos, char* newtag )
示例#23
0
void FbExportParentData::Append(FbModel & model, int book, wxFileName &filename, int size)
{
	int number = 0;
	wxString name = filename.GetName();
	while (true) {
		wxString fullname = Lower(filename.GetFullName());
		size_t count = Count(model);
		bool ok = true;
		for (size_t i = 0; i < count; i++) {
			FbModelData * data = Items(model, i);
			if (!data) continue;
			if (Lower(data->GetValue(model)) == fullname) { ok = false; break; }
		}
		if (ok) break;
		filename.SetName(name + wxString::Format(wxT("(%d)"), ++number));
	}
	new FbExportChildData(model, this, book, filename, size);
}
示例#24
0
ExprResult DataStmtEngine::CreateMemberExprInitializer(const MemberExpr *E,
                                                       const TypeConstructorExpr *Init) {
  auto Field = E->getField();
  auto Val = getAndCheckAnyValue(E->getType(), E);
  if(!Val.isUsable())
    return Sem.ExprError();

  auto FieldCount = E->getTarget()->getType().getSelfOrArrayElementType()->asRecordType()->getElementCount();
  SmallVector<Expr*, 16> Items(FieldCount);
  if(Init) {
    auto Args = Init->getArguments();
    for(unsigned I = 0; I < FieldCount; ++I) Items[I] = Args[I];
  } else {
    for(unsigned I = 0; I < FieldCount; ++I) Items[I] = nullptr;
  }
  Items[Field->getIndex()] = Val.get();
  return TypeConstructorExpr::Create(Context, Val.get()->getLocation(),
                                     Field->getParent(), Items);
}
示例#25
0
文件: pattern.c 项目: andreiw/polaris
int
set_menu_pattern(MENU *m, char *s)
{
	int top;
	ITEM *current;

	if (!m || !s) {
		return (E_BAD_ARGUMENT);
	}
	if (!Items(m)) {
		return (E_NOT_CONNECTED);
	}
	if (Indriver(m)) {
		return (E_BAD_STATE);
	}

	IthPattern(m, 0) = '\0';
	Pindex(m) = 0;

	if (*s == '\0') {
		_position_cursor(m);
		return (E_OK);
	}
	if (LinkNeeded(m)) {
		_link_items(m);
	}

	top = Top(m);
	current = Current(m);

	for (; *s; s++) {
		if (_match(m, *s, &current) != E_OK) {
			IthPattern(m, 0) = '\0';
			Pindex(m) = 0;
			_position_cursor(m);
			return (E_NO_MATCH);
		}
	}
	_chk_current(m, &top, current);
	_affect_change(m, top, current);
	return (E_OK);
}
示例#26
0
FbExportParentData * FbExportParentData::GetDir(FbModel & model, wxArrayString &dirs)
{
	if (dirs.Count() == 0) return this;

	wxString name = dirs[0];
	dirs.RemoveAt(0);

	bool not_found = true;
	FbExportParentData * child = NULL;
	size_t count = Count(model);
	for (size_t i = 0; i < count; i++) {
		FbModelData * data = Items(model, i);
		child = wxDynamicCast(data, FbExportParentData);
		if (child && child->m_name == name) { not_found = false; break; }
	}

	if (not_found) child = new FbExportParentData(model, this, name);

	return child->GetDir(model, dirs);
}
示例#27
0
void RPG_PlayerUIDialog::OnActivate()
{
  // Position energy bar control
  VItemContainer *energyBars = vstatic_cast<VItemContainer*>(Items().FindItem(VGUIManager::GetID("ID_HUD_EnergyBars")));
  VASSERT(energyBars);
  if(energyBars)
  {
    energyBars->SetPosition((GetSize().x - energyBars->GetSize().x) / 2, energyBars->GetPosition().y);

    // Store health and mana bar image controls
    m_healthBar = vstatic_cast<VImageControl*>(energyBars->SubItems().FindItem(VGUIManager::GetID("ID_HUD_HealthBar")));
    VASSERT(m_healthBar);
    if(m_healthBar)
      m_healthBarWidth = m_healthBar->GetSize().x;

    m_manaBar = vstatic_cast<VImageControl*>(energyBars->SubItems().FindItem(VGUIManager::GetID("ID_HUD_ManaBar")));
    VASSERT(m_manaBar);
    if(m_manaBar)
      m_manaBarWidth = m_manaBar->GetSize().x;
  }
}
示例#28
0
void DataStmtEngine::VisitVarExpr(VarExpr *E) {
  if(CheckVar(E))
    return;
  auto VD = E->getVarDecl();
  auto Type = VD->getType();
  if(auto ATy = Type->asArrayType()) {
    uint64_t ArraySize;
    if(!ATy->EvaluateSize(ArraySize, Context)) {
      VisitExpr(E);
      return;
    }

    // Construct an array constructor expression for initializer
    SmallVector<Expr*, 32> Items(ArraySize);
    bool IsUsable = true;
    SourceLocation Loc;
    auto ElementType = ATy->getElementType();
    for(uint64_t I = 0; I < ArraySize; ++I) {
      if(!HasValues(E)) return;
      auto Val = getAndCheckAnyValue(ElementType, E);
      if(Val.isUsable()) {
        Items[I] = Val.get();
        if(!Loc.isValid())
          Loc = Val.get()->getLocation();
      }
      else IsUsable = false;
    }

    if(IsUsable) {
      VD->setInit(ArrayConstructorExpr::Create(Context, Loc,
                                               Items, Type));
    }
    return;
  }

  // single item
  auto Val = getAndCheckAnyValue(Type, E);
  if(Val.isUsable())
    VD->setInit(Val.get());
}
示例#29
0
void AnimationMainMenu::OnInitDialog()
{
  // position the GUI to the left side of the screen
  SetPosition(Vision::Video.GetXRes() - GetSize().x,0);
  SetSize(GetSize().x, (float)Vision::Video.GetYRes());

  // find the entities in the scene
  for (int i = 0; i < ENTITY_COUNT; i++)
  {
    char szKey[64];
    sprintf(szKey, "Soldier_%i", i);
    m_pSoldiers[i] = Vision::Game.SearchEntity(szKey);
    VASSERT(m_pSoldiers[i]);
  }
  // sub menus
  m_pSubMenu = static_cast<VDialogSubCtrl*>(Items().FindItem(VGUIManager::GetID("SUBMENU")));
  m_spSubMenuDialog = GetMenuManager()->CreateDialogInstance("CharacterLOD\\Dialogs\\SubMenu.xml", GetContext(), this);
  VASSERT(m_pSubMenu && m_spSubMenuDialog);

  // skeletal anim
  m_pLODSelectionList = static_cast<VListControl*>(m_spSubMenuDialog->Items().FindItem(VGUIManager::GetID("LOD_SELECTION")));
  m_pCheckBoxStopPlay = static_cast<VCheckBox*>(m_spSubMenuDialog->Items().FindItem(VGUIManager::GetID("STOP_PLAY")));
  VASSERT(m_pLODSelectionList && m_pCheckBoxStopPlay);
  
  // fill the list control (put the enum in the data member):
  VListControlItem *pItem;
  ADD_MODE(VLOD_HIGH,     "High Quality",     "Use characters with high polygon count");
  ADD_MODE(VLOD_MEDIUM,   "Medium Quality",   "Use characters with medium polygon count");
  ADD_MODE(VLOD_LOW,      "Low Quality",      "Use characters with low polygon count");
  ADD_MODE(VLOD_ULTRALOW, "UltraLow Quality", "Use characters with ultra low polygon count");
  ADD_MODE(VLOD_AUTO,     "Use AutoLOD",      "Choose LOD-Level by distance");

  m_pSubMenu->SetDialog(m_spSubMenuDialog);

  // set the initial mode
  SetLODLevel(VLOD_AUTO);
}
示例#30
0
void AnimationMainMenu::OnInitDialog()
{
  // position the GUI to the right side of the screen
  SetPosition(Vision::Video.GetXRes() - GetSize().x,0);
  SetSize(GetSize().x, (float)Vision::Video.GetYRes());

  // find the entities in the scene
  m_pSkeletalCharacter = (SimpleSkeletalAnimatedObject_cl *)Vision::Game.SearchEntity("SkeletalAnimEntity");
  m_pVertexAnimCharacter = (SimpleVertexAnimatedObject_cl *)Vision::Game.SearchEntity("VertexAnimEntity");
  VASSERT(m_pSkeletalCharacter && m_pVertexAnimCharacter);

  // sub menues
  m_pSubMenu = (VDialogSubCtrl *)Items().FindItem(VGUIManager::GetID("SUBMENU"));
  m_spSubMenu_Skeletal = GetMenuManager()->CreateDialogInstance("BasicAnimation\\SubMenu_Skeletal.xml", GetContext(), this);
  m_spSubMenu_Vertex   = GetMenuManager()->CreateDialogInstance("BasicAnimation\\SubMenu_Vertex.xml", GetContext(), this);
  VASSERT(m_pSubMenu && m_spSubMenu_Skeletal && m_spSubMenu_Vertex);

  m_pCheckBoxSkeletalAnim = (VCheckBox *)Items().FindItem(VGUIManager::GetID("SKELETALANIM"));
  m_pCheckBoxVertexAnim = (VCheckBox *)Items().FindItem(VGUIManager::GetID("VERTEXANIM"));
  VASSERT(m_pCheckBoxSkeletalAnim);
  VASSERT(m_pCheckBoxVertexAnim);

  m_pCheckBoxSkeletalAnim->SetChecked(true);

  // vertex anim
  m_pCheckBoxPlayVertexAnim = (VCheckBox *)m_spSubMenu_Vertex->Items().FindItem(VGUIManager::GetID("PLAY_VERTEXANIM"));
  VASSERT(m_pCheckBoxPlayVertexAnim);

  // skeletal anim
  m_pSkeletalModeList = (VListControl *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKELETAL_MODE"));
  VASSERT(m_pSkeletalModeList);
  VListControlItem *pItem;
    // fill the list control (put the enum in the data member):
    ADD_MODE(MODE_SINGLEANIM,       "Single animation",     "Plays a single animation");
    ADD_MODE(MODE_BLENDTWOANIMS,    "Blend two animations", "Blends two animations");
    ADD_MODE(MODE_LISTENTOEVENTS,   "Listen to events",     "Demonstrates event callbacks");
    ADD_MODE(MODE_SETANIMATIONTIME, "Set animation time",   "Shows manual animation time setting");
    ADD_MODE(MODE_LAYERTWOANIMATIONS,"Layer two animations","Layers one animation on top of the other");
    ADD_MODE(MODE_FORWARDKINEMATICS,"Forward kinematics",   "Inserts a bone modifier node\ninto the animation tree");
    ADD_MODE(MODE_LOOKAT,           "Look-at",              "Uses forward kinematics for simple lookat");

  // skeletal mode specific:
  m_pCheckBoxSkelPlay   = (VCheckBox *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_PLAYANIM"));
  m_pCheckBoxSkelBlend  = (VCheckBox *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_BLEND_TOGGLE"));
  m_pSliderSetAnimTime  = (VSliderControl *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_ANIM_TIME"));
  m_pSetAnimTimeLabel   = (VTextLabel *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_ANIM_TIME_LABEL"));
  m_pSliderFKinYaw      = (VSliderControl *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_FKIN_YAW"));
  m_pFKinLabel          = (VTextLabel *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_FKIN_LABEL"));
  m_pSliderLayered      = (VSliderControl *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_LAYERANIMS"));
  m_pLayeredLabel       = (VTextLabel *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_LAYERANIMS_LABEL"));

  VASSERT(m_pCheckBoxSkelPlay);
  VASSERT(m_pCheckBoxSkelBlend);
  VASSERT(m_pSliderSetAnimTime);
  VASSERT(m_pSetAnimTimeLabel);
  VASSERT(m_pSliderFKinYaw);
  VASSERT(m_pFKinLabel);
  VASSERT(m_pSliderLayered);
  VASSERT(m_pLayeredLabel);

  // set the initial mode
  SetSkeletalMode(SimpleSkeletalAnimatedObject_cl::MODE_SINGLEANIM);

}