Sign in to follow this  
Followers 0
Holger

Tristate GUI TreeView

25 posts in this topic

#1 ·  Posted (edited)

Hi :D

here is the lib you could use to create a GUI tristate treeview.

Just take a look in the zip-file.

Extract all files in to the same dir and the take a look into the sample-file.

I also put some state image bitmaps in.

It's just like a beginning (version 0.2).

The next thing I'm working on is to check for the right state:

that means it's not usefull to put the state "GUI_INDERMINATE" manually to an item!

And if the state of an item is changing then call a userdefined function to i.e. set another entry in the combo box(like in the sample) or doing some other things...

If you have any problems/question then just let me know :D

Greets :wacko:

Holger

tristatestuff.zip

post-1133-1203715733_thumb.jpg

Edited by Holger
1 person likes this

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi holger. .this is nice..

Edited by WTS

Share this post


Link to post
Share on other sites

Holger, excellent! Just what I needed!

BTW, for people who like to add icons to their treeviews with _GUICtrlTreeViewSetIcon, make certain you call LoadStateImage after _GUICtrlTreeViewSetIcon :D

Share this post


Link to post
Share on other sites

Update-15.10.2006: Fixed a small bug if using it in compiled file with icons (Thanks to Analyzer from German Autoit-Forum).

P.S.: Thanks @markloman for additional info:

BTW, for people who like to add icons to their treeviews with _GUICtrlTreeViewSetIcon, make certain you call LoadStateImage after _GUICtrlTreeViewSetIcon smile.gif

.

Greets

Holger

Share this post


Link to post
Share on other sites

Excellent work !!!

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Holger,

Has there been any advancement with this really usefull script? like perhaps a UDF???

I have attached a modified version of the scripts to basically do the Opposite of the origional script. You are not able to select any child objects without the parent being enabled, and if you uncheck a parent item, all it's children get unchecked and disabled.

Thanks,

Mike

edit: changed the post from a how do I do this? to a How-to

Edited by MikeOsdx

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Could someone give me more detailed information on how to get the checkboxes to work after the script is compiled?

(Specifically the note in the script about adding the bmp file into the EXE using ResHacker.exe)

I have tried it about 12 different ways and I can't seem to figure it out.

Thanks,

Mike

edit: clarification

Edited by MikeOsdx

Share this post


Link to post
Share on other sites

I don't get what's wrong... I save the files, open the sample... run it and get a bunch of errors.

"Samples" should work right out the box, so was this made with an older version? Or is there further setup that has to be done before this will work?

C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(12,78) : ERROR: $CLR_NONE previously declared as a 'Const'
If Not IsDeclared("CLR_NONE")               Then    Global Const $CLR_NONE                  = 0xFFFFFFFF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~               ~~~~    ~~~~~~~~~~~~~~~~~~~~~~                  ~~~~~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(18,74) : ERROR: $TV_FIRST previously declared as a 'Const'
If Not IsDeclared("TV_FIRST")               Then    Global Const $TV_FIRST                  = 0x1100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~               ~~~~    ~~~~~~~~~~~~~~~~~~~~~~                  ~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(19,93) : ERROR: $TVM_SETIMAGELIST previously declared as a 'Const'
If Not IsDeclared("TVM_SETIMAGELIST")       Then    Global Const $TVM_SETIMAGELIST          = $TV_FIRST + 9
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          ~~~~~~~~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(20,92) : ERROR: $TVM_GETNEXTITEM previously declared as a 'Const'
If Not IsDeclared("TVM_GETNEXTITEM")        Then    Global Const $TVM_GETNEXTITEM           = $TV_FIRST + 10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           ~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(21,86) : ERROR: $TVM_GETITEM previously declared as a 'Const'
If Not IsDeclared("TVM_GETITEM")            Then    Global Const $TVM_GETITEM               = $TV_FIRST + 12
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~               ~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(22,86) : ERROR: $TVM_SETITEM previously declared as a 'Const'
If Not IsDeclared("TVM_SETITEM")            Then    Global Const $TVM_SETITEM               = $TV_FIRST + 13
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~               ~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(25,73) : ERROR: $TVGN_NEXT previously declared as a 'Const'
If Not IsDeclared("TVGN_NEXT")              Then    Global Const $TVGN_NEXT                 = 0x1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~              ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~                 ~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(26,75) : ERROR: $TVGN_PARENT previously declared as a 'Const'
If Not IsDeclared("TVGN_PARENT")            Then    Global Const $TVGN_PARENT               = 0x3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~               ~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(27,74) : ERROR: $TVGN_CHILD previously declared as a 'Const'
If Not IsDeclared("TVGN_CHILD")             Then    Global Const $TVGN_CHILD                = 0x4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~                ~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(28,74) : ERROR: $TVGN_CARET previously declared as a 'Const'
If Not IsDeclared("TVGN_CARET")             Then    Global Const $TVGN_CARET                = 0x9
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~                ~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(29,77) : ERROR: $TVIF_STATE previously declared as a 'Const'
If Not IsDeclared("TVIF_STATE")             Then    Global Const $TVIF_STATE                = 0x0008
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~                ~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(30,78) : ERROR: $TVIF_HANDLE previously declared as a 'Const'
If Not IsDeclared("TVIF_HANDLE")            Then    Global Const $TVIF_HANDLE               = 0x0010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~               ~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(31,90) : ERROR: $TVIS_STATEIMAGEMASK previously declared as a 'Const'
If Not IsDeclared("TVIS_STATEIMAGEMASK")    Then    Global Const $TVIS_STATEIMAGEMASK       = 0xF000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    ~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       ~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(337,73) : WARNING: $hImageList: possibly used before declaration.
    DllCall("comctl32.dll", "int", "ImageList_Destroy", "hwnd", $hImageList)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeViewLib.au3(337,73) : ERROR: $hImageList: undeclared global variable.
    DllCall("comctl32.dll", "int", "ImageList_Destroy", "hwnd", $hImageList)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Steven Morehouse\Desktop\delete\au3\TristateTreeview-sample.au3 - 14 error(s), 1 warning(s)

Share this post


Link to post
Share on other sites

Yeah I get the same weather forecast as London...

Any ideas on how to get rid of these warnings?

Many thanks

Henrik.

Share this post


Link to post
Share on other sites

when you build a exe from the script and run it standalone it doesn't work. One user here already pointed that out before but i think noone spotted this. It looks very nice but I really would love to know why that happens.

Appreciate the feedback,

Glenn

Share this post


Link to post
Share on other sites

Please read the sample-file text again then you know how to use a bmp together with compiled exe file.

P.S.: while reading please replace the line

You could also use a integrated bmw...

with thisone:

You could also use a integrated bmp...

:)

Greets

Holger

Share this post


Link to post
Share on other sites

Please read the sample-file text again then you know how to use a bmp together with compiled exe file.

P.S.: while reading please replace the line

You could also use a integrated bmw...

with thisone:

You could also use a integrated bmp...

:)

Greets

Holger

I see what happened, I got acquainted to this package from within an installer I was trying to modify to my needs and it didn't come with a sample file. I've got it now though so I'll look into this now. So the bottom line -so far I can tell- it can't access the bmp's from disk when an exe is being made, correct ? Is this an AutoIT limit ?

Thanks for responding so fast, really appreciate this.

Glenn

Share this post


Link to post
Share on other sites

I see what happened, I got acquainted to this package from within an installer I was trying to modify to my needs and it didn't come with a sample file. I've got it now though so I'll look into this now. So the bottom line -so far I can tell- it can't access the bmp's from disk when an exe is being made, correct ? Is this an AutoIT limit ?

I must say, I'm still a bit in the dark here, I can see the contents and the icons fine in the exe with resourcehacker but I'm not knowledable about how to actually add these nice little green ones in the exe. tbh, I find this fairly cucumbersome and I wonder why the code does work when I for example run it from scite... Doesn't anybody here need a exe ? I mean, examples are very nice and learnful but being able to use this in lets call it -disrespectfully sounding- the real world would make this and even more excellent program. Why can't the program find the bmp's on disk ? That's really my problem I guess. The issue here is also that the defaults aren't being respected (you know, main program -> required) when it cant seem to find these bitmaps, that's perhaps even more of an issue to some here.

Anyway, if any more insights into this lib is very welcome, again I appreciate all the hard work. I'm just trying to help improve the usability, atleast from my perspective.

Glenn

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

You the king of kings!

great great great great.

Now all i have to do it to make it that you can only choose one subcategory in one time

http://www.autoitscript.com/forum/index.php?showtopic=79740
Edited by oren

Share this post


Link to post
Share on other sites

Very good project! Thanks.

I just found one small(?) bug - When the user holding «Ctrl» and pressing «Space» key on selected item, the item looses it's image, and also disabled items looses their disabled state :)

Any ideas how to fix it? :)


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

The only solution i can get to work is this (i also tried the VK codes, but no success):

Dim $n_Dummy = GUICtrlCreateDummy()
Dim $a_TTV_Accel[4][2] = [["^{SPACE}", $n_Dummy], ["^+{SPACE}", $n_Dummy], ["^!{SPACE}", $n_Dummy], ["^+!{SPACE}", $n_Dummy]]
GUISetAccelerators($a_TTV_Accel)

This should be used after GUICreate() part (perhaps inside LoadStateImage() function?).

Edited by MrCreatoR

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0