EsGRID grid gadget 2.1. Don't post here!
Not without examining the clipboard text yourself. Not even EsGRID knows that until it gets stuck into the business of pasting the data!Poshu wrote:Yeah, I'm starting to be used to it anyway...srod wrote:I wouldn't worry about that
Hey! Question (Mark II): Is there any way to know how many rows are going to be pasted during the next egrid_pastecells()?
EsGRID assumes that a Chr(13) character delimits the end of a row (as is the case when copying from Excel). So, to get the number of rows, retrieve the clipboard text and then use CountString() (for example) to count the number of occurrences of the Chr(13) character. Then, in the case that the last character pasted does not equal Chr(13), add 1 to this count.
You must remember though that EsGRID discards any data being pasted which would lie outside of the grid; unless you take steps to circumvent this of course.
I may look like a mule, but I'm not a complete ass.
EsGRID version 1.3.4 - 28th April 2009.
Version 1.3.4 of EsGRID fixes several bugs encountered with EsGRID during my work upon the Pyrex report designer. Most of these were related to the Nexus property box control.
This version also adds an additional optional parameter to the egrid_SelectCell() function which allows the developer to specify that the newly selected cell is not scrolled into view (if scrolling would otherwise be required).
http://www.nxsoftware.com
Version 1.3.4 of EsGRID fixes several bugs encountered with EsGRID during my work upon the Pyrex report designer. Most of these were related to the Nexus property box control.
This version also adds an additional optional parameter to the egrid_SelectCell() function which allows the developer to specify that the newly selected cell is not scrolled into view (if scrolling would otherwise be required).
http://www.nxsoftware.com
I may look like a mule, but I'm not a complete ass.
> EsGRID version 1.3.4 - 28th April 2009.
thx for the three month old version
thx for the three month old version

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

-
- New User
- Posts: 6
- Joined: Fri Dec 05, 2008 7:18 am
- Location: FRANCE
-
- New User
- Posts: 6
- Joined: Fri Dec 05, 2008 7:18 am
- Location: FRANCE
EsGRID is really not geared towards allowing the user to embed arbitrary controls within a grid. This would really require a completely different approach to the grid control itself. Not even pulling out my huge bag of dirty tricks would be of much use with EsGRID as it does have to remain firmly within the bounds of a Windows ListView control upon which it is based.
Generally speaking there are two means of implementing a custom grid; that taken by Excel for example (which uses two controls to implement just the basic grid) and those used by what I would call more traditional grid controls (EsGRID lies within this second categeory by default because of the fact it is based upon a Windows ListView - even though it does utilise a separate header control) in which a single control is used housing both header cells and non-header cells (forget the Windows header control for the moment). Only grids utilising an inner control to house just the non-header cells (such as Excel) can easily allow the user to embed arbitrary controls etc. All other grids have to adopt all kinds of dirty tricks and, in the case of EsGRID, is just not really viable.
I know of at least one person who has successfully managed to embed a calendar control within an EsGRID, but the situation was such that there were certain factors which allowed for the entire process to be simplified, something which will not hold in general, even for calendar controls.
I am currently working on a new grid control (as I am in need of some features which EsGRID cannot ever offer) but not even this new control will allow us to embed arbitrary controls.
Generally speaking there are two means of implementing a custom grid; that taken by Excel for example (which uses two controls to implement just the basic grid) and those used by what I would call more traditional grid controls (EsGRID lies within this second categeory by default because of the fact it is based upon a Windows ListView - even though it does utilise a separate header control) in which a single control is used housing both header cells and non-header cells (forget the Windows header control for the moment). Only grids utilising an inner control to house just the non-header cells (such as Excel) can easily allow the user to embed arbitrary controls etc. All other grids have to adopt all kinds of dirty tricks and, in the case of EsGRID, is just not really viable.
I know of at least one person who has successfully managed to embed a calendar control within an EsGRID, but the situation was such that there were certain factors which allowed for the entire process to be simplified, something which will not hold in general, even for calendar controls.
I am currently working on a new grid control (as I am in need of some features which EsGRID cannot ever offer) but not even this new control will allow us to embed arbitrary controls.
I may look like a mule, but I'm not a complete ass.
-
- New User
- Posts: 6
- Joined: Fri Dec 05, 2008 7:18 am
- Location: FRANCE
Hi srod,
it seams since 1.3.4 the "single click select" is no more functional?
Taken directly from help file:
or did i miss something?
it seams since 1.3.4 the "single click select" is no more functional?
Taken directly from help file:
Code: Select all
XIncludeFile "EsGRID.pbi"
Procedure.l MyCellCallBack(egrid, uMsg, *cellinfo.egridCellInfo)
Protected result
Select uMsg
Case #egrid_SelectCell
;Check whether the cell was selected using the mouse.
If *cellinfo\param = #egrid_LeftClick
egrid_HideEdit(egrid) ;Hides the selection border.
egrid_SelectCell(egrid, *cellinfo\column, *cellinfo\row, #True) ;Selects the cell in 'edit mode'.
result = #False ;No point getting the Egrid to select the cell as well.
Else
result = #True
EndIf
Case #egrid_NotifyCellType
*cellinfo\celltype = #egrid_String
*cellinfo\text = ""
Default
result = #True ;Ensures default processing for those messages we do not process.
EndSelect
ProcedureReturn result
EndProcedure
OpenWindow(0, 0, 0, 300, 300, "", $C8001)
egrid_CreateGrid(0, 5, 5, 495, 500, 18, #egrid_NoHeaderButtons | #egrid_GridLines, #egrid_ResizeColumnsTrue | #egrid_RequestCellTooltips)
egrid_SetHeaderHeight(0, 22)
egrid_CreateCellCallback(0, @MyCellCallBack())
egrid_AddColumn(0, 0, "aaa", 100)
egrid_AddColumn(0, 1, "bbb", 90)
egrid_AddColumn(0, 2, "ccc", 100)
egrid_AddRows(0, -1, 50)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow