egrid 4 grid gadget - (static PB library version.)

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Back up and running with a new (as in old) P4 computer. All settings restored - so full service resumed in regards to egrid 4.

:)
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

**UPDATE: 3 October 2006.

Added a threadsafe version to the download section.

Thanks to El-Choni and Gnozal (see one of the above posts for further tips from Gnozal).

http://www.purecoder.net/egrid.htm
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Hi srod

Are there any issues using unicode with this? I enabled the unicode compiler option and tried to compile the demo1.pb file, but got an 'Invalid memory access' error at the egrid_CreateGrid( line. Using unicode is a must for me personally, I hope it's possible.

Please consider implementing shift-tab to go backwards horizontally (opposite of going forwards using tab). Perhaps also Enter to go down (columnar) & shift-Enter to go up. This would make the grid nav nice for keyboard users familiar with Excel.

BTW in the zip file, the res file is actually 'egrid_Resident..res' (2 periods) - is that ok?
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

What mskuma said. :) Or pretty close.

Questions (any solution, API or eGrid, acceptable):

Any way we can add functionality? Eg, trap/report key strokes outside of those enumerated, make certain keys automatically do something (like Shift-Tab go backwards).

Is there a way to let a user resize row height? Detect it and work with it, like a spreadsheet?

How can a cell be coloured to give a 3d look? Eg, make the left hand column cells look like the column headers, or get top/left borders slightly different colour to bottom/right.



And .. unicode support is pretty important, currently crashes as per mskuma's report. Windows XP pro here.


Sorry if I have missed some docs or something obvious. But I am stuck with the brain I currently have, no upgrades available for this old model.


Nice package, worth the $, BTW.
Dare2 cut down to size
thamarok
Enthusiast
Enthusiast
Posts: 282
Joined: Wed Sep 06, 2006 1:37 pm

Post by thamarok »

This is worth the money, under $8 for such a great product is very cool!
Maybe you should think about selling parts of the source code for the real extreme developers 8)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Hi,

sorry for the delay in responding, but my computer is laying in bits at the moment whilst I 'persuade' the dvd writer to behave itself. It seems to have complied! :)

Unicode. At the moment, I don't think Tailbite will create a Unicode lib; although I could modify the Tailbite source again in the same way that I did (thanks to Gnozal) to create a threadsafe version.
To be honest, you'd probably be better off with the source code though if creating a unicode compliant app. I'll look into it.


I'll have a look at the shift tab this weekend. At the minute you can use ctrl/tab to alternate between editing a cell and simply navigating through cells. Combine this with the cursor keys and you can easily tab backwards through the grid.

Dare, I could arrange for every message passed to the list icon to be subsequently (or prior to) passed to the CellCallback function.
Crap, that's a damn fine idea actually; why the hell didn't that occur to me? Again, give me a couple of days as I'm on the move at the mo. :)

As for row height; the only way of changing individual row heights with a listicon is to utilise full owenerdrawn methods. The problem with this is that Windows then requires that I draw entire rows at a time as opposed to individual cells. This takes me down a very wayward path and really demands that I create a grid control not based upon a list icon (this is one for the future!)
As for making the first column appear similar to the header row; 2 options. Either remove the header row (set it's height to zero) and go from there, or wait until I've added button cell-types etc.

:D
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Dare wrote:How can a cell be coloured to give a 3d look?
I'm wondering if we can colour the contents of a particular cell, i.e. either a different colour for the text, or failing that, a different background colour. This would aid in telling a user that a particular cell needs attention. (edit: ok I see it seems possible to do it via a callback, sorry).

I agree with the others - it seems like a good solution & looks like it's worth the pounds, but without unicode support, its appeal will be limited. This is like yet another appeal to get tailbite (or better still real in-IDE support for libs) that are unicode-compatible.
Last edited by mskuma on Sat Oct 07, 2006 9:09 am, edited 1 time in total.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

I'm also wondering how this grid would go with very large number of rows? Has anyone got any reports?

I'm thinking of using this for a unicode app. It has a lot of rows to display. If the performance of displaying a lot of rows is not good (might not be the fault of egrid) I've got an idea to make a little interface widget that would appear on the left. It could be a tall rectangle representing the entire data, and then overlaid on that is a tiny rect which represents the portion you see on the egrid. If you drag the latter rect up or down, the content of the egrid (plus and minus some records) would appear. This might be a good add-on to egrid. I'd also like to make it so one-pixel rows in the tall rect could be coloured to flag some info to the user like 'this row needs attention', so the user's attention could be drawn to it, and drag the latter rect to scroll the dataset into view. If any tips to make it, I'd be glad to hear. Thanks.

[edit: on second thought, it was a dumb idea to suggest this kind of widget be incorporated.. it should be separate.]
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Hi srod,

Glad your DVD writer got the message. Gotta let the hardware know who is boss! :)

The option to resize rows is not important, it is (for me, anyhow) a "nice but not essential" feature. In fact nothing I mentioned is really essential ..

.. except that without unicode I can't use it with one app (or within one suite, more accurately). If you do get it to unicode, it would be great, as I tend to use unicode as default these days, needed or not.

Anyway, looking forward to your next release.



Aside: Respect to anyone who modifies tailbite and wins! :shock:



@mskuma:

Your comments re native lib or obj creation is right on target. Couldn't agree more.
Dare2 cut down to size
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

I'm looking forward to updates too. If it had unicode & reasonable performance for large datasets, I'd sign up. It's a big ask I know.. :wink:

BTW I think most of the vertical grid lines in the demos seem to have an alignment problem, like this one in the first demo. Can it be fixed?

Image
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

With the alignment, I am at the mercy of Windows there. Windows passes the dimensions of the header cell and I am only permitted to draw within there. It's undoubtedly to do with the resizing borders etc. so I don't think there's a lot I can do on that score.

I've added the shift/tab that some have been requesting and it seems to work fine. (Unable to upload at the moment because my development machine has no access to the internet at my current location. Give me a few hours...)

I've tried compiling with unicode (straight forward compilation of source code - no Tailbite) and it just crashes out completely with non-sensical errors. Things like gadgetid's being too large when in fact they are equal to 1 ! Are there any PB issues with unicode that I should be aware of? I ask because my knowledge of unicode is very sketchy! :)

If someone is willing to help with this then I will provide the source code etc. and suitable recompense (if the said person manages to get it to work! :D )
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Have fixed the problem with unicode.

So, providing I can get Tailbite to play ball, we'll soon have a unicode version of the lib.

This will have to wait until tomorrow though. :)
I may look like a mule, but I'm not a complete ass.
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

Problems with 'egrid_SelectedRow()':
If the gadget has not the focus (e.g. click on button 'Delete'), I get always '-1' as result.

Code: Select all

; Click on button 'Delete'
selected = egrid_SelectedRow(#eGridID)
If selected <> -1
  egrid_RemoveRow(#eGridID, selected) 
EndIf
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Not a bug, an inconvenience perhaps.

A while ago a request was made that, whenever an egrid loses focus, then the selection box should be hidden. I made the necessary adjustments.

Consequently, as soon as you hit the delete button, focus is lost, the selection box is removed and egrid_SelectedRow() returns -1 to indicate that there is no selection! :)

How about using a column of checkboxes and those which are checked get deleted when the user hits the delete button etc?

If this is a big problem then I'll reinstate the original functionality, but then the emphasise is on the developer to hide the selection box whenever another control receives the focus.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

REMOVED.
Last edited by srod on Sat Oct 07, 2006 3:38 pm, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
Post Reply