Page 2 of 2
Posted: Sun Oct 23, 2005 8:20 pm
by srod
Is it possible automatical activate the cell for editing direct after moving to it? (After selection I have to click on it , before I can insert text.)
When you say,
moving to it, do you mean by clicking the cell only or are you including tabbing into the cell, using cursor keys etc?
It is easy to implement.
Posted: Sun Oct 23, 2005 8:53 pm
by Thorsten1867
I mean tabbing or using cursor keys. ( but I like to activate a cell by one click, too)
I insert text in the first column, go to the next and insert the next text and so on.
Posted: Sun Oct 23, 2005 9:08 pm
by srod
But as soon as a cell is being edited, using the cursor key simply moves the caret within the cell -as it should do, so I wouldn't advise changing this.
However, try making the following adjustment:
- Open the "egrid_KernelFunctions.pb" source file.
- Navigate to the 'egrid_editproc' procedure and find this code
Code: Select all
case #WM_KEYUP
if wParam = #VK_TAB
;Identify the underlying egrid,
ForEach egridList() ;Process all the elements...
If gadgetid(egridList()\stringid) = hWnd : Break : Endif
Next
*pointer = egridList() ;In case some other Windows event alters the linked list to point to another element.
egrid_tabcell(*pointer)
; sendmessage_(hWnd, #EM_SETSEL,len(getgadgettext(*pointer\stringid)),len(getgadgettext(*pointer\stringid)))
activategadget(*pointer\id)
Change to:
Code: Select all
case #WM_KEYUP
if wParam = #VK_TAB
;Identify the underlying egrid,
ForEach egridList() ;Process all the elements...
If gadgetid(egridList()\stringid) = hWnd : Break : Endif
Next
*pointer = egridList() ;In case some other Windows event alters the linked list to point to another element.
egrid_tabcell(*pointer)
sendmessage_(hWnd, #EM_SETSEL,len(getgadgettext(*pointer\stringid)),len(getgadgettext(*pointer\stringid)))
activategadget(*pointer\stringid)
Now, if you are editing a cell (not simply having selected the cell) and press the tab key, then the focus will move to the next cell and you can type straight into the newly selected cell.
I think the only other thing we might add is a similar behaviour with the return key.
Posted: Sun Oct 23, 2005 9:28 pm
by srod
Previus post introduces a slight bug!
I have uploaded a new version (click the link below) which alters the behaviour of the tab and enter keys whilst editing cells.
Thorsten1867: This should be along the lines of what you were requesting.
Regards.
Posted: Sun Oct 23, 2005 9:35 pm
by Thorsten1867
I've tried it. It's works perfect. That's what I need!
Thanks!!!!!!!!!!!!!!!!!!
(You get a place of honour in the credits of my program (KvGS).

)
Posted: Sun Oct 23, 2005 9:48 pm
by srod
What about a percentage of the takings?

Posted: Sun Oct 23, 2005 9:58 pm
by Thorsten1867
srod wrote:What about a percentage of the takings?

Oh, a percentage of nothing?!

The program will be freeware or perhaps donationware.
I'm sorry!

Posted: Mon Oct 24, 2005 12:27 pm
by srod
Good luck with it. Please let me know when it's complete as I'd be interested to see an egrid being used in a proper app.
Regards.
Posted: Mon Oct 24, 2005 1:42 pm
by Thorsten1867
You can work with it already, but I integrate regular new functions.
I can send it to you, but it's german (for german elementary schools).