Re: May I introduce myself to cobol?...

From: Michael Mattias (michael.mattias_at_gte.net)
Date: 02/17/05


Date: Thu, 17 Feb 2005 15:51:01 GMT


"James J. Gavan" <jgavandeletethis@shaw.ca> wrote in message
news:lWTQd.411304$6l.317293@pd7tw2no...
>
> CHECKBOXES : - Michael
>
> NO problem with Listviews, it is Treeviews I was after. Had it been
> Listviews then I could have cribbed OO code from a Dialog System
> example. (That's different to Dialog Editor and GUI classes which I'm
> using).

Treeview styles, direct from the Windows SDK:
"TVS_CHECKBOXES
Version 4.70. Enables check boxes for items in a tree-view control. A check
box is displayed only if an image is associated with the item. When set to
this style, the control effectively uses DrawFrameControl to create and set
a state image list containing two images. State image 1 is the unchecked box
and state image 2 is the checked box. Setting the state image to zero
removes the check box altogether. For more information, see Working with
state image indexes.
Version 5.80. Displays a check box even if no image is associated with the
item.

Once a tree-view control is created with this style, the style cannot be
removed. Instead, you must destroy the control and create a new one in its
place. Destroying the tree-view control does not destroy the check box state
image list. You must destroy it explicitly. Get the handle to the state
image list by sending the tree-view control a TVM_GETIMAGELIST message. Then
destroy the image list with ImageList_Destroy.

If you want to use this style, you must set the TVS_CHECKBOXES style with
SetWindowLong after you create the treeview control, and before you populate
the tree. Otherwise, the checkboxes might appear unchecked, depending on
timing issues."

Line colors in treeview control: See TVM_SETLINECOLOR message (sets all)

Change color of labels (node text) for individual tree nodes:
Process the NM_CUSTOMDRAW message using the same logic as shown my listview
code at http://www.powerbasic.com/support/forums/Forum6/HTML/004773.html

(Except use the treeview calls instead of the listview calls, e.g., to get
the rectangle, use TreeView_getItemRect. You'll have to set the text color,
background color (and optionally the font to be used) using standard GDI
calls, then draw the text without either TextOut or DrawText)

MCM

> Coloured labels, not so sure - although somebody, using another

n the link to listview control code I posted yesterday)

MCM

>
>
> WHAT I WANT :
>
> Having quizzed you two, I've subsequently reliazed I don't need either
> feature :-) But Michael, I will follolw-up on the Colouring you are
> talking about, out of interest.
>
> OK - so here are my original thoughts - An Oil Gas Plant is being
> inspected on an annual basis and VISUALLY as 'bits and pieces' are
> actioned, I want to convey to the end-user what has been 'actioned' and
> what still requires action. (An inspection can spread roughly over three
> days - so, no matter how disciplined, they, (inspectors), can lose track
> of where they are).
>
> Level 0 - Root = Oil/Gas Plant
>
> Level 1 - Main Plant
> Level 1 - Satellite Site # 1 (e.g. some 12 miles from plant)
> Level 1 - Satellite Site # 2....
> Level 1 etc...
>
> Level 2 - a Vessel (think hot water tank with inlet and outlet pipes0
>
> Level 3 - individual pipes, 'pieces' in Level 2 being inspected.
>
> Wanted to convey visually, either 'ticking' a checkbox as 'ON' or
> re-coloring the text in the Label - I would use only ONE changed
> foreground color.
>
> Using either checkbox/foregound color - as each Level 3 is 'updated' -
> change the node display. Similarly when all Level 3s within a Level 2
> are 'actioned' then change checbox/color for Level 2. Similarly when all
> Level 2s within a Level 1 have been actioned, 'change' Level 1 display.
>
> I don't want to go either color or widget-mad so it could be an option
> between a checkbox or foreground color. Now Checkboxes, rather like
> Radiobuttons are meant to convey end-user choices so that the program
> follows down a particular path. That's not exactly how I want to use
> checkboxes - from above you can see I want to set them 'ON'
> programatically - not an end-user option. So I would be 'misusing'
> checkboxes.
>
> Using the ImageList concept (like we see 'folders' in Windows Explorer),
> I want an "actioned" icon to appear before the label description. Much
> easier and I already have sample code to introduce images. Haven't tried
> it yet, but want labels to appear initially without an 'OK icon' and
> only display the 'OK Icon' image when necessary. Much easier.
>
> If anybody is interested in extracting icons for Treeviews etc., here's
> a neat piece of Shareware :-
>
> http://www.nirsoft.net/utils/iconsext.html
>
> You can select specifics like Shell32.dll or run the software to extract
> a list of *ALL* icons on your machine. Beware ! The full feature on my
> machine gave over 3,000 icon images, You get 'repeats' of icons if you
> include sub-folders. From the scrolled dialog you then select the icons
> you want to keep in your own library.
>
> Kellie and Michael - thank you for your input.
>
> Jimmy, Calgary AB



Relevant Pages

  • Re: TreeView Trouble
    ... I would do all this by subclassing listview only. ... I am making a useful new control. ... column will have extra text related to the treeview item. ... My custom control has its own scrollbars and I want to use those for the ...
    (microsoft.public.win32.programmer.ui)
  • Using Splitter!!!
    ... how to use the Splitter Control. ... // Create TreeView, ListView, and Splitter controls. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Using Splitter!!!
    ... // Create TreeView, ListView, and Splitter controls. ... // Set the Splitter to dock to the left side of the TreeView control. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: ListView to TreeView drag and drop question.
    ... What I am attempting to do is to get the row data from the ListView and drag ... it to a TreeView node (similar to Windows Explorer when dropping files into ... >> the TreeView control or the node. ...
    (microsoft.public.vb.controls)
  • RE: listview vertical scrollbar width
    ... ListView control encapsulates Windows build-in List-View to leverage its ... Windows has two kinds of scroll bars. ... You may use Spy++ to view ListView control structure and its windows style ... considered the non-client area of ListView, so this WS_VSCROLL scrollbar is ...
    (microsoft.public.dotnet.framework.windowsforms.controls)