Old 14th May 2009, 22:38   #161
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
I suppose negative positions are not supported? ( control doesn't appear to get created at all).

I've got a label that I need to actually have higher up than 0%; the reason for this is that the font used is pretty tall, but the character I need is low - to align it properly, I have to move the very top of that label to a negative Y position (won't hurt as all the label space above that character is blank).

I'll work around it with GetWindowRect and SetWindowPos (naming consistency? pft) probably as I just need to nudge this thing up, but if I'm not missing something, then this might be a good wishlist item:
- allow negative X and Y positions
- allow negative width/height (calculating from the canvas's width/height and subtracting the value from that, so that e.g. moving a control to the left doesn't require you to adjust the width to end up at the same alignment on the right)
Animaether is offline   Reply With Quote
Old 14th May 2009, 23:40   #162
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
it already supports negative size AFAIK. Not sure why negative x/y does not work

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th June 2009, 15:09   #163
Static_VoiD
Junior Member
 
Join Date: Apr 2009
Location: Lensk, Yakutia
Posts: 16
Send a message via ICQ to Static_VoiD
Hi 2 all once again. I decided to somehow modify nsDialogs original code situated over here. I've downloaded it, modified as i wanted and successfully compiled in MS VCExpress 2009 (125 Kb...isn't it too big?).

But here comes the problem: the heap doesn't allocate at all. Here it comes
PHP Code:
  g_dialog.controls = (struct nsControl*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORYsizeof(struct nsControl)); 
And this
PHP Code:
HeapSize(GetProcessHeap(), 0g_dialog.controls); 
returns me zero . It continues even after HeapReAlloc!

Thus it fails with "access violation" error (0xC0000005) over here @ CreateControl (nsDialogs::CreateControl)
PHP Code:
...
  if (!
lstrcmpi(className"BUTTON"))
    
g_dialog.controls[id].type NSCTL_BUTTON//over here
  
else if (!lstrcmpi(className"EDIT"))
    
g_dialog.controls[id].type NSCTL_EDIT;
... 
//and so on 
So can somebody say what's wrong?

P.S.: I needed to add the ability to create "custom parented" controls, so that not only "g_dialog.hwDialog" could be the parent window when creating a control with CreateWindowEx function.
And if anybody can recompile the DLL for me I'll appreciate that greatly =) (I added one more "popint" to the code to get the necessary parent control).
Static_VoiD is offline   Reply With Quote
Old 11th June 2009, 07:04   #164
Kryder
Junior Member
 
Join Date: Jun 2009
Location: Russia
Posts: 3
Send a message via ICQ to Kryder
Hello! I need help with a ListBox...

Is it possible to make funds nsDialogs, like that drawn in the image and is described below?

I make updater\installer...

To select updates. I use a listlist, but how to configure it, I do not know ..

I need like EmbeddedLists - ListView_MultiColumnCheckBoxes..

http://img140.imageshack.us/img140/2690/42788556.jpg

I need such features as:
- Columns with sorting
- Checks with disabling
- When you click on the component will show information about it.
- It would be the icons for the components, but it is not necessary.

Sorry for my bad English!
Kryder is offline   Reply With Quote
Old 11th June 2009, 22:29   #165
Static_VoiD
Junior Member
 
Join Date: Apr 2009
Location: Lensk, Yakutia
Posts: 16
Send a message via ICQ to Static_VoiD
Kryder,
It's better to write a separate plugin especially for you . But, it seems I got some workarounds for this.
Static_VoiD is offline   Reply With Quote
Old 15th June 2009, 05:18   #166
Kryder
Junior Member
 
Join Date: Jun 2009
Location: Russia
Posts: 3
Send a message via ICQ to Kryder
How do I do that on a white background, displayed correctly Label and Icon?

image:

there is my code:

PHP Code:
Function patcher

    nsDialogs
::Create 1018
    Pop 
$0
    
    GetFunctionAddress 
$0 OnBack
    nsDialogs
::OnBack $0

    
${NSD_CreateButton300 58 75 23 "$(Browse)"
    
Pop $BROWSE_BTN
    GetFunctionAddress 
$0 Browse
    nsDialogs
::OnClick $BROWSE_BTN $0
    
    
${NSD_CreateCheckBox10 83 87 17 "Store path"
    
    
${NSD_CreateText9 59 285 20 "C:\Program Files\Rockstar Games\GTA San Andreas"
    
Pop $PATH
    GetFunctionAddress 
$0 OnChange
    nsDialogs
::OnChange $PATH $0

    
${NSD_CreateLabel102 86 270 17 "Status: you select non-SA path, pleese select real path"
    
Pop $STATUS
  
${NSD_AddStyle$STATUS ${SS_RIGHT}

  ${
NSD_CreateIcon5 3 32 32 icon
    Pop $ICON
    
${NSD_SetIconFromInstaller$ICON $R1

  
${NSD_CreateLabel0 0 384 39 ""
    
Pop $R0
  
${NSD_AddStyle$R0 ${WS_VISIBLE}|${SS_WHITERECT}|${WS_CHILD}|${WS_CLIPSIBLINGS}

    ${
NSD_CreateLabel43 10 336 32 "${PRODUCT_NAME}"
    
Pop $TITLE
    
${NSD_AddStyle$TITLE ${SS_CENTER}
    
CreateFont $"Lucida Console" "15"
  
SendMessage $TITLE ${WM_SETFONT} $1 1
    
    
${NSD_CreateGroupBox3 46 378 60 "SA Path"
    
    
${NSD_CreateGroupBox3 106 378 228 "Information"
    
    
CreateFont $FONT_BOLD "$(^Font)" "8" "800"
    
    
${NSD_CreateLabel12 122 360 16 "Описание:"
    
Pop $R0
  SendMessage $R0 
${WM_SETFONT$FONT_BOLD 1
    
    
${NSD_CreateText9 140 366 65 "$(ReadMe)"
    
Pop $README
    
    
${NSD_CreateLabel12 208 360 16 "Инструкция Ð¿Ð¾ ÑƒÑÑ‚ановке:"
    
Pop $R0
  SendMessage $R0 
${WM_SETFONT$FONT_BOLD 1
    
    
${NSD_CreateText9 227 366 65 "$(ReadMe)"
    
Pop $README
    
    
${NSD_CreateLabel12 299 168 33 "Patch by:$\nAuto-installer by:"
    
Pop $R0
    
${NSD_AddStyle$R0 ${SS_RIGHT}
    
    ${
NSD_CreateLabel183 299 190 33 "Deaglos (ICQ:76411326)$\nKryder (ICQ:9911684"
    
Pop $R0
  SendMessage $R0 
${WM_SETFONT$FONT_BOLD 1
    
  
${NSD_CreateHLine5 340 377 1 ButtonsLine
    
${NSD_CreateHLine5 39 377 1 LabelLine

    
${NSD_CreateButton3 347 75 23 $(Close)
    
Pop $CLOSE_BTN
    GetFunctionAddress 
$0 CloseNSIS
    nsDialogs
::OnClick $CLOSE_BTN $0
    
    
${NSD_CreateButton306 347 75 23 Action
    Pop $ACTION_BTN


  Call GetSAPath

    nsDialogs
::Show

FunctionEnd 
Kryder is offline   Reply With Quote
Old 1st January 2010, 12:15   #167
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Quote:
Originally posted by bnicer
code:
Function OnClick
MessageBox MB_OK "Setup will now abort."
Quit
FunctionEnd

I have a problem with Quit here. Sorry to be disruptive again.
Quote:
Originally posted by kichik
That's not currently possible as the code handling g_quit_flag is in the installer itself, separate from nsDialogs which doesn't have access to this flag. That wasn't a problem until the direct function callbacks were added. I need to think how it'd be best to handle this. Please submit a feature request.
I guess this one managed to disappear out of sight, after two years the issue is still open. I'd like to quit the installer after the users clicks a button. Is there a workaround I can use? Is there any chance this issue could be resolved in nsDialogs?
MSG is offline   Reply With Quote
Old 2nd January 2010, 16:52   #168
chatterjb
Junior Member
 
Join Date: Dec 2009
Posts: 3
How to delete strings from a listbox?

I didn't get any responses to this when posting on the main board. Maybe better luck here:

I've got a simple callback function when a button is clicked to remove the selected item from a listbox. It works correctly only if the topmost item is selected. Otherwise, it seems like the item directly above the actual selection gets removed from the LB. Here's the callback:

PHP Code:
Function Callback_RemoveSite 
LogEx
::Write " RemoveSite button clicked. Inside callback function." 
${NSD_LB_GetSelection$Listbox_SiteNameID $${NSD_LB_DelString$Listbox_SiteNameID $
FunctionEnd 

And here is the snippet of the dialog/page where it's potentially called:

PHP Code:
${NSD_CreateListBox0u 30u 150u 90u 
Pop $Listbox_SiteNameID 
${NSD_CreateButton172u 105u 58u 12u "--> Remove Site" 
Pop $Button_RemoveSite 
${NSD_OnClick$Button_RemoveSite Callback_RemoveSite 
I'm not a GUI expert, but am I missing somthing here? If needed, I can attach the entire script.

Last edited by chatterjb; 2nd January 2010 at 17:22.
chatterjb is offline   Reply With Quote
Old 2nd January 2010, 20:33   #169
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
@chatterjb

Seems like nsDialogs bug. NSD_LB_DelString macro send the LB_DELETESTRING message with lParam set as the string of the item to delete, but according to MSDN lParam is not used by LB_DELETESTRING.

Instead NSD_LB_DelString macro should send the LB_DELETESTRING message with wParam set as the index of the item to delete.

Try using this code:
code:
Function Callback_RemoveSite
LogEx::Write " RemoveSite button clicked. Inside callback function."
SendMessage $Listbox_SiteNameID ${LB_GETCURSEL} 0 0 $0
SendMessage $Listbox_SiteNameID ${LB_DELETESTRING} $0 0
FunctionEnd



PaR

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} is offline   Reply With Quote
Old 4th January 2010, 19:38   #170
chatterjb
Junior Member
 
Join Date: Dec 2009
Posts: 3
Quote:
Originally posted by {_trueparuex^}
@chatterjb

Seems like nsDialogs bug. NSD_LB_DelString macro send the LB_DELETESTRING message with lParam set as the string of the item to delete, but according to MSDN lParam is not used by LB_DELETESTRING.

Instead NSD_LB_DelString macro should send the LB_DELETESTRING message with wParam set as the index of the item to delete.

Try using this code:
code:
Function Callback_RemoveSite
LogEx::Write " RemoveSite button clicked. Inside callback function."
SendMessage $Listbox_SiteNameID ${LB_GETCURSEL} 0 0 $0
SendMessage $Listbox_SiteNameID ${LB_DELETESTRING} $0 0
FunctionEnd



PaR
Yup, this did the trick. Thanks for your help.
chatterjb is offline   Reply With Quote
Old 7th April 2010, 20:22   #171
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Just a minor bug report here as well (nsDialogs isn't listed in the bug tracker, unless I missed it)...

When using ${NSD_SetImage}, the image filename parameter cannot be stored in $R0 - this gets overwritten by nsDialogs and essentially just blanks the bitmap control you're trying to set an image to.

Work-around is to not use $R0.

Fix is to adjust nsDialogs.nsh:
PHP Code:
!macro __NSD_LoadAndSetImage _LIHINSTMODE _IMGTYPE _LIHINSTSRC _LIFLAGS CONTROL IMAGE HANDLE
    Push 
$0
    Push $R0
    Push $R1 
; NEW
    
StrCpy $R1 ${IMAGE# in case ${IMAGE} is $R0 ; NEW
    
StrCpy $R0 ${CONTROL# in case ${CONTROL} is $0
    
...
    
System::Call 'user32::LoadImage(i ${_LIHINSTSRC}, ts, i ${_IMGTYPE}, i0, i0, i${_LIFLAGS}) i.r0' "$R1MODIFIED
    
...
    
Pop $R1 ; NEW
    
Pop $R0
    Exch 
$
Animaether is offline   Reply With Quote
Old 13th January 2011, 23:56   #172
ZmAn3
Senior Member
 
Join Date: Oct 2003
Posts: 178
has anyone been working on a treeview header for nsdialogs like the list view one
http://nsis.sourceforge.net/Header_file_for_Listview
?
I can do all the treeview defines but I dont know the windows api to add items ect.
ZmAn3 is offline   Reply With Quote
Old 14th January 2011, 00:13   #173
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
Quote:
Originally Posted by ZmAn3 View Post
has anyone been working on a treeview header for nsdialogs like the list view one
http://nsis.sourceforge.net/Header_file_for_Listview
?
I can do all the treeview defines but I dont know the windows api to add items ect.
The win32 treeview does not have the same kind of header support like listview has, while it is possible (A header can exist as its own HWND inside any kind of parent control), you would need to write your own custom plugin...

IntOp $PostCount $PostCount + 1
Anders 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