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 » How to create a GridCtrl with fixed cell size
Re: How to create a GridCtrl with fixed cell size [message #15984 is a reply to message #15983] Wed, 21 May 2008 17:45 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:


GetCursorPos worked. I just had to change event from WhenCursor to WhenChangeRow & WhenChangeCol. With WhenCursor it was always (-1,-1), even though this event triggered on cell change.


Starange, you should get correct values in WhenCursor. I'll try to check it.

Quote:


Like in most other cases, I need to insert some data in the container widget, but I need it to display some text. From what I could tell from the interface of GridCtrl, is that you insert some arbitrary type converted to a Value, and write a custom Display to display a string while the control holds you values.


Ok, now I understand. One cell holds one Value object. If you want key/value pair conected with one cell you have to use some structure as Value. As for displaying. You have to extend GridDisplay class which contain some useful methods like SetLeft/Right/CenterImage.

You could also do somehting like this:

grd.AddIndex(); this column will hold keys (and it will be invisible)
grd.AddColumn(); this column will hold values
grd.AddIndex()
grd.AddColumn

In GridDisplay you can access via parent member neighbours' values. You can also read current position via col, row members.
Hope that will help you somehow Smile

[Updated on: Wed, 21 May 2008 17:45]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: bad align of an optionbutton in gridctrl
Next Topic: GridCtrl - copy all [Feature Request]
Goto Forum:
  


Current Time: Tue Apr 29 19:56:44 CEST 2025

Total time taken to generate the page: 0.01162 seconds