Community
    • Login

    HowTo set hIconTab for DockingDlgInterface?

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    12 Posts 6 Posters 3.5k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MarioRosiM Offline
      MarioRosi
      last edited by

      Hello,

      i create a DockingDlgInterface and show it.
      But i will set the tTbData::hIconTab.

      The icons is stored in resource file

      i hav try :

      bool ChangeIDDialog::ShowDLG(bool bShow)
      {
        bool mustShow = bShow && !isVisible();
          if (mustShow)
          {
            if (!isCreated())
            {
              tTbData data = { 0 };
              create(&data);
              data.uMask = DWS_DF_CONT_RIGHT;
              data.pszModuleName = getPluginFileName();
              data.pszName = this->titel.c_str();
              // try 1 == NULL
      	data.hIconTab = (HICON)::LoadImage(getHinst(), MAKEINTRESOURCE(IDPNG_CHANGE), IMAGE_BITMAP, 16, 16, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT);
              // try 2 == NULL
      	data.hIconTab = (HICON)::LoadIcon(getHinst(), MAKEINTRESOURCE(IDPNG_CHANGE));
      	// the dlgDlg should be the index of funcItem where the current function pointer is
      	data.dlgID = static_cast<int>(MyMenuId::Menue_Measure_SetID);
      	::SendMessage(_hParent, NPPM_DMMREGASDCKDLG, 0, (LPARAM)&data);				
            }
            DockingDlgInterface::display(bShow);
          }
          return mustShow;
      }
      

      the data.hIconTab is allways NULL.

      I have also try with bmp instance of png, also NULL.

      The resource IDPNG_CHANGE is compiled into dll, see with “Resource Hacker”.

      How can i use the recource image for hIconTab?

      regards Mario

      CoisesC 1 Reply Last reply Reply Quote 0
      • CoisesC Offline
        Coises @MarioRosi
        last edited by

        @MarioRosi

        I think that you cannot convert a png into an icon in this way. If an icon is expected, I believe that’s what you must supply.

        Perhaps try this with a *.ico file, just as a test. If that works, then you’ll know you need to convert your png into an ico before adding it to your resources.

        MarioRosiM 1 Reply Last reply Reply Quote 2
        • MarioRosiM Offline
          MarioRosi @Coises
          last edited by

          @Coises

          thanks for the idea.

          It is a partial solution. With an icon its create the icon-handle with

          ...
          data.hIconTab = (HICON)::LoadIcon(getHinst(), MAKEINTRESOURCE(IDI_CHANGE));
          ...
          

          But the DockingDlgInterface don not display the icon…

          ThosRTannerT Michael VincentM 2 Replies Last reply Reply Quote 0
          • ThosRTannerT Offline
            ThosRTanner @MarioRosi
            last edited by ThosRTanner

            @MarioRosi Have you set the DWS_ICONTAB bit in data.uMask?

            You need to set that for the icon to display.

            I think I might publish my highly overengineered replacement for DockingDlgInterace at some point cos the current one takes a lot of experimentation to get right.

            Alan KilbornA 1 Reply Last reply Reply Quote 2
            • Alan KilbornA Offline
              Alan Kilborn @ThosRTanner
              last edited by

              @ThosRTanner said in HowTo set hIconTab for DockingDlgInterface?:

              I think I might publish my highly overengineered replacement for DockingDlgInterace at some point cos the current one takes a lot of experimentation to get right.

              Yes, please!

              ThosRTannerT 1 Reply Last reply Reply Quote 0
              • Michael VincentM Offline
                Michael Vincent @MarioRosi
                last edited by

                @MarioRosi said in HowTo set hIconTab for DockingDlgInterface?:

                But the DockingDlgInterface don not display the icon…

                Your mask is not set correctly:

                data.uMask = DWS_DF_CONT_RIGHT | DWS_ICONTAB;
                

                Cheers.

                MarioRosiM 1 Reply Last reply Reply Quote 2
                • MarioRosiM Offline
                  MarioRosi @Michael Vincent
                  last edited by

                  @Michael-Vincent

                  thanks, that it

                  1 Reply Last reply Reply Quote 1
                  • ThosRTannerT Offline
                    ThosRTanner @Alan Kilborn
                    last edited by

                    @Alan-Kilborn Working on it here. I will probably fiddle with the API (and clang settings) and the documentation is definitely still in need of serious work, but it builds and runs

                    C++17 is required.

                    Feel free to play with it/raise issues/…

                    https://github.com/ThosRTanner/Docking_Dialogue_Interface

                    Alan KilbornA 3 Replies Last reply Reply Quote 2
                    • Alan KilbornA Offline
                      Alan Kilborn @ThosRTanner
                      last edited by

                      @ThosRTanner said in HowTo set hIconTab for DockingDlgInterface?:

                      Feel free to play with it/raise issues/…

                      It is now officially on my to-do list. :-)
                      Thanks for your efforts.

                      1 Reply Last reply Reply Quote 0
                      • Alan KilbornA Offline
                        Alan Kilborn @ThosRTanner
                        last edited by Alan Kilborn

                        @ThosRTanner

                        I gave it a quick try (with Vis. Studio 2022 Community Ed.) but was confused by this from the docs:

                        The layout of this assumes you have created a repositories directory and cloned the notepad++ template repo and this repo into there.

                        Since there are no releases of this, I simply got a zip of the code and extracted it to a folder. Building the .sln I got not-found errors regarding PluginInterface.h which reminded me that I needed the real “notepad++ template” code, so I went and got that, but I was unsure where to put it in the source tree…


                        Later EDIT:

                        In Vis. Studio’s “Solution Explorer” for the new template code, I see there’s a Notepad++ Headers folder which references PluginInterface.h. Looking at what path it thinks that is at, I see it is at the same level as the base folder for this new template, thus I think this is what’s needed:

                        • ...\myfolder\Docking_Dialogue_Interface-master\ <-- new template code
                        • ...\myfolder\plugintemplate\ <-- official Notepad++ template code

                        With this, the “not found” problems seem to be cleared up, but I get some different errors from that point onward…

                        @ThosRTanner , should I open an issue on the site for the project to continue discussing, so as to not annoy uninterested readers here?

                        rdipardoR 1 Reply Last reply Reply Quote 1
                        • rdipardoR Offline
                          rdipardo @Alan Kilborn
                          last edited by

                          @Alan-Kilborn said in HowTo set hIconTab for DockingDlgInterface?:

                          should I open an issue on the site for the project to continue discussing, so as to not annoy uninterested readers here?

                          https://github.com/ThosRTanner/Docking_Dialogue_Interface/issues/1

                          1 Reply Last reply Reply Quote 1
                          • Alan KilbornA Offline
                            Alan Kilborn @ThosRTanner
                            last edited by

                            @ThosRTanner said:

                            I think I might publish my highly overengineered replacement for DockingDlgInterace at some point cos the current one takes a lot of experimentation to get right.

                            More of an official announcement for it is HERE.

                            1 Reply Last reply Reply Quote 0
                            • Alan KilbornA Alan Kilborn referenced this topic on

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better 💗

                            Register Login
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors