The CheckboxTree is a base class derived by OptionsCheckboxTree and used by OptionsTree. If you go to "Tools -> Options", that Dialog Box uses a generic reusable form that if selecting "Export/Import Options" and choosing "Export Groups", will display the type of functionality I am trying to achieve.
Basically, I want to create the same functionality that the "Export Groups" has. I want a TreeCtrl of check boxes such that if I click the parent checkbox it will automatically select it's children or unselect them.
The code is hard to follow without having more knowledge of how the Slick-C language works when tying it to forms. Also, it seems all of the docs and demos don't show "Object Oriented" Slick-C, just procedural.
So, I discovered all of this by doing the research in the macros directory, but can't seem to get a grasp.
I have a form "gsform" that I designed with a TreeCtrl "ctltree1". Here's what I have so far:
#pragma option(pedantic,on)
#region Imports
#include "slick.sh"
#require "sc/controls/CheckboxTree.e"
#require "se/options/ExportImportGroupManager.e"
#require "se/options/RelationTable.e"
#import "optionsxml.e"
#import "stdprocs.e"
#import "treeview.e"
#endregion
namespace se.options;
using namespace sc.controls.CheckboxTree;
defeventtab gsform;
void gsform.on_create()
{
_control ctltree1;
CheckboxTree cbTree (p_active_form._find_control("ctltree1"));
cbTree.getWindowID()._TreeAddItem(0, "HELLO", TREE_ADD_AS_CHILD, 0, 0);
cbTree.getWindowID()._TreeAddItem(1, "GOODBYE", TREE_ADD_AS_CHILD, 0, 0);
cbTree.getWindowID()._TreeAddItem(1, "CIAO", TREE_ADD_AS_CHILD, 0, 0);
}
void ctlcancel.lbutton_up()
{
_message_box("CANCEL");
p_active_form._delete_window("");
}
void ctlok.lbutton_up()
{
_message_box("OK");
p_active_form._delete_window("done");
}
I just don't see any checkboxes, etc with my tree elements.
Thanks!