Sign in to follow this  
Followers 0
new2this

Move from GuictrlcreateTab to _Guictrltab_create is messy

6 posts in this topic

I have a gui with 7 different tabs on it with each tab having it's own series of buttons, combo boxes, labels, and input boxes. Everything works great with the gui, but I would like to make it look nicer, so I moved from using GuiCtrlCreateTab() to _guictrltab_create and _guictrltab_insertitem. The tabs get created alright, but every button, combo box, label, and input box is visible on the entire GUI, no matter which tab you are on. I have included some screen captures of the "before" and "after" in addition to my code.

#include <GUIConstants.au3>
#Include <GuiComboBox.au3>
#Include <GuiListBox.au3>
#include <Array.au3>
#include <file.au3>
#include <GuiConstantsEx.au3>
#include <GuiTab.au3>


$Form1 = GUICreate("Toolbox", 706, 390, 193, 115,$WS_SIZEBOX+$WS_SYSMENU+$WS_MAXIMIZEBOX+$WS_MINIMIZEBOX)
GUISetFont(12, 400);, 0, "Comic Sans MS")
GUISetBkColor(0xFFFFFF,$Form1)


$lblMain = GUICtrlCreateLabel("SAN Toolbox", 115, 35, 430, 60, $SS_CENTER)
GUICtrlSetResizing ($lblMain,$GUI_DOCKHEIGHT + $GUI_DOCKTOP)
GUICtrlSetBkColor($lblMain, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($lblMain, 22)

;***************************************************************************************************

********************************************************************
;Sets up the GUI in Tabbed mode
;***************************************************************************************************

********************************************************************
$tab = _GUICtrlTab_Create($Form1, 0, 120, 706, 250)
GUICtrlSetResizing ($tab,$GUI_DOCKBORDERS)
GUISetState()

;***************************************************************************************************

********************************************************************
;Sets up the first tab "My Volumes"
;***************************************************************************************************

********************************************************************
;$myVolumeGroup = GUICtrlCreateTabItem("My Volumes")

$myVolumeGroup=_GUICtrlTab_InsertItem($tab, 0, "My Volumes")
GUICtrlSetResizing (-1,$GUI_DOCKBORDERS)
$lblMyVolumes = GUICtrlCreateLabel("Volume location, Volume Name, Size", 30, 150, 400, 25)
GUICtrlSetResizing (-1,$GUI_DOCKBORDERS)
$lstMyVolumes = GUICtrlCreateList("", 30, 180, 400, 100)
GUICtrlSetResizing (-1,$GUI_DOCKBORDERS)

;***************************************************************************************************

********************************************************************
;Sets up the Create tab
;***************************************************************************************************

********************************************************************
;$Group1 = GUICtrlCreateTabItem("Create")
$Group1=_GUICtrlTab_InsertItem($tab, 1, "Create")
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblCreateSize = GUICtrlCreateLabel("Size(GB):", 5, 160, 100, 24, $SS_CENTER)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$inptCreateSize = GUICtrlCreateInput("", 110, 160, 117, 28)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblCreateVolumeName = GUICtrlCreateLabel("SAN Volume Name:", 5, 202, 100, 34, $SS_CENTER)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$inptCreateName = GUICtrlCreateInput("", 110, 202, 117, 28)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblCreateServername = GUICtrlCreateLabel("Server name:", 256, 160, 98, 24)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$cmbCreateServername = GUICtrlCreateCombo("", 350, 160, 141, 25, $CBS_Dropdownlist + $WS_VSCROLL)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblCreateFolderName = GUICtrlCreateLabel("Destination:", 256, 202, 98, 24)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$cmbCreateFolderName = GUICtrlCreateCombo("", 350, 202, 141, 24, $CBS_Dropdownlist + $WS_VSCROLL)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnCreateVolume = GUICtrlCreateButton("Create\Attach Volume", 514, 175, 169, 25, 0)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)

;***************************************************************************************************

********************************************************************
;Sets up the Delte tab
;***************************************************************************************************

********************************************************************
;$Group2 = GUICtrlCreateTabItem("Delete")
$Group2=_GUICtrlTab_InsertItem($tab, 2, "Delete")
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblDeleteVolume = GUICtrlCreateLabel("SAN Volume Name:", 5, 160, 100, 34, $SS_CENTER)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$cmbDeleteVolume = GUICtrlCreateCombo("", 110, 160, 187, 28, $CBS_Dropdownlist + $WS_VSCROLL)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnDeleteVolume = GUICtrlCreateButton("Unmap\Delete Volume", 504, 160, 169, 25, 0)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)

;***************************************************************************************************

********************************************************************
;Sets up the Expand tab
;***************************************************************************************************

********************************************************************
;$Group3 = GUICtrlCreateTabItem("Expand")
$Group3=_GUICtrlTab_InsertItem($tab, 3, "Expand")
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblExpandVolume = GUICtrlCreateLabel("SAN Volume Name:", 5, 160, 100, 34, $SS_CENTER)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$cmbExpandVolume = GUICtrlCreateCombo("", 110, 160, 187, 28, $CBS_Dropdownlist + $WS_VSCROLL)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblExpandSize = GUICtrlCreateLabel("Amount (GB):", 5, 202, 100, 34, $SS_CENTER)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$inptExpandSize = GUICtrlCreateInput("", 110, 202, 187, 28)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnExpandVolume = GUICtrlCreateButton("Expand Volume", 504, 175, 169, 25, 0)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblExpandLocalMachine = GUICtrlCreateLabel("NOTE: You must perform this procedure on the computer where the SAN volume for expansion is LUN mapped.", 10, 250, 686, 40, $SS_CENTER)
GUICtrlSetFont($lblExpandLocalMachine, 14, 400)
GUICtrlSetResizing ($lblExpandLocalMachine,$GUI_DOCKAUTO)


;***************************************************************************************************

********************************************************************
;Sets up the Snapshot tab
;***************************************************************************************************

********************************************************************
;$Group4 = GUICtrlCreateTabItem("Snapshot")
$Group4=_GUICtrlTab_InsertItem($tab, 4, "Snapshot")
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$radPostImaging = GUICtrlCreateRadio("Post Imaging", 8, 160, 120, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$radPostProcessing = GUICtrlCreateRadio("Post Processing", 8, 185, 150, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$radUserProvided = GUICtrlCreateRadio("User Provided Label ------------->", 8, 210, 250, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblSnapShotVolume = GUICtrlCreateLabel("Volume Name:", 180, 158, 120, 25)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$inptUserProvided = GUICtrlCreateInput("", 290, 210, 189, 28)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$cmbSnapshotVolume = GUICtrlCreateCombo("", 290, 158, 189, 25, $CBS_Dropdownlist + $WS_VSCROLL + $CBS_SORT)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$chkMapReplayToServer = GUICtrlCreateCheckbox("Map snapshot to this server:", 20, 255, 220, 18)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$cmbServerForSnapshot = GUICtrlCreateCombo("", 290, 250, 189, 25, $CBS_Dropdownlist + $WS_VSCROLL)
$lblFolderForView = GUICtrlCreateLabel("Place snapshot ""view"" in this folder:", 20, 290, 260, 18)
$cmbFolderForView = GUICtrlCreateCombo("", 290, 285, 189, 25, $CBS_Dropdownlist + $WS_VSCROLL)
GUICtrlSetState($cmbFolderForView, $gui_disable)
GUICtrlSetState($cmbServerForSnapshot, $gui_disable)
$btnSnapshotCreate = GUICtrlCreateButton("Create SnapShot", 504, 220, 169, 35, 0)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)

;***************************************************************************************************

********************************************************************
;Sets up the Move tab
;***************************************************************************************************

********************************************************************
;$Group5 = GUICtrlCreateTabItem("Move")
$Group5=_GUICtrlTab_InsertItem($tab, 5, "Move")
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblMoveVolumes = GUICtrlCreateLabel("Volume location, Volume Name, Size", 10, 155, 400, 25)
GUICtrlSetResizing (-1,$GUI_DOCKTOP)
$lstMoveVolumes = GUICtrlCreateList("", 10, 180, 350, 100)
GUICtrlSetResizing (-1,$GUI_DOCKTOP + $GUI_DOCKBOTTOM)
$radMoveFolder = GUICtrlCreateRadio("Move to folder:", 370, 185, 150, 12)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$cmbMoveFolder = GUICtrlCreateCombo("", 395, 205, 150, 20, $CBS_Dropdownlist + $WS_VSCROLL)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$radMoveMap = GUICtrlCreateRadio("Move LUN Mapping:", 370, 235, 185, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$cmbMoveMapping = GUICtrlCreateCombo("", 395, 260, 150, 20, $CBS_Dropdownlist + $WS_VSCROLL)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnMoveFolder = GUICtrlCreateButton("Move to folder", 568, 205, 120, 24)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnMoveMapping = GUICtrlCreateButton("Move LUN Mapping", 553, 255, 150, 24)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
GUICtrlSetState($btnMoveFolder, $gui_disable)
GUICtrlSetState($btnMoveMapping, $gui_disable)

;***************************************************************************************************

********************************************************************
;Sets up the Map\Unmap tab
;***************************************************************************************************

********************************************************************
;$Group6 = GUICtrlCreateTabItem("Map\Unmap")
$group6=_GUICtrlTab_InsertItem($tab, 6, "Map\Unmap")
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblMapVolumesList = GUICtrlCreateLabel("Volume location, Volume Name, Size", 10, 155, 400, 25)
GUICtrlSetResizing (-1,$GUI_DOCKTOP)
$lstMapVolumes = GUICtrlCreateList("", 10, 180, 350, 100)
GUICtrlSetResizing (-1,$GUI_DOCKTOP + $GUI_DOCKBOTTOM)
$radUnmapVolume = GUICtrlCreateRadio("Remove LUN Map:", 370, 185, 170, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$radMapVolumes = GUICtrlCreateRadio("Add LUN Map:", 370, 215, 120, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$cmbMapVolumes = GUICtrlCreateCombo("", 395, 235, 150, 20, $CBS_Dropdownlist + $WS_VSCROLL)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnUnmapVolumes = GUICtrlCreateButton("Unmap Now", 563, 205, 120, 24)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnMapVolumes = GUICtrlCreateButton("Map Now", 563, 255, 120, 24)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
GUICtrlSetState($btnMapVolumes, $gui_disable)
GUICtrlSetState($btnUnmapVolumes, $gui_disable)

;***************************************************************************************************

********************************************************************
;Sets up the Back this up II tab
;***************************************************************************************************

********************************************************************
;$Group7 = GUICtrlCreateTabItem("Back This UP II")
$Group7=_GUICtrlTab_InsertItem($tab, 7, "Back This Up II")
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblBackupServer = GUICtrlCreateLabel("Backup Server Name:", 8, 160, 180, 25)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$inptBackupServer = GUICtrlCreateInput("server", 190, 160, 108, 25)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblBackupName = GUICtrlCreateLabel("Backup Job Name:", 8, 190, 180, 24)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$inptBackupName = GUICtrlCreateInput("", 190, 190, 108, 25)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblUserName = GUICtrlCreateLabel(@UserName & " password:", 8, 220, 180, 25)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$inptBackupPassword = GUICtrlCreateInput("", 190, 220, 108, 25, $ES_PASSWORD)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$radDerivitive = GUICtrlCreateRadio("Derivitive", 340, 167, 110, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$radNearline = GUICtrlCreateRadio("Nearline", 340, 197, 110, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$chkBackup = GUICtrlCreateCheckbox("Export Tapes", 340, 227, 120, 18)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnBackupBrowse = GUICtrlCreateButton("Browse For Target", 505, 168, 169, 25, 0)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$btnBackupSchedule = GUICtrlCreateButton("Schedule Backup", 505, 213, 169, 25, 0)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
$lblBackupTarget = GUICtrlCreateLabel("Current backup selection: ", 20, 270, 680, 40)
GUICtrlSetResizing (-1,$GUI_DOCKAUTO)
GUICtrlSetBkColor($lblBackupTarget, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($lblBackupTarget, 14, 400)

$btnCloseToolbox = GUICtrlCreateButton("Close Toolbox", 102, 320, 180, 30)
GUICtrlSetResizing ($btnCloseToolbox,$GUI_DOCKBOTTOM+$GUI_DOCKSIZE+$GUI_DOCKHCENTER)
$btnRefreshToolbox = GUICtrlCreateButton("Refresh Toolbox", 404, 320, 180, 30)
GUICtrlSetResizing ($btnRefreshToolbox,$GUI_DOCKBOTTOM+$GUI_DOCKSIZE+$GUI_DOCKHCENTER)
#EndRegion ### END Koda GUI section ###



ProgramMain()

Func ProgramMain()


GUISetState(@SW_SHOW, $Form1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $btnCloseToolbox
        Exit
EndSwitch   
WEnd
EndFunc

post-28960-1207343282_thumb.jpg

post-28960-1207343288_thumb.jpg

post-28960-1207343294_thumb.jpg

post-28960-1207343301_thumb.jpg

Share this post


Link to post
Share on other sites



Everything works great with the gui, but I would like to make it look nicer, so I moved from using GuiCtrlCreateTab() to _guictrltab_create

I'm kinda curious how exactly _GUICtrlTab_Create() makes the tabs look nicer...

If anything, it looks like you've just discovered ancient wisdom - "if it ain't broke, don't fix it" :)


"be smart, drink your wine"

Share this post


Link to post
Share on other sites

It appears that the _GuiCtrlTab_Create has more extended styles (like highlighting).

Share this post


Link to post
Share on other sites

It appears that the _GuiCtrlTab_Create has more extended styles (like highlighting).

You should be able to apply anything that the UDF has to the built-in control


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thanks for all of the replies...

I think I'll revert to the GuiCtrlCreateTab and try the extended styles there. Thanks again.

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