Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Setting right align in ArrayCtrl does not work
Setting right align in ArrayCtrl does not work [message #52093] Thu, 18 July 2019 09:45 Go to next message
aftershock is currently offline  aftershock
Messages: 143
Registered: May 2008
Experienced Member
Any idea why?

void set_tradelist_oolumns ( ArrayCtrl & ac )
{
ac.AddColumn ( "Ticket", t_ ( "Ticket" ) ).Sorting();
ac.AddColumn ( t_ ( "Time" ) ).Sorting();
ac.AddColumn ( t_ ( "Symbol" ) ).Sorting();
ac.AddColumn ( t_ ( "Type" ) ).Sorting().SetConvert ( Single<MyOrderTypeConvert>() );
ac.AddColumn ( t_ ( "Size" ) ).Sorting().HeaderTab().AlignRight();
ac.AddColumn ( t_ ( "Price" ) ).Sorting().HeaderTab().AlignRight();
ac.AddColumn ( t_ ( "Swap" ) ).Sorting().HeaderTab().AlignRight();
ac.AddColumn ( t_ ( "Profit" ) ).Sorting().HeaderTab().AlignRight();
// ac.AddColumn ( t_ ( "Equity" ) ).Sorting();
ac.AddColumn ( t_ ( "Balance" ) ).Sorting().HeaderTab().AlignRight();
// ac.AddColumn ( t_ ( "Max drawdown" ) ).Sorting();
// ac.AddColumn ( t_ ( "Date of max drawdown" ) ).Sorting();
ac.ColumnWidths ( "1 4 3 2 2 2 2 2 2" );
}
Re: Setting right align in ArrayCtrl does not work [message #52102 is a reply to message #52093] Fri, 19 July 2019 15:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
It works for me.

Maybe the problem is that this is alignment of header tab and you expect it to align the content - it does not work that way...

You need to provide SetDisplay for the column (or for the individual cell) to align the content right.

E.g. StdRightDisplay.

GUI_APP_MAIN
{
	ArrayCtrl ac;
	ac.AddColumn("Aligned right").SetDisplay(StdRightDisplay());
	ac.Add(123);
	
	TopWindow win;
	win.Add(ac.SizePos());
	win.Run();
}



Mirek
Re: Setting right align in ArrayCtrl does not work [message #52107 is a reply to message #52102] Fri, 19 July 2019 22:42 Go to previous message
aftershock is currently offline  aftershock
Messages: 143
Registered: May 2008
Experienced Member
Yes, I wanted to align content , thanks.
Previous Topic: RegExp::ReplaceGlobal() is buggy
Next Topic: Unable to run exe file in windows
Goto Forum:
  


Current Time: Sat Apr 20 03:38:56 CEST 2024

Total time taken to generate the page: 0.05326 seconds