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


Python View.View类代码示例

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


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

示例1: __init__

 def __init__(self, style=STYLE_DEFAULT, fixed_size=None):
     View.__init__(self)
     self._window = self
     self._first_responder = None
     self._title = None
     self._style = style
     self._resizable = fixed_size is None
     self._application = Application.shared_application()
     self._min_size = None
     self._max_size = None
     self._zoomed = False
     self._key_window = False
     self._main_window = False
     if fixed_size is None:
         # normal window
         self._pyglet = PygletWindow(self, 
                                     style=style, 
                                     resizable=True)
     else:
         # fixed size window
         self._pyglet = PygletWindow(self, 
                                     style=style, 
                                     resizable=False, 
                                     width=fixed_size.width, 
                                     height=fixed_size.height)
     x, y = self._pyglet.get_location()
     width, height = self._pyglet.get_size()
     View.set_frame(self, Rect(x, y, width, height))
     self._application._add_window(self)
开发者ID:mountainstorm,项目名称:MtUI,代码行数:29,代码来源:Window.py

示例2: set_frame

 def set_frame(self, rect):
     if (    self._resizable == False
         and (rect.size.width != None or rect.size.height != None)):
         raise ValueError(u'Window is not resizable')
     View.set_frame(self, rect)
     self._pyglet.set_location(self._frame.origin.x, self._frame.origin.y)
     self._pyglet.set_size(self._frame.size.width, self._frame.size.height)
开发者ID:mountainstorm,项目名称:MtUI,代码行数:7,代码来源:Window.py

示例3: export_print_page

 def export_print_page(self, event):
     """Export a print page using a JSON file"""
     event.Skip()
     if self.view.image is not None:
         # We don't require an RMAP file, just rect data that we can generate
         dlg = wx.FileDialog(self, "Choose a JSON file to load", "", "", "", wx.SAVE)
         if dlg.ShowModal() == wx.ID_OK:
             filename = dlg.GetFilename()
             dirname = dlg.GetDirectory()
             dlg.Destroy()
         else:
             self.SetStatusText(Preferences.failedToOpen)
             return False
         rmap_data = self.view.rects
         try:
             with open(join(dirname, filename), "r") as f:
                 json_data = loads(f.read())
         except Exception as e:
             self.SetStatusText(Preferences.failedToExport)
             return False
         fd = self.img.split(".")
         fd.pop()
         fname = ".".join(fd)
         rmap_data = View.filter_list(rmap_data)
         rmap_data = View.clean_list(rmap_data)
         rmap_data = View.generate_data(rmap_data)
         self.write_html_printpage(self.filename, fname, rmap_data, json_data)
     else:
         self.SetStatusText(Preferences.noImageLoaded)
开发者ID:sleibrock,项目名称:form-creator,代码行数:29,代码来源:FormCreator.py

示例4: __init__

 def __init__(self):
     View.__init__(self)
     self._state = Control.STATE_NORMAL
     self._attrs = {}
     for k, v in ControlState:
         self._attrs[k] = None
     self._actions = {}
开发者ID:mountainstorm,项目名称:MtUI,代码行数:7,代码来源:Control.py

示例5: __init__

 def __init__(self, controller, parentXYView):
   View.__init__(self, controller)
   self._mplAxes = None
   self._mplLines = None
   self._isHighlighted = False
   self._initialLineWidth = None
   self._parentXYView = parentXYView
   
   self._marker = None
   self._color = None
   self._lineStyle = None
开发者ID:FedoraScientific,项目名称:salome-gui,代码行数:11,代码来源:CurveView.py

示例6: __init__

 def __init__( self, controller) :
     """ Constructor """
     View.__init__( self, controller)
     CurveTreeDockWidget.__init__(self)
     self._noUpdate = False
     
     treeWidget = self.getTreeWidget()
     treeWidget.itemSelectionChanged.connect(self.onItemSelectionChanged)
     treeWidget.itemDoubleClicked.connect(self.onItemDoubleCliked)
     treeWidget.setContextMenuPolicy(Qt.CustomContextMenu)
     treeWidget.customContextMenuRequested.connect(self.openMenu)
开发者ID:FedoraScientific,项目名称:salome-gui,代码行数:11,代码来源:CurveBrowserView.py

示例7: main

def main(args) :
	"""Fonction principal qui va nous lancer notre annuaire"""	
	#bdd = sqlite3.connect('Bdd/patron.db')
	
	app=QApplication(args)
	control = Control()
	model = Model(control)
	fenetre = View(control);
	fenetre.show();
	
	#bdd.close()
	return app.exec_()
开发者ID:Anabad,项目名称:TP_M1C_Maite_Kevin_Anand,代码行数:12,代码来源:main.py

示例8: __init__

 def __init__(self, path):
     self.myModel = Model(Filer(), Validator())
     if path != "" or path is not None:
         self.load_data(path)
     self.myView = View(self)
     self.myModel.pickle_data()
     self.myView.cmdloop()
开发者ID:Jacob-McPhail,项目名称:Interpreter_V2,代码行数:7,代码来源:Controller.py

示例9: __init__

 def __init__(self, path):
     self.myModel = Model()
     if path != "" or path is not None:
         self.load_data(path)
     self.myView = View(self)
     self.myModel.data_handler.load_pickle_data()
     self.myView.cmdloop()
开发者ID:ZachChristensen,项目名称:PR301InterpreterPattern,代码行数:7,代码来源:Controller.py

示例10: __init__

 def __init__(self):
     self.model = Model()
     self.view = View()
     self.firstTime = True
     self.result = 0.0
     self.a = 0.0
     self.b = 0.0
     self.usePrev = 0
开发者ID:krauskc,项目名称:EECS448-Lab09,代码行数:8,代码来源:Controller.py

示例11: Controller

class Controller(object):
  def __init__(self):
    self.model = Model()
    self.view = View()

  def run(self):
    name = self.view.welcome()
    if name == 'Ken':
      print(self.model.say_hello(name))
    else:
      print(self.model.say_bye())
开发者ID:mendoncakr,项目名称:testing,代码行数:11,代码来源:Controller.py

示例12: __init__

class Game:
    def __init__(self):
        self.board = Board()
        self.evaluation = Evaluation(self.board)
        self.view = View(self.board)

    def __finish(self, computerPlayer):
        if self.evaluation.winner() == computerPlayer:
            print "Computer player wins"
        elif self.evaluation.isTie():
            print "Tie game"
        else:
            print "Human player wins"

    def run(self):
        startPlayer = self.view.inputStartPlayer()
        computerPlayer = 'X' if startPlayer == 2 else 'O'
        ai = AI(computerPlayer, self.board)
        while self.evaluation.winner() == None and not self.evaluation.isTie():
            self.view.displayBoard()
            if self.board.getPlayer() == computerPlayer:
                ai.makeMove()
            else:
                move = self.view.inputMove()
                self.board.move(move)
        self.view.displayBoard()
        self.__finish(computerPlayer)
开发者ID:mhendren,项目名称:Tic-Tac-Toe,代码行数:27,代码来源:Game.py

示例13: run

    def run(self):

        self.rows,self.lines = View.GreatingMessage()

        self.NamesOfPlayers,View.NumberOfPlayers = View.NamesOfPlayers() # intial Players from View

        for name in self.NamesOfPlayers:
            player = Controller.Player(name)
            self.Players.append(player)







        self.Turner  = Controller.Turner(self.Players)

        View.Symbols = View.GenerateSymbols(View.NumberOfPlayers)
        View.tablePrint(self.rows,self.lines,[])

        Win = False

        while not Win:
            CurentPlayer = self.Turner.getNext()
            print "Hello ", CurentPlayer.getName()
            x,y = View.InputMessage()

            if not self.ValidCoordinate((x,y)):
                print "continue"
                self.Turner.CurentState = self.Turner.CurentState - 1
                continue
            self.Model.setCordinate(CurentPlayer,(x,y))
            mapp = self.Model.getMappingNotLinear()
            View.tablePrint(self.lines,self.rows,mapp)

            Win = self.is_win(CurentPlayer,(x,y))
        
            pass
        View.WinMessage(Winner=self.Winner)
开发者ID:IRRAT,项目名称:TicTacToe,代码行数:40,代码来源:Controller.py

示例14: __init__

 def __init__(self, controller):
   View.__init__(self, controller)
   self._eventHandler = EventHandler()
   
   self._curveViews = {}    # key: curve (model) ID, value: CurveView
   self._salomeViewID = None
   self._mplFigure = None
   self._mplAxes = None
   self._mplCanvas = None
   self._plotWidget = None
   self._sgPyQt = self._controller._sgPyQt
   self._toolbar = None
   self._mplNavigationActions = {}
   self._toobarMPL = None
   self._grid = None
   self._currCrv = None   # current curve selected in the view
   
   self._legend = None
   self._legendLoc = "right"  # "right" or "bottom"
   
   self._fitArea = False
   self._zoomPan = False
   self._dragOnDrop = False
   self._move = False
   
   self._patch = None
   self._xdata = None
   self._ydata = None
   self._defaultLineStyle = None
   self._last_point = None
   self._lastMarkerID = -1
   self._blockLogSignal = False
   
   self._axisXSciNotation = False
   self._axisYSciNotation = False
   self._prevTitle = None
开发者ID:FedoraScientific,项目名称:salome-gui,代码行数:36,代码来源:XYView.py

示例15: __init__

    def __init__(self, app):
        # initialize the model and view
        # * The model handles all the data, and signal-related operations
        # * The view handles all the data visualization
        self.model = Model()
        self.view = View()

        # subscribe to messages sent by the view
        pub.subscribe(self.parse_file, "FILE PATH CHANGED")
        pub.subscribe(self.reprocess_fft, "FFT CONTROLS CHANGED")

        # subscribe to messages sent by the model
        pub.subscribe(self.signal_changed, "SIGNAL CHANGED")
        pub.subscribe(self.signal_changed, "FFT CHANGED")

        self.view.Show()
开发者ID:splendeo,项目名称:adctest,代码行数:16,代码来源:Controller.py


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