📄 readme.m
字号:
README -- Presto Tool Box % Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.% All Rights Reserved.% Disclosure without explicit written consent from the% copyright owner does not constitute publication. % Version of 03-Nov-1999 08:17:54.% Updated 14-Dec-1999 14:34:50.The "PS" ClassPresto's "ps" class provides a framework for handlingevents generated by interactive graphical componentsin Matlab-5. Users are expected to derive their ownclass from the "ps" class and then provide a"doevent" method to overload the basic "ps" behavior,as needed. Methods for creating menus, controls, anduser-defined properties are included.How Presto WorksThe "ps" constructor writes a "ps" object intothe "UserData" of the graphical entity to which itwill be attached, typically a "figure". Key callbacksof the associated graphical components are forced toinvoke "psevent the_callback_name" whenever they aremanipulated with the mouse. The "ps" object itselfis extracted from the GUI, and its "doevent" method iscalled as "doevent(self, the_callback_name)". In thecase of menus and controls, the callback-name istranslated to the tag of the particular itembefore the "doevent" method is invoked.The basic "doevent" method is a "switch" ladder, whichuses the names of the callbacks to decide how to actupon any request.User-Defined PropertiesUsers may set and get additional properties of their ownchoosing for each "ps" object, using the standard"dot" syntax associated with Matlab "struct" entities.Interestingly, if the requested property happens to bean actual graphical property, it is instituted directly.Thus, whether dealing with a GUI property, or a user-definedproperty, the same "dot" syntax works for both. Indeed, the"ps" subscripting abilities are versatile, unlike theMatlab "set/get" commands.Example:p = ps(anyFigure)p.myColor = [0 1 1]p.color = p.myColorMenusIn "ps", uimenus are created with the "menu" method, whosesecond argument is the name of the menu-item, suitably prefixedwith an indication of where it lies in the menu heirarchy.When enables, these menus call the "event" method, which cleansup the name before deciding what to do. For example, "Open..."is translated into "open" before the switch-ladder is executed.ControlsThe "control" method allocates uicontrols, whose layout is definedin normalized units, plus pixel offsets. Whenever a "ResizeFcn"event occurs in "presto", all such controls are themselvesresized to fit the new figure geometry. This scheme is veryimportant for preserving the appearance of the figure, anability not otherwise available in Matlab.Standard scrollbars are created using the keywords "right", "bottom","left", and "top" as the style-name in the "control" method. Thisfacilitates immensely the otherwise difficult burden of positioningMatlab scrollbars (sliders).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -