Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

LINKBOX vs. LINK in dialogs

 Post Reply Post Reply
Author
Message
Svente View Drop Down
Member
Member


Joined: 2017 Nov 07
Location: Wolfsburg
Online Status: Offline
Posts: 14
Post Options Post Options   Quote Svente Quote  Post ReplyReply Direct Link To This Post Topic: LINKBOX vs. LINK in dialogs
    Posted: 2017 Nov 10 at 3:11am

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


Edited by Svente - 2017 Nov 10 at 3:39am
Back to Top
Svente View Drop Down
Member
Member


Joined: 2017 Nov 07
Location: Wolfsburg
Online Status: Offline
Posts: 14
Post Options Post Options   Quote Svente Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Nov 10 at 5:00am
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?
Back to Top
S_Bach View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2011 Jun 27
Online Status: Offline
Posts: 1330
Post Options Post Options   Quote S_Bach Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Nov 13 at 2:24am
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

SDK Support Engineer
Back to Top
Svente View Drop Down
Member
Member


Joined: 2017 Nov 07
Location: Wolfsburg
Online Status: Offline
Posts: 14
Post Options Post Options   Quote Svente Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Nov 13 at 3:22am
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 the LINK element isn't listed. But the Description Resource 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
Back to Top
S_Bach View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2011 Jun 27
Online Status: Offline
Posts: 1330
Post Options Post Options   Quote S_Bach Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Nov 13 at 9:11am
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
SDK Support Engineer
Back to Top
Svente View Drop Down
Member
Member


Joined: 2017 Nov 07
Location: Wolfsburg
Online Status: Offline
Posts: 14
Post Options Post Options   Quote Svente Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Nov 13 at 2:16pm
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
Back to Top
Svente View Drop Down
Member
Member


Joined: 2017 Nov 07
Location: Wolfsburg
Online Status: Offline
Posts: 14
Post Options Post Options   Quote Svente Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Nov 14 at 6:24am
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
Back to Top
S_Bach View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2011 Jun 27
Online Status: Offline
Posts: 1330
Post Options Post Options   Quote S_Bach Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Nov 14 at 9:45am
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

SDK Support Engineer
Back to Top
Svente View Drop Down
Member
Member


Joined: 2017 Nov 07
Location: Wolfsburg
Online Status: Offline
Posts: 14
Post Options Post Options   Quote Svente Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Nov 14 at 12:12pm
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. Big smile

Cheers,
Sven
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.