Jump to content

GUICtrlCreateTabItem & $TCS_MULTILINE


Recommended Posts

On a project im working on Which i had some help from Melba and UEZ they used

GUICtrlCreateTab for the initial tab and

GUICtrlCreateTabItem for the subsequent ones

Now before these changes i had $TCS_MULTILINE working nicely as i used GUICtrlCreateTab for every tab i had.

Is there a way to force $TCS_MULTILINE to work with GUICtrlCreateTabItem ?

I tried updating the tab but that didnt seem to work using

$hTab3 = GUICtrlCreateTabItem("[4]")
GUICtrlSetStyle(-1, $TCS_MULTILINE)

Any thoughts?

Chimaera

Link to comment
Share on other sites

  • Moderators

Chimaera,

The $TCS_MULTILINE style applied to tabs shows all the tab items at once using multiple rows if necessary. A single tab item does not have subordinate tab items and so applying this style makes no sense. :)

I am afraid I have forgotten what your project dealt with and how tabs were involved. Does it have subordinate tabs on tabitems using child GUIs to hold them? If do then all you need to do is add the $TCS_MULTILINE style to each of the subordinate tabs. ;)

Perhaps posting some of your basic GUI and tab code would help. ;)

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

First tab i have this

$hTab = GUICtrlCreateTab(10, 10, 683, 583, $TCS_MULTILINE, $TCS_RIGHTJUSTIFY) 
$tab_font = GUICtrlSetFont( $hTab , $fsize, 600, "", $font) 
$area_font = GUISetFont( $fsize, 600, "", $font)

Then every subsequent one up to 8 tabs is this

$hTab1 = GUICtrlCreateTabItem("[1]")
GUICtrlSetStyle(-1, $TCS_MULTILINE)     
$area_font = GUISetFont( $fsize, 600, "", $font)

But it ignores the Multiline set with the create tab or the setstyle

Edited by Chimaera
Link to comment
Share on other sites

  • Moderators

Chimaera,

I will try and explain again. ;)

The $TCS_MULTILINE style applied to tab controls shows all the tabitem controls at once on multiple rows (if necessary). Omitting the style gives you a single line of tabitem controls with a "left/right" control to move them into view. Here is a short example - first you see the "classic" tab and then the "multiline" tab:

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>

_Ex_1()

_Ex_2()

Func _Ex_1()

    $hGUI = GUICreate("Classic with 'left/right'", 500, 500)

    $hTab1 = GUICtrlCreateTab(10, 10, 200, 200)

    For $i = 0 To 10
        GUICtrlCreateTabItem($i)
    Next
    GUICtrlCreateTabItem("")

    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

EndFunc

Func _Ex_2()

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

    $hTab1 = GUICtrlCreateTab(10, 10, 200, 200, BitOr($TCS_RIGHTJUSTIFY, $TCS_MULTILINE))

    For $i = 0 To 10
        GUICtrlCreateTabItem($i)
    Next
    GUICtrlCreateTabItem("")

    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

EndFunc

Applying the $TCS_MULTILINE style to a tabitem control makes no sense, as it has no subordinate tabitem controls to display. :)

Why did you want to apply the style to the tabitems? Perhaps you are looking to achieve some other effect which requires another style. ;)

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

I wasnt applying it to the tabitems i just wanted it to multiline, ive solved it now with the help of your examples.

and im feeling a little stupid right now guess what was missing

#include <TabConstants.au3>

Told you it was stupid.... :)

Gaaaah

Chim

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...