Conversion LVEd.inc from DDT to WinApi

Started by Klaas Holland, July 30, 2010, 09:55:29 AM

Previous topic - Next topic

Klaas Holland

I tried to make LVEd.inc to work in a ListView in FF3.
Thid wil not work because of the DDT stuff in the LVEd.inc.
My knowledge of DDT versus WinApi is none.
Can anyone help me with converting this LVEd.inc so it will work in FF3.
I'll try to incude LVEd.inc and a PB example LVGrid.bas.

Regards,
Klaas Holland.

Klaas Holland

I assume it takes too long to convert LVEd.inc.

My wish is to show the Text1 Textbox in column 2 and the Combo2 Combobox in column 3
in the selected row of the Listview in the following Sample Listview.
I know that this can be done with the rectangle of the subItem.
But do I have to create the Textbox or Combobox over and over again and do I do that?
Or is there a better way e.g. can you show and hide these boxes?

Regards,
Klaas.

Rudolf Furstauer

Here are two old examples, as I do that.
If you are using the standard BP-INC, this line must be changed:
'get Rect of the Cell
ListView_GetSubItemRect(HWND_FRMLISTVIEWEDIT_LVWEDIT, lEditRow, lEditCol, %LVIR_LABEL, VarPtr(rectForm))


I use the includes from Jose Roca.

Klaas Holland

Thanks Rudolf,

This is what I was looking for.
I will try to implement it in my Sample Listview.
This way the LVEd.inc will not be necessary I think.

Is it possible to move the Editbox from one row to another with the Up and Down Buttons?

Regards,
Klaas.


Rudolf Furstauer

You can retrieve keydown, and then move the position of the editcontrol.
'--------------------------------------------------------------------------------

'--------------------------------------------------------------------------------
Function FRMLISTVIEWEDIT_TXTEDIT_WM_KEYDOWN ( _
                                            ControlIndex  As Long,  _  ' index in Control Array
                                            hWndForm      As Dword, _  ' handle of Form
                                            hWndControl   As Dword, _  ' handle in Control
                                            nVirtKey      As Long,  _  ' virtual key code
                                            lKeyData      As Long   _  ' key data
                                            ) As Long
    'key data
    Select Case nVirtKey
   
        Case %VK_LEFT   : MsgBox "VK_LEFT"                     
        Case %VK_RIGHT  : MsgBox "VK_RIGHT"       
        Case %VK_UP     : MsgBox "VK_UP"     
        Case %VK_DOWN   : MsgBox "VK_DOWN"   
     
    End Select
End Function


With FF, everything should be possible.  ;)

Klaas Holland

Thanks again Rudolf,

I took the time and had a good look at your samples and compared them with the LVEd.inc.
You are right when you say  "With FF, everything should be possible."

My Sample Listview works fine with me now and is included.

Regards,
Klaas.

Klaas Holland

Jim,

Correct.
It should be FF_ListView_GetCountPerPage in your case.
In my Function Library of FF3 is a bug.
In the TreeView the Function is called FF_ListView_GetCountPage, but the real Function is FF_ListView_GetCountPerPage. 
I did not think about that and changed the Function name in FF_ListView_GetCountPage.
Perhaps I should have reported this to Paul.

Regards,
Klaas.

Paul Squires

Quote from: Jim Dunn on September 01, 2010, 11:27:33 AM
Paul, are you able to compile Klaas' sample-listview project?

You will need to traverse to your CodeStore folder and delete the file "FF_ListView_GetCountPage.inc".

\FireFly3\CodeStore\PowerBASIC\FireFly_Functions\ListView

Add the attached new function to the ListView folder in the CodeStore. It contains the proper name for the function.


Paul Squires
PlanetSquires Software