EsGRID grid gadget 2.1. Don't post here!
Boah, that was fast!
Many thanks, that solved it.
One more question:
I realized, when selecting all text of a string-field and pressing the Delete-key, nothing happens, i don't even see a single Msg within my callback.
Is this normal?
[Edit]
O.k., this doesn't happen with the above snippet, have to investigate deeper...
[Edit2]
Ha ha ha
forget this last one, i'm stupid like hell
Many thanks, that solved it.
One more question:
I realized, when selecting all text of a string-field and pressing the Delete-key, nothing happens, i don't even see a single Msg within my callback.
Is this normal?
[Edit]
O.k., this doesn't happen with the above snippet, have to investigate deeper...
[Edit2]
Ha ha ha
forget this last one, i'm stupid like hell

- captain_skank
- Enthusiast
- Posts: 639
- Joined: Fri Oct 06, 2006 3:57 pm
- Location: England
- captain_skank
- Enthusiast
- Posts: 639
- Joined: Fri Oct 06, 2006 3:57 pm
- Location: England
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
srod,
Is it possible to restrict cell selection using the mouse to only one row?
I have successfully used a CellCallback function to trap the initial cell selected by a mouseclick,
but I haven't been able to figure out how to catch the cells selected when the user drags the mouse.
Is there a way to get the row/column for each selected cell as the user selects a range of cells?
Thanks,
Eric
Is it possible to restrict cell selection using the mouse to only one row?
I have successfully used a CellCallback function to trap the initial cell selected by a mouseclick,
but I haven't been able to figure out how to catch the cells selected when the user drags the mouse.
Is there a way to get the row/column for each selected cell as the user selects a range of cells?
Thanks,
Eric
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
egrid_GetCellSelection() will allow you to determine the range of cells selected (although you may have to take the column order into account if you have allowed the user to reorder columns etc.)
It is currently not possible to restrict the user's actions whilst engaged in multiple cell selection etc. although you can prevent all such selections etc. I'll have a quick look and see if I can easily implement this. If it's too much work then I am afraid that it will not be implemented any time soon because I am just too busy.
It is currently not possible to restrict the user's actions whilst engaged in multiple cell selection etc. although you can prevent all such selections etc. I'll have a quick look and see if I can easily implement this. If it's too much work then I am afraid that it will not be implemented any time soon because I am just too busy.

I may look like a mule, but I'm not a complete ass.
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
@ebs : right, a quick tinker first revealed a huge problem with EsGRID and PB 4.4 which has taken me 3 hours to get to the bottom of and fix!
Second, yes I can implement what you are asking and we basically have two choices.
The easiest option is that I add a creation flag to EsGRID; something like #egrid_SingleRowCellSelection (and one for columns) which will then prevent the user selecting cells beyond those in the initial row etc. This option requires about 6 lines of code!
The second option is a new CellCallback message which fires whenever the multiple-cell selection changes through user action. This message would inform you about the range of cells the user is attempting to select and give you the opportunity to refuse/alter the selection (within reason). This would involve quite a bit of work (not a massive amount though).
The reason I ask your opinion here is because I do not like the second option for one reason alone; namely that it could slow things down massively. Imagine the user clicking a cell and sweeping the mouse off of the screen. This would result in a barrage of messages being sent to your callback whilst EsGRID sought your permission to highlight the cells as the selection rapidly changed. This is on top of all the other messages being sent whilst the grid is continually repainted because of all the scrolling / selection etc. There would be a right old backlog of messages!
How do you feel about the first option? Would it be enough for your purposes?

The easiest option is that I add a creation flag to EsGRID; something like #egrid_SingleRowCellSelection (and one for columns) which will then prevent the user selecting cells beyond those in the initial row etc. This option requires about 6 lines of code!

The second option is a new CellCallback message which fires whenever the multiple-cell selection changes through user action. This message would inform you about the range of cells the user is attempting to select and give you the opportunity to refuse/alter the selection (within reason). This would involve quite a bit of work (not a massive amount though).
The reason I ask your opinion here is because I do not like the second option for one reason alone; namely that it could slow things down massively. Imagine the user clicking a cell and sweeping the mouse off of the screen. This would result in a barrage of messages being sent to your callback whilst EsGRID sought your permission to highlight the cells as the selection rapidly changed. This is on top of all the other messages being sent whilst the grid is continually repainted because of all the scrolling / selection etc. There would be a right old backlog of messages!
How do you feel about the first option? Would it be enough for your purposes?
I may look like a mule, but I'm not a complete ass.
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
srod,
Thanks for your fast reply!
Yes, the creation flags approach would probably be sufficient for what I need,
and I agree about the "message overload" that could result with the callback method.
But, as long as you're in a generous mood
Would it be possible to make the "SingleRowCellSelection" and "SingleColumnCellSelection"
flags able to be changed at run-time?
Regards,
Eric
Thanks for your fast reply!
Yes, the creation flags approach would probably be sufficient for what I need,
and I agree about the "message overload" that could result with the callback method.
But, as long as you're in a generous mood

Would it be possible to make the "SingleRowCellSelection" and "SingleColumnCellSelection"
flags able to be changed at run-time?
Regards,
Eric
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Okay, I'll finish it tomorrow. It turns out to be a little more complex than I thought (more than 6 lines of work!
) but it shouldn't take long.
What I will do then is not use a creation flag, but an option which we set with egrid_SetOption(). Actually this makes more sense in this case anyhow. The default will be for full cell selection, but then you will be able to select between full cell selection, selection within a single row, selection within a single column or no selection at all. This can of course be changed at run-time etc.
That should do it.

What I will do then is not use a creation flag, but an option which we set with egrid_SetOption(). Actually this makes more sense in this case anyhow. The default will be for full cell selection, but then you will be able to select between full cell selection, selection within a single row, selection within a single column or no selection at all. This can of course be changed at run-time etc.
That should do it.
I may look like a mule, but I'm not a complete ass.
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
srod,
Thank you!
Please let me know when the new version is available.
Regards,
Eric
Thank you!
Please let me know when the new version is available.
Regards,
Eric
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
25th September 2009 EsGRID 1.4.0 for PB 4.3 / 4.4.
Hi,
Version 1.4.0 of EsGRID has the following changelog :
Hi,
Version 1.4.0 of EsGRID has the following changelog :
- Fixed a major incompatibility between the EsGRID source, Vista and Purebasic 4.4.
- The developer can now specify that multi-cell selections are no longer highlighted with a background color (just with the border). This is achieved through the egrid_SetOption(..., #egrid_SelectedCellsColour, -1) function by specifying the color value to equal -1.
- Have removed the #egrid_ProhibitCellSelection extended style creation flag. Instead, use the egrid_SetOption(..., #egrid_SetCellSelectionRange, value) function with the value parameter set to one of the following :
#egrid_CanSelectAllCells (Default)
#egrid_CanSelectSingleColumnOnly
#egrid_CanSelectSingleRowOnly
#egrid_ProhibitCellSelection
For example, egrid_SetOption(#myEsGRID, #egrid_SetCellSelectionRange, #egrid_CanSelectSingleRowOnly) means that when the user selects a range of cells (through click and drag for example) then he/she can only select cells within the initially selected row etc.
I may look like a mule, but I'm not a complete ass.
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Dear Srod:
Since I'm having problems with EsGRID 1.40 and/or PB 4.40b3, I put a debug line in my 'problematic' procedure
And I get some errors: Invalid Memory access, cells mixed with debug text...
See image from EsGRID demo7.pb:

Sorry for my limited english! :roll:
Since I'm having problems with EsGRID 1.40 and/or PB 4.40b3, I put a debug line in my 'problematic' procedure
Code: Select all
Procedure.i egrid_listiconcallback(hwnd, uMsg, wParam, lParam)
See image from EsGRID demo7.pb:

Sorry for my limited english! :roll:
PB 6.21 beta, PureVision User