Jump to content



Photo

Tristate GUI TreeView


  • Please log in to reply
24 replies to this topic

#1 Holger

Holger

    AutoIt Spammer

  • Developers
  • 1,384 posts

Posted 30 June 2006 - 10:19 PM

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

Attached Thumbnails

  • tristate.jpg

Attached Files


Edited by Holger, 22 February 2008 - 09:28 PM.






#2 WTS

WTS

    Polymath

  • Active Members
  • PipPipPipPip
  • 247 posts

Posted 01 July 2006 - 05:39 AM

Hi holger. .this is nice..

Edited by WTS, 01 July 2006 - 05:42 AM.


#3 rakudave

rakudave

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 01 July 2006 - 08:46 AM

very nice indeed!

#4 markloman

markloman

    Seeker

  • Active Members
  • 39 posts

Posted 06 July 2006 - 12:03 PM

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

#5 Holger

Holger

    AutoIt Spammer

  • Developers
  • 1,384 posts

Posted 15 October 2006 - 09:39 AM

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

#6 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 15 October 2006 - 03:20 PM

Holger.. :lmao:

I simply love what you've done!

#7 taz742

taz742

    Seeker

  • Active Members
  • 46 posts

Posted 09 March 2007 - 04:27 PM

Excellent work !!!
Posted Image

#8 AutoItKing

AutoItKing

    Don't mess with the king.

  • Active Members
  • PipPipPipPipPipPip
  • 1,379 posts

Posted 11 March 2007 - 01:26 AM

Dude, this rocks! Great work, looking forward to more great scripts from you!
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

#9 MikeOsdx

MikeOsdx

    Never trust a Monkey

  • Active Members
  • PipPipPipPipPipPip
  • 543 posts

Posted 21 March 2007 - 03:49 PM

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, 21 March 2007 - 04:43 PM.

Posted Image

#10 MikeOsdx

MikeOsdx

    Never trust a Monkey

  • Active Members
  • PipPipPipPipPipPip
  • 543 posts

Posted 21 March 2007 - 05:34 PM

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, 21 March 2007 - 05:39 PM.

Posted Image

#11 LondonNDIB

LondonNDIB

    Prodigy

  • Active Members
  • PipPipPip
  • 192 posts

Posted 11 June 2007 - 08:01 PM

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?

Plain Text         
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)


#12 mrbond007

mrbond007

    License To Script

  • Active Members
  • PipPipPipPipPipPip
  • 422 posts

Posted 12 June 2007 - 12:34 PM

This is one kickass script , Excellent

#13 Henke

Henke

    Seeker

  • Active Members
  • 10 posts

Posted 13 July 2007 - 09:48 PM

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

Any ideas on how to get rid of these warnings?

Many thanks

Henrik.

#14 GPLv2

GPLv2

    Seeker

  • Active Members
  • 6 posts

Posted 15 August 2007 - 10:07 PM

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

#15 Holger

Holger

    AutoIt Spammer

  • Developers
  • 1,384 posts

Posted 16 August 2007 - 12:57 AM

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

#16 GPLv2

GPLv2

    Seeker

  • Active Members
  • 6 posts

Posted 16 August 2007 - 09:15 AM

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

#17 GPLv2

GPLv2

    Seeker

  • Active Members
  • 6 posts

Posted 16 August 2007 - 09:40 AM

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

#18 oren

oren

    Adventurer

  • Active Members
  • PipPip
  • 145 posts

Posted 04 September 2008 - 12:25 PM

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, 04 September 2008 - 02:20 PM.


#19 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 17 July 2009 - 10:48 PM

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

Posted Image AutoIt Russian CommunityPosted Image Projects: 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 ProgramPosted Image UDFs: 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 UDFPosted Image Examples: 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 DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#20 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 18 July 2009 - 05:14 PM

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, 18 July 2009 - 05:21 PM.

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

Posted Image AutoIt Russian CommunityPosted Image Projects: 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 ProgramPosted Image UDFs: 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 UDFPosted Image Examples: 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 DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users