avovana Posted February 27, 2018 Share Posted February 27, 2018 Hello everyone!I have very interesting task. I'm new in the gamedev that is why asking for your help.I need to make some kind of extention of the GuiTreeViewCtrl class.The task is:Map chosen Xml file into a Tree. 1. Part.I worked a bit with the SimXMLDocument() class. I tried an example from the documentation - mapped a small Xml to the GuiTextListCtrl.I used TorqueScript for that. It works.Now I need to try GuiTreeViewCtrl instead GuiTextListCtrl. Ok. I will do it to understand better how GuiTreeViewCtrl works.2. Part.But what I can not image right now is about additional task:There should be new control class that has tree to show and a field where the information from the selected item is shown. 3. PartI'm thinking about few steps:Inherit from the GuiTreeViewCtrl;Add a string(or const char*) variable for a path to the xml file - "xmlPath";Add a setter - setXmlPath(const char*); These are very first steps. Here I have questions:After making this 3 steps whould I have access from the Gui Editor to call the setXmlPath() method(so via TorqueScript)?How to add new gui field to this class? Erm.. maybe GuiTextField to this class? Quote Link to comment Share on other sites More sharing options...
avovana Posted February 27, 2018 Author Share Posted February 27, 2018 Adding method. Solved.I succesfully added new method to the class I'm playing with.I added a new method to the class:int GuiButtonNewCtrl::getNewVar() { return newVar; } And registered it with DefineEngineMethod:DefineEngineMethod(GuiButtonNewCtrl, getNewVar, int, (), , "Get the text display on the button's label (if any).\n\n" "@return The button's label.") { return object->getNewVar(); } Ok. It works with int. But conceptually problem about transmission data to the class using TorqueScript is solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.