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 » Autosizing columns
Autosizing columns [message #35945] Sun, 08 April 2012 00:33 Go to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi,

I want to be able to resize columns in an ArrayCtrl to fit the contents of the column - like when you double-click on the gap between two column headers in Excel.

I have set about this but I appear to be missing elements:
=> there is no double-click event for a column header (so I am using a popup menu on right-click just now)
=> I can't find the font for the array - only for the header tab

Are there any examples of this? I can't help thinking that this must have been done many times before.

Nick






[Updated on: Sun, 08 April 2012 01:42]

Report message to a moderator

Re: Autosizing columns [message #35966 is a reply to message #35945] Mon, 09 April 2012 22:08 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 347
Registered: March 2007
Senior Member
Hi, nixnixnix!

You can probably use ArrayCtrl's WhenLeftDouble, check if mouse position is close to column boundary, ie, +/- 3 pixels. It's not ideal, but a tiny bit more convenient than use a menu. And it will not work for the right most column.

By default, ArrayCtrl use StdFont(), and if you used customized Display for a column, you should have it report the desired width.

HTH
Re: Autosizing columns [message #36099 is a reply to message #35945] Fri, 27 April 2012 09:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
nixnixnix wrote on Sat, 07 April 2012 18:33

Hi,

I want to be able to resize columns in an ArrayCtrl to fit the contents of the column - like when you double-click on the gap between two column headers in Excel.

I have set about this but I appear to be missing elements:
=> there is no double-click event for a column header (so I am using a popup menu on right-click just now)



Added HeaderTab::Column::WhenLeftDouble, WhenLeftClick.

Mirek
Re: Autosizing columns [message #36107 is a reply to message #36099] Sat, 28 April 2012 03:51 Go to previous message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Thanks!

Nick
Previous Topic: GridCtrl: how to set label of an Option
Next Topic: ArrayCtrl: How to use WhenDropCell...
Goto Forum:
  


Current Time: Sun Sep 22 07:42:24 CEST 2019

Total time taken to generate the page: 0.01255 seconds