Page 19 of 23
Posted: Tue Sep 01, 2009 10:34 am
by srod
Fixed. Download version 1.3.5.
Thanks for the report.
Posted: Tue Sep 01, 2009 10:41 am
by HeX0R
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

Posted: Tue Sep 01, 2009 10:52 am
by srod
[Edit3]
What the deuce...

Posted: Wed Sep 02, 2009 2:29 pm
by captain_skank
Any way to center an icon within a cell ??
Also, not sure if this is a pb or esgrid peculiarity but using rgb colour values e.g. $ff0000 is not working properly. At the moment it appears bgr so red is $0000ff.
An excelent grid though.

Posted: Wed Sep 02, 2009 2:47 pm
by srod
Icons are automatically centered. Just set the width and height that you would like the icon displayed in the cellcallback and that should be it.
Posted: Wed Sep 02, 2009 3:43 pm
by captain_skank
my bad - had some text in the cell as well.

Posted: Wed Sep 02, 2009 4:29 pm
by srod
I don't see how that would effect matters. If you set the cell's type to #egrid_Icon then any cell text is ignored. You can store text in the cell and retrieve it again, but it will not effect the rendering of the icon.
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Posted: Thu Sep 24, 2009 3:10 pm
by ebs
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
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Posted: Thu Sep 24, 2009 5:22 pm
by srod
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.

Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Posted: Thu Sep 24, 2009 8:07 pm
by srod
@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?
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Posted: Thu Sep 24, 2009 9:05 pm
by ebs
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
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Posted: Thu Sep 24, 2009 9:13 pm
by srod
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.
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Posted: Thu Sep 24, 2009 9:23 pm
by ebs
srod,
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)
Posted: Fri Sep 25, 2009 12:37 pm
by srod
25th September 2009 EsGRID 1.4.0 for PB 4.3 / 4.4.
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.
http://www.nxsoftware.com
Re: EsGRID grid gadget 1.3.4. (Compiles with PB 32 and PB 64)
Posted: Mon Oct 05, 2009 9:21 am
by zikitrake
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
Code: Select all
Procedure.i egrid_listiconcallback(hwnd, uMsg, wParam, lParam)
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: