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 » ArrayCtrl: how to set column width? [SOLVED]
ArrayCtrl: how to set column width? [SOLVED] [message #192] Thu, 01 December 2005 10:27 Go to next message
jeff1101 is currently offline  jeff1101
Messages: 11
Registered: November 2005
Location: Philippines
Promising Member

I want to individually set the column widths for the
ArrayCtrl. How do I go about doing this?

I want it so that the Columns automatically size depending
on the length of the field under the column. I already
compute this largest "size" by getting the largest for
all row occurrences of the field.

The Problem now is to set the column width, The default
behaviour of the ArrayCtrl is that it sets all column width
to the same size and tries to fit all the columns in the
ArrayCtrl "client" area so that it doesnt even show the
horizontal scroll bar.

Sorry for my questions but since these controls dont have
much in a way of documentation I end up guessing. Looking
at the header files and method names doesnt help either
especially if the method names are short and obscure.

[Updated on: Mon, 01 May 2006 14:17] by Moderator

Report message to a moderator

Re: How do I set the column width in an ArrayCtrl??? [message #194 is a reply to message #192] Thu, 01 December 2005 15:36 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

You can do this when you add columns:

arr.AddColumn("Col 0", 100)
.AddColumn("Col 1", 50);

or after creating array

arr.HeaderTab(0).SetRatio(500);
arr.HeaderTab(1).SetRatio(1500);




Re: How do I set the column width in an ArrayCtrl??? [message #196 is a reply to message #194] Thu, 01 December 2005 19:00 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeff1101 wrote on Thu, 01 December 2005 04:27

I want to individually set the column widths for the
ArrayCtrl. How do I go about doing this?

I want it so that the Columns automatically size depending
on the length of the field under the column. I already
compute this largest "size" by getting the largest for
all row occurrences of the field.

The Problem now is to set the column width, The default
behaviour of the ArrayCtrl is that it sets all column width
to the same size and tries to fit all the columns in the
ArrayCtrl "client" area so that it doesnt even show the
horizontal scroll bar.

Sorry for my questions but since these controls dont have
much in a way of documentation I end up guessing. Looking
at the header files and method names doesnt help either
especially if the method names are short and obscure.


Actually, ArraCtrl is the best documented widget in the library Smile

http://upp.sourceforge.net/src$CtrlLib$ArrayCtrl$en-us.html
http://upp.sourceforge.net/src$CtrlLib$HeaderCtrl$en-us.html

To have horizontal scrollbar, you need to change the mode of HeaderCtrl of ArrayCtrl to absolute

arr.HeaderObject().Absolute();

and then numbers passed as column witdth will be in pixels.
Next Topic: SpreadSheet control
Goto Forum:
  


Current Time: Mon Apr 29 14:15:54 CEST 2024

Total time taken to generate the page: 0.02723 seconds