Jump to content

Recommended Posts

Posted (edited)

Or to delete all items except this "about" !?

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted

Hey, is possible to make this but without button bug, see this:

#include <GUIConstants.au3>

GUICreate("GUI with more treeviews", 340, 200, -1, -1)

$maintree = GUICtrlCreateTreeView(10, 10, 120, 150)
$aboutitem = GUICtrlCreateTreeViewItem("About", $maintree)
$generalitem = GUICtrlCreateTreeViewItem("General", $maintree)
$toolsitem = GUICtrlCreateTreeViewItem("Tools", $maintree)
$effectitem = GUICtrlCreateTreeViewItem("Effects", $maintree)
$styleitem = GUICtrlCreateTreeViewItem("Styles", $maintree)
$cmditem = GUICtrlCreateTreeViewItem("Commandline", $maintree)
$miscitem = GUICtrlCreateTreeViewItem("Misc", $maintree)
$edit = GUICtrlCreateEdit("", 150, 44, 163, 20, $ES_AUTOHSCROLL)
GUICtrlCreateLabel("Type 'about' in edit", 150, 25, 100, 17)
$about_button = GUICtrlCreateButton("Bugged Button:)", 150, 70, 81, 25, 0)
GUICtrlSetState($about_button, $GUI_HIDE )

$cancelbutton = GUICtrlCreateButton("Cancel", 130, 170, 70, 20)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = -3 Or $msg = -1 Or $msg = $cancelbutton
            ExitLoop
    EndSelect
    $item = GUICtrlRead($edit)
    If $item = "About"  Then
        If BitAND(GUICtrlGetState($about_button), $GUI_HIDE ) = $GUI_HIDE Then GUICtrlSetState($about_button, $GUI_SHOW )
    EndIf
WEnd

GUIDelete()
Exit
Posted

Yea, that is great, but one more question, i want to enable button when is in edit some text typed, and if is deleted to disable button, like in msn <_<

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted

Yea, that is great, but one more question, i want to enable button when is in edit some text typed, and if is deleted to disable button, like in msn <_<

I said already I will not do scripts for you.

I gave you concept script. So take it, play with it, accomodate it to your wishes ...

Instead of $GUI_HIDE/$GUI_SHOW use $GUI_DISABLE/$GUI_ENABLE

Posted

Ok,tnx <_<

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

  • 3 weeks later...
Posted

This is smothing what i want but when enter in edit some name from items to select him :/

#include <GUIConstants.au3>

GUICreate("GUI with more treeviews", 340, 200, -1, -1)

$maintree = GUICtrlCreateTreeView(10, 10, 120, 150)
$aboutitem = GUICtrlCreateTreeViewItem("About", $maintree)
$generalitem = GUICtrlCreateTreeViewItem("General", $maintree)
$toolsitem = GUICtrlCreateTreeViewItem("Tools", $maintree)
$effectitem = GUICtrlCreateTreeViewItem("Effects", $maintree)
$styleitem = GUICtrlCreateTreeViewItem("Styles", $maintree)
$cmditem = GUICtrlCreateTreeViewItem("Commandline", $maintree)
$miscitem = GUICtrlCreateTreeViewItem("Type", $maintree)
$edit = GUICtrlCreateEdit("", 150, 44, 163, 20, $ES_AUTOHSCROLL)
$label = GUICtrlCreateLabel("Type", 150, 25, 100, 17)
$about_button = GUICtrlCreateButton("Bugged Button:)", 150, 70, 81, 25, 0)

$cancelbutton = GUICtrlCreateButton("Cancel", 130, 170, 70, 20)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = -3 Or $msg = -1 Or $msg = $cancelbutton
            ExitLoop
    EndSelect
    $item = GUICtrlRead($edit)
    $asd = Guictrlread($label)
    If $item > "" Then
        If BitAND(GUICtrlGetState($about_button), $GUI_DISABLE ) = $GUI_DISABLE Then GUICtrlSetState($about_button, $GUI_ENABLE )
    ElseIf $item <> "0" Then
        If BitAND(GUICtrlGetState($about_button), $GUI_ENABLE ) = $GUI_ENABLE Then GUICtrlSetState($about_button, $GUI_DISABLE )
    EndIf
WEnd

GUIDelete()
Exit

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted (edited)

anybody ???

i just want to enter treeview item name in edit and select him :/

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted

#include <GUIConstants.au3>

GUICreate("GUI with more treeviews", 340, 200, -1, -1)

$maintree = GUICtrlCreateTreeView(10, 10, 120, 150)
$aboutitem = GUICtrlCreateTreeViewItem("About", $maintree)
$generalitem = GUICtrlCreateTreeViewItem("General", $maintree)
$toolsitem = GUICtrlCreateTreeViewItem("Tools", $maintree)
$effectitem = GUICtrlCreateTreeViewItem("Effects", $maintree)
$styleitem = GUICtrlCreateTreeViewItem("Styles", $maintree)
$cmditem = GUICtrlCreateTreeViewItem("Commandline", $maintree)
$miscitem = GUICtrlCreateTreeViewItem("Type", $maintree)
$edit = GUICtrlCreateEdit("", 150, 44, 163, 20, $ES_AUTOHSCROLL)
$label = GUICtrlCreateLabel("Type", 150, 25, 100, 17)
$about_button = GUICtrlCreateButton("Bugged Button:)", 150, 70, 81, 25, 0)

$cancelbutton = GUICtrlCreateButton("Cancel", 130, 170, 70, 20)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
      Case $msg = -3 Or $msg = -1 Or $msg = $cancelbutton
            ExitLoop
    Case $msg = $about_button
        $item = GUICtrlRead($edit)
        ControlTreeView ( "GUI with more treeviews", "", $maintree, "Select", $item)
    EndSelect
    $item = GUICtrlRead($edit)
    $asd = Guictrlread($label)
    If $item > "" Then
        If BitAND(GUICtrlGetState($about_button), $GUI_DISABLE ) = $GUI_DISABLE Then GUICtrlSetState($about_button, $GUI_ENABLE )
    ElseIf $item <> "0" Then
        If BitAND(GUICtrlGetState($about_button), $GUI_ENABLE ) = $GUI_ENABLE Then GUICtrlSetState($about_button, $GUI_DISABLE )
    EndIf
WEnd

GUIDelete()
Exit

The point of world view

Posted

Thank you man.. that is very cool... but tis is better but bugged, first item is selected if edit = "" why?

#include <GUIConstants.au3>

GUICreate("GUI with more treeviews", 340, 200, -1, -1)

$maintree = GUICtrlCreateTreeView(10, 10, 120, 150)
$aboutitem = GUICtrlCreateTreeViewItem("About", $maintree)
$generalitem = GUICtrlCreateTreeViewItem("General", $maintree)
$toolsitem = GUICtrlCreateTreeViewItem("Tools", $maintree)
$effectitem = GUICtrlCreateTreeViewItem("Effects", $maintree)
$styleitem = GUICtrlCreateTreeViewItem("Styles", $maintree)
$cmditem = GUICtrlCreateTreeViewItem("Commandline", $maintree)
$miscitem = GUICtrlCreateTreeViewItem("Type", $maintree)
$edit = GUICtrlCreateEdit("", 150, 44, 163, 20, $ES_AUTOHSCROLL)
$label = GUICtrlCreateLabel("Type", 150, 25, 100, 17)
$about_button = GUICtrlCreateButton("Bugged Button:)", 150, 70, 81, 25, 0)

$cancelbutton = GUICtrlCreateButton("Cancel", 130, 170, 70, 20)
GUISetState()

While 1
    $item = GUICtrlRead($edit)
    ControlTreeView ( "GUI with more treeviews", "", $maintree, "Select", $item)
    $msg = GUIGetMsg()
    Select
      Case $msg = -3 Or $msg = -1 Or $msg = $cancelbutton
            ExitLoop
    EndSelect
    $item = GUICtrlRead($edit)
    $asd = Guictrlread($label)
    If $item > "" Then
        If BitAND(GUICtrlGetState($about_button), $GUI_DISABLE ) = $GUI_DISABLE Then GUICtrlSetState($about_button, $GUI_ENABLE )
    ElseIf $item <> "0" Then
        If BitAND(GUICtrlGetState($about_button), $GUI_ENABLE ) = $GUI_ENABLE Then GUICtrlSetState($about_button, $GUI_DISABLE )
    EndIf
WEnd

GUIDelete()
Exit

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted (edited)

Fixed :P

but i dont know how to deselect item :/

#include <GUIConstants.au3>

GUICreate("GUI with more treeviews", 340, 200, -1, -1)

$maintree = GUICtrlCreateTreeView(10, 10, 120, 150)
$aboutitem = GUICtrlCreateTreeViewItem("About", $maintree)
$generalitem = GUICtrlCreateTreeViewItem("General", $maintree)
$toolsitem = GUICtrlCreateTreeViewItem("Tools", $maintree)
$effectitem = GUICtrlCreateTreeViewItem("Tools2", $maintree)
$styleitem = GUICtrlCreateTreeViewItem("Styles", $maintree)
$cmditem = GUICtrlCreateTreeViewItem("Commandline", $maintree)
$miscitem = GUICtrlCreateTreeViewItem("Type", $maintree)
$edit = GUICtrlCreateEdit("", 150, 44, 163, 20, $ES_AUTOHSCROLL)
$label = GUICtrlCreateLabel("Type", 150, 25, 100, 17)
$about_button = GUICtrlCreateButton("Bugged Button:)", 150, 70, 81, 25, 0)

$cancelbutton = GUICtrlCreateButton("Cancel", 130, 170, 70, 20)
GUISetState()

While 1
    $item = GUICtrlRead($edit)
    If $item = "" Then
    ElseIf $item <> "" Then
    ControlTreeView( "GUI with more treeviews", "", $maintree, "Select", $item)
    EndIf
    $msg = GUIGetMsg()
    Select
      Case $msg = -3 Or $msg = -1 Or $msg = $cancelbutton
            ExitLoop
    EndSelect
    $item = GUICtrlRead($edit)
    $asd = Guictrlread($label)
    If $item > "" Then
        If BitAND(GUICtrlGetState($about_button), $GUI_DISABLE ) = $GUI_DISABLE Then GUICtrlSetState($about_button, $GUI_ENABLE )
    ElseIf $item <> "0" Then
        If BitAND(GUICtrlGetState($about_button), $GUI_ENABLE ) = $GUI_ENABLE Then GUICtrlSetState($about_button, $GUI_DISABLE )
    EndIf
WEnd

GUIDelete()
Exit
Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

  • 3 weeks later...
Posted

Look for this script pls:

Type for example Item5 and delete and automaticly will be selected first item :/

#include <GuiConstants.au3>
#include <GuiTreeView.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$TreeView1 = GUICtrlCreateTreeView(20, 30, 130, 200, BitOR($TVS_HASBUTTONS, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_TRACKSELECT, $TVS_FULLROWSELECT, $WS_HSCROLL, $WS_VSCROLL, $WS_BORDER, $WS_CLIPSIBLINGS), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
_GUICtrlTreeView_SetTextColor ($TreeView1, 0xDC143C)
_GUICtrlTreeView_SetBkColor ($TreeView1, 0x40e0d0)
Guictrlcreatetreeviewitem("Item1",$TreeView1)
Guictrlcreatetreeviewitem("Item2",$TreeView1)
Guictrlcreatetreeviewitem("Item3",$TreeView1)
Guictrlcreatetreeviewitem("Item4",$TreeView1)
Guictrlcreatetreeviewitem("Item5",$TreeView1)
Guictrlcreatetreeviewitem("Item6",$TreeView1)
$Label0a = GUICtrlCreateEdit("", 247, 38, 100, 19, $ES_AUTOHSCROLL)
GuiSetState()

$old1 = ""
While 1
        $item = GUICtrlRead($Label0a)
    If $item <> $old1 Then
        $old1 = $item
        ControlTreeView ("MyGUI", "", $TreeView1, "Select", $item)
    EndIf
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
        ;;;
    EndSelect
WEnd
Exit

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Posted

Hi, how hard can it be?

#include <GuiConstants.au3>
#include <GuiTreeView.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$TreeView1 = GUICtrlCreateTreeView(20, 30, 130, 200, BitOR($TVS_HASBUTTONS, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_TRACKSELECT, $TVS_FULLROWSELECT, $WS_HSCROLL, $WS_VSCROLL, $WS_BORDER, $WS_CLIPSIBLINGS), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
_GUICtrlTreeView_SetTextColor ($TreeView1, 0xDC143C)
_GUICtrlTreeView_SetBkColor ($TreeView1, 0x40e0d0)
Guictrlcreatetreeviewitem("Item1",$TreeView1)
Guictrlcreatetreeviewitem("Item2",$TreeView1)
Guictrlcreatetreeviewitem("Item3",$TreeView1)
Guictrlcreatetreeviewitem("Item4",$TreeView1)
Guictrlcreatetreeviewitem("Item5",$TreeView1)
Guictrlcreatetreeviewitem("Item6",$TreeView1)
$Input = GUICtrlCreateInput("", 247, 38, 100, 19, $ES_AUTOHSCROLL)
GuiSetState()

$old1 = ""

While 1
    If GuiCtrlRead($Input) <>  $old1 Then
        Local $FindEx = _GUICtrlTreeView_FindItemEx(GUICtrlGetHandle($TreeView1), GUICtrlRead($Input))
        If $FindEx Then
            _GUICtrlTreeView_SelectItem(GUICtrlGetHandle($TreeView1), $FindEx, $TVGN_CARET)
        Else
            If GUICtrlRead($TreeView1) Then _GUICtrlTreeView_SetState(GUICtrlGetHandle($TreeView1), GUICtrlGetHandle(GUICtrlRead($TreeView1)), 0, $TVIS_SELECTED)
        EndIf
        $old1 = GuiCtrlRead($Input)
    EndIf
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
        ;;;
    EndSelect
WEnd
Exit

Cheers

Posted

really is not hard, tnx :)

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

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
×
×
  • Create New...