• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tsWxSize.wxSize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tsWxSize.wxSize函数的典型用法代码示例。如果您正苦于以下问题:Python wxSize函数的具体用法?Python wxSize怎么用?Python wxSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wxSize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: tsGetStdioPositionAndSize

    def tsGetStdioPositionAndSize(self):
        '''
        Return position and size of window used for redirected output.
        '''
        if not self.ts_PyOnDemandStdioWindow:
 
            # Establish defaults until attributes finalized
            theRedirectedPos = wxPoint(-1, -1)
            theRedirectedSize = wxSize(450, 300)

        else:

            try:
                self.Display = wxDisplay(self)
                theClientArea = self.Display.theRedirectedStdioArea

                theRedirectedSize = wxSize(theClientArea.width,
                                           theClientArea.height)

                theRedirectedPos = wxPoint(
                    theClientArea.x,
                    theClientArea.y)
            except Exception, getError:
                theRedirectedPos = wxPoint(-1, -1)
                theRedirectedSize = wxSize(450, 300)
                self.logger.debug(
                    '  GetStdioPositionAndSize Exception. %s' % getError)
                msg = 'GetStdioPositionAndSize Exception: %s' % str(getError)
                raise tse.ProgramException(tse.APPLICATION_TRAP, msg)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:29,代码来源:tsWxPyOnDemandOutputWindow.py


示例2: tsGetBorderCharacterDimensions

    def tsGetBorderCharacterDimensions(self, thickness):
        """
        Return width and height of border character in pixels.

        Parameter:

        thickness --- Border line thickness in pixels.
        """
        if thickness == -1:

            if wx.USE_BORDER_BY_DEFAULT:

                # Default (1-pixel) border required.
                dimensions = wxSize(wx.pixelWidthPerCharacter, wx.pixelHeightPerCharacter)
            else:

                # No border required.
                dimensions = wxSize(0, 0)

        elif thickness == 0:

            # No border required.
            dimensions = wxSize(0, 0)

        else:

            # Override thickness and apply default (1-pixel) border.
            dimensions = wxSize(
                min(1, thickness) * wx.pixelWidthPerCharacter, min(1, thickness) * wx.pixelHeightPerCharacter
            )

        return dimensions
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:32,代码来源:tsWxSizerFlags.py


示例3: tsBestSize

    def tsBestSize(self):
        """
        """
        borderThickness = self.tsIsBorderThickness(style=self.ts_Style, pixels=True)

        maxWidth = 0
        maxHeight = 0
        for choice in self.ts_Choices:
            buttonText = self.tsStripAcceleratorTextLabel(choice)
            if len(buttonText) > maxWidth:
                maxWidth = len(buttonText)
                maxHeight += 1

        if self.ts_Style & wx.RA_VERTICAL:
            # Vertical
            best = wxSize(
                (maxWidth * wx.pixelWidthPerCharacter + 2 * borderThickness.width),
                (maxHeight * wx.pixelHeightPerCharacter + 2 * borderThickness.height),
            )

        elif self.ts_Style & wx.RA_HORIZONTAL:
            # Horizontal
            best = wxSize(
                (maxWidth * wx.pixelWidthPerCharacter + 2 * borderThickness.width),
                (maxHeight * wx.pixelHeightPerCharacter + 2 * borderThickness.height),
            )

        else:
            # TBD - Should this be allowed?
            best = wxSize(
                (maxWidth * wx.pixelWidthPerCharacter + 2 * borderThickness.width),
                (maxHeight * wx.pixelHeightPerCharacter + 2 * borderThickness.height),
            )

        return best
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:35,代码来源:tsWxRadioBox.py


示例4: tsBestSize

    def tsBestSize(self):
        '''
        '''
        borderThickness = self.tsIsBorderThickness(
            style=self.ts_Style, pixels=True)

        gaugeThickness = 1
        gaugeLength = 10
 
        if self.ts_Style & wx.SB_VERTICAL:
            # Vertical
            best = wxSize(
                (gaugeThickness * wx.pixelWidthPerCharacter + \
                 2 * borderThickness.width),
                (gaugeLength * wx.pixelHeightPerCharacter + \
                 2 * borderThickness.height))
        else:
            # Horizontal
            best = wxSize(
                (gaugeLength * wx.pixelWidthPerCharacter + \
                 2 * borderThickness.width),
                (gaugeThickness * wx.pixelHeightPerCharacter + \
                 2 * borderThickness.height))

        return (best)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:25,代码来源:tsWxScrollBarGauge.py


示例5: SizeFromMajorMinor

    def SizeFromMajorMinor(self, major, minor):
        '''
        '''
        if self.ts_Orientation == wx.HORIZONTAL:

            return (wxSize(major, minor))

        else: # wxVERTICAL

            return (wxSize(minor, major))
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:10,代码来源:tsWxBoxSizer.py


示例6: CreateOutputWindow

    def CreateOutputWindow(self, st):
        '''
        Create frame and text control. Append st (text) to output. Show the
        frame and bind the frame OnCloseButtton to the event.
        '''
        # TBD - Under Construction. The class wxTextCtrl is not available.
        if not (self.ts_Frame is None):
            return
 
        try:
            self.ts_Frame = wxFrame(
                self.ts_Parent,
                id=-1,
                title=self.ts_Title,
                pos=wxPoint(self.ts_Rect.x, self.ts_Rect.y),
                size=wxSize(self.ts_Rect.width, self.ts_Rect.height),
                style=self.ts_Style,
                name=self.ts_Name)
        except Exception as frameError:
            self.logger.error(
                '  CreateOutputWindow: frameError. %s' % frameError)
            msg = 'CreateOutputWindow Frame Error: %s' % str(frameError)
            raise tse.ProgramException(tse.APPLICATION_TRAP, msg)

        if self.ts_Frame.display.HasColors:
            self.ts_Markup = wx.ThemeToUse['Stdio']['Markup']['DEFAULT']
        else:
            self.ts_Markup = None

        try:
            self.ts_Text  = wxTextCtrl(
                self.ts_Frame,
                id=-1,
                value=wx.EmptyString,
                pos=wxPoint(
                    self.ts_ClientRect.x + self.ts_Margin.width,
                    self.ts_ClientRect.y + self.ts_Margin.height),
                size=wxSize(
                    self.ts_ClientRect.width - 2 * self.ts_Margin.width,
                    self.ts_ClientRect.height - 2 * self.ts_Margin.height),
                style=0, # wx.TE_MULTILINE |wx.TE_READONLY,
                validator=wx.DefaultValidator,
                name=wx.TextCtrlNameStr)
        except Exception as textCtrError:
            self.logger.error(
                '  CreateOutputWindow: textCtlError. %s' % textCtrError)
            msg = 'CreateOutputWindow textCtr Error: %s' % str(textCtrError)
            raise tse.ProgramException(tse.APPLICATION_TRAP, msg)

        # Skip this since text has been pre-cached in self.write
        # before invocation of self.CreateOutputWindow.
        if False:
            self.ts_Text.AppendText(st)

        self.ts_Frame.Show(True)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:55,代码来源:tsWxPyOnDemandOutputWindow.py


示例7: AddSpacer

    def AddSpacer(self, size):
        '''
        '''
        if self.IsVertical():
            item = wxSize(0, size)
        else:
            item = wxSize(size, 0)

        child = self.Add(item, proportion=0, flag=0, border=0, userData=None)

        # Register the child in the wxSizerItemList
        self.ts_Children.Add(child)

        return (child)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:14,代码来源:tsWxBoxSizer.py


示例8: __init__

    def __init__(self, window, size):
        """
        Create a new caret object.
        """
        theClass = "Caret"

        wx.RegisterFirstCallerClassName(self, theClass)

        ##        self.tsBeginClassRegistration(theClass, id)
        try:

            self.logger = tsLogger.TsLogger(
                threshold=tsLogger.ERROR, start=time.time(), name=tsLogger.StandardOutputFile
            )

        except AttributeError as e:

            self.logger = None
            msg = "tsWxCaret.__init__: Exception = %s" % e
            raise tse.ProgramException(tse.APPLICATION_TRAP, msg)

        self.ts_Position = wxPoint(0, 0)
        self.ts_Size = wxSize(0, 0)

        self.ts_Window = window
        self.ts_visibility = wx.caretNormal
        self.theScreen = tsGTUI.GraphicalTextUserInterface(theClass)
        self.theScreen.curs_set(self.ts_visibility)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:28,代码来源:tsWxCaret.py


示例9: tsGetClientArea

    def tsGetClientArea(self, pixels=True):
        '''
        Returns the bounding rectangle the client area of the Dialog.
        '''
        parent = self.ts_Parent
        pos = wxPoint(self.ts_Rect.x, self.ts_Rect.y)
        size = wxSize(self.ts_Rect.width, self.ts_Rect.height)
        style = self.ts_Style
        name = self.ts_Name

        (myRect, myClientRect) = self.tsDialogWindowLayout(
            parent, pos, size, style, name)

        if self.ts_Rect != myRect:

            # My Area changed after by new feature
            fmt1 = 'Wrong layout. myRect (%s) ' % str(myRect)
            fmt2 = 'changed from self.ts_Rect (%s) ' % str(self.ts_Rect)
            fmt3 = 'in tsWxFrame.tsGetClientArea'
            msg = fmt1 + fmt2 + fmt3
            self.logger.wxASSERT_MSG(
                (self.ts_Rect == myRect),
                msg)

            self.ts_Rect = myRect

        if self.ts_ClientRect != myClientRect:

            # Client Area changed after by new feature
            self.ts_ClientRect = myClientRect

        return (self.ts_ClientRect)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:32,代码来源:tsWxDialog.py


示例10: ShowFullScreen

    def ShowFullScreen(self, show, style):
        '''
        '''
        # TBD - Under Construction.
        # Extent resize of the top level window to include its children.
        theDisplay = self.Display
 
        theDisplayPos = wxPoint(theDisplay.ClientArea.x,
                                theDisplay.ClientArea.y)

        theDisplaySize = wxSize(theDisplay.ClientArea.width,
                                theDisplay.ClientArea.height)

        self.logger.debug(
            '      ShowFullScreen (screen): pos=%s; size=%s.' % (
                str(theDisplayPos), str(theDisplaySize)))

        self.Rect = wxRect(theDisplayPos.x,
                           theDisplayPos.y,
                           theDisplaySize.width,
                           theDisplaySize.height)

        self.logger.debug(
            '      Need Event to ShowFullScreen (rect): %s.' % (
                str(self.Rect)))

        return (show)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:27,代码来源:tsWxTopLevelWindow.py


示例11: tsShow

    def tsShow(self):
        """
        Create and update MenuBar specific native GUI.
        """
        if self.tsIsShowPermitted:

            if self.ts_Handle is None:

                myRect = wxRect(
                    self.ts_Parent.Rect.x + wx.pixelWidthPerCharacter,
                    self.ts_Parent.Rect.y + wx.pixelHeightPerCharacter,
                    self.ts_Parent.Rect.width - 2 * wx.pixelWidthPerCharacter,
                    wx.ThemeToUse["MenuBar"]["WindowHeight"],
                )

                thePosition = wxPoint(myRect.x, myRect.y)
                theSize = wxSize(myRect.width, myRect.height)

                # TBD - Update Class geometry.
                ##            self.ts_Rect = myRect
                ##            self.logger.debug(
                ##                '_show: myRect=%s; Rect = %s' % (myRect, self.ts_Rect))

                self.Create(
                    self, id=-1, pos=thePosition, size=theSize, style=self.ts_Style, name=self.Name, pixels=True
                )

            try:
                self.tsRegisterShowOrder()
            except Exception as e:
                self.logger.error("%s; %s" % (__title__, e))

            self.tsUpdate()
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:33,代码来源:tsWxMenuBar.py


示例12: __init__

    def __init__(self, orient=wx.HORIZONTAL):
        '''
        Constructor for a wx.BoxSizer. orient may be one of wx.VERTICAL
        or wx.HORIZONTAL for creating either a column sizer or a row sizer.
        '''
        theClass = 'BoxSizer'

        wx.RegisterFirstCallerClassName(self, theClass)

        Sizer.__init__(self)

        self.tsBeginClassRegistration(theClass, id)

        # either wxHORIZONTAL or wxVERTICAL
        self.ts_Orientation = orient

        # the sum of proportion of all of our elements
        self.ts_TotalProportion = 0

        # minimal size needed for this sizer as calculated by
        # the last call to our CalcMin()
        self.ts_MinSize = DEFAULT_SIZE

        # minimal size needed for this sizer as calculated, by
        # calcMin, for the containing window (panel), the parent
        # of those subpanels managed by this BoxSizer instance.
        self.ts_CalcMinArea = []
        self.ts_CalcMinAreaProportion = []
        self.ts_CalcMinKind = []
        self.ts_CalcMinWindow = []
        self.ts_ClientArea = []
        self.ts_ContainingWindow = None
        self.ts_MinSize = wxSize(0, 0)
        self.ts_SizeMinThis = []
        self.ts_TotalFixedSize = wxSize(0, 0)
        self.ts_TotalProportion = 0

##        self.ts_SizeMinThis = None
##        self.ts_CalcMinArea = None
##        self.ts_CalcMinAreaProportion = None
##        self.ts_CalcMinKind = None
##        self.ts_CalcMinWindow = None
##        self.ts_ClientArea = None
##        self.ts_ContainingWindow = None
        self.ts_RecalcArea = None

        self.tsEndClassRegistration(theClass)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:47,代码来源:tsWxBoxSizer.py


示例13: CalcMin

    def CalcMin(self):
        '''
        Calculate the total minimum width and height needed by all items
        in the sizer according to this sizer layout algorithm.

        This method is abstract and has to be overwritten by any derived
        class.

        Here, the sizer will do the actual calculation of its childrens
        minimal sizes.

        Implemented in wxGridBagSizer, and wxBoxSizer.
        '''
        width = 0
        height = 0
        for i in range(0, self.ts_Children.GetCount()):
            node = self.ts_Children.GetIndex(i)

            item = node.GetUserData()

            size = wxSize(0, 0)
            if (isinstance(self, Window)):
                try:
                    parent = self.ts_Parent
                    theClientRect = parent.ClientArea
                except AttributeError:
                    parent = None
                    theClientRect = wxRect(0, 0, 0, 0)

                width = theClientRect.width
                height = theClientRect.height
                minSize = wxSize(width, height)

                self.logger.debug(
                    'CalcMin: item=%s; minSize=%s; width=%s; height=%s' % (
                    str(item), str(minSize), str(width), str(height)))

                size = minSize
                self.logger.debug('CalcMin: size=%s' % size)

            return (size)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:41,代码来源:tsWxPySizer.py


示例14: tsShow

    def tsShow(self):
        '''
        Shows or hides the window. You may need to call Raise for a top
        level window if you want to bring it to top, although this is not
        needed if Show is called immediately after the frame creation.
        Returns True if the window has been shown or hidden or False if
        nothing was done because it already was in the requested state.
        '''
        if self.tsIsShowPermitted:

            if self.ts_Handle is None:

                myRect = wxRect(
                    self.ts_Parent.Rect.Left,
                    (self.ts_Parent.Rect.Bottom - \
                     wx.ThemeToUse['StatusBar']['WindowHeight'] - \
                     wx.pixelHeightPerCharacter),
                    self.ts_Parent.Rect.width,
                    wx.ThemeToUse['StatusBar']['WindowHeight'])

                thePosition = wxPoint(myRect.x, myRect.y)
                theSize = wxSize(myRect.width, myRect.height)

                # TBD - Update Class geometry.
                self.ts_Rect = myRect
                self.logger.debug(
                    'tsShow: myRect=%s; Rect = %s' % (myRect, self.ts_Rect))

                self.ts_BaseRect = self.ts_Rect
                if DEBUG:
                    print('tsShow: myRect=%s; Rect = %s' % (myRect, self.ts_Rect))

                self.Create(self,
                            id=-1,
                            pos=thePosition,
                            size=theSize,
                            style=self.ts_Style,
                            name=self.Name,
                            pixels=True)

            try:
                self.tsRegisterShowOrder()
            except Exception, e:
                self.logger.error('%s; %s' % (__title__, e))

            self.tsUpdate()
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:46,代码来源:tsWxStatusBar.py


示例15: GetDefaultSize

    def GetDefaultSize(self):
        '''
        Returns the default button size for this platform.
        '''
        thickness = self.tsIsBorderThickness(
            style=self.ts_Style, pixels=False)

        if False:
            width = (len(self.ts_ButtonText) + 1) * wx.pixelWidthPerCharacter

            height = (1) * wx.pixelHeightPerCharacter
        else:
            width = (thickness.width + \
                     len(self.ts_ButtonText) + 1) * wx.pixelWidthPerCharacter

            height = (thickness.height + 1) * wx.pixelHeightPerCharacter

        return (wxSize(width, height))
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:18,代码来源:tsWxButton.py


示例16: tsSetStdioWindowAttributes

    def tsSetStdioWindowAttributes(self,
                                   title=None,
                                   pos=None,
                                   size=None,
                                   style=None,
                                   name=None):
        '''
        Set the title, position, size, style and name of the output window
        if the stdio has been redirected.
        '''
        if self.stdioWin:
            # TBD - Cannot set attributes when window does not exist.
            myRect = self.Display.theRedirectedStdioArea
            if title is not None:
                self.stdioWin.title = title
            else:
                self.stdioWin.title = wx.ThemeToUse['Stdio']['Title']

            if pos is not None:
                self.stdioWin.pos = pos
            else:
                self.stdioWin.pos = wxPoint(myRect.x, myRect.y)

            if size is not None:
                self.stdioWin.size = size
            else:
                self.stdioWin.size = wxSize(myRect.width, myRect.height)

            if style is not None:
                self.stdioWin.style = style
            elif wx.ThemeToUse['Stdio']['Title'] == wx.StdioRedirectedTitleStr:
                self.stdioWin.style = wx.DEFAULT_STDIO_STYLE
            else:
                self.stdioWin.style = wx.DEFAULT_FRAME_STYLE

            if name is not None:
                self.stdioWin.name = name
            elif wx.ThemeToUse['Stdio']['Title'] == wx.StdioRedirectedTitleStr:
                self.stdioWin.name = wx.StdioNameStr
            else:
                self.stdioWin.name = wx.FrameNameStr
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:41,代码来源:tsWxApp.py


示例17: CalcMin

    def CalcMin(self):
        '''
        This method is where the sizer will do the actual calculation of its
        childrens minimal sizes. You should not need to call this directly
        as it is called by Layout

        Modeled after TBD in sizer.cpp file of wxWidgets.
        '''
        width = 0
        height = 0
        for item in self.GetChildren():
            # calculate the total minimum width and height needed
            # by all items in the sizer according to this sizer's
            # layout algorithm.
            minSize = item.MinSize
            width += minSize.width
            height += minSize.height

        size = wxSize(width, height)
        self.logger.debug('CalcMin: size=%s' % size)

        return (size)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:22,代码来源:tsWxFlexGridSizer.py


示例18: CreateOutputWindow

    def CreateOutputWindow(self, st):
        '''
        Create frame and text control. Append st (text) to output. Show the
        frame and bind the frame OnCloseButtton to the event.
        '''
        # TBD - Under Construction. The class wxTextCtrl is not available.
        if not (self.ts_Frame is None):
            return
 
        try:
            self.ts_Frame = wxFrame(
                self.ts_Parent,
                id=-1,
                title=self.ts_Title,
                pos=wxPoint(self.ts_Rect.x, self.ts_Rect.y),
                size=wxSize(self.ts_Rect.width, self.ts_Rect.height),
                style=self.ts_Style,
                name=self.ts_Name)
        except Exception, frameError:
            self.logger.error(
                '  CreateOutputWindow: frameError. %s' % frameError)
            msg = 'CreateOutputWindow Frame Error: %s' % str(frameError)
            raise tse.ProgramException(tse.APPLICATION_TRAP, msg)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:23,代码来源:tsWxPyOnDemandOutputWindow.py


示例19: __init__


#.........这里部分代码省略.........
        ##        style = 0

        self.ts_ItemLabel = []
        self.ts_ItemEnabled = []
        self.ts_ItemHelpText = []
        self.ts_ItemToolTip = []
        self.ts_ItemShown = []
        self.ts_ItemWindow = []

        # TBD - Verify scaling.
        if self.ts_Style & wx.RA_HORIZONTAL:
            itemWidth = bestSize.width // (self.ts_MajorDimension + 1)
        else:
            itemWidth = bestSize.width

        for item in range(self.ts_Count):
            self.ts_ItemLabel.append(self.ts_Choices[item])
            self.ts_ItemHelpText.append(self.ts_ItemLabel[item])
            self.ts_ItemToolTip.append(self.ts_ItemLabel[item])
            self.ts_ItemShown.append(True)

            if item == 0:
                self.ts_ItemEnabled.append(True)
            else:
                self.ts_ItemEnabled.append(False)

            # TBD - Under Construction.
            if self.ts_Style & wx.RA_HORIZONTAL:
                # Horizontal layout
                posTBD = wxPoint(
                    self.Rect.x + (item * itemWidth + 2) * wx.pixelWidthPerCharacter,
                    self.Rect.y + (2) * wx.pixelHeightPerCharacter,
                )
            else:
                # Vertical layout
                posTBD = wxPoint(
                    self.Rect.x + (2) * wx.pixelWidthPerCharacter, self.Rect.y + (item + 2) * wx.pixelHeightPerCharacter
                )

            ##            sizeTBD = wxSize(
            ##                (len('(*)  ') + len(
            ##                    self.ts_ItemLabel[item])) * wx.pixelWidthPerCharacter,
            ##                wx.pixelHeightPerCharacter)

            sizeTBD = wxSize(
                (len("(*)  ") + len(self.tsStripAcceleratorTextLabel(self.ts_ItemLabel[item])))
                * wx.pixelWidthPerCharacter,
                wx.pixelHeightPerCharacter,
            )

            self.ts_ItemWindow.append(
                wxRadioButton(
                    self,
                    id=wx.ID_ANY,
                    label=self.ts_ItemLabel[item],
                    pos=posTBD,
                    size=sizeTBD,
                    style=(self.ts_Style & wx.ALIGN_LEFT | self.ts_Style & wx.ALIGN_RIGHT | wx.NO_BORDER),
                    validator=wx.DefaultValidator,
                    name=self.ts_ItemLabel[item],
                )
            )

            self.ts_ItemWindow[item].SetValue(self.ts_ItemEnabled[item])

        if self.ts_Style & wx.RA_HORIZONTAL:
            self.ts_ColumnCount = self.ts_MajorDimension
            self.ts_RowCount = 1

        elif self.ts_Style & wx.RA_VERTICAL:
            self.ts_ColumnCount = 1
            self.ts_RowCount = self.ts_MajorDimension

        else:
            # TBD - Temporary dimension
            self.ts_ColumnCount = self.ts_MajorDimension
            rows, cols = divmod(self.ts_Count, self.ts_MajorDimension)
            if cols == 0:
                self.ts_RowCount = rows
            else:
                self.ts_RowCount = rows + 1

        self.ts_Selection = 0
        self.ts_StringSelection = 0

        # Automatically Bind all mouse events ASAP (now).
        # Will register event in the SystemEventTable.
        event = EVT_COMMAND_LEFT_CLICK
        handler = self.tsOnLeftClick
        source = self
        self.Bind(event, handler, source, useSystemEventTable=True)

        # Automatically Bind all Radio Button events ASAP (now).
        # Will register event in the SystemEventTable.
        event = EVT_RADIOBUTTON
        handler = self.tsOnRadioButtonClick
        source = self
        self.Bind(event, handler, source, useSystemEventTable=True)

        self.tsEndClassRegistration(theClass)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:101,代码来源:tsWxRadioBox.py


示例20: __init__

    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 bitmap=None,
                 splashStyle=0,
                 milliseconds=0,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.DEFAULT_SPLASHSCREEN_STYLE):
        '''
        Construct class.
        '''
        theClass = 'SplashScreen'

        # Capture initial caller parametsrs before they are changed
        self.caller_bitmap = bitmap
        self.caller_splashStyle = splashStyle
        self.caller_milliseconds = milliseconds
        self.caller_parent = parent
        self.caller_id = id
        self.caller_pos = pos
        self.caller_size = size
        self.caller_style = style

        wx.RegisterFirstCallerClassName(self, theClass)

        TopLevelWindow.__init__(self)

        self.tsBeginClassRegistration(theClass, id)

##        size = wxSize(500, 300)
        Frame.__init__(
            self,
            parent,
            id=wx.ID_ANY,
            title=wx.EmptyString,
            pos=pos,
            size=size,
            style=wx.BORDER_SIMPLE, #wx.DEFAULT_SPLASHSCREEN_STYLE,
            name=wx.SplashScreenNameStr)

        splashWindow = self
        splashWindow.ts_ForegroundColour = wx.COLOR_RED
        splashWindow.ts_BackgroundColour = wx.COLOR_WHITE

        self.ts_SplashStyle = splashStyle
        self.ts_SplashWindow = splashWindow
        self.ts_SplashTimeout = milliseconds

        self.ts_bitmap = wxTextCtrl(
            splashWindow,
            id=-1,
            value=wx.EmptyString,
            pos=wxPoint(
                splashWindow.ts_ClientRect.x + wx.pixelWidthPerCharacter,
                splashWindow.ts_ClientRect.y + wx.pixelHeightPerCharacter),
            size=wxSize(
                splashWindow.ts_ClientRect.width - (
                    2 * wx.pixelWidthPerCharacter),
                splashWindow.ts_ClientRect.height -(
                    2 * wx.pixelHeightPerCharacter)),
            style=0, # wx.TE_MULTILINE |wx.TE_READONLY,
            validator=wx.DefaultValidator,
            name=wx.TextCtrlNameStr)

        self.ts_bitmap.AppendText(bitmap)
        self.ts_bitmap.Show()

        self.SetFocus()

##        print('SplashScreen: Show')
##        self.Show()
##        print('SplashScreen: Sleep(%d)' % self.ts_SplashTimeout)
##        time.sleep(self.ts_SplashTimeout / 1000)
##        print('SplashScreen: Hide')
##        self.Hide()

        self.tsEndClassRegistration(theClass)
开发者ID:rigordo959,项目名称:tsWxGTUI_PyVx_Repository,代码行数:78,代码来源:tsWxSplashScreen.py



注:本文中的tsWxSize.wxSize函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tshark.run_tshark函数代码示例发布时间:2022-05-27
下一篇:
Python transaction.Transaction类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap