当前位置: 首页>>代码示例>>Python>>正文


Python wx.Size方法代码示例

本文整理汇总了Python中wx.Size方法的典型用法代码示例。如果您正苦于以下问题:Python wx.Size方法的具体用法?Python wx.Size怎么用?Python wx.Size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


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

示例1: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def __init__(self, parent, text, title):
        wx.Dialog.__init__(self, parent, -1, title,
                           style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        vsizer = wx.BoxSizer(wx.VERTICAL)

        tc = wx.TextCtrl(self, -1, size = wx.Size(400, 200),
                         style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_LINEWRAP)
        tc.SetValue(text)
        vsizer.Add(tc, 1, wx.EXPAND);

        vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        okBtn = gutil.createStockButton(self, "OK")
        vsizer.Add(okBtn, 0, wx.ALIGN_CENTER)

        util.finishWindow(self, vsizer)

        wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)

        okBtn.SetFocus() 
开发者ID:trelby,项目名称:trelby,代码行数:23,代码来源:misc.py

示例2: _init_ctrls

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def _init_ctrls(self, prnt):
        wx.Frame.__init__(self, id=ID_OBJDICTEDIT, name='objdictedit',
              parent=prnt, pos=wx.Point(149, 178), size=wx.Size(1000, 700),
              style=wx.DEFAULT_FRAME_STYLE, title=_('Objdictedit'))
        self._init_utils()
        self.SetClientSize(wx.Size(1000, 700))
        self.SetMenuBar(self.MenuBar)
        self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
        if not self.ModeSolo:
            self.Bind(wx.EVT_MENU, self.OnSaveMenu, id=wx.ID_SAVE)
            accel = wx.AcceleratorTable([wx.AcceleratorEntry(wx.ACCEL_CTRL, 83, wx.ID_SAVE)])
            self.SetAcceleratorTable(accel)

        self.FileOpened = wx.Notebook(id=ID_OBJDICTEDITFILEOPENED,
              name='FileOpened', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(0, 0), style=0)
        self.FileOpened.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED,
              self.OnFileSelectedChanged, id=ID_OBJDICTEDITFILEOPENED)

        self.HelpBar = wx.StatusBar(id=ID_OBJDICTEDITHELPBAR, name='HelpBar',
              parent=self, style=wx.ST_SIZEGRIP)
        self._init_coll_HelpBar_Fields(self.HelpBar)
        self.SetStatusBar(self.HelpBar) 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:25,代码来源:objdictedit.py

示例3: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def __init__(self):
        wx.Frame.__init__(self, None,
                          pos=wx.DefaultPosition, size=wx.Size(450, 100),
                          style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION |
                          wx.CLOSE_BOX | wx.CLIP_CHILDREN,
                          title="BRUNO")
        panel = wx.Panel(self)

        ico = wx.Icon('boy.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)

        my_sizer = wx.BoxSizer(wx.VERTICAL)
        lbl = wx.StaticText(panel,
                            label="Bienvenido Sir. How can I help you?")
        my_sizer.Add(lbl, 0, wx.ALL, 5)
        self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER,
                               size=(400, 30))
        self.txt.SetFocus()
        self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
        my_sizer.Add(self.txt, 0, wx.ALL, 5)
        panel.SetSizer(my_sizer)
        self.Show()
        speak.Speak('''Welcome back Sir, Broono at your service.''') 
开发者ID:ab-anand,项目名称:Bruno,代码行数:25,代码来源:daily.py

示例4: PicRefresh

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def PicRefresh(seite):
    i_seite = getint(seite)
    i_seite = max(1, i_seite)           # ensure page# is within boundaries
    i_seite = min(PDFcfg.seiten, i_seite)

    dlg.zuSeite.Value = str(i_seite)    # set page number in dialog fields
    if PDFcfg.oldpage == i_seite:
        return
    PDFcfg.oldpage = i_seite

    bmp = pdf_show(i_seite)
    dlg.PDFbild.SetSize(bmp.Size)
    dlg.PDFbild.SetBitmap(bmp)
    dlg.PDFbild.Refresh(True)
    bmp = None
    dlg.Layout()

#==============================================================================
# Disable OK button
#============================================================================== 
开发者ID:ActiveState,项目名称:code,代码行数:22,代码来源:recipe-580623.py

示例5: DoGetBestSize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def DoGetBestSize(self):
        """
        Overridden base class virtual. Determines the best size of the
        button based on the label and bezel size.
        """

        label = self.GetLabel()
        if not label:
            return wx.Size(32, 32)
        
        dc = wx.ClientDC(self)
        dc.SetFont(self.GetFont())
        retWidth, retHeight = dc.GetTextExtent(label)
        
        width = int(max(retWidth, retHeight) * 1.5)
        return wx.Size(width, width) 
开发者ID:ActiveState,项目名称:code,代码行数:18,代码来源:recipe-577951.py

示例6: OnHelpCANFestivalMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def OnHelpCANFestivalMenu(self, event):
        #self.OpenHtmlFrame("CAN Festival Reference", os.path.join(ScriptDirectory, "doc/canfestival.html"), wx.Size(1000, 600))
        if wx.Platform == '__WXMSW__':
            readerpath = get_acroversion()
            readerexepath = os.path.join(readerpath,"AcroRd32.exe")
            if(os.path.isfile(readerexepath)):
                os.spawnl(os.P_DETACH, readerexepath, "AcroRd32.exe", '"%s"'%os.path.join(ScriptDirectory, "doc","manual_en.pdf"))
            else:
                message = wx.MessageDialog(self, _("Check if Acrobat Reader is correctly installed on your computer"), _("ERROR"), wx.OK|wx.ICON_ERROR)
                message.ShowModal()
                message.Destroy()
        else:
            try:
                os.system("xpdf -remote CANFESTIVAL %s %d &"%(os.path.join(ScriptDirectory, "doc/manual_en.pdf"),16))
            except:
                message = wx.MessageDialog(self, _("Check if xpdf is correctly installed on your computer"), _("ERROR"), wx.OK|wx.ICON_ERROR)
                message.ShowModal()
                message.Destroy() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:20,代码来源:objdictedit.py

示例7: setWH

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def setWH(ctrl, w = -1, h = -1):
    size = ctrl.GetClientSize()

    if w != -1:
        size.width = w

    if h != -1:
        size.height = h

    ctrl.SetMinSize(wx.Size(size.width, size.height))
    ctrl.SetClientSizeWH(size.width, size.height)

# wxMSW doesn't respect the control's min/max values at all, so we have to
# implement this ourselves 
开发者ID:trelby,项目名称:trelby,代码行数:16,代码来源:util.py

示例8: get_wx_font

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def get_wx_font(self, s, prop):
        """
        Return a wx font.  Cache instances in a font dictionary for
        efficiency
        """
        DEBUG_MSG("get_wx_font()", 1, self)


        key = hash(prop)
        fontprop = prop
        fontname = fontprop.get_name()

        font = self.fontd.get(key)
        if font is not None:
            return font

        # Allow use of platform independent and dependent font names
        wxFontname = self.fontnames.get(fontname, wx.ROMAN)
        wxFacename = '' # Empty => wxPython chooses based on wx_fontname

        # Font colour is determined by the active wx.Pen
        # TODO: It may be wise to cache font information
        size = self.points_to_pixels(fontprop.get_size_in_points())


        font =wx.Font(int(size+0.5),             # Size
                      wxFontname,                # 'Generic' name
                      self.fontangles[fontprop.get_style()],   # Angle
                      self.fontweights[fontprop.get_weight()], # Weight
                      False,                     # Underline
                      wxFacename)                # Platform font name

        # cache the font and gc and return it
        self.fontd[key] = font

        return font 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:38,代码来源:backend_wx.py

示例9: resize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def resize(self, width, height):
        'Set the canvas size in pixels'
        self.canvas.SetInitialSize(wx.Size(width, height))
        self.window.GetSizer().Fit(self.window)

# Identifiers for toolbar controls - images_wx contains bitmaps for the images
# used in the controls. wxWindows does not provide any stock images, so I've
# 'stolen' those from GTK2, and transformed them into the appropriate format.
#import images_wx 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:11,代码来源:backend_wx.py

示例10: get_wx_font

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def get_wx_font(self, s, prop):
        """
        Return a wx font.  Cache instances in a font dictionary for
        efficiency
        """
        DEBUG_MSG("get_wx_font()", 1, self)

        key = hash(prop)
        fontprop = prop
        fontname = fontprop.get_name()

        font = self.fontd.get(key)
        if font is not None:
            return font

        # Allow use of platform independent and dependent font names
        wxFontname = self.fontnames.get(fontname, wx.ROMAN)
        wxFacename = ''  # Empty => wxPython chooses based on wx_fontname

        # Font colour is determined by the active wx.Pen
        # TODO: It may be wise to cache font information
        size = self.points_to_pixels(fontprop.get_size_in_points())

        font = wx.Font(int(size + 0.5),             # Size
                       wxFontname,                # 'Generic' name
                       self.fontangles[fontprop.get_style()],   # Angle
                       self.fontweights[fontprop.get_weight()],  # Weight
                       False,                     # Underline
                       wxFacename)                # Platform font name

        # cache the font and gc and return it
        self.fontd[key] = font

        return font 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:36,代码来源:backend_wx.py

示例11: resize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def resize(self, width, height):
        'Set the canvas size in pixels'
        self.canvas.SetInitialSize(wx.Size(width, height))
        self.window.GetSizer().Fit(self.window) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:6,代码来源:backend_wx.py

示例12: resize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def resize(self, width, height):
        'Set the canvas size in pixels'
        self.canvas.SetInitialSize(wx.Size(width, height))
        self.window.GetSizer().Fit(self.window)

# Identifiers for toolbar controls - images_wx contains bitmaps for the images
# used in the controls. wxWindows does not provide any stock images, so I've
# 'stolen' those from GTK2, and transformed them into the appropriate format.
# import images_wx 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:11,代码来源:backend_wx.py

示例13: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def __init__(self, parent, pos, size):
        super().__init__(parent=parent, pos=pos, size=wx.Size(size, size))
        self.end_point = wx.Point(self.point.x + size, self.point.y + size) 
开发者ID:johnehunt,项目名称:advancedpython3,代码行数:5,代码来源:PyDraw.py

示例14: add

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def add(self, mode, point, size=30):
        if mode == PyDrawConstants.SQUARE_MODE:
            fig = Square(self.view, point, wx.Size(size, size))
        elif mode == PyDrawConstants.CIRCLE_MODE:
            fig = Circle(self.view, point, size)
        elif mode == PyDrawConstants.TEXT_MODE:
            fig = Text(self.view, point, size)
        elif mode == PyDrawConstants.LINE_MODE:
            fig = Line(self.view, point, size)
        self.model.add_figure(fig) 
开发者ID:johnehunt,项目名称:advancedpython3,代码行数:12,代码来源:PyDraw.py

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Size [as 别名]
def __init__(self, parent, iid):
        self.iid = iid
        wx.Dialog.__init__(self, parent, wx.ID_ANY, "Quotation "+self.iid, size= (650,320))
        self.panel = wx.Panel(self,wx.ID_ANY)

        self.m_cartDV = wx.dataview.DataViewListCtrl( self.panel, wx.ID_ANY, (20,20), wx.Size( 600, 180 ), 0 )
        self.m_cartDV.SetMinSize( wx.Size( -1,400 ) )
        
        self.m_cartDV.AppendTextColumn('Name')
        self.m_cartDV.AppendTextColumn('Quantity')
        self.m_cartDV.AppendTextColumn('Price')
        self.m_cartDV.AppendTextColumn('Total Price')
        
        qry = 'select p.name, pq.quantity, pq.price from products p, productquotes pq, quotations q where p.id = pq.product and  q.id = pq.quoteId and pq.quoteId = %s' % (iid)
        curs = conn.cursor()
        curs.execute(qry)
        r = curs.fetchone()
        while (1):
            if r is not None:
                self.m_cartDV.AppendItem([ r['name'], str(r['quantity']), str(r['price']), str(int(r['quantity']) * int(r['price'])) ])
                r = curs.fetchone()
            else:
                break
	
        self.lblRecMoney = wx.StaticText(self.panel, label="Recieved Money", pos=(20,220))
        self.recMoney = wx.TextCtrl(self.panel, value="", pos=(130,220), size=(90,-1), validator=numOnlyValidator())
	
        self.convertButton =wx.Button(self.panel, label="Convert to Invoice", pos=(110,260))
        self.closeButton =wx.Button(self.panel, label="Cancel", pos=(250,260))
        
        self.convertButton.Bind(wx.EVT_BUTTON, self.convertToInvoice)
        #self.convertButton.Bind(wx.EVT_BUTTON, self.asd)
        self.closeButton.Bind(wx.EVT_BUTTON, self.OnQuit)
        
        self.Bind(wx.EVT_CLOSE, self.OnQuit)
        
        self.Show() 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:39,代码来源:convertQuotation.py


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