EsGRID grid gadget 2.1. Don't post here!

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

Post by Poshu »

Hmm (I'm trying to get ready to be looked as a fool), How to use rightclick with Esgrid? There is no such constant as "#Egrid_RightClick" in the callback section T_T
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Code: Select all

#egrid_ContextMenu
:wink:
I may look like a mule, but I'm not a complete ass.
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

Post by Poshu »

I knew I would look stupid >.<;

Thanks!
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Poshu wrote:I knew I would look stupid >.<;

Thanks!
I wouldn't worry about that; with my trousers on back to front and pulled up to my arm-pits, I always look stupid! :wink:
I may look like a mule, but I'm not a complete ass.
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

Post by Poshu »

srod wrote:I wouldn't worry about that
Yeah, I'm starting to be used to it anyway...

Hey! Question (Mark II): Is there any way to know how many rows are going to be pasted during the next egrid_pastecells()?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Poshu wrote:
srod wrote:I wouldn't worry about that
Yeah, I'm starting to be used to it anyway...

Hey! Question (Mark II): Is there any way to know how many rows are going to be pasted during the next egrid_pastecells()?
Not without examining the clipboard text yourself. Not even EsGRID knows that until it gets stuck into the business of pasting the data!

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.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

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
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

> EsGRID version 1.3.4 - 28th April 2009.
thx for the three month old version :wink:
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.
Image
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

ts-soft wrote:> EsGRID version 1.3.4 - 28th April 2009.
thx for the three month old version :wink:
I uhm don't know what you mean!

srod scuttles away whilst whistling to himself...

:wink:
I may look like a mule, but I'm not a complete ass.
nemo.lechat
New User
New User
Posts: 6
Joined: Fri Dec 05, 2008 7:18 am
Location: FRANCE

Post by nemo.lechat »

Hi, I've been using Esgrid for a few monthes and i think it's a great app !

But I have a small problem: I need to have a cell where I can verticaly scroll inside the cell if there are a few lines of text.

Is this possible ?

PS: I'm using #egrid_MultiLineText at the creation of the grid.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Sorry, no that is not possible.
I may look like a mule, but I'm not a complete ass.
nemo.lechat
New User
New User
Posts: 6
Joined: Fri Dec 05, 2008 7:18 am
Location: FRANCE

Post by nemo.lechat »

:cry:
Too bad.....I really needed it !
I'll have to find another way to do it... maybe using a listbox inside a cell is possible ?
Anyone have a suggestion ?

/me scratching his head
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

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.
I may look like a mule, but I'm not a complete ass.
nemo.lechat
New User
New User
Posts: 6
Joined: Fri Dec 05, 2008 7:18 am
Location: FRANCE

Post by nemo.lechat »

Thank you for the answer !
I'll have to find anotherway to see a few lignes of text (maybe tooltips..)
:o
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Post by HeX0R »

Hi srod,

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
or did i miss something?
Post Reply