www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Any gui frameworks got WinApi TreeView control working?

reply "Lynn Allan" <l.allan att.net> writes:
I've been attempting to get the winsamp.d code expanded to show more of the
WinApi call. Specifically, I want to use the TreeView control as part of
converting a freeware app to D.

Looking over windows.d, COMCTRL.h, WINDOWSX.h, and WINUSER.h, it appears
that the basic windows controls (button, static, combobox, edit, etc.) are
at least partially implemented, but some or all of the advanced controls are
missing.

That seems to include the TreeView. As a newbie who doesn't know what he is
doing, I've been able to use CreateWindowA to create a TreeView, but had to
code
const int TVS_HASLINES = 2; // from windows comctrl.h
hChapSelectorTree = CreateWindowA("SYSTREEVIEW32", "",
     _CHILD | WS_VISIBLE | WS_BORDER | TVS_HASLINES,
     5, 32, 110, 300, hWndMain,
     cast(HMENU) IDC_TREE_CHAP_SELECTOR, ghInstance, null);

because TVS_HASLINES isn't defined in windows.d

Also, the associated structures
TV_ITEMA tvI;
TV_INSERTSTRUCTA tvIns;
HTREEITEM myItem;

aren't defined in windows.h so I wasn't able to figure out how to actually
put anything in the TreeView.

I've proceeded to "clone + snip" windows.d into
\dmd\src\std\phobos\c\windows\windows_tree.h
with my best guesses as to the appropriate enum's and structs

It's starting to work, as I can add a root item to the tree and it shows up
visually in winsamp3.exe. Before proceeding further, I wanted to check if I
was re-inventing the wheel.

TIA,
Lynn A.
Jul 17 2004
parent "Phill" <phill pacific.net.au> writes:
DIG has a Tree component.

Phill.


"Lynn Allan" <l.allan att.net> wrote in message
news:cdbd5b$1bnb$1 digitaldaemon.com...
 I've been attempting to get the winsamp.d code expanded to show more of
the
 WinApi call. Specifically, I want to use the TreeView control as part of
 converting a freeware app to D.

 Looking over windows.d, COMCTRL.h, WINDOWSX.h, and WINUSER.h, it appears
 that the basic windows controls (button, static, combobox, edit, etc.) are
 at least partially implemented, but some or all of the advanced controls
are
 missing.

 That seems to include the TreeView. As a newbie who doesn't know what he
is
 doing, I've been able to use CreateWindowA to create a TreeView, but had
to
 code
 const int TVS_HASLINES = 2; // from windows comctrl.h
 hChapSelectorTree = CreateWindowA("SYSTREEVIEW32", "",
      _CHILD | WS_VISIBLE | WS_BORDER | TVS_HASLINES,
      5, 32, 110, 300, hWndMain,
      cast(HMENU) IDC_TREE_CHAP_SELECTOR, ghInstance, null);

 because TVS_HASLINES isn't defined in windows.d

 Also, the associated structures
 TV_ITEMA tvI;
 TV_INSERTSTRUCTA tvIns;
 HTREEITEM myItem;

 aren't defined in windows.h so I wasn't able to figure out how to actually
 put anything in the TreeView.

 I've proceeded to "clone + snip" windows.d into
 \dmd\src\std\phobos\c\windows\windows_tree.h
 with my best guesses as to the appropriate enum's and structs

 It's starting to work, as I can add a root item to the tree and it shows
up
 visually in winsamp3.exe. Before proceeding further, I wanted to check if
I
 was re-inventing the wheel.

 TIA,
 Lynn A.
Jul 20 2004