Autor Tema: ucListViewEx 2.5 + clsIconList [UPDATED]  (Leído 19398 veces)

0 Usuarios y 1 Visitante están viendo este tema.

chip

  • Bytes
  • *
  • Mensajes: 16
  • Reputación: +2/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #60 en: Junio 20, 2011, 05:21:36 am »
mi espanol es muy mal, pero aqui es un otro update para todos.

screen shot:  http://www.convivea.com/update.png

download:  http://www.convivea.com/download/ucListView2.5.2011.6.22.chip.rar


 2011.6.20: Added support for Unicode with ListItems and Columns Headers.
            Optimized: .Sort routines (about 2x as fast, and works with Unicode, and fixed DEFAULT sort order, works now :) )
            Updated FilterItems: added parameter to update the Filter after ItemAdd or new sub FilterReApply() to re-apply the filter after adding a large number of items (example: add a filter then hit the Fill button)
            Renamed FreezePaint(sub) to AllowRedraw (boolean property)
            Added: HeaderCheckBoxes style (thnx LeandroA & Jen)

gracias :)
« última modificación: Junio 23, 2011, 12:22:22 am por chip »

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #61 en: Junio 20, 2011, 10:26:31 am »

 2011.6.20: Added support for Unicode with ListItems and Columns Headers.
            Optimized: .Sort routines (about 2x as fast, and works with Unicode, and fixed DEFAULT sort order, works now :) )
           

Since you are making effort into sorting,how about multisorting (holding Shift + clicking two column header)?Let's do something different ;)

chip

  • Bytes
  • *
  • Mensajes: 16
  • Reputación: +2/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #62 en: Junio 20, 2011, 04:19:34 pm »
I can take a look at it, but I might not be adding much more to the control.  Can you modify the attached project to Fill the Data with an example of when MultiSort would be used?  (I am guessing when you have lots of the same identical values  in Column 1 and lots of identical values in Column 2)?

thanks,
chip
« última modificación: Junio 20, 2011, 05:29:23 pm por xkiz ™ »

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #63 en: Junio 20, 2011, 08:12:41 pm »
I saw iGrid got multisort functionality,but it's not Listview. www.10tec.com

"Sorting is multi-column with numerated sort icons using different sort criteria for each column (by raw cell data, as case-insensitive text, by icons, by colors, by fonts, etc - including custom sorting)."
« última modificación: Junio 20, 2011, 08:14:35 pm por xkiz ™ »

ADONAIRAFA

  • Gigabyte
  • ****
  • Mensajes: 291
  • Reputación: +37/-1
  • Que bien se siente al terminar un programa !!!
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #64 en: Junio 20, 2011, 08:34:31 pm »
Saludos a todos !!!

Con todo respeto Raul338... te está quedando bárbaro !!!
Y eso es lo que digo, aquí hay buenos maestros !!! y lo digo porque he aprendido bastante de uds !!!
Felicitaciones Raul338 y a los demás !!!

Saludos !!!
Manuel F. Borrego S.
Barcelona, Edo. Anzoátegui. Venezuela. 8)
Hay dos tipos de personas: Los que siguen un camino... y los que hacen camino al avanzar !!!

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #65 en: Junio 21, 2011, 05:47:42 am »
New findings:

When ucListview1 Group is enabled, the scrollbar unit is pixels.
When ucListview1 Group is disabled, the scrollbar unit is number of items.

e.g.  ucListview1 Group is enabled,click scrollbar scoll down button once,Value(efsVertical) =33 (pixels)
e.g.  ucListview1 Group is disabled,click scrollbar scoll down button once,Value(efsVertical) =1 (item)

Código: [Seleccionar]

MsgBox CStr(Min(efsVertical) & ":" & Max(efsVertical)  & ":" & LargeChange(efsVertical) & ":" & Value(efsVertical))

'/* Bars:
Private Enum EFSScrollBarConstants
    efsHorizontal = 0
    efsVertical = 1
End Enum

Private Type SCROLLINFO
    cbSize                                      As Long
    fMask                                       As Long
    nMin                                        As Long
    nMax                                        As Long
    nPage                                       As Long
    nPos                                        As Long
    nTrackPos                                   As Long
End Type

Private Declare Function GetScrollInfo Lib "user32" (ByVal hWnd As Long, _
                                                     ByVal n As Long, _
                                                     LPSCROLLINFO As SCROLLINFO) As Long
Private Declare Function SetScrollInfo Lib "user32" (ByVal hWnd As Long, _
                                                     ByVal n As Long, _
                                                     lpcScrollInfo As SCROLLINFO, _
                                                     ByVal BOOL As Boolean) As Long
                                                     
Private Sub pGetSI(ByVal eBar As EFSScrollBarConstants, _
                   ByRef tSI As SCROLLINFO, _
                   ByVal fMask As Long)

Dim lO      As Long
   
    lO = eBar
    tSI.fMask = fMask
    tSI.cbSize = LenB(tSI)
   
    GetScrollInfo ucListView1.hWnd, lO, tSI
 
End Sub

Private Property Get Min(ByVal eBar As EFSScrollBarConstants) As Long

Dim tSI         As SCROLLINFO

    pGetSI eBar, tSI, &H1
    Min = tSI.nMin
   
End Property

Private Property Get Max(ByVal eBar As EFSScrollBarConstants) As Long

Dim tSI         As SCROLLINFO

    pGetSI eBar, tSI, &H1 Or &H2
    Max = tSI.nMax - tSI.nPage
   
End Property

Private Property Get Value(ByVal eBar As EFSScrollBarConstants) As Long

Dim tSI         As SCROLLINFO

    pGetSI eBar, tSI, &H4
    Value = tSI.nPos
   
End Property

Private Property Get LargeChange(ByVal eBar As EFSScrollBarConstants) As Long

Dim tSI         As SCROLLINFO

   If (eBar = efsHorizontal) Then
    pGetSI eBar, tSI, &H2
    LargeChange = tSI.nPage
   Else
    pGetSI eBar, tSI, &H2
    LargeChange = tSI.nPage
   End If
   
End Property


« última modificación: Junio 21, 2011, 05:55:19 am por Jen »

raul338

  • Terabyte
  • *****
  • Mensajes: 896
  • Reputación: +62/-8
  • xD fan!!!!! xD
    • Ver Perfil
    • Raul's Weblog
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #66 en: Junio 21, 2011, 10:43:25 am »
New findings:

When ucListview1 Group is enabled, the scrollbar unit is pixels.
When ucListview1 Group is disabled, the scrollbar unit is number of items.

e.g.  ucListview1 Group is enabled,click scrollbar scoll down button once,Value(efsVertical) =33 (pixels)
e.g.  ucListview1 Group is disabled,click scrollbar scoll down button once,Value(efsVertical) =1 (item)

The same when WM_SCROLL is handled, in icon view the units ard pixels and in others views the units are items


Con todo respeto Raul338... te está quedando bárbaro !!!
Y eso es lo que digo, aquí hay buenos maestros !!! y lo digo porque he aprendido bastante de uds !!!
Felicitaciones Raul338 y a los demás !!!
Gracias! Aunque sigo intenando mejorarlo! :)

Thanks chip for your updates, i'll include in the control!

Since you are making effort into sorting,how about multisorting (holding Shift + clicking two column header)?Let's do something different ;)
With that we have to implement custom sorting too :P

Good Luck! :P

PD: This is like the OFFICIAL ucListView thread  ;D
« última modificación: Junio 21, 2011, 10:51:08 am por raul338 »

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #67 en: Junio 21, 2011, 10:43:08 pm »
Why GetFooterRECT & GetFooterItemRECT failed on Win7?

Código: [Seleccionar]
        BOOL GetFooterRect(LPRECT lpRect) const
{
ATLASSERT(::IsWindow(m_hWnd));
return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERRECT, 0, (LPARAM)lpRect);
}

BOOL GetFooterItemRect(int nItem, LPRECT lpRect) const
{
ATLASSERT(::IsWindow(m_hWnd));
return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERITEMRECT, nItem, (LPARAM)lpRect);
}

Código: [Seleccionar]

Private Function GetFooterItemRECT(hWnd As Long, ByVal Index As Long) As RECT2
   
    '/* Get GetFooterItemRECT RECT ,no need to assign top
    Dim bOK As Boolean
    bOK = SendMessage(hWnd, LVM_GETFOOTERITEMRECT, Index, GetFooterItemRECT)

End Function

Private Function GetFooterRECT(hWnd As Long) As RECT2
   
    '/* Get GetFooterRECT RECT ,no need to assign top & index
    Dim bOK As Boolean
    bOK = SendMessage(hWnd, LVM_GETFOOTERRECT, 0, GetFooterRECT)

End Function
« última modificación: Junio 21, 2011, 11:10:21 pm por Jen »

raul338

  • Terabyte
  • *****
  • Mensajes: 896
  • Reputación: +62/-8
  • xD fan!!!!! xD
    • Ver Perfil
    • Raul's Weblog
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #68 en: Junio 21, 2011, 11:37:32 pm »
I don't know why, its looks microsoft will add the API in next version of windows :P For know i only saw it in Explorer :( (and MFC i think)

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #69 en: Junio 22, 2011, 12:47:39 am »
I don't know why, its looks microsoft will add the API in next version of windows :P For know i only saw it in Explorer :( (and MFC i think)

Have you tried the code on your computer?On my Win7, GetFooterRECT & GetFooterItemRECT failed.

chip

  • Bytes
  • *
  • Mensajes: 16
  • Reputación: +2/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #70 en: Junio 22, 2011, 11:40:53 pm »
Here is an easy way to implement Multi Column Sort (supports 2 columns) :)

download:  http://www.convivea.com/download/ucListView2.5.2011.6.22.chip.rar

you can also change the Sort Order of each column at any time (independent of each other), and you can change what the 2nd Sort Column is, without re-sorting or losing your first "main" column.  i think its cool :)

http://www.convivea.com/multi_sort.png

For example, Header 1 is main and sorted first. Then Header 2 is clicked (with shift/cntrl). If you hold cntrl/shift and click Header 2, you will change only that column sort order. If you hold shift/cntrl and click Header 3, then Header 1 and Header 3 will be sorted.

Form:
Código: [Seleccionar]
Private Sub ucListView1_ColumnClick(Column As Long)
   
    On Error Resume Next
   
    Dim ncol As Long

    With ucListView1
   
        .AllowRedraw = False
       
        If (.Count > 1) Then
       
            'ADDED BY CHIP! - Support for Multi Column Sort
            If (m_CurrentColumn > -1) And CNTRLorSHIFT = True Then  ' Multi Column Sort
           
                For ncol = 0 To .ColumnCount - 1

                    If (ncol <> Column) And (ncol <> m_CurrentColumn) Then
                        .ColumnOrder(ncol) = soDefault
                    End If
                   
                Next ncol
               
                'SORT THE NEW COLUMN AND THEN SORT THE MAIN COLUMN AGAIN AFTER
           
                If .ColumnOrder(Column) = soAscending Then
                    .ColumnOrder(Column) = soDescending
                ElseIf .ColumnOrder(Column) = soDescending Then
                    .ColumnOrder(Column) = soDefault
                Else
                    .ColumnOrder(Column) = soAscending
                End If

                Select Case Column

                    Case 0: Call .Sort(Column, .ColumnOrder(Column), [stStringSensitive])

                    Case 1, 3: Call .Sort(Column, .ColumnOrder(Column), [stNumeric])

                    Case 2: Call .Sort(Column, .ColumnOrder(Column), [stDate])
                End Select
               
                'PREPARE SORT THE MAIN COLUMN AGAIN
                Column = m_CurrentColumn
           
            Else  ' Single Column Sort
           
                For ncol = 0 To .ColumnCount - 1

                    If (ncol <> Column) Then .ColumnOrder(ncol) = soDefault
                Next ncol
           
                If .ColumnOrder(Column) = soAscending Then
                    .ColumnOrder(Column) = soDescending
                ElseIf .ColumnOrder(Column) = soDescending Then
                    .ColumnOrder(Column) = soDefault
                Else
                    .ColumnOrder(Column) = soAscending
                End If
           
            End If

            Select Case Column

                Case 0: Call .Sort(Column, .ColumnOrder(Column), [stStringSensitive])

                Case 1, 3: Call .Sort(Column, .ColumnOrder(Column), [stNumeric])

                Case 2: Call .Sort(Column, .ColumnOrder(Column), [stDate])
            End Select

        End If
       
        Call .ColumnFocused(Column)
       
        m_CurrentColumn = Column
       
        .AllowRedraw = True
       
    End With
End Sub

Module.bas:
Código: [Seleccionar]
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Public Function CNTRLorSHIFT() As Boolean
    On Error Resume Next
           
    If (GetAsyncKeyState(160) And &H8000) Then  ' SHIFT
        CNTRLorSHIFT = True
    ElseIf (GetAsyncKeyState(162) And &H8000) Then ' CTRL
        CNTRLorSHIFT = True
    End If

End Function



Also:
Why GetFooterRECT & GetFooterItemRECT failed on Win7?

"The creation of footers in list-view controls is currently not supported." @  http://msdn.microsoft.com/en-us/library/bb774748.aspx

There is no Footer in a list-view control (yet).
« última modificación: Junio 23, 2011, 12:22:09 am por chip »

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #71 en: Julio 01, 2011, 03:50:24 am »
Still stuck in GetFooterRECT & GetFooterItemRECT. GetFooterRECT & GetFooterItemRECT always return empty RECT. But Footer RECT height is always 15 pixels (?). I am afraid MS will update the Footer RECT in future (e.g. Add ImageList/Set Font...) if I set a const.



Citar
Private Function GetFooterItemRECT(hwnd As Long, ByVal Index As Long) As RECT2

'/* Get GetFooterItemRECT RECT ,no need to assign top & index
'//Failed

    GetFooterItemRECT.y1 = LVGGR_GROUP
    Call SendMessage(hwnd, LVM_GETFOOTERITEMRECT, Index, GetFooterItemRECT)

End Function

Private Function GetFooterRECT(hwnd As Long) As RECT2

'/* Get GetFooterRECT RECT ,no need to assign top & index
'//Failed

    Call SendMessage(hwnd, LVM_GETFOOTERRECT, 0, GetFooterRECT)

End Function
« última modificación: Julio 01, 2011, 07:22:40 am por Jen »

raul338

  • Terabyte
  • *****
  • Mensajes: 896
  • Reputación: +62/-8
  • xD fan!!!!! xD
    • Ver Perfil
    • Raul's Weblog
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #72 en: Julio 01, 2011, 10:26:39 am »
you're cofusing ListView Footer rect with GroupFooter :P

Listview Footer


What you marked is Group Footer :D

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #73 en: Julio 01, 2011, 11:39:13 am »
you're cofusing ListView Footer rect with GroupFooter :P

Listview Footer


What you marked is Group Footer :D
Yes,I want to get the Group Footer RECT or 'Gap'.