Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Issues with ListBox (http://forums.winamp.com/showthread.php?t=330497)

ksps1024 10th May 2011 20:39

Issues with ListBox
 
Hi,

I'm having issues with the listbox control. I have created a custom page with a listbox, and am populating it with strings read from a file(>1000 lines). The problem I'm experiencing is that while the items are being inserted into the listbox, I do not see them there until the process completes. Now the interesting part is that I can see the vertical scrollbar shrink. Once the file read is complete, then it displays the items in the listbox.....

Below is excerpt for the insertion of the strings.
code:


${NSD_CreateListBox} 0 25 100% 80% " "
pop $listbox

SendMessage $listbox ${LB_INSERTSTRING} -1 "STR:Delete: $R0"




Any ideas how to get around this?

I'm trying to accomplish something similar to the install part where you can see the details of the installation.

Thanks in advance....

T.Slappy 11th May 2011 06:33

Quote:

I do not see them there until the process completes
This is OK, because painting of the control is locked and whole control is repainted at the end.
Try to send WM_REDRAW message after each LB_INSERTSTRING - but you will lose a lot of performance!

ksps1024 11th May 2011 13:10

How is this done in the MUI_PAGE_INSTFILES where you can see the items being inserted in the details box (I assume WM_REDRAW is being sent??)

Afrow UK 11th May 2011 13:13

That uses a list view control and inserts items from another thread separate to the UI thread.

Stu

ksps1024 11th May 2011 13:28

Are there any examples out there that mimic the INSTFILES page? If not can you point me in the right direction with the listview?

Thanks

Afrow UK 11th May 2011 16:16

Search Google for "nsis listview".

Stu

vicokoby 10th June 2011 23:03

ListBox Multiselectable
 
Please teachme how to get the selected strings in a ListBox with the style ${LBS_MULTIPLESEL}

${NSD_LB_GetSelection} return only a item, I want recover several items.

Please helpme!

Afrow UK 12th June 2011 15:42

These are the messages you can send: http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

Stu

vicokoby 16th June 2011 17:32

1 Attachment(s)
Please helpme with this issue,

This is a try to get the selected items
Quote:

!macro Show_Selected_Items ListBox_HWND

StrCpy $0 ${ListBox_HWND} ; $0 = ListBox handle

System::Alloc 1024
Pop $1
StrCpy $2 $1 ; $2 = buffer to store the selected items.

System::Call 'user32::SendMessage(i, i, i, i) i(r0, ${LB_GETSELITEMS}, 100, r2) .r3' ; $3 = Number of selected items; (Max capacity: 100)
StrCpy $4 0 ; $4 = Counter

Next:
IntCmp $4 $3 Done ShowItem Done

ShowItem:
; Here is my problem
; My problem is that not you how to pass the elements from the buffer to the message
; The enclosed Code line is incorrect please helps me to fix it
; That line returns any element of the listbox, not the selected items.

;-------------------------------------------------------------------------------
System::Call 'user32::SendMessage(i, i, i, t) i(r0, ${LB_GETTEXT}, r4, .s) .r6'
;-------------------------------------------------------------------------------

Pop $5 ; $5 = Selected Item (It is what wanted)
MessageBox MB_YESNO "Selected Item: $5 Size: $6$\n$\nDo you want to continue?" IDNO Done
IntOp $4 $4 + 1
Goto Next

Done:
System::Free $1

!macroend


Example complete: Attachment 48913


Please give me more help!

Anders 16th June 2011 20:16

Your LB_GETTEXT code is ok, but you need to get the item index out of the array you filled with LB_GETSELITEMS

Quote:

!macro Show_Selected_Items ListBox_HWND

StrCpy $0 ${ListBox_HWND} ; $0 = ListBox handle

System::Alloc 1024 ; max items would be 1024/4, not 100...
Pop $2


System::Call 'user32::SendMessage(i, i, i, i) i(r0, ${LB_GETSELITEMS}, 100, r2) .r3'
StrCpy $4 0 ; $4 = Counter

Next:
IntCmp $4 $3 Done ShowItem Done

ShowItem:
IntOp $5 $4 * 4
IntOp $5 $5 + $2
System::Call '*$5(i.r5)'

System::Call 'user32::SendMessage(i, i, i, t) i(r0, ${LB_GETTEXT}, r5, .r5) .r6'
MessageBox MB_YESNO "Selected Item: $5 Size: $6$\n$\nDo you want to continue?" IDNO Done

IntOp $4 $4 + 1
Goto Next
Done:
System::Free $2
!macroend

vicokoby 17th June 2011 14:36

Thank you very much!


All times are GMT. The time now is 17:30.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.