News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

How to create a custom control using XTreeList object?

Started by step8, January 20, 2025, 01:04:13 AM

Previous topic - Next topic

step8

XPropertyTree is very beautiful,how to create a custom control using XPropertyTree?

thanks

Biterider

Hi step8
You will find a good example in your installation ObjAsm\Projects\X\XPropertyTree.
Basically you need to create an XPropertyTree (Application.OnCreate) using:

OCall xbx::XPropertyTree.Init, xsi, [xsi].hWnd, offset XPT_Def
and all category and subcategory nodes, inserting them in the appropriate place in the tree.
When you initialise each of these, you specify the type of node and additional parameters such as selection data or a validation procedure.

mov pNodeCat, $New(XPT_CategoryNode)
OCall xbx::XPropertyTree.Insert, xax, NULL, XTVN_INSERT_AS_LAST_CHILD
OCall pNodeCat::XPT_CategoryNode.Init, xbx, hIconStrMain, $OfsCStr("Strings"), HEIGHT_LEVEL_1, XTVNS_EXPANDED
 

The rest is more or less standard application code.  :biggrin:

Regards, Biterider

step8

Thanks for quick reply.
I want to use this XTreeList in a C program,
If i use the code
OCall xbx::XPropertyTree.Init, xsi, [xsi].hWnd, offset XPT_Defdoes it mean the whole project must programed in ASM?

I try to embed XPropertyTree in a dll,but compile failed.


Biterider

Hi step8
Interfacing with C is more than just putting some code into a DLL. 
For example, all the memory allocation and deallocation routines have to match perfectly, as well as calling conventions, data alignment, etc. 

If your project is not too complicated and you will be using this GUI component, asm (ObjAsm) is the way to go.

Regards, Biterider

step8