📄 instructions.txt
字号:
There are 2 versions of VB_ReadBMP, one for R11 and another for R12.1 and above (Can not remember which works for R12.0 but the tell-tale sign is whether or not there exists a file FREADU8.M in the %matlabroot\toolbox\matlab\iofun\ or %matlabroot\toolbox\matlab\iofun\private directory). To use the R11 version simply rename it by removing the "_R11" part of the filename.
Once you have figured out which VB_ReadBMP, file is appropriate to your version of Matlab, move VB_ReadBMP.m & VB_BMPinfo to %matlabroot\toolbox\matlab\iofun\ directory. Do NOT copy the files because these functions call private functions which are not seen on the path. Therefore if Matlab uses a copy of these M-files from another location the process will crash.
Run GUI_Scripter and select the visual basic project required. Each form in the VB project will be converted to a separate M-file and the handles for each object within the form will be suffixed with "_?", where ? is an integer denoting the number of the form processed. e.g. mybutton_1 is a button on the first form and mybutton_2 is another button on the second form. All the handles are stored in the root userdata property - handles=get(0,'userdata');
Once processed the resultant M-files will be written to a sub-directory of the one where the VB project is located called Matlab_gui.
Unless the directory where GUI_Scripter is located is on the matlab path then you will need to copy 2 files to the newly created Matlab_GUI directory.
These are:
"script_resize.m", which ensures that all object in the figure stay in their locations relative to the top left corner, rather than the bottom left as is standard in Matlab. The units are always in pixels therefore there is no scale change either and also any bitmap images that are used on buttons.
"script_radiogroup.m" which is a callback to ensure XOR operation on groups of radio buttons. NB Make sure that any callback for radio buttons is appended to the existing "script_radiogroup(gco);" callback.
There must not be any code whatsoever in the Visual Basic Project and certain characters are not permitted in Captions and Tooltip strings, i.e. single quotes ('), percentage sign (%) and other Matlab characters which may be interpreted wrongly.
Picture Box Controls in VB get converted into Axis objects in Matlab.
Once the VB forms have been scripted all the user has to do is code up the callbacks. I usually create a script called Set_Callbacks() to set the appropriate code to the objects.
Hope this helps a lot of people who have had experience with Matlab GUIDE (especially in Matlab 5.3!!);
Yours
Martin Dale
Martin.Dale@Physics.Org
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -