Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - jonney

Páginas: [1]
1
I try to log in w/ this username, but I can't.

2
Visual Basic 6 / Re:[BETA] ucListView 3
« 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.

3
Visual Basic 6 / Re:[BETA] ucListView 3
« 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).
 
       

4
Visual Basic 6 / Re:[BETA] ucListView 3
« 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?


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.

Páginas: [1]