EsGRID grid gadget 2.1. Don't post here!

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Update. EsGRID version 1.1 - 12th Nov 2007.

Version 1.1 of EsGRID (please ignore the previous indexing which related to egrid and not EsGRID) is quite a large update.

Fixed a few few minor bugs and added some subtle refinements to things like grid alignment etc. The major changes come with button type cells and combo box (not editable combo boxes) type cells.

Changes to cells of type #egrid_Button :
There are now two styles of command button; 'standard' and 'flat'. This is communicated through a CellCallback function. You can also now alter the button dimensions. That is the buttons no longer have to fill the entire cell etc.

Changes to cells of type #egrid_ComboBox :
With the 'traditional' combo boxes, a row height setting for the EsGRID which is too narrow for the underlying font can cause the combo box controls to overlap neighbouring cells.
By setting the egrid creation flag #egrid_NoComboBoxOutlines (this is a 'further styles' flag) all combo box type cells will not display the main outline of the combo box control, but will instead display only the downward scroll button. Furthermore this button will be sized so that it DOES NOT overlap neighbouring cells no matter how narrow the row heights etc.

Very useful for grids with very narrow rows.

See the user guide for further details.
Last edited by srod on Mon Nov 12, 2007 4:40 pm, edited 1 time in total.
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 »

srod wrote:**EDIT : please take care with the install whilst I bully Thorsten into making an alteration to EasySETUP! :twisted: Make sure you point the setup program to your PB installation folder when installing.
*** fixed ***
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 »

The EsGRID libraries have been taken down pending a new update - version 1.2.

This should be uploaded within the hour.

:)
I may look like a mule, but I'm not a complete ass.
Flaming Amoeba

Post by Flaming Amoeba »

srod wrote:The EsGRID libraries have been taken down pending a new update - version 1.2.
A new update? You spoil us. Now, to track down my reg info... :lol:
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Flaming Amoeba wrote:A new update? You spoil us. Now, to track down my reg info... :lol:
:lol:
I may look like a mule, but I'm not a complete ass.
Flaming Amoeba

Post by Flaming Amoeba »

I only have 34 unmarked and uncataloged DVD backups to search through :roll:
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

E-mail me if you need a reminder of your reg code.
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. EsGRID version 1.2.

Hot on the heels of the 1.1 release, comes version 1.2 !

This version adds a new type of cell, namely a custom cell.

Such cells are the responsibility of the host application to paint etc. Basically, when such cells are about to be rendered by the EsGRID library, a message (egrid_PaintCustomCell) is sent to the CellCallback function (if defined). Here, the host application is asked to paint 'off screen' to an image which is passed by the EsGRID library to the CellCallback function. The image is sized exactly to fit the cell being painted and has also been 'filled' with the background colour specified by the egrid_FormatCell message (which may involve a gradient fill of course).

The host application can of course choose not to perform any painting, in which case just the background image is displayed within the underlying cell.

Such cells are of course 'static' in that the user cannot readily edit them (although this can be gotten around with some 'creative' programming on the part of the developer! :wink: )

NOTES.
  • If you are thinking that these new custom type cells are equivalent to cells of type egrid_Bitmap, then rest assure -they are not! For example, an application utilising an EsGRID using 1000 cells of type egrid_Bitmap would require storage for up to 1000 bitmaps. On the other hand, the same application using 1000 custom cells would require storage for precisely 0 bitmaps as they remain the sole responsibility of the EsGRID library which destroys them immediately after rendering individual cells!
  • With regard to these custom cells. the dll versions of the EsGRID library operates slightly differently than the Purebasic static library version in that the dll versions will pass the bitmap handle of the 'off screen' image whilst the static library version will pass the Purebasic image# etc. This means that users of the static library version can use the full range of the Purebasic image library commands when painting to the off-screen image (such as StartDrawing() etc.)
As usual, the user guides are fully up to date.

egrid forum: http://egrid.aceboard.com/
egrid website: http://www.purecoder.net/esgrid.htm


**EDIT - a simple example of using custom cells. Static library version of EsGRID for PB 4.1 only.

Code: Select all

;******************************************************************************************
;'EsGRID' editable grid control. By Stephen Rodriguez.
;******************************************************************************************


;************************************CELLCALLBACK FUNCTION*********************************
;NOTE, THIS IS NOT A PROPER WINDOWS CALLBACK!
Procedure.l MyCellCallBack(egrid, uMsg, *cellinfo.egridCellInfo)
  Protected result, width, height
  Select uMsg

    Case #egrid_NotifyCellType
      If *cellinfo\column = 0
          *cellinfo\celltype=#egrid_CustomCell
      EndIf

     Case #egrid_FormatCell
        If *cellinfo\column = 0
;          *cellinfo\backcolour = $CBCBCB
        EndIf

    Case #egrid_PaintCustomCell
      ;Let's do some custom painting in this cell.
      ;We simply place a box at the center of the cell.
        StartDrawing(ImageOutput(*cellinfo\param))
          Box(*cellinfo\width/2-10,*cellinfo\height/2-10, 20, 20, #Blue) 
        StopDrawing()

    Default 
      result = #True; This accounts for all messages we have decided not to process.
  EndSelect
  ProcedureReturn result
EndProcedure
;******************************************************************************************

If OpenWindow(0,0,0,640,300,"EsGRID demo 9.",#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_Maximize|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))

  ;Create an egrid with resizable columns.
    egrid_CreateGrid(1, WindowWidth(0)/4, WindowHeight(0)/8, WindowWidth(0)/2, WindowHeight(0)/2,48,#egrid_GridLines|#egrid_HeaderDragDrop|#egrid_AlwaysShowSelection, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
    egrid_CreateCellCallback(1, @MyCellCallBack())


  ;Add columns and rows.
    egrid_AddColumn(1,0,"CUSTOM CELLS",120)
    For i = 1 To 10
      egrid_AddColumn(1,-1,"",80) ;Some dummy columns.
    Next
    egrid_AddRows(1,-1, 20) ;20 rows.

  ;Set a few options.
    egrid_SetHeaderHeight(1,40)
    egrid_SetOption(1, #egrid_SelectionBorderWidth, 2)

  Repeat
    EventID = WaitWindowEvent()
  Until EventID = #PB_Event_CloseWindow
EndIf
  
End
I may look like a mule, but I'm not a complete ass.
MrMat
Enthusiast
Enthusiast
Posts: 762
Joined: Sun Sep 05, 2004 6:27 am
Location: England

Post by MrMat »

How do you find the time?! :lol: Excellent work!
Mat
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

MrMat wrote:How do you find the time?! :lol: Excellent work!
Self-employed you see! :wink: Thanks.

Actually, all of the recent updates to EsGRID have been driven by my current work. Particularly the most obscure bug fixes imaginable! At least this way the whole library is getting a good 'road test' as I constantly ransack it and extend it etc.
I may look like a mule, but I'm not a complete ass.
Flaming Amoeba

Post by Flaming Amoeba »

Now that it is in a DLL version is there any chance somebody has converted the wrapper so it can still be used with PB 3.94?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

I doubt it somehow! :)

Why not upgrade to PB 4.1?
I may look like a mule, but I'm not a complete ass.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Keep up the good work -- just registered a copy. I haven't actually tried it yet but plan to soon. Even the chance of it working is worth the price! :-)

Oh, and your forum is pretty broken :

Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Hi Karbon,

have just got in and haven't checked my e-mail as yet but I'll be right on your registration asap.

The forums are nothing to do with me - although I just checked the forums and it let me make a post okay!

There's another EsGRID update in the pipeline. Mainly a bugfix release, but a couple of more refinements have been included. :)
I may look like a mule, but I'm not a complete ass.
Flaming Amoeba

Post by Flaming Amoeba »

Karbon, it is worth every penny. I keep bragging on my golf scoring program I made with it, but esgrid is awesome and has more features than similar controls costing up to $200.00
Post Reply