Page 20 of 25
Posted: Thu Nov 30, 2006 2:49 pm
by srod
30th November 2006.
Release version 1.4 now available.
A bug with using PURELVSort has been fixed.
Also, a new command added:
egrid_HasSelectedCellChanged()
The use of this command should be obvious.
This was added to assist a current user of egrid etc.
http://www.purecoder.net/egrid.htm

Posted: Thu Jan 11, 2007 8:06 pm
by ts-soft
how can i autoresize the header?
Code: Select all
PureLVSORT_SetLastColumnAutoResize(#egrid, #True)
doesn't work (Custom Header)
regards
thomas
Posted: Thu Jan 11, 2007 10:34 pm
by srod
I can confirm a 'problem' (not just with the custom header), but I am finding the same problems when using a basic listicon instead of an egrid.
Actually, I am not sure this is a problem. As soon as the last column is smaller than the header text, it stops resizing automatically. Now this seems reasonable and is definitely at the heart of the behaviour I am seeing with listicons and egrids.
Now with an egrid, because of the custom drawing involved with the header, the problem is made apparent a little earlier than with listicons. Nothing serious though.
If you're using vertical text in the header, then this problem will be exacerbated.
In short this is just one of those Windows things.
I've looked at the PureLV source code and can see nothing wrong at all. In fact it's pure class!

Posted: Thu Jan 11, 2007 11:55 pm
by ts-soft
Is there a other way to resize a column?
It looks bad without resize the column

Posted: Fri Jan 12, 2007 12:53 am
by srod
You can use:
Code: Select all
SendMessage_(GadgetID(#egrid), #LVM_SETCOLUMNWIDTH, egrid_NumberOfColumns(1), #LVSCW_AUTOSIZE_USEHEADER)
but this gives identical results to PureLVSORT, confirming that there really is nothing wrong.
All we're seeing is the normal Windows behaviour when resizing the last column etc.
Unless of course you've found something else which I haven't yet come across?
One thing comes to mind, namely there could be a problem with resizing the last column if you allow the user to reorder the columns by dragging etc. If this happens you may not be able to identify the column index of the last column etc.
I don't know if PureLVSORT takes account of this? Egrid does in that it will identify the index of the last column if you ask it to.
So, before using the above SendMessage_(), you should take steps to identify which column is actually last. For this, use the egrid_GetColumnOrderArray() function.
Posted: Fri Jan 12, 2007 3:05 am
by ts-soft
with sendmessage it works
thank you
Posted: Fri Jan 12, 2007 11:38 am
by srod
Glad it works.
Thanks to the testing with the resizing columns, I've found a slight redrawing bug when a non-themed application is created so I'll have to try and fix this.
Expect an update soon.
Posted: Fri Jan 12, 2007 12:55 pm
by srod
12th January 2007.
Release version 1.5 now available (minor bug-fix update).
When creating non xp-themed applications, there would be a 'stray' row of pixels between the header and the first row of the grid which wasn't being erased correctly.
Fixed.
Have also updated the manual to include the resizing 'tip' above.
http://www.purecoder.net/egrid.htm

Posted: Fri Jan 12, 2007 4:14 pm
by srod
12th January 2007.
My apologies to those who have already downloaded the new version as I discovered another bug (related to the above one).
It's now fixed for version 1.5.1 and ready to download.
http://www.purecoder.net/egrid.htm
Posted: Wed Jan 17, 2007 12:13 am
by Q*bert
eGrid is wonderfully flexible.
Is there a way to highlight the selected row rather than the selected cell?
Posted: Wed Jan 17, 2007 12:24 am
by srod
Thanks. I'm glad you like it.
If by highlight the selected row you mean colour it, then the following shows one way.
Code: Select all
Procedure.l MyCellCallBack(egrid, uMsg, *cellinfo.egridCellInfo)
Protected result
Select uMsg
Case #egrid_SelectCell
;Here we arrange for the selected row to be coloured.
;This requires a complete redraw of the egrid.
;The actual colouring has to be notified in the #egrid_FormatCell message below.
result=#True
RedrawWindow_(GadgetID(1), 0, 0, #RDW_INTERNALPAINT|#RDW_ERASE|#RDW_INVALIDATE)
Case #egrid_LosingFocus
;As part of colouring the selected row, we must arrange to clear these
;colours whenever the selection box is removed.
;The actual colouring has to be notified in the #egrid_FormatCell message below.
result=#True
RedrawWindow_(GadgetID(1), 0, 0, #RDW_INTERNALPAINT|#RDW_ERASE|#RDW_INVALIDATE)
Case #egrid_FormatCell
If *cellinfo\row<>-1 And *cellinfo\row=egrid_SelectedRow(1)
*cellinfo\backcolour = $A5F4F9
EndIf
Default
result = #True ;This accounts for all messages we have decided not to process.
EndSelect
ProcedureReturn result
EndProcedure
;******************************************************************************************
;*************************************WINDOW + GADGET LIST*********************************
If OpenWindow(0,0,0,640,300,"egrid - colour selected row.",#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_Maximize|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
;******************************************************************************************
;********************************************EGRID*****************************************
;Create an egrid with resizable columns.
egrid_CreateGrid(1, WindowWidth(0)/4, WindowHeight(0)/8, WindowWidth(0)/2, WindowHeight(0)/2,26,0, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
;******************************************************************************************
egrid_CreateCellCallback(1, @MyCellCallBack())
egrid_SetHeaderHeight(1, 26)
egrid_SetOptions(1, -1, #Black, 2, -1) ; gadgetnum, header border colour, selection border colour, selection border width, gridline colour
;***************************************ADD COLUMNS AND ROWS TO EGRID**********************************
egrid_AddColumn(1,0,"",60)
For b=1 To 4 ;50 columns.
egrid_AddColumn(1,b,"Col " + Str(b-1),60)
Next
For b=0 To 99 ; Add 100 rows.
egrid_AddRow(1,-1)
Next
;*****************************************EVENT LOOP***************************************
Repeat
EventID = WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
Until EventID = #PB_Event_CloseWindow
EndIf
End

Posted: Wed Jan 17, 2007 9:34 pm
by ts-soft
How can i get a checkboxclick (TRUE/FALSE), without selecting bei user?
Posted: Wed Jan 17, 2007 9:53 pm
by srod
Sorry, I'm not sure I understand?
Do you wish to set the checkmark from code?
Posted: Wed Jan 17, 2007 9:56 pm
by ts-soft
No, i will capture the event to actualisizing information. I can found an
callback event that give me the information, that a checkbox has changed.
checkbox can be changed without selection
Posted: Wed Jan 17, 2007 9:57 pm
by merihevonen
Yes that's what he means.
"How can you set a CheckBox mark programmatically"
This is really a wonderful project btw.