Old 29th September 2004, 13:02   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Small bug

I've found that if you change the text colour of a Label control, and then try and change the text within it the new text appears over the old text and doesn't actually replace it.

Screenshot attached.

A similar thing happens when changing the background colour of e.g. a ListBox control. The background color isn't set for the whole ListBox background, but when you select an item the background colour of that item is set to the new background colour.

I have found a fix for this which is to hide the control and then show it again using ShowWindow (so basically it refreshes the control).

E.g.
ShowWindow $R0 0
ShowWindow $R0 5

-Stu
Attached Images
File Type: jpg ouch.jpg (2.2 KB, 250 views)
Afrow UK is offline   Reply With Quote
Old 29th September 2004, 13:05   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
If you set the background to transparent and then set the text, Windows has no color to draw over the old text.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 13th October 2005, 23:56   #3
edream
Junior Member
 
Join Date: Oct 2005
Posts: 5
I'm trying to add text in ListBox in Leave page. The ListBox is not getting refreshed. If I use abort or MessageBox followed by it, then I can see the refreshed content.

Is there a way I can refresh the newly added text?

I tried ShowWindow {SW_HIDE} and {SW_SHOW}, but the hidden window never comes back. Here is the snippet

Function tempProgressLeave

; disable back button before showing the progress
GetDlgItem $0 $HWNDPARENT 3
EnableWindow $0 0

; disable next button
GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 0

FindWindow $1 "#32770" "" $HWNDPARENT
GetDlgItem $0 $1 1202
StrCpy $2 0
StrCpy $vard "hello world"

loopd:
IntOp $2 $2 + 10 ;here the progressbar increases
;MessageBOX MB_OK "hello ${SW_SHOW} ${SW_HIDE}"
ShowWindow $0 ${SW_HIDE}
SendMessage $0 ${LB_ADDSTRING} "" "STR: $2:$vard"
ShowWindow $0 ${SW_SHOW}
IntCmp $2 100 loopd loopd

Sleep 5000

FunctionEnd
edream is offline   Reply With Quote
Old 15th October 2005, 12:41   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Please attach a complete example.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 18th October 2005, 17:22   #5
edream
Junior Member
 
Join Date: Oct 2005
Posts: 5
I have attached the sample script. The script just contains welcome-install-finish page. I had to write custom install page to control the progress bar. I'm able to control the progress bar but not able to refresh the listbox.

could you please take a look at the files and let me know if there is something I am missing ?

Thanks.
Attached Files
File Type: zip dinst.zip (1.4 KB, 143 views)
edream is offline   Reply With Quote
Old 20th October 2005, 18:45   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I don't see the code from the first post in your example. Attach an example that contains the code you've tried. Also, there are a lot of missing files. It'd be nicer, if you provide a complete minimal example that I can compile with too much hassle.

BTW, to create a .lnk file, use CreateShortcut. Don't copy premade shortcuts over to the user's computer.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 21st October 2005, 06:26   #7
edream
Junior Member
 
Join Date: Oct 2005
Posts: 5
The example I tried is in the zip file. I'm not sure what are the missing files. It requires only the dinst.nsi and the DInstall.ini. both files are bundled in the zip file.
I copied the zip file in to the separate directory and I'm able to compile. Could you please let me know what the problem you are facing?

I'm not very clear about the createshortcut suggestion.I dont have any such code. Could you please clarify.

Attaching the zip file again.

Thanks.
Attached Files
File Type: zip dinst.zip (1.4 KB, 127 views)
edream is offline   Reply With Quote
Old 21st October 2005, 08:12   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It also needs InstallOptionsEx plugin to be present.

-Stu
Afrow UK is offline   Reply With Quote
Old 21st October 2005, 09:45   #9
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
To update the page you can just use this:
code:
System::Call "User32::UpdateWindow(i)i (r0)"
Put that line of code after trying to show back the window.

This should be seen as a feature, not bug. You add an item but you have an option to update them when you really need.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 21st October 2005, 13:15   #10
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Oops, sorry. I've opened up another script instead of yours.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 21st October 2005, 18:54   #11
edream
Junior Member
 
Join Date: Oct 2005
Posts: 5
Great! It worked with this change.

System::Call "User32::UpdateWindow(i)i (r0)"

Thanks a lot!
edream is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump