예제 #1
0
void TGuiToProfile::_sourceRootDirList()
{
	PProfile->sourceRootDirList.clear();

	TTreeNode* node = f_Main->fr_Source->tv_Dirs->Items->GetFirstNode();
	while (node)
	{
		PProfile->sourceRootDirList.push_back(IncludeTrailingPathDelimiter(node->Text));
		node = node->getNextSibling();
	}
}
예제 #2
0
AnsiString __fastcall TfrmTreeFrame::GetOption()
                           
{
  AnsiString opt,temp;
  TTreeNode *node =Tree->Items->GetFirstNode();
  while (node !=NULL)
  {
    if ((node->ImageIndex==2) || (node->ImageIndex==1))
    {
      temp = GetSub(node);
      if ((temp !="") & (opt!=""))
         opt =opt+ CRLF +temp;
      else opt =opt+temp;
    }
    node = node->getNextSibling();
  }
  return opt;
}
예제 #3
0
void TGuiToProfile::sourceDirLists()
{
	_sourceRootDirList();
	PProfile->excludeDirList.clear();
	PProfile->includeDirList.clear();
	PProfile->excludeTreeList.clear();
	PProfile->includeTreeList.clear();
	String rootdir;

	TTreeNode* node = f_Main->fr_Source->tv_Dirs->Items->GetFirstNode();
	while (node)
	{
		_addSourceDirToList(node, rootdir, false);
		_sourceDirLists2(node->getFirstChild(),
            IncludeTrailingPathDelimiter(rootdir + node->Text));
		node = node->getNextSibling();
	}
}
예제 #4
0
//---------------------------------------------------------------------------
void __fastcall TLocationProfilesDialog::BookmarkButtonClick(TObject * Sender)
{
  TControl * Control = dynamic_cast<TControl *>(Sender);
  TTreeNode * Node = GetProfilesView(Sender)->Selected;
  assert(Node);
  assert(Node->Data);

  TTreeNode * TargetNode;
  if (Control->Tag < 0)
  {
    TargetNode = Node->getPrevSibling();
    assert(TargetNode);
  }
  else
  {
    TargetNode = Node->getNextSibling();
  }

  BookmarkMove(Sender, Node, TargetNode ? TargetNode : Node->Parent);
}
예제 #5
0
//---------------------------------------------------------------------------
void __fastcall TFrm1010::CarregaMenu(TTreeNode *pParentItem)
{
	String TextNode;
	SfgMenuInfo *MenuInfo;
	TTreeNode *pChildItem = NULL;
	TTreeNode *pFirstItem = NULL;
	CadMenu->Filtered = false;
	if (pParentItem == NULL) {
		CadMenu->Filter = "cod_rotina_pai IS NULL";
	} else {
		MenuInfo = (SfgMenuInfo*)pParentItem->Data;
		CadMenu->Filter =  "cod_rotina_pai  = " + QuotedStr(MenuInfo->cod_rotina);
	}
	CadMenu->Filtered = true;
	CadMenu->First();
	while (!CadMenu->Eof) {
      MenuInfo = new SfgMenuInfo();
		MenuInfo->cod_rotina = CadMenu->FieldByName("cod_rotina")->AsString;
      if (CadMenu->FieldByName("programa")->AsString.Length() > 0) {
		   TextNode = CadMenu->FieldByName("programa")->AsString.UpperCase() + " - " + CadMenu->FieldByName("den_rotina")->AsString;
      } else {
		   TextNode = CadMenu->FieldByName("den_rotina")->AsString;
      }
		if (pParentItem == NULL) {
			pChildItem = TreeMenu->Items->AddObject(pParentItem, TextNode, (void*)MenuInfo);
		} else {
			pChildItem = TreeMenu->Items->AddChildObject(pParentItem, TextNode, (void*)MenuInfo);
		}
      pChildItem->ImageIndex = CadMenu->FieldByName("ico_index")->AsInteger;
      pChildItem->SelectedIndex = pChildItem->ImageIndex;
		if (pFirstItem == NULL) {
			pFirstItem = pChildItem;
		}
		CadMenu->Next();
	}
	while(pFirstItem != NULL) {
		CarregaMenu(pFirstItem);
		pFirstItem = pFirstItem->getNextSibling();
	}
}