Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common properties of GUI objects in matlab

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will share with you about the common properties of GUI objects in matlab. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

GUIDE programming development

When matlab Visualization Sister buys your design, there are generally two ways, one is to generate GUI directly by editing M script files, and the other is to establish the interface through MATLAB graphical user interface development environment GUIDE. GUIDE is an integrated development tool provided by matlab for writing the GUI interface, providing me with the appearance, properties and callback functions of you. GUIDE saves the user's saved GUI interface in a FIG resource file, and can also generate an M file of GUI initialization and component interface layout control code, which provides a reference framework for the implementation of callback functions.

I. Common properties of GUI objects

1. Control style and appearance

BackgroundColor: sets the background color of the control, using [R G B] or color definition

CData: a true color image displayed on a control, represented by a matrix

ForegroundColor: used to set the color of the text displayed on the control

String property: setting text on a control

Visible: sets whether the space is visible. You can set it to on or off.

two。 General information about the control

Enable property: indicates the enabled state of the control. Values can be on\ inactive and off, and the default value is on. When set to inactive, the control is not available.

Style: sets the type of control object. Values can be pushbutton, togglebutton, radiobutton, checkbox, edit, text, slider, frame, listbox, popupmenu. Default is pushbutton.

Tag: the name of the control, which is used to name the callback function of the control

TooltipString property: this property is a string and is used to set the prompt message that is displayed when the mouse pointer is over this control.

UserData: sets the user-specified data. Data transmission can be realized by using this attribute.

Position: setting the location and size of control objects

Units: sets the location, size, and other units of the control

3. Callback function of the control

BusyAction: handles interrupts of backfill functions. There are two options: cancel: cancel interrupt events, queue: queue (default)

ButtonDownFcn property: handle function when the button is pressed

Callback attribute: it is the link that condenses the substantive function of the entire program system. The attribute value should be a string that can be evaluated directly, and the system will evaluate the string automatically when the object is selected and changed.

CreateFcn: callback function executed during object generation

DeleteFcn: callback function executed during deletion of an object

Interruptible attribute: specifies whether the current callback function allows interrupts when executing to execute other functions

4. Control current state information

ListboxTop: the index of the topmost string displayed in the list box

Max: maximum

Min: minimum

Value: the current value of the space. For radio buttons, the value of this property is the value of the Max property if selected, and the value of the MIn property if not selected

2. M file of GUI

The frame of M file can be generated by GUIDE, the corresponding operation of GUI user can be determined by M file, and the M file can be generated automatically through GUIDE, and then the callback function of GUI space can be written in M file.

The M file consists of several subfunctions, including the main function, the opening function, the output function and the callback function. Where the main function cannot be modified and is the same as the file name.

Examples of shortcut menus:

Thank you for reading! This is the end of this article on "what are the common properties of GUI objects in matlab?" I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report