The MASM Forum

Projects => ObjAsm => Topic started by: step8 on January 20, 2025, 01:04:13 AM

Title: How to create a custom control using XTreeList object?
Post by: step8 on January 20, 2025, 01:04:13 AM
XPropertyTree is very beautiful,how to create a custom control using XPropertyTree?

thanks
Title: Re: How to create a custom control using XTreeList object?
Post by: Biterider on January 20, 2025, 01:35:34 AM
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
Title: Re: How to create a custom control using XTreeList object?
Post by: step8 on January 20, 2025, 01:56:11 AM
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.

Title: Re: How to create a custom control using XTreeList object?
Post by: Biterider on January 20, 2025, 02:09:47 AM
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
Title: Re: How to create a custom control using XTreeList object?
Post by: step8 on January 20, 2025, 02:39:58 AM
Thank you Biterider
Thanks for your great work :thumbsup: