loading the control isn't a problem. but there are many structs and constants to deal with. i think the one who made RAEdit must be the one who can write out a demo most quickly.
ps: Ketilo does code in VB. He ever wrote a good VB demo of RAEdit which help me a lot. And VB is just sth good. I program with VB and win32 asm together to do most of the jobs. In that way, both efficiency and performance can be guranteed.
Check out my web site:
http://base.3322.org/proemu/
That's my project using RAEdit. (can't see RAEdit in screenshot yet)
ps: Ketilo does code in VB. He ever wrote a good VB demo of RAEdit which help me a lot. And VB is just sth good. I program with VB and win32 asm together to do most of the jobs. In that way, both efficiency and performance can be guranteed.
Check out my web site:
http://base.3322.org/proemu/
That's my project using RAEdit. (can't see RAEdit in screenshot yet)
Hi optimus
Among other things I code in VB for a living.
Here is a VB demo.
KetilO
Among other things I code in VB for a living.
Here is a VB demo.
KetilO
Thanks a lot, KetilO!!!
Hi KetilO. How to set the height of a cell, or can it be set?
And how to know if a certain cell has just been modified?
And how to know if a certain cell has just been modified?
Check out: RaGrid.inc
Try out these messages and notifications!
Hi KetilO. How to set the height of a cell, or can it be set?
And how to know if a certain cell has just been modified?
Try out these messages and notifications!
Hi KetilO. How to set the height of a cell, or can it be set?
GM_GETROWHEIGHT equ WM_USER+32 ;wParam=0, lParam=0
GM_SETROWHEIGHT equ WM_USER+33 ;wParam=0, lParam=nHeight
And how to know if a certain cell has just been modified?
GN_BEFOREEDIT equ 7 ;Sendt before the cell edit control shows
GN_AFTEREDIT equ 8 ;Sendt when the cell edit control is about to close
GN_BEFOREUPDATE equ 9 ;Sendt before a cell updates grid data
GN_AFTERUPDATE equ 10 ;Sendt after grid data has been updated
thanks. but i am using RAGrid in vb. Is it any callback method for notification in RAGrid?
OK, I managed to make a hook proc in vb app to receive the notification from RAGrid. But also found a problem. When receiving GN_AFTERUPDATE, the GRIDNOTIFY.col is the correct column number (it is always 1188).
Hi optimus
Thanks for the bug report. New upload at the top.
Can you post the code for the hook proc?
KetilO
Thanks for the bug report. New upload at the top.
Can you post the code for the hook proc?
KetilO
This is my code to receive notification messages from RAGrid. To avoid the bug I mentioned, I placed two module-wide variables, EditingCol and EditingRow.
I've made the code related with RAGrid a class (RAGrid_Class), mainly based on your vb demo code and expanded a little. The attached file is the class file.
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal HWND As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, ByVal HWND As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const GWL_WNDPROC = (-4)
Private Const WM_NOTIFY = &H4E
Private PrevFuncPointer As Long, EditingCol As Integer, EditingRow As Integer
Private Type NMHDR_TYPE
hwndFrom As Long
idFrom As Long
code As Long
End Type
Private Type GRIDNOTIFY
NMHDR As NMHDR_TYPE
col As Long
row As Long
HWND As Long
lpdata As Long
fcancel As Long
End Type
Public GNotify As GRIDNOTIFY
Public Function WndProc(ByVal HWND As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If Msg = WM_NOTIFY Then
If Not Busy Then
CopyMemory ByVal VarPtr(GNotify), ByVal lParam, Len(GNotify)
Select Case GNotify.NMHDR.code
Case GN_BEFOREUPDATE
EditingCol = GNotify.col
EditingRow = GNotify.row
If EditingCol = 0 Then 'Disable modifying column 0
GNotify.fcancel = 1
CopyMemory ByVal lParam, ByVal VarPtr(GNotify), Len(GNotify)
End If
Exit Function
Case GN_AFTERUPDATE
Select Case GNotify.NMHDR.hwndFrom
Case RAGrid.hGrid
SetRegValue GNotify.lpdata
Case SFRGrid.hGrid
SetSFRValue GNotify.lpdata
End Select
Exit Function
End Select
End If
End If
'Pass the procedure to the default handler
WndProc = CallWindowProc(PrevFuncPointer, HWND, Msg, wParam, lParam)
End Function
Sub SetMsgHook(HWND As Long)
PrevFuncPointer = SetWindowLong(HWND, GWL_WNDPROC, AddressOf WndProc)
End Sub
Sub RemoveMsgHook(HWND As Long)
If PrevFuncPointer <> 0 Then
SetWindowLong HWND, GWL_WNDPROC, PrevFuncPointer
End If
End Sub
I've made the code related with RAGrid a class (RAGrid_Class), mainly based on your vb demo code and expanded a little. The attached file is the class file.
Hi KetilO. Does RAGrid support check box in cell? If not, can u one day implement this?
Hi Optimus
There is the TYPE_CHECKBOX column. For weird things use TYPE_USER column.
KetilO
There is the TYPE_CHECKBOX column. For weird things use TYPE_USER column.
KetilO
I noticed that checkbox in RAGrid is checked by a double-click. can it be changed to a single-click?
I've got several questions.
How to make one column un-editable?
How to make the column name row invisible?
Does RAGrid support full-row-selection, just like a list view control?
And also find function maybe? I think it's useful.
How to make one column un-editable?
How to make the column name row invisible?
Does RAGrid support full-row-selection, just like a list view control?
And also find function maybe? I think it's useful.
Hi Optimus
1. How to make one column un-editable?
2. How to make the column name row invisible?
3. Does RAGrid support full-row-selection, just like a list view control?
4. And also find function maybe? I think it's useful.
1. Cencel the GN_BEFOREEDIT notification.
2. Use GM_SETHDRHEIGHT with height = 0
3. Have a look at STYLE_XX's
4. On my todo list.
KetilO
1. How to make one column un-editable?
2. How to make the column name row invisible?
3. Does RAGrid support full-row-selection, just like a list view control?
4. And also find function maybe? I think it's useful.
1. Cencel the GN_BEFOREEDIT notification.
2. Use GM_SETHDRHEIGHT with height = 0
3. Have a look at STYLE_XX's
4. On my todo list.
KetilO
Thanks!
Is it possible to set fixed column width (can't be sized by user)?
And will RAGrid support hex type?
btw: I found another small bug. When RAGrid lost focus, the selection box doesn't disappear. (I think it should)
Is it possible to set fixed column width (can't be sized by user)?
And will RAGrid support hex type?
btw: I found another small bug. When RAGrid lost focus, the selection box doesn't disappear. (I think it should)
wish HexEd comes with a vb demo too
Hello all.
I want show the current system date in a TYPE_DATE cell
but if I am not wrong is needed convert date to dword format
is true? I am looking for code for convert date to dword and
dword to date formats or there is another better way... ???
Is this the way?
*********************************
; time is a SYSTEMTIME struct
; rdta is a ROWDATA struct
;......
.elseif eax==IDC_BTNADD
invoke GetLocalTime, addr time ; Get current date and time
;..... ; code for date to dword convert
mov eax, code
mov rdta.lpDate, eax
invoke SendMessage, hGrd, GM_ADDROW, 0, addr rdta
invoke SendMessage,hGrd,GM_SETCURSEL,0,eax
invoke SetFocus,hGrd
*********************************
Thanks and I am sorry for mi english, regards from Barcelona.. . :cool:
I want show the current system date in a TYPE_DATE cell
but if I am not wrong is needed convert date to dword format
is true? I am looking for code for convert date to dword and
dword to date formats or there is another better way... ???
Is this the way?
*********************************
; time is a SYSTEMTIME struct
; rdta is a ROWDATA struct
;......
.elseif eax==IDC_BTNADD
invoke GetLocalTime, addr time ; Get current date and time
;..... ; code for date to dword convert
mov eax, code
mov rdta.lpDate, eax
invoke SendMessage, hGrd, GM_ADDROW, 0, addr rdta
invoke SendMessage,hGrd,GM_SETCURSEL,0,eax
invoke SetFocus,hGrd
*********************************
Thanks and I am sorry for mi english, regards from Barcelona.. . :cool:
Hi mnemox
Converting dword to system time:
Converting system time to dword:
KetilO
Converting dword to system time:
;Days since 01.01.1601
mov eax,val
;Convert to number of 100 nano seconds since 01.01.1601
mov ecx,24*60*60
mul ecx
push edx
mov ecx,1000*1000*10
mul ecx
mov ftime.dwLowDateTime,eax
pop eax
push edx
mul ecx
pop edx
add eax,edx
mov ftime.dwHighDateTime,eax
invoke FileTimeToSystemTime,addr ftime,addr stime
Converting system time to dword:
invoke SystemTimeToFileTime,addr stime,addr ftime
;Convert to days since 01.01.1601
mov ecx,10*1000*1000
mov eax,ftime.dwHighDateTime
xor edx,edx
div ecx
mov ftime.dwHighDateTime,eax
mov eax,ftime.dwLowDateTime
div ecx
mov ftime.dwLowDateTime,eax
mov ecx,24*60*60
mov edx,ftime.dwHighDateTime
mov eax,ftime.dwLowDateTime
div ecx
mov val,eax
KetilO
Thanks , KetilO , I am going to try it.
ok, is working fine but is posible some code for modify the data base?
add rows , insert o delete rows or modify the data in cell?
Thanks for all.
add rows , insert o delete rows or modify the data in cell?
Thanks for all.