Home » U++ Library support » Menus&Toolbars » Only one additional argument for Bar callback? 
	
		
		
			| Only one additional argument for Bar callback? [message #20823] | 
			Fri, 10 April 2009 19:15   | 
		 
		
			
				
				
				
					
						  
						Mindtraveller
						 Messages: 917 Registered: August 2007  Location: Russia, Moscow rgn.
						
					 | 
					Experienced Contributor  | 
					 
  | 
		 
		 
	 | 
 
	
		As it was stated in U++ docs, I may post additional argument to a function creating a toolbar: 
	void OnUpdateGraphToolbar(GraphProjectUI &ui, bool newTabSelected)
	{
		ui.toolsGraphs.Clear();
		ui.toolsGraphs.Set(callback1(this, &GraphProject::SetToolsGraphs, &ui));
	}
	void SetToolsGraphs(Bar &b, GraphProjectUI *ui)
	{
		gecs.InstallToDropCtrl(ui->colls);
		b.Add(ui->colls, 100, ui->colls.GetStdSize().cy);
		b.Add(!ui->colls.GetData().IsNull(), GraphEditorImg::graph_add, callback(this, &GraphProject::Dummy));
		b.ToolGapRight();
		b.Separator();
		b.Add(false, GraphEditorImg::graph_remove, callback(this, &GraphProject::Dummy));
	} 
 
But when I try to post two additional arguments:	void OnUpdateGraphToolbar(GraphProjectUI &ui, bool newTabSelected)
	{
		ui.toolsGraphs.Clear();
		ui.toolsGraphs.Set(callback2(this, &GraphProject::SetToolsGraphs, &ui, newTabSelected));
	}
	void SetToolsGraphs(Bar &b, GraphProjectUI *ui, bool newTabSelected)
	{
		if (newTabSelected)
			gecs.InstallToDropCtrl(ui->colls);
		b.Add(ui->colls, 100, ui->colls.GetStdSize().cy);
		b.Add(!ui->colls.GetData().IsNull(), GraphEditorImg::graph_add, callback(this, &GraphProject::Dummy));
		b.ToolGapRight();
		b.Separator();
		b.Add(false, GraphEditorImg::graph_remove, callback(this, &GraphProject::Dummy));
	} 
-- it fails to compile! 
 
I may of course work around this, but IMO it is a U++ bug.
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 10:25:01 CET 2025 
 Total time taken to generate the page: 0.04625 seconds 
 |