|
|
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Selecting a cell in gridctrl
Selecting a cell in gridctrl [message #12220] |
Fri, 19 October 2007 00:20  |
dmcgeoch
Messages: 52 Registered: November 2006 Location: New Jersey
|
Member |
|
|
Hello,
I am currently writing an application that is displaying the contents of a file in hex and ascii. I am using gridctrl to contain the data. What I am trying to do is allow the user to select a cell in one gridctrl and have the corresponding cell in the other gridctrl be highlighted. Is this possible? I was trying to figure out how to get the cell location and managed to get the row information and get the row selected on the other gridctrl, but I was unable to figure out how to get the column.
Thank you for any help you can give me.
Dave
|
|
|
|
|
|
|
Re: Selecting a cell in gridctrl [message #12237 is a reply to message #12235] |
Sat, 20 October 2007 11:18   |
|
dmcgeoch wrote on Fri, 19 October 2007 19:49 | Where is that function defined? I am using 710-dev1 and the only version of the function is SetCursor(int n). Has there been an update to gridctrl for that function?
Thanks,
Dave
|
Opps, I'm sorry. There is SetCursor0(Point p) which is not public. Sorry for mistake..
Anyway please add for now to gridctrl interface:
void SetCursor(Point p) { SetCursor0(p.x + fixed_cols, p.y + fixed_rows, false); }
I'll add it this in the next dev snapshot.
|
|
|
|
Re: Selecting a cell in gridctrl [message #12272 is a reply to message #12262] |
Mon, 22 October 2007 23:19   |
|
Hi!
There is WhenChangeRow but it is not called when cursor changes position horizontaly. There is also no key callback, but I think I could provide one. I will also add WhenCursorChange. In most cases I use "row mode", that's why grid lacks some callbacks In the meantime (before new dev) you must update grid code manually..
|
|
|
|
|
|
Re: Selecting a cell in gridctrl [message #12449 is a reply to message #12447] |
Thu, 01 November 2007 18:47   |
|
Quote: | The next problem I've run into is I can't seem to force GridCtrl to scroll if the selected cell is off screen. I tried to used the ScrollView function, but it appears to have no effect. I tried all the available variants of ScrollView with no change. Is there something else I am missing?
|
You can use GotTo(int row) method to make the given row visible. There is no method to do the same in horizontal direction however so I will overload GotTo to make it possible.
You can also make public sbx and sby members and use their methods to force scrolling (SetPos). Of course it's not a proper way, but it can temorarly solve your problems.
|
|
|
|
|
Goto Forum:
Current Time: Sun Apr 27 12:54:34 CEST 2025
Total time taken to generate the page: 0.00702 seconds
|
|
|