LINKBOX vs. LINK in dialogs
-
On 10/11/2017 at 03:11, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R18.057
Platform: Windows ;
Language(s) : C++ ;---------
Hi everybody,actually I got stucked by adding a link-field to my dialog. Reading the online help shows that LINK's are related to description and CustomGui LINKBOXES are allowed in dialogs.
When I try to add a linkbox to the layout inside the .cpp it works just fine. But adding a linkbox in the .res file throws an error (using the identifier LINKBOX or CUSTOMGUI_LINKBOX).
Isn't it possible to add a linkbox per definition to dialogs?
Surprisingly Using the LINK identifier in the .res file works fine.
Cheers,
Svente->Searching for "LINK" in the res-files contained in the Cinema program folder shows many dialogs using the LINK element (e.g. in the cinema4dsdk IDD_SHADER_BROWSER example).
-
On 10/11/2017 at 05:00, xxxxxxxx wrote:
Ok, the GeDialog Manual says:
Some "custom GUIs" are no real custom GUI elements but are hardcoded in the DescriptionCustomGui and cannot be used in a GeDialog (e.g. CUSTOMGUI_VECTOR).
But which ones can't be used?
-
On 13/11/2017 at 02:24, xxxxxxxx wrote:
Hello,
a Link gadget can be defined in a dialog's resource file using "LINK":
LINK DIALOG_LINK {}
where "DIALOG_LINK" is the ID defined in the header file and *.str file.
Please do not confuse parameter descriptions and dialog resources. Both use files with the *.res suffix but are describing completly different things. Only *.res files in a "dialogs" folder are describing dialogs.
best wishes,
Sebastian -
On 13/11/2017 at 03:22, xxxxxxxx wrote:
Hi Sebastian,
I know the difference between dialog and description. But the online documentation seems to be a little bit confused about this.
Within the online documentation under
Dialog Resource
[URL-REMOVED] the LINK element isn't listed. But theDescription Resource
[URL-REMOVED] shows the element.Using the LINK element in a res file of a dialog creates the LINK field, but the ACCEPT and REFUSE flags produce failures on plugin call in Cinema.
Using the LINKBOX element with within the GeDialog::CreateLayout() method creates also a LINK field. But using LINKBOX in a res file of a dialog produce a failure, too.
Therefore the question about LINKBOX vs. LINK in dialogs.
Kind regards,
Sven
[URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.
-
On 13/11/2017 at 09:11, xxxxxxxx wrote:
Hello,
the "LINK" GUI gadget is not a standard gadget but a custom GUI element. This is why is is not listed in the "Element Types" (and maybe it should be named "CUSTOMGUI_LINK" instead but, well, it isn't).
The "Description Resource" pages does not list GUI elements. It lists parameter types.
So there is a custom GUI element for GeDialogs called "LINK" and there is a parameter type for parameter descriptions called "LINK" but these two things are two different things.
It seems that the custom GUI element "LINK" does not handle "ACCEPPT" settings. You must implement the proper behaviour in your dialog yourself.
What do you mean with "Using the LINKBOX element with within the GeDialog::CreateLayout()"? Could you show your code?
best wishes,
Sebastian -
On 13/11/2017 at 14:16, xxxxxxxx wrote:
Hi,
ok, so it's called parameter types in descriptions - makes sense to me.
I'll post the code when I'm back at work tomorrow.
Cheers,
Sven -
On 14/11/2017 at 06:24, xxxxxxxx wrote:
Hi,
here comes the code:
Bool MC_Dialog::CreateLayout(void)
{
Bool res = TRUE;
res = LoadDialogResource(MC, nullptr, 0);BaseContainer tbc = BaseContainer();
tbc.SetBool(LINKBOX_HIDE_ICON, TRUE);
tbc.SetBool(LINKBOX_LAYERMODE, TRUE);myLinkBox = (LinkBoxGui* )AddCustomGui(TEST_LINKBOX, CUSTOMGUI_LINKBOX, "shushu", BFH_CENTER, 0, 0, tbc);
return res;
}Is that the customgui element you talked about?
The wished accept functionality is working too. There are just a few minor behavior issues to solve (filling the link field even when mouse not released, but delete when focus is lost). But that seems not to be a big problem at all. Hopefully....
Cheers,
Sven -
On 14/11/2017 at 09:45, xxxxxxxx wrote:
Hello,
CUSTOMGUI_LINKBOX is just a define defining the ID of the custom GUI element. In contrast "LINK" is a resource symbol used in a *.res file of a dialog to identify the same custom GUI element. In some cases the define and the resource symbol look alike. But they don't have to.
best wishes,
Sebastian -
On 14/11/2017 at 12:12, xxxxxxxx wrote:
Hi Sebastian,
thank you for your help. After testing and trying today - and after your helping hints, tipps and explaining answers - I've masterd the "LINK" issue for my plugin.
The online documentation doesn't make it everytime easy to understand, but plugincafe does.
Cheers,
Sven