Page 2 of 3

Posted: Mon Sep 04, 2006 11:39 pm
by Sparkie
Excellent work srod! :)

Posted: Mon Sep 04, 2006 11:57 pm
by srod
Thanks Sparkie.

Or would you prefer the new title from now on? :)

Posted: Tue Sep 05, 2006 1:59 am
by Dare
lol. :lol:

Posted: Tue Sep 05, 2006 2:48 am
by Sparkie
You can call me by any name you wish as long as my wife doesn't hold the rights to it...


...that means Jackass and Numb-nuts are off limits here. :wink:

Posted: Tue Sep 05, 2006 5:54 am
by Dare
:lol:

Posted: Tue Sep 05, 2006 8:24 am
by Fangbeast
Sparkie wrote:You can call me by any name you wish as long as my wife doesn't hold the rights to it...


...that means Jackass and Numb-nuts are off limits here. :wink:
Can we call you "late for dinner" or is that too long?

/me falls off the chair laughing like a hyena

Posted: Tue Sep 05, 2006 10:32 am
by srod
:lol:

How about 'dumbass and numb-nuts'? There's a couple of likely characters for a movie I reckon. Parts played by Jim Carrey and myself.

Yep, I can see it now; Leicester square premiere here we come... 8)

Posted: Tue Sep 05, 2006 11:06 pm
by srod
Update (now Beta 2) : - 5 Sept 2006.
2 bugs fixed; one (minor) with the selection box not rendering correctly and one (major) with the detection of clicks within check box cells before a cell had been selected.

Please see the first post for the download link.

Posted: Fri Sep 08, 2006 12:59 am
by srod
Update: - 8 Sept 2006.
1 bug fixed; a redrawing issue when resizing columns whilst a cell in the first row was selected.

Please see the first post for the download link.

Posted: Fri Sep 08, 2006 9:18 pm
by srod
Update: - 8 Sept 2006.
1 bug fixed; when a column was prohibited from being resized, the sizing cursor would occasionally still appear.

Please see the first post for the download link.

I'm now using this library quite heavily and are thus finding the more subtle bugs. Now at beta 3 which I hope should be the last.

:)

Posted: Sun Sep 10, 2006 10:57 am
by kinglestat
I Have tried the egrid and looks really cool.
But I seem to be stuck in a bug or unwanted practice
I am trying to make grid to show and add records in a small database...where the default db entries are static (user cannot change them) but can add additional records. the code below. But when I add a new row to the grid, the

SetGadgetItemText ( #GGrid, gLastRow, Str ( gLastRow ), 1 )
SetGadgetItemText ( #GGrid, gLastRow, "bobby", 2 )
SetGadgetItemText ( #GGrid, gLastRow, "coulthard", 3 )

dont work

any clues ?


Procedure.l MyCellCallBack ( egrid, uMsg, *cellinfo.egridCellInfo )

Protected result

Select uMsg

Case #egrid_NotifyCellType

;If ( *cellinfo\column = 1 ) Or ( *cellinfo\row < #ValidationCount )
If ( *cellinfo\row < #ValidationCount )
*cellinfo\celltype = #egrid_StaticString
EndIf

Case #egrid_cellupdated

result = #True

Case #egrid_FormatCell

;*cellinfo\font = FontID(1)

If ( *cellinfo\row % 2 )
*cellinfo\backcolour = $E1282B ; Dark blue
*cellinfo\forecolour = $E7FDDE ; Light grey
Else
*cellinfo\backcolour = $898989 ; Grey
*cellinfo\forecolour = $21F6F7 ; Yellow

;*cellinfo\backcolour = $D1E92E ; Cyan
;*cellinfo\forecolour = $39F7F3 ; Yellow
EndIf

If *cellinfo\column = 1
*cellinfo\textjustification = #egrid_CenterText
EndIf

Default

result = #True

EndSelect

ProcedureReturn result

EndProcedure


Procedure ValidationPanel ()

Protected RS.SQLite3_Recordset
Protected sSQL.s
Protected i.l

If IsGadget ( #GContainer )
FreeGadget ( #GContainer )
EndIf

gActiveWindow = #MNUValidation
gLastRow = 0

ContainerGadget ( #GContainer, #AppMyX, #AppMyY, #AppMySizeX - ( 2 * #AppMyX ), #AppMySizeY - 54, #PB_Container_Raised )
;ContainerGadget ( #GContainer, #AppMyX, #AppMyY, #AppMySizeX - ( 2 * #AppMyX ), #AppMySizeY - 54, #PB_Container_Double )

egrid_CreateGrid ( #GGrid, #AppMyX, #AppMyY, ( #AppMySizeX - ( 2 * #AppMyX ) ) - 20, #AppMySizeY - 94, 18, #PB_ListIcon_GridLines, #egrid_ResizeColumnsTrue )
egrid_CreateCellCallback ( #GGrid, @MyCellCallBack() )
ButtonGadget ( #GAddButton, #AppMyX, #ButtonPosY, #ButtonSizeX, #ButtonSizeY, "Add Record" )
ButtonGadget ( #GDelButton, #AppMyX + 100, #ButtonPosY, #ButtonSizeX, #ButtonSizeY, "Delete Record" )

AddGadgetColumn ( #GGrid, 1, "ID", 40 )
AddGadgetColumn ( #GGrid, 2, "Description", 100 )
AddGadgetColumn ( #GGrid, 3, "Data", 300 )

sSQL = "SELECT id, description, data from validation order by id"

If SQLite3_GetRecordset ( sSQL, dbHandler, @RS )

If RS\Handle

i = 0

While RS\EOF = 0

AddGadgetItem ( #GGrid, -1, "" )

SQLite3_GetRecordsetValueByName ( "id", @RS )
SetGadgetItemText ( #GGrid, i, RS\sValue, 1 )
SQLite3_GetRecordsetValueByName ( "description", @RS )
SetGadgetItemText ( #GGrid, i, RS\sValue, 2 )
SQLite3_GetRecordsetValueByName ( "data", @RS )
SetGadgetItemText ( #GGrid, i, RS\sValue, 3 )

SQLite3_RecordsetMoveNext ( @RS )
i + 1

Wend

gLastRow = i

EndIf

Else
MessageRequester ( MyAppName, SQLite3_GetLastMessage() )
EndIf


;CloseGadgetList () ; remarked as I'm not sure if should b eenabled or not

EndProcedure


and when Add button pressed

gLastRow + 1
AddGadgetItem ( #GGrid, gLastRow, "" )
SetGadgetItemText ( #GGrid, gLastRow, Str ( gLastRow ), 1 )
SetGadgetItemText ( #GGrid, gLastRow, "bobby", 2 )
SetGadgetItemText ( #GGrid, gLastRow, "coulthard", 3 )



cheers

Terence

Posted: Sun Sep 10, 2006 11:20 am
by srod
Well you haven't supplied me any code that I can actually run!

The only thing that immediately comes to mind, is the value of #ValidationCount. Now this is a fixed, immutable value and it seems to me that this could cause some problems.

If poking around with this doesn't help, then you might have to pm me, to e-mail me the entire code, sqlite database as well.

Incidentally, egrid 3 is going to be trashed very soon as egrid 4 (a complete rewrite which should be compatible with all existing code) will hit the decks within the next day or so.
egrid 3 is based on old code which is creaking and groaning under the weight of all the dirty scumy hacks!

I'll have a go at integrating your callback in some code of mine to see if I can get it working.

**EDIT:
I've just run some almost identical code and it works fine. I really think that the value of #ValidationCount is causing all cells to be static.

Posted: Sun Sep 10, 2006 11:41 am
by kinglestat
geez
you had already answerred
I wanted to post before so you dont waste any time
sorry about that
actually bug is in my code

I was modifieng on the wrong line....ie I was adding lastrow before updating the text gadget

AddGadgetItem ( #GGrid, -1, "" )
SetGadgetItemText ( #GGrid, gLastRow, Str ( gLastRow + 1 ), 1 )
gLastRow + 1

I realized after I wrote the delete code

cheers

Terence

Posted: Sun Sep 10, 2006 11:47 am
by srod
:)

Posted: Fri Sep 15, 2006 5:39 pm
by drahneir
Hello Stephen,

I have integrated egrid in my application and it is very impressive. There are only two things which I have mentioned:

Does 'HideGadget()' work properly? Here it seems to be a grey box after this command, and unfortunately my window is not grey :lol: .

And I did not have success yet with right mouseclick, which should cause the egrid to disappear.

But besides this it is a great work.