sandin Posted May 18, 2008 Share Posted May 18, 2008 (edited) I have this script: expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> Dim $Letter1[13] Global $letter = "" $Form1 = GUICreate("Form1", 372, 225, 214, 154) $Tab1 = GUICtrlCreateTab(32, 5, 305, 185) $Tabitem1 = GUICtrlCreateTabItem("General") $Button1 = GUICtrlCreateButton("Button1", 50, 50) $tabitem2 = GUICtrlCreateTabItem("Something") GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlCreateTabItem("") $dodaj = GUICtrlCreateButton("Add", 32, 190) $oduzmi = GUICtrlCreateButton("Delete", 200, 190) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $dodaj $neki_broj = Random(3,12, 1) for $i = 1 to $neki_broj $Letter1[$i] = Chr(Random(Asc("a"), Asc("z"), 1)) $letter = $letter & $Letter1[$i] Next $promenljiva = GUICtrlCreateTabItem($letter) $Button2 = GUICtrlCreateButton("Button2", 80, 80) GUICtrlCreateTabItem("") $letter = "" case $oduzmi $selektovani_tab = GUICtrlRead($Tab1, 1) if $selektovani_tab <> $Tabitem1 And $selektovani_tab <> $Tabitem2 Then GUICtrlDelete ($selektovani_tab) GUICtrlSetState($selektovani_tab-4, $GUI_SHOW) GUICtrlSetState($selektovani_tab-2, $GUI_SHOW) EndIf EndSwitch WEnd and each time I create a new tab, I get focus on it, which I don't want to happen. I can delete GUICtrlCreateTabItem("") line under case $dodaj, then I don't get focus, but in that case after clicking ADD button I loose everything that is under "general" tab (button1). Can I make new tab without focusing to it? Edited May 18, 2008 by sandin Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
sandin Posted May 18, 2008 Author Share Posted May 18, 2008 is it possible? Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
TnTProductions Posted May 18, 2008 Share Posted May 18, 2008 define what you mean by "focus" on a new tab "FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology" Link to comment Share on other sites More sharing options...
TnTProductions Posted May 18, 2008 Share Posted May 18, 2008 also displaying the entire script may help some people? "FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology" Link to comment Share on other sites More sharing options...
zackrspv Posted May 18, 2008 Share Posted May 18, 2008 (edited) So, this may help: Note, the addition of $active and how $active is used under your new tab button expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTab.au3> #include <Array.au3> Dim $Letter1[13] Global $letter = "" $Form1 = GUICreate("Form1", 372, 225, 214, 154) $Tab1 = GUICtrlCreateTab(32, 5, 305, 185) $Tabitem1 = GUICtrlCreateTabItem("General") $Button1 = GUICtrlCreateButton("Button1", 50, 50) $tabitem2 = GUICtrlCreateTabItem("Something") GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlCreateTabItem("") $dodaj = GUICtrlCreateButton("Add", 32, 190) $oduzmi = GUICtrlCreateButton("Delete", 200, 190) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() $active = GUICtrlRead($tab1, 1) Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $dodaj $neki_broj = Random(3,12, 1) for $i = 1 to $neki_broj $Letter1[$i] = Chr(Random(Asc("a"), Asc("z"), 1)) $letter = $letter & $Letter1[$i] Next $promenljiva = GUICtrlCreateTabItem($letter) $Button2 = GUICtrlCreateButton("Button2", 80, 80) GUICtrlCreateTabItem("") GUICtrlSetState($active, $GUI_SHOW) $letter = "" case $oduzmi $selektovani_tab = GUICtrlRead($Tab1, 1) if $selektovani_tab <> $Tabitem1 And $selektovani_tab <> $Tabitem2 Then GUICtrlDelete ($selektovani_tab) GUICtrlSetState($selektovani_tab-4, $GUI_SHOW) GUICtrlSetState($selektovani_tab-2, $GUI_SHOW) EndIf EndSwitch WEnd Edited May 18, 2008 by zackrspv -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
sandin Posted May 18, 2008 Author Share Posted May 18, 2008 tnx for replies define what you mean by "focus" on a new tabfocus = set to be active also displaying the entire script may help some people?the post above is my entire script So, this may help: Note, the addition of $active and how $active is used under your new tab button expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTab.au3> #include <Array.au3> Dim $Letter1[13] Global $letter = "" $Form1 = GUICreate("Form1", 372, 225, 214, 154) $Tab1 = GUICtrlCreateTab(32, 5, 305, 185) $Tabitem1 = GUICtrlCreateTabItem("General") $Button1 = GUICtrlCreateButton("Button1", 50, 50) $tabitem2 = GUICtrlCreateTabItem("Something") GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlCreateTabItem("") $dodaj = GUICtrlCreateButton("Add", 32, 190) $oduzmi = GUICtrlCreateButton("Delete", 200, 190) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() $active = GUICtrlRead($tab1, 1) Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $dodaj $neki_broj = Random(3,12, 1) for $i = 1 to $neki_broj $Letter1[$i] = Chr(Random(Asc("a"), Asc("z"), 1)) $letter = $letter & $Letter1[$i] Next $promenljiva = GUICtrlCreateTabItem($letter) $Button2 = GUICtrlCreateButton("Button2", 80, 80) GUICtrlCreateTabItem("") GUICtrlSetState($active, $GUI_SHOW) $letter = "" case $oduzmi $selektovani_tab = GUICtrlRead($Tab1, 1) if $selektovani_tab <> $Tabitem1 And $selektovani_tab <> $Tabitem2 Then GUICtrlDelete ($selektovani_tab) GUICtrlSetState($selektovani_tab-4, $GUI_SHOW) GUICtrlSetState($selektovani_tab-2, $GUI_SHOW) EndIf EndSwitch WEndtnx, that does the trick however, my script above is just a simplified version of a real script, real script has lots of objects including IE, so making all those objects, selecting new-made tab, and restoring to current tab made my script flashy and slow. Can this be avoided? (making all those objects and tab in the background, without focusing to it at all) Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
zackrspv Posted May 18, 2008 Share Posted May 18, 2008 (edited) tnx for replies focus = set to be active the post above is my entire script tnx, that does the trick however, my script above is just a simplified version of a real script, real script has lots of objects including IE, so making all those objects, selecting new-made tab, and restoring to current tab made my script flashy and slow. Can this be avoided? (making all those objects and tab in the background, without focusing to it at all) Hum, hum, hum. Is it possible to hide it right after you create it, and then add the controls to it, and then show the first tab? It probably will still flicker, so scratch that idea............ TBH, i'm at a loss. I have no idea how to help you with this. You want to add controls to a tab, right after it's created, and still have the focus on the first tab; the best method (from my experience, which is limited vs everyone else ) i've already given you flickers, ie it switches to the new tab, and then builds the controls, and then switches to the proper tab..... Try this and let me know if it still flickers: expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTab.au3> #include <Array.au3> Dim $Letter1[13] Global $letter = "" $Form1 = GUICreate("Form1", 372, 225, 214, 154) $Tab1 = GUICtrlCreateTab(32, 5, 305, 185) $Tabitem1 = GUICtrlCreateTabItem("General") $Button1 = GUICtrlCreateButton("Button1", 50, 50) $tabitem2 = GUICtrlCreateTabItem("Something") GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlCreateTabItem("") $dodaj = GUICtrlCreateButton("Add", 32, 190) $oduzmi = GUICtrlCreateButton("Delete", 200, 190) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() $active = GUICtrlRead($tab1, 1) Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $dodaj $neki_broj = Random(3,12, 1) for $i = 1 to $neki_broj $Letter1[$i] = Chr(Random(Asc("a"), Asc("z"), 1)) $letter = $letter & $Letter1[$i] Next $promenljiva = GUICtrlCreateTabItem($letter) GUICtrlSetState(-1, $GUI_HIDE) $Button2 = GUICtrlCreateButton("Button2", 80, 80) GUICtrlSetState($active, $GUI_SHOW) GUICtrlCreateTabItem("") $letter = "" case $oduzmi $selektovani_tab = GUICtrlRead($Tab1, 1) if $selektovani_tab <> $Tabitem1 And $selektovani_tab <> $Tabitem2 Then GUICtrlDelete ($selektovani_tab) GUICtrlSetState($selektovani_tab-4, $GUI_SHOW) GUICtrlSetState($selektovani_tab-2, $GUI_SHOW) EndIf EndSwitch WEnd Edited May 18, 2008 by zackrspv -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
sandin Posted May 18, 2008 Author Share Posted May 18, 2008 yup, it still does... but tnx for the ideas, I appreciate it, I'll try to figure out something... Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now