Visual Basic Foro

Programación => Visual Basic 6 => Mensaje iniciado por: raul338 en Noviembre 28, 2011, 10:00:28 pm

Título: [BETA] ucListView 3
Publicado por: raul338 en Noviembre 28, 2011, 10:00:28 pm
Buenas :D :D

Después de tiempo, algunas criticas y un descanso de ver el código en si :P retome el desarrollo este control de usuario :)

Mejoras

Novedades

Algunas imagenes
(http://i44.tinypic.com/14j6i6g.png)
(http://i39.tinypic.com/nlxvu0.png)

Detalles
Hay que "ponerlo a prueba" y darle duro ;) Algunas de las cosas que no se pueden juntar son

Así que, a probar :D
Descargar :) (http://www.mediafire.com/download.php?oqgovurkkaka0w1)

EDIT: Usar solo en Windows 7, en Windows XP no funciona por el ASM al vuelo
Título: Re:[BETA] ucListView 3
Publicado por: coco en Noviembre 28, 2011, 10:28:02 pm
Raul, esta bueno. 3 cosas a tener en cuenta:
1 - si activo checkboxes en el header, y los saco despues, siguen estando.
2 - habria que implementar lo del editor de celdas
3 - hacer un drag & drop sencillo (que incluya mover elementos de un grupo al otro) <--- esto lo hice, pero hay ciertos detalles si vos tenes un grupo sin elementos, y queres mover un item a ese grupo, no se puede

saludos y muy bueno que no flickee
Título: Re:[BETA] ucListView 3
Publicado por: raul338 en Noviembre 28, 2011, 10:31:45 pm
1 - si activo checkboxes en el header, y los saco despues, siguen estando.
Error mio, la segunda linea del evento del checkbox esta puesto para que siempre ponga en true x'D
Código: [Seleccionar]
ucListView1.ColumnCheckStyle(0) = Truey debe ser
Código: [Seleccionar]
ucListView1.ColumnCheckStyle(0) = chkCheck.Value = vbChecked
Título: Re:[BETA] ucListView 3
Publicado por: Jen en Noviembre 29, 2011, 12:54:08 am
The project can't be compiled into exe. Don't know what is going on.
Título: Re:[BETA] ucListView 3
Publicado por: xkiz ™ en Noviembre 29, 2011, 01:00:51 am
@Jen: VB6's Err.Description?
Título: Re:[BETA] ucListView 3
Publicado por: Jen en Noviembre 29, 2011, 01:22:46 am
@Jen: VB6's Err.Description?


No errors.

Edited: After removing the resource file, it can compile.
Título: Re:[BETA] ucListView 3
Publicado por: coco en Noviembre 29, 2011, 09:45:29 am
@Jen: I think you have an error with the manifest. I didn't tryied to compile it, but I have the manifest in the IDE. But there is a normal behaivor that if you put the manifest in some exe (compiled from vb6) and it doesn't call the InitCommonControls, it doesnt start at all.
Título: Re:[BETA] ucListView 3
Publicado por: raul338 en Noviembre 29, 2011, 10:14:01 am
Jen, are you a magician?  Now i can't compile it too x'D Just remove the resource and add a simple manifest :)
Título: Re:[BETA] ucListView 3
Publicado por: ssccaann43 en Noviembre 29, 2011, 10:52:15 am
Muy bueno raul...!
Título: Re:[BETA] ucListView 3
Publicado por: LeandroA en Noviembre 29, 2011, 08:13:38 pm
Muy buena Raul esta muy prolija y me gusto lo del CustomPaint

Saludos.
Título: Re:[BETA] ucListView 3
Publicado por: raul338 en Noviembre 30, 2011, 06:51:10 am
Gracias! Me alegra que les haya gustando n.n

Un pequeño fix al dibujado del primer item en el ranking :P

Tienen que poner en el UserControl_Initialize

m_rLastIndex = -1

y después con la versión final hay otro arreglo sobre el mouse_hover en el ranking :P

Alguien probo lo de resizear la columna donde esta el ranking? A veces se pone un poco mas grande de lo que debería x'D
Título: Re:[BETA] ucListView 3
Publicado por: seba123neo en Noviembre 30, 2011, 10:25:20 am
yo uso el otro listview, el del otro post, donde posteaban los fix, no quiero ser pesado pero lamentablemnte no es tan rapido con recordsets como esperaba, el MSHFlexgrid es mas rapido, pero bueno sacrifico 1 o 2 segundos por tener este control ya que es mucho mas lindo que el MSHFlexgrid. pero con bucles sin recordset es rapidisimo.

saludos.
Título: Re:[BETA] ucListView 3
Publicado por: raul338 en Noviembre 30, 2011, 07:46:06 pm
Cierto seba123neo, igual muchos de los fix de ahi los puse aca, y estoy viendo para agregar mas cosas...
fijate el "AutoRedraw" (creo que lo tenia antes), ahora es "NoRedraw" porque estaba medio confuso antes :P te acelera la carga :)
Título: Re:[BETA] ucListView 3
Publicado por: LeandroA en Noviembre 30, 2011, 08:10:29 pm
Alguien probo lo de resizear la columna donde esta el ranking? A veces se pone un poco mas grande de lo que debería x'D

Raul en el form load llama estas lina en este orden

   
Código: [Seleccionar]
    cbViewMode.ListIndex = 1
   
    chkRanking.Value = vbChecked

osea primero cbViewMode y luego chkRanking para que primero este en modo reporte y luego se ajuste la columna.

Saludos.
Título: Re:[BETA] ucListView 3
Publicado por: raul338 en Noviembre 30, 2011, 10:57:28 pm
Gracias por el consejo leandro :)

Ahí lo volví a subir, tenia mal el mensaje de ItemFindText (usaba la versión ANSI cuando tenia que usar la versión Unicode)

http://www.mediafire.com/download.php?oqgovurkkaka0w1
Título: Re:[BETA] ucListView 3
Publicado por: ..::Carlos::.. en Diciembre 02, 2011, 01:07:57 am
Raul y como llamaria la funcion ItemFindText?
 Gracias
Título: Re:[BETA] ucListView 3
Publicado por: raul338 en Diciembre 02, 2011, 09:19:09 am
De la misma forma que antes :P

Código: (vb) [Seleccionar]
ucListView1.ItemFindText(Texto, Start, cPartial/cWholeWord, Warp)
Start es a partir de que item
cPartial es para si buscar el item que incluya el texto, cWholeWord es que el texto del item sea el texto buscado
Warp es para "empezar otra vez" la lista (en caso de que start no sea -1 o 0)
Título: Re:[BETA] ucListView 3
Publicado por: ackshun en Enero 03, 2012, 12:22:37 pm
Great control.. showed me somethings I wasn't sure how to do. Here are some issues.

if no manifest file exist
- flicker with progress bars.
- if explorer theme is checked, the font overwrites each other and causes bolder looking font.
Título: Re:[BETA] ucListView 3
Publicado por: coco en Febrero 06, 2012, 01:09:46 pm
Raul, >:@, me explota el VB6 cuando el lv "TIENE FOCO, y LUEGO LO PIERDE" (adentro del FORM, con un boton y un texto...) en una pc con W7 con VB6 nomas instalado... (UAC off).  >:(

PD: Es el IPAO!!!
Título: Re:[BETA] ucListView 3
Publicado por: ackshun en Febrero 08, 2012, 09:01:34 pm
is there anyway to hide a column besides setting it to 0?
Título: Re:[BETA] ucListView 3
Publicado por: jonney en Abril 04, 2012, 01:07:07 am
De la misma forma que antes :P

Código: (vb) [Seleccionar]
ucListView1.ItemFindText(Texto, Start, cPartial/cWholeWord, Warp)
Start es a partir de que item
cPartial es para si buscar el item que incluya el texto, cWholeWord es que el texto del item sea el texto buscado
Warp es para "empezar otra vez" la lista (en caso de que start no sea -1 o 0)

1. According to MSDN, the LVS_EX_DOUBLEBUFFER extended style also enables alpha-blended marquee selection on systems where it is supported. But I didn't see Alpha-blended style marqeen box like win7 explorer.

LVS_EX_DOUBLEBUFFER
Version 6.00. Paints via double-buffering, which reduces flicker. This extended style also enables alpha-blended marquee selection on systems where it is supported.

2. How to do multiselection or deselect items or groups by Left mouse down on empty area of an item like marqee selection?
(http://www.telerik.com/help/winforms/media/gridview-selection-multiple-selection003.png)

At this moment, I used hard codes to calculate the selection RECT considering the scrollbar position.

The MultiSelection works this way:

    MouseDown
        SetStartPosition
        SetStartScrollbarPosition
        SetIsDragging or MultiSelection Flag
        Capture mouse, so it works if user moves outside the listview
    MouseMove - If IsDragging...
       SelectionAdorner shown?
           (No) if (move distance > threshold) Show SelectionAdorner
           (Yes)
                GetMousePosition
                GetScrollbarPostion
                UpdateAdornerPosition
                UpdateSelection (preview)
                HighlightItems
    MouseUp - If IsDragging...
          UpdateSelection(final)
          Update SelectedItems
          Hide SelectionAdorner
          SetIsDragging to False
          Release mouse
It looks very simple, but there are a number of issues that are required to be solved.
Título: Re:[BETA] ucListView 3
Publicado por: jonney en Abril 07, 2012, 10:25:41 am
Código: [Seleccionar]
Private Function GetItemRect(hWnd As Long, ByVal Index As Long) As RECT

    GetItemRect.X1 = LVIR_BOUNDS
    Call SendMessage(hWnd, LVM_GETITEMRECT, Index, GetItemRect)

End Function

GetItemRect returns information about the location of a listview item. By default, GetItemRect returns the rectangle. The rectangle returned includes the item’s X and Y position relative to the listview, its width, and its height.
If the item is currently scrolled out of view, the returned coordinates will reflect this. For example, if item 1 is specified, and the top item visible is item 10, then the Y coordinate returned is a negative number.

Reversely, how to get the Row index by giving the rectangle Coordinate?

for example:
  Top visible Row is 10, Listview got Scrollbar
  I use GetItemRect(m_hListview,0) to retrieve the first Row #0's rectangle, it returns (0, -303, 450, -270 ).

  1. My question is how to use API to determine (0, -303, 450, -270 ) is Row #0?

  2. I want to determine (0,-290,450,-298) is in which of Row (apparently, it is in ROW 0).
 
       
Título: Re:[BETA] ucListView 3
Publicado por: raul338 en Abril 07, 2012, 11:10:51 am
  Top visible Row is 10, Listview got Scrollbar
  I use GetItemRect(m_hListview,0) to retrieve the first Row #0's rectangle, it returns (0, -303, 450, -270 ).
  1. My question is how to use API to determine (0, -303, 450, -270 ) is Row #0?
  2. I want to determine (0,-290,450,-298) is in which of Row (apparently, it is in ROW 0).
You have to use LVM_HITTEST (and similars), maybe with the TopItem and the PageCount
Título: Re:[BETA] ucListView 3
Publicado por: jonney en Abril 07, 2012, 11:18:31 am
  Top visible Row is 10, Listview got Scrollbar
  I use GetItemRect(m_hListview,0) to retrieve the first Row #0's rectangle, it returns (0, -303, 450, -270 ).
  1. My question is how to use API to determine (0, -303, 450, -270 ) is Row #0?
  2. I want to determine (0,-290,450,-298) is in which of Row (apparently, it is in ROW 0).
You have to use LVM_HITTEST (and similars), maybe with the TopItem and the PageCount

   
Código: [Seleccionar]
Public Function ItemHitTest( _
                            ByVal x As Single, _
                            ByVal y As Single _
                            ) As Long

Dim uLVHI As LVHITTESTINFO

    If (m_hListView) Then

        With uLVHI.pt
            .x = ScaleX(x, UserControl.ScaleMode, vbPixels)
            .y = ScaleY(y, UserControl.ScaleMode, vbPixels)
        End With

        ItemHitTest = SendMessage(m_hListView, LVM_HITTEST, 0, uLVHI)
    End If

End Function
SendMessage  doesn't work because .Pt is always positive value.

on Grouping mode, things get complicated if we use TopItem and the PageCount to determine.
Título: Re:[BETA] ucListView 3
Publicado por: k_arlytos en Febrero 19, 2014, 01:44:31 pm
yo uso el otro listview, el del otro post, donde posteaban los fix, no quiero ser pesado pero lamentablemnte no es tan rapido con recordsets como esperaba, el MSHFlexgrid es mas rapido, pero bueno sacrifico 1 o 2 segundos por tener este control ya que es mucho mas lindo que el MSHFlexgrid. pero con bucles sin recordset es rapidisimo.

saludos.

y cual es el otro uclistview mas rapido podrias pasarme el link?
Título: Re:[BETA] ucListView 3
Publicado por: igor en Abril 15, 2014, 05:41:34 pm
Иногда возникает ошибка в Function pvSortingCallback.
Ошибка сортировки неправильный тип.
Возможно нужно исправить на это

A veces, hay un error en el pvSortingCallback Funcion.
Error de clasificacion del tipo equivocado.
Tal vez usted necesita para arreglarlo

Sometimes there is an error in the Function pvSortingCallback.
Error sorting the wrong type. Maybe you need to fix it
Código: [Seleccionar]
Case eSortTypeConstants.stNumeric: val1 = Val(val1): val2 = Val(val2)
'=================================================
И здесь возвращается строка из 256 символов
Y aqui se vuelve una cadena de 256 caracteres
And here it returns a string of 256 characters
Código: [Seleccionar]
Public Property Get ColumnText(ByVal Column As Long) As String
If m_hListView = 0 Or m_hHeader = 0 Then Exit Property
    Dim uLVC  As LVCOLUMN
    Dim a     As String
    With uLVC
        [b]a = String$(255, Chr(0))[/b]
        .pszText = StrPtr(a)
        .cchTextMax = Len(a)
        .mask = LVCF_TEXT
    End With
    Call SendMessage(m_hListView, LVM_GETCOLUMN, Column, uLVC)
   
    'Correccion исправление
    ColumnText = Left$(a, InStr(2, a, Chr(0), vbBinaryCompare) - 1) ' <<<<<<
   
End Property