Jump to content

Hide tabs without hiding controls inside them


Go to solution Solved by orbs,

Recommended Posts

How can I the hide tabs without hiding the progress bar & slider inside them...

post-89462-0-91597000-1425658714_thumb.g

(Click image for animation)

 

I want to make a invisible navigation system by activating tabs when a specific button is clicked

Thanks in Advance :)

Edited by TheDcoder

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • Moderators

TheDcoder,

The whole idea of tabs is to keep the controls separate. How do you want the progress and slider to be displayed without the tabs? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

TheDcoder,

Then I suggest you use a series of child GUIs and hide/show them as required. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Then I suggest you use a series of child GUIs and hide/show them as required. :)

I have a very special ctrl present in my main GUI, so i would like to stick to this idea :)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • Moderators

TheDcoder,

A tab control is essentially a windows controlled series of child GUIs with the tabs at the top for user selection, so what I am suggesting is no different really. What is this "very special control" that demands the use of tabs? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

What is this "very special control" that demands the use of tabs? :huh:

Func GUICtrlCreateOutputTerminal($hWnd, $iLeft, $iTop, $iWidth, $iHeight)
    $return = _GUICtrlRichEdit_Create($hWnd, "", $iLeft, $iTop, $iWidth, $iHeight, $WS_HSCROLL + $WS_VSCROLL + $ES_READONLY + $ES_MULTILINE)
    Local $RGB[3]
    $RGB[0] = 0
    $RGB[1] = 0
    $RGB[2] = 0
    $colour = _ColorSetCOLORREF($RGB)
    _GUICtrlRichEdit_SetBkColor($return, $colour)
    Return $return
EndFunc ;= OutputTerminal
Edited by TheDcoder

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • Moderators

TheDcoder,

So why does a RichEdit prevent the use of child GUIs? You can place it within a child without problem. :huh:

M23

P.S. And I suggest you read the Setting Styles tutorial in the Wiki to see how to apply multiple styles correctly. ;)

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

So why does a RichEdit prevent the use of child GUIs? You can place it within a child without problem. :huh:

I just want it to be fixed in its place :D

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • Moderators

TheDcoder,

You need to explain what you need more clearly - is the RichEdit inside or outside the Tab control? Just draw a little picture of how you want the final GUI to look and we can start producing it. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Does the slider and progress need to be on a tab?

Can't you just have them placed above or below the tab control?

That seems more logical to me.

But then like Melba23 said, it is not very clear what you are doing overall, and some simple drawing would help immensely.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

You need to explain what you need more clearly - is the RichEdit inside or outside the Tab control? Just draw a little picture of how you want the final GUI to look and we can start producing it. :)

Thanks, I will make a simple drawing using ms paint and post it here

TD :)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

I had the same scenario. I got around it by creating an empty label control and positioning it across the tabs headers.

Will try :)

Result:

post-89462-0-67338900-1425903128_thumb.p

Edited by TheDcoder

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • Moderators

TheDcoder,

Here you go - in a very simplistic form: :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiRichEdit.au3>

$hGUI = GUICreate("Test", 500, 500)

$cNav = GUICtrlCreateLabel("", 0, 0, 150, 300)
GUICtrlSetBkColor($cNav, 0xFE7E27)
GUICtrlSetState($cNav, $GUI_DISABLE)

$cButton_0 = GUICtrlCreateButton("Child 0", 10, 10, 80, 30)
$cButton_1 = GUICtrlCreateButton("Child 1", 10, 50, 80, 30)
$cButton_2 = GUICtrlCreateButton("Child 2", 10, 90, 80, 30)

$hRichEdit = _GUICtrlRichEdit_Create($hGUI, "RichEdit", 0, 300, 500, 200)
_GUICtrlRichEdit_SetBkColor($hRichEdit, 0)

GUISetState(@SW_SHOW, $hGUI)

$hChild_0 = GUICreate("Child 0", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xFF0000)

GUISetState(@SW_SHOW, $hChild_0)

$hChild_1 = GUICreate("Child 1", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0x00FF00)

GUISetState(@SW_HIDE, $hChild_1)

$hChild_2 = GUICreate("Child 2", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0x0000FF)

GUISetState(@SW_HIDE, $hChild_2)

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cButton_0
            _All_Hide()
            GUISetState(@SW_SHOW, $hChild_0)
        Case $cButton_1
            _All_Hide()
            GUISetState(@SW_SHOW, $hChild_1)
        Case $cButton_2
            _All_Hide()
            GUISetState(@SW_SHOW, $hChild_2)
    EndSwitch

WEnd

Func _All_Hide()
    GUISetState(@SW_HIDE, $hChild_0)
    GUISetState(@SW_HIDE, $hChild_1)
    GUISetState(@SW_HIDE, $hChild_2)
EndFunc
M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Also, This puts me to a dis-advantage, i.e I can't use my GUI designer anymore.

Any suggestions?, Thanks :)!

<Suggestion coming soon!>

TD :)

Edited by TheDcoder

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

simple layout example

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiTab.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 526, 300, 831, 260)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form2Close")
$Label1 = GUICtrlCreateLabel("", 160, 68, 290, 25)
$Button1 = GUICtrlCreateButton("Button1", 24, 112, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("Button2", 24, 152, 75, 25)
GUICtrlSetOnEvent(-1, "Button2Click")
$Tab1 = GUICtrlCreateTab(160, 72, 289, 193)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$Button4 = GUICtrlCreateButton("tab 1", 176, 112, 75, 25)
$Combo1 = GUICtrlCreateCombo("Combo1", 176, 152, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 176, 192, 97, 17)
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$Button5 = GUICtrlCreateButton("tab 2", 176, 112, 75, 25)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Sleep(100)
WEnd

Func Button1Click()
    _GUICtrlTab_ActivateTab($Tab1, 0)
EndFunc   ;==>Button1Click

Func Button2Click()
    _GUICtrlTab_ActivateTab($Tab1, 1)
EndFunc   ;==>Button2Click

Func Form2Close()
    Exit
EndFunc   ;==>Form2Close
Link to comment
Share on other sites

  • Solution

sorry to budge in so late,

have you noticed that the position of the controls inside tabs are not relative to the tab position?

well, what happens if you position the tab outside of the GUI, but leave the controls position unchanged?

you get "hidden" tab, with perfectly visible controls:

#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $msg

    GUICreate('"hidden" tab')

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    GUICtrlCreateTab(1000, 10, 200, 100) ; >>>>>>>>>> x=1000 = outside of the GUI

    Local $gTab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    GUICtrlCreateInput("default", 80, 50, 70, 20)

    Local $gTab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    GUICtrlCreateCombo("", 20, 50, 60, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    Local $gTab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    GUICtrlCreateButton("OK2", 140, 50, 50)

    GUICtrlCreateTabItem("") ; end tabitem definition

    GUICtrlCreateLabel("label3", 20, 130, 50, 20)

    Local $gShowTab0 = GUICtrlCreateButton('show contents of tab 0', 20, 200, 200, 20)
    Local $gShowTab1 = GUICtrlCreateButton('show contents of tab 1', 20, 230, 200, 20)
    Local $gShowTab2 = GUICtrlCreateButton('show contents of tab 2', 20, 260, 200, 20)


    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $gShowTab0
                GUICtrlSetState($gTab0, $GUI_SHOW)
            Case $gShowTab1
                GUICtrlSetState($gTab1, $GUI_SHOW)
            Case $gShowTab2
                GUICtrlSetState($gTab2, $GUI_SHOW)
        EndSwitch
    WEnd
EndFunc   ;==>Example

PRO: you avoid the main window focus loss/regain that is apparent when using child GUI's.

CON: transparent controls inside tab have their background color as the tab (i.e. white), not as the GUI.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
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
 Share

×
×
  • Create New...