11#!/usr/bin/python3
2- version = __version__ = "0.30.0 Released 16-Nov-2019 "
2+ version = __version__ = "0.31.1 UnReleased "
33
44import sys
55import types
@@ -5386,7 +5386,7 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win):
53865386 window .QT_QTabWidget .addTab (tab_widget , element .Title )
53875387 # ------------------------- TabGroup element ------------------------- #
53885388 elif element_type == ELEM_TYPE_TAB_GROUP :
5389-
5389+ element = element # type:TabGroup
53905390 element .Widget = element .QT_QTabWidget = qtab = QTabWidget ()
53915391
53925392 style = qtab .styleSheet ()
@@ -5398,6 +5398,14 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win):
53985398 style += 'QTabBar::tab {color: %s;}' % element .TextColor
53995399 qtab .setStyleSheet (style )
54005400
5401+ if element .TabLocation is not None :
5402+ position_dict = {'left' : QtWidgets .QTabWidget .TabPosition .West , 'right' : QtWidgets .QTabWidget .TabPosition .East , 'top' : QtWidgets .QTabWidget .TabPosition .North , 'bottom' : QtWidgets .QTabWidget .TabPosition .South , 'lefttop' : QtWidgets .QTabWidget .TabPosition .North ,
5403+ 'leftbottom' : QtWidgets .QTabWidget .TabPosition .South , 'righttop' : QtWidgets .QTabWidget .TabPosition .North , 'rightbottom' : QtWidgets .QTabWidget .TabPosition .South , 'bottomleft' : QtWidgets .QTabWidget .TabPosition .South ,
5404+ 'bottomright' : QtWidgets .QTabWidget .TabPosition .South , 'topleft' : QtWidgets .QTabWidget .TabPosition .North , 'topright' : QtWidgets .QTabWidget .TabPosition .North }
5405+ try :
5406+ element .Widget .setTabPosition (position_dict [element .TabLocation ])
5407+ except :
5408+ print ('Bad tab position specified {}' , element .TabLocation )
54015409 PackFormIntoFrame (element , element .ParentForm .QFormLayout , toplevel_win )
54025410
54035411 qt_row_layout .addWidget (element .QT_QTabWidget )
@@ -7969,7 +7977,7 @@ def main():
79697977 Frame ('Variable Choice Group' , frame4 , title_color = 'blue' ), Stretch ()],
79707978 [Frame ('Structured Data Group' , frame5 , title_color = 'red' ), ],
79717979 # [Frame('Graphing Group', frame6)],
7972- [TabGroup ([[tab1 , tab2 ]],title_color = 'black' )],
7980+ [TabGroup ([[tab1 , tab2 ]],title_color = 'black' , tab_location = 'bottom' )],
79737981 [ProgressBar (max_value = 600 , start_value = 400 , size = (600 , 25 ), key = '+PROGRESS+' ),
79747982 Text ('' , key = '_PROGTEXT_' ), Stretch (),
79757983 ButtonMenu ('&Menu' , ['Menu' , ['&Pause Graph' , 'Menu item::optional_key' ]], key = '_MENU_' ,
0 commit comments