Announcement

Collapse
No announcement yet.

nsDialogs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 

    Comment


    • 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.
      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?

      Comment


      • 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; 2 January 2010, 16:22.

        Comment


        • @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

          Comment


          • 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.

            Comment


            • 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 
              $

              Comment


              • 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.

                Comment


                • 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

                  Comment

                  Working...
                  X