IonicWind Software

IWBasic => The Roundtable => Topic started by: sapero on October 22, 2008, 03:32:58 PM

Title: Mini Grid class
Post by: sapero on October 22, 2008, 03:32:58 PM
This is a class which makes possible to easy edit list view cells. Just single click (or double click) makes the cell editable.
The included example program shows also how to change font in one of list view columns.
Title: Re: Mini Grid class
Post by: Haim on October 23, 2008, 12:18:57 AM
Sapero,
Great program!
Thanks for sharing this.

Haim
Title: Re: Mini Grid class
Post by: sapero on October 23, 2008, 10:26:06 AM
Thanks Haim.

I've attached extended version with drag-drop support, build on standard ole interfaces IDataObject, IDropSource and IDropTarget.
There is additional CDragDrop class with just one method StartDragDrop.
Drag-drop is initiated from CApp::OnBeginDrag, fired by list view notification  LVN_BEGINDRAG.

I have also splited the root cases in OnNotify method.
Happy study :)
Title: Re: Mini Grid class
Post by: Ionic Wind Support Team on October 23, 2008, 10:43:48 AM
That's great Sapero. 

You must have a little camera sitting behind me, as I was just working on example drag and drop classes for Emergence using standard ole interfaces. ;)  It will be interesting to compare the two.

Paul.

Title: Re: Mini Grid class
Post by: talun on October 24, 2008, 01:17:17 AM
Sapero, many thanks for the code. I've just a problem during the rebuilding of the project:

Compiling...
main.eba
File: C:\bbb\main.eba (72) Warning: Uninitialized variable: app
grid.eba
......


Hovewer the program starts and seems to work fine.

Any suggestions?

bye

Sergio
Title: Re: Mini Grid class
Post by: Ionic Wind Support Team on October 24, 2008, 01:20:12 AM
Sergio,
It's a warning, not an error.  And can be ignored. 

Paul.
Title: Re: Mini Grid class
Post by: talun on October 24, 2008, 06:24:05 AM
Thank you  :)

Sergio
Title: Re: Mini Grid class
Post by: sapero on October 24, 2008, 02:07:21 PM
The third version displays an insertion mark, and automatically scrolls the list view when needed. All this in dragdrop.src. You find here also autorepeat implementation, which scrolls the listview with full speed after some time.

When you are editing a cell and scroll the list view or mouse wheel, the edit control will now hide. Scrolling events are detected in subclassed listview procedure (grid.src).
Title: Re: Mini Grid class
Post by: LarryMc on January 28, 2009, 12:02:54 PM
Sapero,

How hard would it be to make your Mini Grid windows based instead of dialog based?

Larry
Title: Re: Mini Grid class
Post by: sapero on January 28, 2009, 01:29:39 PM
It's not much work, you'll need to replace CreateDialog with OpenWindow, IDINITDIALOG with IDCREATE, clear WINDOW type before opening the window, return directly the value from OnCustomDraw and from OnNotify, instead saving the return value in DWL_MSGRESULT.
Attached zipped main.eba modified to use a window.
Title: Re: Mini Grid class
Post by: LarryMc on January 28, 2009, 01:32:28 PM
Thanks again, Sapero

Larry