Jump to content

Recommended Posts

Posted

Hi to all!

My question is - it is possible to "know" when is plus or minus (for expand the item) is pressed?

I mean, somthing like this:

#include <GUIConstants.au3>
#include <GUITreeView.au3>
Opt("GuiOnEventMode", 1)

GUICreate("test", 250, 250)
GUISetOnEvent(-3, "Quit")

$MainTreeViewID = GUICtrlCreateTreeView(10, 50, 230, 180)
$ItemTreeViewID = GUICtrlCreateTreeViewItem("test", $MainTreeViewID)
GUICtrlSetOnEvent(-1, "GetClicked")

Func GetClicked()
    MsgBox(0, "", "It Was clicked")
 EndFunc

Func Quit()
       Exit
EndFunc

I would like to see the message not when the item is selected, just when the plus (+) or minus (-) is clicked... it is possible?

Thanx!

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Hi, please, if it is not hard for you, show me by code how to do this, i have try what you say, but this is not work :whistle: - i need that when i click on plus (or minus) the messaege will be instant shown (from MsgBox).

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Hmm

#include <GUIConstants.au3>
#include <GUITreeView.au3>
Opt("GuiOnEventMode", 1)

GUICreate("test", 250, 250)
GUISetOnEvent(-3, "Quit")

$MainTreeViewID = GUICtrlCreateTreeView(10, 50, 230, 180)
GUICtrlSetOnEvent(-1, "GetClicked")
$ItemTreeViewID = GUICtrlCreateTreeViewItem("test", $MainTreeViewID)
GUICtrlSetOnEvent(-1, "GetClicked")
$2ItemTreeViewID = GUICtrlCreateTreeViewItem("test", $ItemTreeViewID)
GUICtrlSetOnEvent(-1, "GetClicked")
$3ItemTreeViewID = GUICtrlCreateTreeViewItem("test", $MainTreeViewID)
GUICtrlSetOnEvent(-1, "GetClicked")

GUISetState()

While 1
    Sleep(100)
WEnd

Func GetClicked()
    MsgBox(0, "", "It Was clicked")
 EndFunc

Func Quit()
       Exit
EndFunc

Well the event is not even ticked when pressing the plus

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Posted

Shevilie

Thank you for trying, but it not work :whistle: - i mean click on the plus, not on an item itself, when you click it to expand, nothing happend.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Shevilie

  Quote

As i stated before

O, sorry, i didn't see that :">

  Quote

But why do you wanna know this ??

For this

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  MsCreatoR said:

Shevilie

O, sorry, i didn't see that :">

For this

It's like a big loop with those topics... this links to that one, and that one links to this one... :whistle:

Posted

As far as I know the usual is actually to have the person mark the folder, then you check if theres any subs and then the + will apear..... and you can open it

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Posted

Shevilie

  Quote

And you wanna add the subfolders as the tree expands ??

Yep, i can do it now, but it (function execute) take a looooong time (like 5 minutes if you hard drive is full of folders).

  Quote

As far as I know the usual is actually to have the person mark the folder, then you check if theres any subs and then the + will apear..... and you can open it

It's a good idea, but this is not like the original view.... anyway, thanx, maybe someone later will show ho to do this (check if item is expanded).

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Hm... now i dont know how to clear a single item (without actualy delete him) - any ideas?

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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...