Egrid 3.0 grid control (replaced by egrid 4)

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 »

Ah, that's a good point; HideGadget() will not function properly on an egrid. :)

egrid 3 is effectively obsolete as egrid 4 will be a complete replacement. It is looking a lot better at the moment. A few more days before a beta release is viable though.

In the meantime, the following should (untested) hide an egrid:

Code: Select all

HideGadget(egrid_containerID(egrid#))
I may look like a mule, but I'm not a complete ass.
drahneir
Enthusiast
Enthusiast
Posts: 105
Joined: Tue Jul 18, 2006 4:18 pm
Location: JO42RM

Post by drahneir »

Yes, it works fine. Thanks.
drahneir
Enthusiast
Enthusiast
Posts: 105
Joined: Tue Jul 18, 2006 4:18 pm
Location: JO42RM

Post by drahneir »

Well, the RightClick does not work with my egrid.
But with EasyVent it works like a charme.
Thanks again.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Hey Srod, great stuff you got here! Thanks!

I must ask you something as i can't get it myself*. Well, i add rows in an egrid when the user presses a button (using addgadgetitem). I have a remove button too but when i try to delete the last row, it scrambles, and the last selected cell still remains in the egrid. To delete the rows i use:

Code: Select all

   Row = egrid_SelectedRow(31)
   If Row <> -1
      RemoveGadgetItem(31,Row)
   EndIf
What can i do to cleanly delete each selected row when the user presses 'remove'?

* = as allways :P
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Hi,

I'm aware there's problems when deleting rows. One reason why egrid 4 is about to hit the shelves; a complete rewrite. Could be here later tonight.

For now, try the following (haven't the time to test I'm afraid):

use egrid_HideEdit() to remove the selection box, then delete the row.
Finally, if the egrid is now empty (check CountGadgetItems etc.) then force a repaint of the egrid.

Something like:

Code: Select all

egrid_HideEdit(#grid)
RemoveGadgetItem(#grid, item)
If CountGadgetItems(#grid)=0
  InvalidateRect_(GadgetID(#grid), 0)
  UpdateWindow_(GadgetID(#grid))
EndIf
See if this works?
I may look like a mule, but I'm not a complete ass.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Thank you for your time, that did the trick :). Looking forward to see egrid4 :). Success ;).
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Post Reply