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 » ArrayCtrl, HeaderCtrl & GridCtrl » Set ArrayCtrl minimum column width
Set ArrayCtrl minimum column width [message #43861] Tue, 11 November 2014 18:35 Go to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello,

I am using ArrayCtrl's for a lot of purposes in my application. I noticed that you can drag a column out of range fairly easily. After I did so, I cannot drag it back. Is there a way to set a minimum width for an ArrayCtrl column? Do I need to override and modify the paint event?

Thanks!

crydev
Re: Set ArrayCtrl minimum column width [message #43871 is a reply to message #43861] Wed, 12 November 2014 11:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
HeaderTab::Column has Min/Max methods...
Re: Set ArrayCtrl minimum column width [message #43875 is a reply to message #43861] Wed, 12 November 2014 14:16 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Thanks a lot Mirek! I searched the ArrayCtrl source and documentation for this function but I think I overlooked it.

I solved it with a derived ArrayCtrl class that implements a proxy method for the AddColumn and AddRowNumColumn:

ArrayCtrl::Column& CrySearchArrayCtrl::CryAddColumn(const char *text, int w)
{
	ArrayCtrl::Column& col = this->AddColumn(text, w);
	col.HeaderTab().Min(25);
	return col;
}

ArrayCtrl::Column& CrySearchArrayCtrl::CryAddRowNumColumn(const char *text, int w)
{
	ArrayCtrl::Column& col = this->AddRowNumColumn(text, w);
	col.HeaderTab().Min(25);
	return col;
}
Previous Topic: ArrayCtrl Drag&Drop
Next Topic: GridCtrl: Add Option inside a column header
Goto Forum:
  


Current Time: Sun Nov 17 19:37:55 CET 2019

Total time taken to generate the page: 0.01604 seconds