HowTo set hIconTab for DockingDlgInterface?
-
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
-
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.
-
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…
-
@MarioRosi Have you set the
DWS_ICONTAB
bit indata.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.
-
@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!
-
@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.
-
thanks, that it
-
@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/…
-
@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. -
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?
-
@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
-
@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.
-