Ejemplo n.º 1
0
String SelectPackageDlg::Run(String startwith)
{
	finished = canceled = false;
	if(!IsSplashOpen())
		Open();
	if(selectvars)
		SyncBase(GetVarsName());
	else
		OnBase();
	String bkvar = GetVarsName();
	if(finished)
		return GetCurrentName();
	if(canceled)
		return Null;
	alist.FindSetCursor(startwith);
	clist.FindSetCursor(startwith);
	ActiveFocus(alist.IsShown() ? (Ctrl&)alist : (Ctrl&)clist);
	switch(TopWindow::Run()) {
	case IDOK:  return GetCurrentName();
	case IDYES: return selected;
	default:
		LoadVars(bkvar);
		SyncBase(GetVarsName());
		return Null;
	}
}
Ejemplo n.º 2
0
bool
ZXmlParser::GoBackward( LPCTSTR NodeName )
{
   // Sibling node
   IXMLDOMNodePtr pSibling;

   if ( IsMSXML_Node( m_CurrentNode ) != NODE_ELEMENT && IsMSXML_Node( m_CurrentNode ) != NODE_CDATA_SECTION )
      return( false );

   for ( pSibling = m_CurrentNode;  NULL != pSibling;  pSibling = pSibling->previousSibling )
   {
      // Grab Information from Sibling node
      GrabNodeInformation( pSibling );

      if ( GetCurrentName( ) == NodeName )
      {
         // Update new Position
         m_attrib_index = -1;
         m_CurrentNode = pSibling;
         return( true );
      }
   }

   // Node Not Found (restore Node information)
   GrabNodeInformation( m_CurrentNode );
   return( false );
}
Ejemplo n.º 3
0
bool
ZXmlParser::GoToChild( LPCTSTR NodeName )
{
   // Child node
   IXMLDOMNodePtr pChild;

   if ( IsMSXML_Node( m_CurrentNode ) != NODE_ELEMENT )
      return( false );

   ChainTagAdd( GetCurrentTag( ) );

   for ( pChild = m_CurrentNode->firstChild;  NULL != pChild;  pChild = pChild->nextSibling )
   {
      // Grab Information from Child node
      GrabNodeInformation( pChild );

      if ( GetCurrentName( ) == NodeName )
      {
         // Update new Position
         m_attrib_index = -1;
         m_CurrentNode = pChild;
         return( true );
      }
   }

   // Node Not Found (restore Node information)
   ChainTagRemove( 1 );
   GrabNodeInformation( m_CurrentNode );
   return( false );
}
Ejemplo n.º 4
0
		// returns the name of a profiling entry that includes
		// its scope information
		PooledString BuildCompleteName(const char* name) {
			PooledString completeName(GetCurrentName());
			// appends the new name to the current scope name
			completeName+="::";
			completeName+=name;
			return completeName;
		}
Ejemplo n.º 5
0
int   SelectPackageDlg::GetCurrentIndex()
{
	String s = GetCurrentName();
	for(int i = 0; i < packages.GetCount(); i++)
		if(packages[i].package == s)
			return i;
	return -1;
}
Ejemplo n.º 6
0
void SelectPackageDlg::PackageMenu(Bar& menu)
{
	bool b = GetCurrentName().GetCount();
	menu.Add("New package..", THISBACK(OnNew));
	menu.Separator();
	menu.Add(b, "Rename package..", THISBACK(RenamePackage));
	menu.Add(b, "Delete package", THISBACK(DeletePackage));
}
Ejemplo n.º 7
0
void SelectPackageDlg::RenamePackage()
{
	String n = GetCurrentName();
	if(IsNull(n))
		return;
	WithRenamePackageLayout<TopWindow> dlg;
	CtrlLayoutOKCancel(dlg, "Rename package");
	dlg.name.SetFilter(FilterPackageName);
	dlg.name <<= n;
	dlg.name.SelectAll();
again:
	if(dlg.Execute() != IDOK)
		return;
	if(!RenamePackageFs(PackagePath(GetCurrentName()), ~dlg.name))
		goto again;
	Load();
}
Ejemplo n.º 8
0
void SelectPackageDlg::DeletePackage()
{
	String n = GetCurrentName();
	if(IsNull(n))
		return;
	String pp = GetFileFolder(PackagePath(GetCurrentName()));
	if(!DirectoryExists(pp)) {
		Exclamation("Directory does not exist!");
		return;
	}
	if(!PromptYesNo("Do you really want to delete package [* \1" + GetCurrentName() + "\1]?&&"
	                "[/ Warning:] [* Package will not be removed "
	                "from uses of any other package!]"))
		return;
	if(!PromptYesNo("This operation is irreversible.&Do you really want to proceed?"))
		return;
	DeleteFolderDeep(pp);
	Load();
}
Ejemplo n.º 9
0
CString CLayerSelect::GetStrLayers()
{
	CString Str;
	GetCurrentName();
	for(int i=0;i<aList.GetSize();i++)
	{
		Str=Str+","+aList[i].csName;
	}
	Str.TrimLeft(',');
	return Str;

}
Ejemplo n.º 10
0
void SelectPackageDlg::OnOK()
{
	Package pkg;
	int f = ~filter;
	String n = GetCurrentName();
	if(n.GetCount() && pkg.Load(PackagePath(n)) &&
	   (!(f & MAIN) || pkg.config.GetCount())) {
		loading = false;
		finished = true;
		AcceptBreak(IDOK);
	}
}
Ejemplo n.º 11
0
void SelectPackageDlg::ListCursor()
{
	int c = GetCurrentIndex();
	if(c >= 0 && c < packages.GetCount()) {
		String pp = PackagePath(GetCurrentName());
		Package pkg;
		pkg.Load(pp);
		description <<= pkg.description;
	}
	else
		description <<= Null;
}
Ejemplo n.º 12
0
void SelectPackageDlg::SyncList()
{
	String n = GetCurrentName();
	int asc = alist.GetScroll();
	int csc = clist.GetSbPos();

	packages.Clear();
	String s = ~search;
	int f = ~filter;
	Index<String> added;
	for(int i = 0; i < min((f & FIRST) ? 1 : data.GetCount(), data.GetCount()); i++) {
		const ArrayMap<String, PkData>& nest = data[i];
		for(int i = 0; i < nest.GetCount(); i++) {
			const PkData& d = nest[i];
			if(!nest.IsUnlinked(i) &&
			   d.ispackage &&
			   (!(f & MAIN) || d.main) &&
			   ToUpper(d.package + d.description + d.nest).Find(s) >= 0 &&
			   added.Find(d.package) < 0) {
				packages.Add() = d;
				added.Add(d.package);
			}
		}
	}
	Sort(packages);
	alist.Clear();
	clist.Clear();
	ListCursor();
	static PackageDisplay pd, bpd;
	bpd.fnt.Bold();
	for(int i = 0; i < packages.GetCount(); i++) {
		const PkInfo& pkg = packages[i];
		Image icon = pkg.icon;
		if(IsNull(icon))
			icon = pkg.main ? IdeImg::MainPackage() : IdeImg::Package();
		clist.Add(pkg.package, icon);
		alist.Add(pkg.package, pkg.nest, pkg.description, icon);
		alist.SetDisplay(alist.GetCount() - 1, 0, pkg.main ? bpd : pd);
	}
	if(!alist.FindSetCursor(n))
		alist.GoBegin();
	if(!clist.FindSetCursor(n) && clist.GetCount())
		clist.SetCursor(0);
	alist.ScrollTo(asc);
	clist.SetSbPos(csc);
	alist.HeaderTab(0).SetText("Package (" + AsString(alist.GetCount()) + ")");
}
Ejemplo n.º 13
0
bool
ZXmlParser::GoToDescendant( LPCTSTR NodeName )
{
   // Child node
   IXMLDOMNodePtr pChild;

   // Current Node before the call method
   IXMLDOMElementPtr pCurrent = m_CurrentNode;

   if ( IsMSXML_Node( m_CurrentNode ) != NODE_ELEMENT )
      return( false );

   ChainTagAdd( GetCurrentTag( ) );

   for ( pChild = m_CurrentNode->firstChild;  NULL != pChild;  pChild = pChild->nextSibling )
   {
      // Grab Information from Child node
      GrabNodeInformation( pChild );

      if ( GetCurrentName( ) == NodeName )
      {
         // Update new Position
         m_attrib_index = -1;
         m_CurrentNode = pChild;
         return( true );
      }

      // Try to go into Childs of this Child
      m_CurrentNode = pChild;
      if (  GoToDescendant( NodeName ) )
      {
         // We find the approriate node
         // All is set, we can return
         return( true );
      }

      // Restore Current node
      m_CurrentNode = pCurrent;
   }

   // Node Not Found (restore Node information)
   ChainTagRemove( 1 );
   GrabNodeInformation( m_CurrentNode );
   return( false );
}
Ejemplo n.º 14
0
void CLayerSelect::ReLoadGrid()
{
	GetCurrentName();
	CCellID curCell=m_Grid.GetFocusCell();
	m_Grid.SetRowCount(0);
	m_Grid.SetRowCount(aList.GetSize());

	aList[nCurrentEdit].bVisible=1;
	for(int i=0;i<aList.GetSize();i++)
	{
		m_Grid.SetItemText(i,2,aList[i].csName);
		if(aList[i].bVisible)
			m_Grid.SetItemImage(i,0,608);
	}

	m_Grid.SetItemImage(nCurrentEdit,1,609);
	m_Grid.SetFocusCell(curCell);
}
Ejemplo n.º 15
0
LRESULT CDdjdemoCtrl::OnOcmCommand(WPARAM wParam, LPARAM lParam)
{
#ifdef _WIN32
	WORD wNotifyCode = HIWORD(wParam);
#else
	WORD wNotifyCode = HIWORD(lParam);
#endif
	
	// This is where the listbox notifications are received. The only
	// one we're interested in is LBN_SELCHANGE. When the selection is
	// changed, we reuse the code for GetCurrentName and GetCurrentNumber
	// to retrieve the correct strings for name and phone number, then
	// call the FireNameNumberChanged event that ClassWizard created.
	switch(wNotifyCode)
	{
	case LBN_SELCHANGE:
		FireNameNumberChanged(GetCurrentName(), GetCurrentNumber());
		break;
	}

	return 0;
}
Ejemplo n.º 16
0
bool
ZXmlParser::GoToParent( LPCTSTR NodeName )
{
   // Parent node
   IXMLDOMNodePtr pParent = NULL;
   IXMLDOMNodePtr oldCurrent = m_CurrentNode;

   if ( m_CurrentNode == m_pDocRoot )
      return( false );

   CString oldChainTag = m_ChainTag;

   m_CurrentNode->get_parentNode( &pParent );

   while ( true )
   {
      m_CurrentNode = pParent;
      ChainTagRemove( 1 );
      GrabNodeInformation( m_CurrentNode );
      if ( GetCurrentName( ) == NodeName )
      {
         m_attrib_index = -1;
         return( true );
      }

      if ( m_CurrentNode == m_pDocRoot )
         break;

      m_CurrentNode->get_parentNode( &pParent );
   }

   // Parent not found
   m_CurrentNode = oldCurrent;
   m_ChainTag = oldChainTag;
   GrabNodeInformation( m_CurrentNode );
   return( false );
}