Search Results for: gui

189 relevant articles found:

Adding a context-menu to a uitree

…ssible to add uicontextmenus to uitree.
Your post saved my time.
Thanks a lot Scott Koch If you have access to the figure handle (stored as User Data for instance) you could also use the click event coordinates to display a GUIDE created context menu:

 ...
if eventData.isMetaDown
fh = get(hTree,'UserData');%Get figure handle
cm = findobj(fh,'tag','mycontextmenu');%Get context menu handle.
tpos = get(hTree,'Pixel... Continue reading

Categories: GUI, Java, Low risk of breaking in future versions, UI controls
Tags: , ,
29 Comments

Setting status-bar components

I last week’s post, Setting status-bar text, I showed how to set the status-bar text in Matlab figures and the main desktop. But Matlab status-bars are Java containers in which we can add GUI controls, not just simple text labels. In this post I will show how to do this for Matlab 7 figures. Let’s return to the two alternatives I’ve presented in my previous post for setting a Matlab 7 figure status-bar text: % Alternative #1 (… Continue reading

Categories: Figure window, GUI, Java, Medium risk of breaking in future versions
Tags: , , ,
15 Comments

JTattoo look-and-feel demo

Three years ago, I wrote an article about modifying Matlab’s look-and-feel (L&F, or LnF), using Java’s built-in support for replaceable LnFs. To date, that article has 27 comments by 13 different commenters (plus 20 responses by me), making it the second most active article on this website. I decided to follow up on that article with a demo that shows the effects that different L&Fs have on GUI controls, and a demonstration… Continue reading

Categories: Guest bloggers, GUI, Java, Medium risk of breaking in future versions, UI controls
Tags: , , , ,
13 Comments

Rich Matlab editbox contents

…javax.swing.text.html.HTMLEditorKit); % alternative: jEditbox.setContentType(‘text/html’); htmlStr = ['<b><div style="font-family:impact;color:green">’… ‘Matlab</div></b> GUI is <i>’ … ‘<font color="red">highly</font></i> customizable’]; jEditbox.setText(htmlStr) HTML contents in a Matlab editbox Let’s show another usage exampl… Continue reading

Categories: GUI, High risk of breaking in future versions, Java, UI controls
Tags: , , ,
51 Comments

Undocumented button highlighting

One of my consulting clients approached me yesterday with a mystery: In his GUIDE-generated GUI, one of the buttons had a bluish tint, and no obvious property seemed to control this or to differentiate it from its sibling controls. Here’s a parred-down version of his GUI: Highlighted GUI button So while it was very nice to have a highlighted button in this manner, the fact that he did not know why it happened and how to control it was a bi… Continue reading

Categories: GUI, Low risk of breaking in future versions, UI controls, Undocumented feature
Tags: , , , ,
Leave a comment

GUI integrated HTML panel

Last week, I explained how a browser control can be integrated in Matlab GUI applications. Sometimes we only need to display simple HTML, for which a full browser seems like overkill. Moreover, we may wish to edit the displayed contents, which cannot be done using the browser control. The solution is to use a standard Java Swing JEditorPane control, which is an editable HTML-aware control. Oddly enough, it was only yesterday that Mikhail, a know… Continue reading

Categories: GUI, Java, Low risk of breaking in future versions, UI controls
Tags: , , , ,
3 Comments

Tri-state checkbox

When presenting information visually in graphical user interfaces (GUIs), we often need to present and enable interaction with state data (such as On/Off). In most cases, we would naturally use a checkbox to present the information and enable interaction. But What can we do if the data has three possible states. For example, Yes/No/Maybe, or: Full/Empty/Partial, or: Up/Down/Undetermined ? Until today, Matlab GUIs had to resort to using drop-down… Continue reading

Categories: GUI, Java, Medium risk of breaking in future versions, UI controls, Undocumented feature
Tags: , , , , ,
5 Comments

Unorthodox checkbox usage

…underlying problem description is easy: we wish to have the ability to split a Matlab uipanel into two or more sub-panels, separated by a draggable horizontal/vertical divider. Such split-panes are standard in any semi-decent GUI, but for some reason were never incorporated in official Matlab. This is a real pity, but not to worry as there are at least two alternatives we could use: UISplitPane UISplitPane is a utility that I wrote back in 2009 t… Continue reading

Categories: GUI, Medium risk of breaking in future versions, UI controls
Tags: , , ,
1 Comment

Figure window customizations

…yboard shortcuts/accelerators, font colors/styles, callbacks, icons etc. (details1, details2) Control figure docking in compiled (deployed) applications (details1, details2) Display an integral figure status-bar with text and GUI controls (details1, details2). A few other features that I will not discuss here As you can see, there are numerous very interesting customizations that can be done to Matlab figures which rely on the undocumented imple… Continue reading

Categories: Figure window, GUI, Hidden property, High risk of breaking in future versions, Java, Undocumented feature
Tags: , , , ,
Leave a comment

Font selection components

…oints’ FontSize: 10 Matlab’s uisetfont dialog The main drawback of uisetfont is the fact that it displays a separate non-resizable modal dialog window. We cannot embed uisetfont within our own panel, integrated in our GUI figure. DesktopFontPicker DesktopFontPicker is a Swing component that presents a font selection panel that can easily be inserted into any Matlab GUI container (figure, panel or tab) using the javacomponent function: fo… Continue reading

Categories: GUI, Java, Medium risk of breaking in future versions, Undocumented feature
Tags: , , , ,
3 Comments