Tool Tip [SOLVED]
-
On 20/11/2014 at 02:59, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R16
Platform: Windows ;
Language(s) : PYTHON ;---------
Hello all,How can we make the text in a tool tip 'bold' like in all other tooltips in cinema4d?
Thanks
Nishant -
On 20/11/2014 at 03:57, xxxxxxxx wrote:
Hi,
I suppose you are talking about BitmapButtons?
In your .str please try the following:
ID_YOURBITMAPBUTTON "Text 1" "Text 2";
I hope, you'll see "Text 1" formatted bold. -
On 20/11/2014 at 10:24, xxxxxxxx wrote:
Can someone please post an example of using the tool tip option using the .res &.str files?
I can't find a single example anywhere. And this is not working for me using the .res file:BITMAPBUTTON MY_BMP_BUTTON { BUTTON; //Sets it as a button type action: bc.SetBool(BITMAPBUTTON_BUTTON, true); TOOLTIP Hello; //<---Does not work!! }
Here is an example of how to do it dynamically within the plugin's .cpp file.
But I'm missing an example using the .res & .str files.Bool MyTool::GetDDescription(BaseDocument* doc, BaseContainer& data, Description* description, DESCFLAGS_DESC& flags) { //First we have to create a group for the gizmo to sit inside of DescID gid = DescLevel(MY_GROUP, DTYPE_GROUP, 0); BaseContainer maingroupBc = GetCustomDataTypeDefault(DTYPE_GROUP); maingroupBc.SetString(DESC_NAME, "My Tab"); //The name of the group(AM tab) maingroupBc.SetLong(DESC_COLUMNS, 2); maingroupBc.SetReal(DESC_DEFAULT, 1); //Makes this group(AM tab) selected by default if(!description->SetParameter(gid, maingroupBc, DescLevel(0))) return TRUE; //Then we create the kind of gimzo we want to dynamically add DescID did2 = DescLevel( MY_IMGBTN, DTYPE_BUTTON, 0); BaseContainer settings2; settings2.SetLong(DESC_CUSTOMGUI, CUSTOMGUI_BITMAPBUTTON); settings2.SetString(DESC_NAME, "My Button"); settings2.SetBool(BITMAPBUTTON_BUTTON, true); settings2.SetLong(DESC_GUIOPEN, true); settings2.SetBool(BITMAPBUTTON_BUTTON, true); settings2.SetBool(BITMAPBUTTON_TOGGLE, true); settings2.SetString(BITMAPBUTTON_TOOLTIP, "Click Me!"); settings2.SetLong(BITMAPBUTTON_ICONID1, Ocube); settings2.SetLong(BITMAPBUTTON_ICONID2, Osphere); if (!description->SetParameter(did2,settings2,DescLevel(MY_GROUP))) return false; flags |= DESCFLAGS_DESC_LOADED; return SUPER::GetDDescription(doc, data, description, flags); }
Thanks,
ScottA -
On 20/11/2014 at 11:33, xxxxxxxx wrote:
Well you'd need a resource symbol called "Hello" for this to work.
-
On 20/11/2014 at 11:47, xxxxxxxx wrote:
Here are examples on how to have a bitmap button with tooltip (same in dialog and description resources) :
BITMAPBUTTON YOUR_BUTTON_ID { BUTTON; TOOLTIP YOUR_TOOLTIP_STRING_ID; ICONID1 300000255; }
-
On 20/11/2014 at 13:32, xxxxxxxx wrote:
Yeah. I tried that. But the usual stuff isn't working for me.
This is for a bitmap button in a ToolData plugin. And when I hover the mouse over the button it doesn't display the text.
If I create the bitmap button dynamically it works fine. But not using .res & .str files.//The .res file CONTAINER mytool { //NAME mytool; //INCLUDE ToolBase; //This creates the Apply, New Tranform, Reset Values buttons gui BITMAPBUTTON MY_BMP_BUTTON { BUTTON; //Sets it as a button type action: bc.SetBool(BITMAPBUTTON_BUTTON, true); TOOLTIP T_TIP; } } //The .h file #ifndef _mytool_H_ #define _mytool_H_ enum { MY_BMP_BUTTON = 1111, T_TIP = 1112, _DUMMY_ }; #endif //The .str file STRINGTABLE mytool { mytool "ToolData Example"; MY_BMP_BUTTON "My BTN"; T_TIP "hello"; }
-ScottA
*Edit-
I just tried it again in a tag plugin. And getting nothing in that one too.
Aside from setting up the .res, .h and .str files. Do we need to write any code in the .cpp file to make this work? -
On 20/11/2014 at 14:32, xxxxxxxx wrote:
No, I tried it here and it simply worked. No code needed. Perhaps double check your IDs.
-
On 20/11/2014 at 14:57, xxxxxxxx wrote:
OK thanks.
It turns out that this is a bug in R13.
Maxon must have fixed it in the later versions.-ScottA
-
On 20/11/2014 at 15:07, xxxxxxxx wrote:
Ok, thanks for the info. Indeed I tested with R14 and R15...
-
On 20/11/2014 at 21:52, xxxxxxxx wrote:
Hi,
I am new to cinema 4d so i was not able to understand the above description.
This is my code. Can you tell me how to do it here.bc = c4d.BaseContainer()
bc.SetInt32(c4d.BITMAPBUTTON_BORDER, c4d.BORDER_ROUND)
bc.SetInt32(c4d.BITMAPBUTTON_ICONID1, CUST_ICON_ID)
bc.SetString(c4d.BITMAPBUTTON_TOOLTIP, "I am a tool tip")
self.myBitButton=self.AddCustomGui(MY_BITMAP_BUTTON, c4d.CUSTOMGUI_BITMAPBUTTON, "My Button", c4d.BFH_CENTER | c4d.BFV_CENTER, 50, 20, bc)Thanks
Nishant -
On 21/11/2014 at 03:02, xxxxxxxx wrote:
Nishant,
the stuff I posted was to be inserted into a resource file (.res). ScottA's code posted above is for a dynamic description. You seem to look for a dialog solution?
Unfortunately we do not have the resources to provide step by step introductions. But I'm pretty sure, the links will get you going.
Regarding your question: Unfortunately you do not say, in which context your posted code is called. This makes it nearly impossible to say, what goes wrong. One thing I'm missing is:
bc.SetBool(c4d.BITMAPBUTTON_BUTTON, true);
I suggest to read the SDK docs on
SDK Docs R15 - User Interface
[URL-REMOVED] first in order to get a basic understanding.
Then you should take a look at the cinema4dsdk examples and the resources for starting plugin development in this sticky post: C++ plugin tutorial resourcesOh, and please use the "Edit post" function (under Post Options on every post in the top right corner) to avoid double postings.
[URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.