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

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

E N T E R

  • Petabyte
  • ******
  • Mensajes: 1062
  • Reputación: +57/-13
  • www.enterpy.com
    • Ver Perfil
    • www.enterpy.com
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #15 en: Marzo 08, 2011, 06:17:46 pm »
Moutro hijo de quien sos "bill gate" o "linus torvald", jejeje espectacular el control man felicitaciones...
CIBER GOOGLE - CONCEPCIÓN PARAGUAY
www.enterpy.com
Primera regla de la programacion, para que vas a hacerlo complicado si lo puedes hacer sencillo

Cudder

  • Bytes
  • *
  • Mensajes: 26
  • Reputación: +0/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #16 en: Marzo 22, 2011, 07:01:57 pm »
Hola! Gracias por esta fuente agradable, pero podría subir un sencillo con sólo un informe listview bien con pequeño icono y por favor todas las otras cosas?

¡Gracias!

EN:
Hi! Thank you for this nice source but could you upload a simple one with just a good listview report with small icon and every other things please?

Thank you!

raul338

  • Terabyte
  • *****
  • Mensajes: 894
  • Reputación: +62/-8
  • xD fan!!!!! xD
    • Ver Perfil
    • Raul's Weblog
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #17 en: Marzo 23, 2011, 10:24:46 am »
I don't get what you call "simple good listview report"  ::)

You just have to copy de ucListView.ctl, the mListViewEx.bas, the mIOleInPlaceActivate.bas (I'm trying to join it to the ctl, but it's difficult xD) and the OleGuids3.tlb (by removing mIOleInPlaceActivate.bas I want to remove this tlb too). And add those to your project. The tlb goes in the References section (Project -> References -> Add Reference)

And then add the listView to your form, and add this code in the form Load or whether you want to init de listview

Código: (vb) [Seleccionar]
    With ucListView1
        Call .Initialize
        Call .InitializeImageListHeader ' You must Call this even if you won't use images on the headers, or you will get a Blank header

        ' Add Icons
        Dim ilSmall As clsIconList      ' My Class to load icons, or use .ImageListSmall_AddBitmap or .ImageListSmall_AddIcon to add by Handle
        ' My class only add icons, i didn't want to add bmp or jpg, but... it's not difficult to replace, and i'll add it in the next version
        Set ilSmall = New clsIconList
        Call ilSmall.Initialize(16, 16) ' Size of the icons
        Call ilSmall.AddIcon(App.Path & "\Graphics\document.ico") ' Add a icon by file
        Call ilSmall.AddIcon("document", true) ' Add a icon by resource
        Call .DuplicateImageListSmall(ilSmall.Handle) ' Set the imagelist to the ucListView
        Set ilSmall = Nothing ' Free resources :D

        ' Add Headers (id, Caption, Width, Align, Image)
        ' In id you can use .ColumnCount to make it "auto"
        Call .ColumnAdd(0, "Header 1", 150, [caLeft], 0)
        Call .ColumnAdd(1, "Header 2", 150, [caLeft], 0)

        ' Add Items (id, Caption, ident, iconId) ' With ident you can simulate a TreeListView x)
        Call .ItemAdd(i, "Item " & i, 0, 1) ' Icon: document.ico
        ' Set SubItems ( itemId, column, caption, icon) ' For Icon you must Enable "SubItemIcons"
        Call .SubItemSet(i, 1, CInt(Rnd * 10), 0)

        ' Set Properties
        .ViewMode = vmDetails  ' Report
    End With

And that's the basics, if you want add other properties, you can copy&paste from the property's CheckBox and set in the code.

Example, if you want to add Multiselect, you'll see
Código: (vb) [Seleccionar]
Private Sub chkMultiselect_Click()
    ucListView1.MultiSelect = CBool(chkMultiselect)
End Sub

you only have to add
Código: (vb) [Seleccionar]
    .MultiSelect = True
to your "Set Properties" section :D


NOTE:
You must put this in your form to work well with de XP Styles manifest (by file or resource)
Código: (vb) [Seleccionar]
Private Declare Sub InitCommonControls Lib "COMCTL32" ()
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function LoadLibraryA Lib "kernel32" (ByVal lpLibFileName As String) As Long

' This goes to the first form show
Private Sub Form_Initialize()
    hMod = LoadLibraryA("shell32.dll")
    Call InitCommonControls
End Sub

' And this to the last form, the "are you sure to exit" form
Private Sub Form_Terminate()
    Call FreeLibrary(hMod)
End Sub
« última modificación: Marzo 23, 2011, 10:27:46 am por raul338 »

Cudder

  • Bytes
  • *
  • Mensajes: 26
  • Reputación: +0/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #18 en: Marzo 25, 2011, 06:14:34 pm »
Thank you man! Your listview looks so good you know that? Do we can Drag and Drop on it?

EDIT: Did what you said and see:

« última modificación: Marzo 25, 2011, 07:15:48 pm por Cudder »

raul338

  • Terabyte
  • *****
  • Mensajes: 894
  • Reputación: +62/-8
  • xD fan!!!!! xD
    • Ver Perfil
    • Raul's Weblog
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #19 en: Marzo 25, 2011, 08:03:47 pm »
Do we can Drag and Drop on it?
Not Yet  >:(

:| you didn't saw all my code. Check the ScrollBar in the code seccion

If you see, there is an "' Add Headers (id, Caption, Width, Align, Image)" and you cut it up rigth there xD

Código: (vb) [Seleccionar]
' Add Headers (id, Caption, Width, Align, Image)
        ' In id you can use .ColumnCount to make it "auto"
        Call .ColumnAdd(0, "Header 1", 150, [caLeft], 0)
        Call .ColumnAdd(1, "Header 2", 150, [caLeft], 0)

        ' Add Items (id, Caption, ident, iconId) ' With ident you can simulate a TreeListView x)
        Call .ItemAdd(i, "Item " & i, 0, 1) ' Icon: document.ico
        ' Set SubItems ( itemId, column, caption, icon) ' For Icon you must Enable "SubItemIcons"
        Call .SubItemSet(i, 1, CInt(Rnd * 10), 0)

        ' Set Properties
        .ViewMode = vmDetails  ' Report
    End With

Rembember to put the Manifest resource to the EXE or the vb6.exe if you want things like Groups, FilterHeader, etc
Using the XN Resource Editor (follow link and look for it)
You open it, look for vb6.exe in (Program Files)/Microsoft Visual Studio/VB98

And then you save it! (REMENBER TO DO A BACK UP!)
« última modificación: Marzo 25, 2011, 08:10:28 pm por raul338 »

Cudder

  • Bytes
  • *
  • Mensajes: 26
  • Reputación: +0/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #20 en: Marzo 25, 2011, 08:35:07 pm »
I'm really stoned man. Could you simply just upload a simple project only using listview report with multiselect etc.

Thanks man

Cudder

  • Bytes
  • *
  • Mensajes: 26
  • Reputación: +0/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #21 en: Marzo 26, 2011, 10:34:04 am »
This is what I would like to have without the checkboxes etc. Only one listview. (Icons too)



Thanks :D
« última modificación: Marzo 26, 2011, 01:20:55 pm por Cudder »

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #22 en: Mayo 22, 2011, 04:51:00 am »
Listview may get repaint issue when groups are collapsing or expanding with scrollbar presenting or disappearing. Tested on Win7.
 
« última modificación: Mayo 27, 2011, 01:12:02 am por Jen »

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #23 en: Mayo 22, 2011, 10:55:34 pm »
Confirmed if Listview always got vertical scrollbar before/after groups collapsed,repaint is always OK.
Confirmed if Listview always don't have vertical scrollbar before/after groups collapsed,repaint is always OK.

Edited:
I am trying to subclass WM_LBUTTONUP, WM_RBUTTONUP, WM_MBUTTONUP and NM_CLICK, NM_RCLICK and eat them to use our own codes. Still studying in.
« última modificación: Mayo 25, 2011, 06:30:12 am por Jen »

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #24 en: Mayo 25, 2011, 06:34:35 am »
The progress bar can't draw properly after groupheaders added.
The TopIndex is always 0 when Listview got groups according to MSDN. So
all calculation in WM_PAINT is not right.

Using WM_PAINT is not a good idea. We should draw by NMLVCUSTOMDRAW.

After using NMLVCUSTOMDRAW:
« última modificación: Mayo 27, 2011, 01:10:19 am por Jen »

chip

  • Bytes
  • *
  • Mensajes: 16
  • Reputación: +2/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #25 en: Mayo 26, 2011, 03:45:26 pm »
raul338,

thank you very much for the updated ucListView control. This is exactly what I have needed.

one question, regarding the "Header Filter", this functionality seems like "Find <text> in the Column".

would it be possible to change this functionality to be  "only show listview items that contain <text> in the Column"?

some ideas I had: change the font to White for all other not matching list results, thus hiding them. 

otherwise, it looks like I will have to:

1. keep a 2nd data structure containing the ListView items.
2.   .Clear the ListView
3.   .Add back the ListView matching results
4.  When finished with this Filter, then  .Clear the ListView and .Add back the original ListView items.


My spanish is bad, but hopefully my question/issue makes sense to you?


raul338

  • Terabyte
  • *****
  • Mensajes: 894
  • Reputación: +62/-8
  • xD fan!!!!! xD
    • Ver Perfil
    • Raul's Weblog
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #26 en: Mayo 26, 2011, 05:02:47 pm »
Actually there a bunch of bugs that Jen and I are fixing :)

For "hiding" items, well, it cannot be done simply like the Common Controls OCX

But there's a trick. Enabling groups (without adding a group) doesn't show all items wich group is 0 or -1. So, the trick is to set 1 to the "visible" items and -1 to "not visible" items :) and voila! (I didnt tried this, but it should work)

chip

  • Bytes
  • *
  • Mensajes: 16
  • Reputación: +2/-1
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #27 en: Mayo 26, 2011, 05:59:41 pm »
Thanks for the suggestion, I will try that when I get home tonight.

Should that work on WinXP too or is that ListView "group feature" only available in Windows 7 (or Vista)?

raul338

  • Terabyte
  • *****
  • Mensajes: 894
  • Reputación: +62/-8
  • xD fan!!!!! xD
    • Ver Perfil
    • Raul's Weblog
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #28 en: Mayo 26, 2011, 06:30:10 pm »
Yes :) I shouldnt be a problem. I'll Try that later :)

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:ucListViewEx 2.5 + clsIconList [UPDATED]
« Respuesta #29 en: Mayo 26, 2011, 08:11:07 pm »
Thanks for the suggestion, I will try that when I get home tonight.

Should that work on WinXP too or is that ListView "group feature" only available in Windows 7 (or Vista)?
WinXP only shows Group without Substitle,Footer and collapse button. That means you can't collapse the groups. In Vista/Win7,the looking is better than ever.