Sign in to follow this  
Followers 0
monitorlg

Groupbox items cannot selected

2 posts in this topic

Hi All,

I am creating a GUI where 2 Group boxes are present.One group box have TreeView, and other Group box have List view with in them.

When i set the background color of Group boxes, i am not able to access the items inside the Group box,

for ex: I am not able to expand the tree of the Group box one and i am not able to select the items in ListView of Groupbox2.

Here is my code:

Code is only for creation of Groupbox1:

#include <IE.au3>

#include <EditConstants.au3>

#include <GuiButton.au3>

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <ListBoxConstants.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#include <TreeViewConstants.au3>

#include <Excel_Monitor.au3>

#include <GuiListView.au3>

#include <ListViewConstants.au3>

#include <GuiConstantsEx.au3>

#include <GuiTreeView.au3>

#include <Constants.au3>

#Region ### START Koda GUI section ### Form=d:\autoit\form1gui.kxf

;$Form1_1 = GUICreate("Form1", 1007, 632, 187, 116)

$dwidth = @DesktopWidth

$dheight = @DesktopHeight

$Form1_1 = GUICreate("Form1", $dwidth, $dheight, -3, -3)

#Region ### START Koda GUI section ### Form=d:\auto it\ipsca\form1_1.kxf

;------------------------------------Modules Group-------------------------------

GUICtrlCreateGraphic(16, 87, 183, 859)

GUICtrlSetBkColor(-1, 0xbc8f8f)

$Gmodules = GUICtrlCreateGroup("Modules in IPSCA", 16, 80, 185, 865)

;---------------------------------------Creating Treeview in the Modules Group--------------

$TreeView1 = GUICtrlCreateTreeView(28, 144, 160, 500)

$hImage = _GUIImageList_Create(16, 16, 5, 3)

_GUIImageList_AddIcon($hImage, "shell32.dll", 110)

_GUIImageList_AddIcon($hImage, "shell32.dll", 131)

_GUIImageList_AddIcon($hImage, "shell32.dll", 165)

_GUIImageList_AddIcon($hImage, "shell32.dll", 168)

_GUIImageList_AddIcon($hImage, "shell32.dll", 137)

_GUIImageList_AddIcon($hImage, "shell32.dll", 146)

_GUICtrlTreeView_SetNormalImageList($TreeView1, $hImage)

$TreeView1_0 = GUICtrlCreateTreeViewItem("System", $TreeView1)

$TreeView1_1 = GUICtrlCreateTreeViewItem("Version", $TreeView1_0)

$TreeView1_2 = GUICtrlCreateTreeViewItem("Date & Time", $TreeView1_0)

$TreeView1_3 = GUICtrlCreateTreeViewItem("Maintainenance", $TreeView1_0)

$TreeView1_4 = GUICtrlCreateTreeViewItem("Log", $TreeView1_0)

$TreeView1_5 = GUICtrlCreateTreeViewItem("Language", $TreeView1_0)

$TreeView1_6 = GUICtrlCreateTreeViewItem("Audio", $TreeView1)

$TreeView1_7 = GUICtrlCreateTreeViewItem("Basic", $TreeView1_6)

$TreeView1_8 = GUICtrlCreateTreeViewItem("Speaker", $TreeView1_6)

$TreeView1_9 = GUICtrlCreateTreeViewItem("Video", $TreeView1)

$TreeView1_10 = GUICtrlCreateTreeViewItem("Camera", $TreeView1_9)

$TreeView1_11 = GUICtrlCreateTreeViewItem("Stream", $TreeView1_9)

$TreeView1_12 = GUICtrlCreateTreeViewItem("Pan/Tilt", $TreeView1_9)

$TreeView1_13 = GUICtrlCreateTreeViewItem("Network", $TreeView1)

$TreeView1_14 = GUICtrlCreateTreeViewItem("Basic", $TreeView1_13)

$TreeView1_15 = GUICtrlCreateTreeViewItem("RTPStream", $TreeView1_13)

$TreeView1_16 = GUICtrlCreateTreeViewItem("TCP/IP", $TreeView1_13)

$TreeView1_17 = GUICtrlCreateTreeViewItem("DDNS", $TreeView1_13)

$TreeView1_18 = GUICtrlCreateTreeViewItem("IP Filtering", $TreeView1_13)

$TreeView1_19 = GUICtrlCreateTreeViewItem("Encryption", $TreeView1_13)

$TreeView1_20 = GUICtrlCreateTreeViewItem("User", $TreeView1)

$TreeView1_21 = GUICtrlCreateTreeViewItem("Basic", $TreeView1_20)

$TreeView1_22 = GUICtrlCreateTreeViewItem("List", $TreeView1_20)

$TreeView1_23 = GUICtrlCreateTreeViewItem("Schedule", $TreeView1)

$TreeView1_24 = GUICtrlCreateTreeViewItem("Event List", $TreeView1_23)

$TreeView1_25 = GUICtrlCreateTreeViewItem("Event Server List", $TreeView1_23)

$TreeView1_26 = GUICtrlCreateTreeViewItem("Recording Schedule", $TreeView1_23)

$TreeView1_27 = GUICtrlCreateTreeViewItem("Recording server", $TreeView1_23)

$TreeView1_28 = GUICtrlCreateTreeViewItem("Sensor & Relay", $TreeView1_23)

GUICtrlSetFont($TreeView1, 8, 800, 0, "MS Sans Serif")

_GUICtrlTreeView_SetBkColor($TreeView1, 0xeee8aa)

_GUICtrlTreeView_SetTextColor($TreeView1, 0xff0000)

_GUICtrlTreeView_SetLineColor($TreeView1, 0x000000)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Please Help me...

Thank you

Share this post


Link to post
Share on other sites



Hi All,

I am creating a GUI where 2 Group boxes are present.One group box have TreeView, and other Group box have List view with in them.

When i set the background color of Group boxes, i am not able to access the items inside the Group box,

for ex: I am not able to expand the tree of the Group box one and i am not able to select the items in ListView of Groupbox2.

Here is my code:

Code is only for creation of Groupbox1:

CODE
#include <IE.au3>

#include <EditConstants.au3>

#include <GuiButton.au3>

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <ListBoxConstants.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#include <TreeViewConstants.au3>

#include <Excel_Monitor.au3>

#include <GuiListView.au3>

#include <ListViewConstants.au3>

#include <GuiConstantsEx.au3>

#include <GuiTreeView.au3>

#include <Constants.au3>

#Region ### START Koda GUI section ### Form=d:\autoit\form1gui.kxf

;$Form1_1 = GUICreate("Form1", 1007, 632, 187, 116)

$dwidth = @DesktopWidth

$dheight = @DesktopHeight

$Form1_1 = GUICreate("Form1", $dwidth, $dheight, -3, -3)

#Region ### START Koda GUI section ### Form=d:\auto it\ipsca\form1_1.kxf

;------------------------------------Modules Group-------------------------------

GUICtrlCreateGraphic(16, 87, 183, 859)

GUICtrlSetBkColor(-1, 0xbc8f8f)

$Gmodules = GUICtrlCreateGroup("Modules in IPSCA", 16, 80, 185, 865)

;---------------------------------------Creating Treeview in the Modules Group--------------

$TreeView1 = GUICtrlCreateTreeView(28, 144, 160, 500)

$hImage = _GUIImageList_Create(16, 16, 5, 3)

_GUIImageList_AddIcon($hImage, "shell32.dll", 110)

_GUIImageList_AddIcon($hImage, "shell32.dll", 131)

_GUIImageList_AddIcon($hImage, "shell32.dll", 165)

_GUIImageList_AddIcon($hImage, "shell32.dll", 168)

_GUIImageList_AddIcon($hImage, "shell32.dll", 137)

_GUIImageList_AddIcon($hImage, "shell32.dll", 146)

_GUICtrlTreeView_SetNormalImageList($TreeView1, $hImage)

$TreeView1_0 = GUICtrlCreateTreeViewItem("System", $TreeView1)

$TreeView1_1 = GUICtrlCreateTreeViewItem("Version", $TreeView1_0)

$TreeView1_2 = GUICtrlCreateTreeViewItem("Date & Time", $TreeView1_0)

$TreeView1_3 = GUICtrlCreateTreeViewItem("Maintainenance", $TreeView1_0)

$TreeView1_4 = GUICtrlCreateTreeViewItem("Log", $TreeView1_0)

$TreeView1_5 = GUICtrlCreateTreeViewItem("Language", $TreeView1_0)

$TreeView1_6 = GUICtrlCreateTreeViewItem("Audio", $TreeView1)

$TreeView1_7 = GUICtrlCreateTreeViewItem("Basic", $TreeView1_6)

$TreeView1_8 = GUICtrlCreateTreeViewItem("Speaker", $TreeView1_6)

$TreeView1_9 = GUICtrlCreateTreeViewItem("Video", $TreeView1)

$TreeView1_10 = GUICtrlCreateTreeViewItem("Camera", $TreeView1_9)

$TreeView1_11 = GUICtrlCreateTreeViewItem("Stream", $TreeView1_9)

$TreeView1_12 = GUICtrlCreateTreeViewItem("Pan/Tilt", $TreeView1_9)

$TreeView1_13 = GUICtrlCreateTreeViewItem("Network", $TreeView1)

$TreeView1_14 = GUICtrlCreateTreeViewItem("Basic", $TreeView1_13)

$TreeView1_15 = GUICtrlCreateTreeViewItem("RTPStream", $TreeView1_13)

$TreeView1_16 = GUICtrlCreateTreeViewItem("TCP/IP", $TreeView1_13)

$TreeView1_17 = GUICtrlCreateTreeViewItem("DDNS", $TreeView1_13)

$TreeView1_18 = GUICtrlCreateTreeViewItem("IP Filtering", $TreeView1_13)

$TreeView1_19 = GUICtrlCreateTreeViewItem("Encryption", $TreeView1_13)

$TreeView1_20 = GUICtrlCreateTreeViewItem("User", $TreeView1)

$TreeView1_21 = GUICtrlCreateTreeViewItem("Basic", $TreeView1_20)

$TreeView1_22 = GUICtrlCreateTreeViewItem("List", $TreeView1_20)

$TreeView1_23 = GUICtrlCreateTreeViewItem("Schedule", $TreeView1)

$TreeView1_24 = GUICtrlCreateTreeViewItem("Event List", $TreeView1_23)

$TreeView1_25 = GUICtrlCreateTreeViewItem("Event Server List", $TreeView1_23)

$TreeView1_26 = GUICtrlCreateTreeViewItem("Recording Schedule", $TreeView1_23)

$TreeView1_27 = GUICtrlCreateTreeViewItem("Recording server", $TreeView1_23)

$TreeView1_28 = GUICtrlCreateTreeViewItem("Sensor & Relay", $TreeView1_23)

GUICtrlSetFont($TreeView1, 8, 800, 0, "MS Sans Serif")

_GUICtrlTreeView_SetBkColor($TreeView1, 0xeee8aa)

_GUICtrlTreeView_SetTextColor($TreeView1, 0xff0000)

_GUICtrlTreeView_SetLineColor($TreeView1, 0x000000)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Please Help me...

Thank you

The problem has nothing to do with groups, just overlapping controls. The graphic you created is receiving the mouse clicks instead of the TreeView control. Just changing the order you create them in fixes it:
;------------------------------------Modules Group-------------------------------
$Gmodules = GUICtrlCreateGroup("Modules in IPSCA", 16, 80, 185, 865)

$TreeView1 = GUICtrlCreateTreeView(28, 144, 160, 500)
GUICtrlCreateGraphic(16, 87, 183, 859)
GUICtrlSetBkColor(-1, 0xbc8f8f)

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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