Sorry for my bad describing. YES I m speaking about your last scenario. When you click the cell, the whole text is selected. Thats great, because I can start to edit without moving cursor.srod wrote: Do you mean that instead of a double click to edit a cell we use a siingle click? Or do you mean that when a cell is first edited, rather than place the caret at the end of the text, we select the whole text? Either is simple to add.
Editing cells in ListIcons (updated for Vista)
Simply comment out (or remove completely) the line :
in the _LIEeditProc() procedure.

Code: Select all
SendMessage_(hWnd, #EM_SETSEL, -1,0)

I may look like a mule, but I'm not a complete ass.
Numeric only cell
Hi,
Thanks for this very useful utility, I have to finish a demo program this week and your utility has just cut 25% off the job... great. I have added code to limit which columns can be eddited (as per your comments) All I need now is to restrict some columns to numeric only. Can you give me a hint please.
Best regards,
RichardL
PS: Why does the sun come out when I need an excuse to write code?
Thanks for this very useful utility, I have to finish a demo program this week and your utility has just cut 25% off the job... great. I have added code to limit which columns can be eddited (as per your comments) All I need now is to restrict some columns to numeric only. Can you give me a hint please.
Best regards,
RichardL
PS: Why does the sun come out when I need an excuse to write code?
Re: Numeric only cell
Just add a #WM_CHAR handler to the _LIEeditProc() procedure. E.g. the following will only allow the user to enter numeric characters in column 1 (any character in other columns) :RichardL wrote:All I need now is to restrict some columns to numeric only. Can you give me a hint please.
Best regards,
RichardL
PS: Why does the sun come out when I need an excuse to write code?
Code: Select all
Case #WM_CHAR
;For cells in column 1, only allow numeric characters.
If *liedit\subitem <> 1 Or (wParam>=48 And wParam<=57)
result=CallWindowProc_(oldwinproc, hWnd, uMsg, wParam, lParam)
EndIf
I may look like a mule, but I'm not a complete ass.
Hmm, it's impossible to use a backspace key in such cellsrod wrote: Just add a #WM_CHAR handler to the _LIEeditProc() procedure. E.g. the following will only allow the user to enter numeric characters in column 1 (any character in other columns) :
Code: Select all
Case #WM_CHAR ;For cells in column 1, only allow numeric characters. If *liedit\subitem <> 1 Or (wParam>=48 And wParam<=57) result=CallWindowProc_(oldwinproc, hWnd, uMsg, wParam, lParam) EndIf

Nothing's impossible :klaver wrote:Hmm, it's impossible to use a backspace key in such cell
Code: Select all
Case #WM_CHAR
;For cells in column 1, only allow numeric characters.
If *liedit\subitem <> 1 Or (wParam>=48 And wParam<=57) Or wParam=8
result=CallWindowProc_(oldwinproc, hWnd, uMsg, wParam, lParam)
EndIf

I may look like a mule, but I'm not a complete ass.
Update: 08/07/08. Vista compatible.
Getting this to run on Vista required a couple of dirty hacks as we are doing something here which Windows (especially Vista) is set up to prevent!
In fact, earlier version of Windows are also set up to prevent us moving the edit control reserved for editing labels (column 0) in order to edit other cells - it's just that the prevention fails! Not on Vista (with XP themes enabled) however!
I'll not bore you with the details of the evil hacks - suffice to say that I have tested on XP and Vista and everything seems okay. I am suspicious that the edit control alignment will be out on Win Server 2003, but this is easily fixed if it proves to be the case.
Code is in the first post.
Getting this to run on Vista required a couple of dirty hacks as we are doing something here which Windows (especially Vista) is set up to prevent!

I'll not bore you with the details of the evil hacks - suffice to say that I have tested on XP and Vista and everything seems okay. I am suspicious that the edit control alignment will be out on Win Server 2003, but this is easily fixed if it proves to be the case.
Code is in the first post.
I may look like a mule, but I'm not a complete ass.
Well, the thing is that the original column zero has been blanked out because it is somewhat badly behaved when attempting to edit cells. The first column you see in the example is in fact column 1. Thus if you want to highlight a cell in response to a selection then you will have to add that code yourself. This is not necessarily as easy as it sounds, however, depending on how you approach this.
What is easier is to simply apply the #PB_ListIcon_FullRowSelect flag to the listicon. This will of course result in the entire row being highlighted.
What is easier is to simply apply the #PB_ListIcon_FullRowSelect flag to the listicon. This will of course result in the entire row being highlighted.
I may look like a mule, but I'm not a complete ass.