Jump to content

Recommended Posts

Posted

One more problem - When i disable some item, and user set the checkbox for parent item, then my item is no longer been disabled :)

I thought it could be fixed by adding this line to MyCtrlSetItemState():

$nState = BitOR(MyCtrlGetItemState($hTV, $nID), $nState)

But nope, it's not working as i expected...

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted (edited)

Ok, the last problem i mentioned can be fixed by adding this line to MyCtrlSetItemState():

If BitAND(MyCtrlGetItemState($hTV, $nID), $GUI_DISABLE) Then $nState = BitOR($nState, $GUI_DISABLE)

and this:

SetItemState($hWnd, $hChild, $nState)
            CheckChildItems($hWnd, $hChild, $nState)

should be replaced with this (inside CheckChildItems() function):

If BitAND(MyCtrlGetItemState($hWnd, $hChild), $GUI_DISABLE) <> $GUI_DISABLE Then
            SetItemState($hWnd, $hChild, $nState)
            CheckChildItems($hWnd, $hChild, $nState)
        EndIf

But not sure if this is right solution.

Edited by MrCreatoR

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

  • 2 months later...
Posted (edited)

I first have to say that I really like the udf and use it in one project.

It uses different colored boxes for different types of information.

So I just thought I'd add a few own images. My mac-like checkboxes are these: Posted Image

At first, it was successful. I used SetItemState($hWnd, $hItem, $nState) with $nState = image-number. But after adding 4 colored groups of 3 new images, the next one just starts from the beginning. So my pink and ongoing images are not used. :D

Example: If you edit the udf, line 99-101, it should show the pink images... but it does not. Replace 14 with 11 and you see yellow boxes. (I know that this is not good, just for a quick "proof".)

SetItemState($hWnd, $hItem, $nState+14)
CheckChildItems($hWnd, $hItem, $nState+14)
CheckParents($hWnd, $hItem, $nState+14)

I tried change the grow-parameter, but it had no visible effect.

So, is there a limit, or am I wrong? Is it my fault? Do I need to tweak something?

I really would like to add these. :D

Edit: Reduced them, but I'm curious what would be the cause.

Edit: Ok, a friendly guy found it. :D

  Quote

A state image is displayed next to an item's icon to indicate an application-defined state. Specify the state image list by sending a TVM_SETIMAGELIST message. To set an item's state image, include the TVIS_STATEIMAGEMASK value in the stateMask member of the TVITEM structure. Bits 12 through 15 of the structure's state member specify the index in the state image list of the image to be drawn.

To set the state image index, use INDEXTOSTATEIMAGEMASK. This macro takes an index and sets bits 12 through 15 appropriately. To indicate that the item has no state image, set the index to zero. This convention means that image zero in the state image list cannot be used as a state image. To isolate bits 12 through 15 of the state member, use the TVIS_STATEIMAGEMASK mask.

So I really hit a limit here. :D Edited by dabus
  • 2 years later...
Posted

I absolutely love using this method! However, I'm having one issue. How can I add this bmp as a resource, using resources.au3, so I can call the check image from within the executable? I really don't want to save it to a file just to use it every time my gui is brought up.

Any ideas? Thanks!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...