Jump to content

2D picture GUI Library


Recommended Posts

On 7/2/2021 at 9:51 PM, Taylorh140 said:

Two questions about this: 

1. Does something like this already exist?

2. Is this something that could be useful?

Every once in a while I need dynamic UI components that can be generated at runtime. One nice thing to use for this is a picture control; however it doesn't lend itself as well to keeping other pieces of function such as mouse click events and such. I put together a mini library of UI functions for this that has the ability to be extended. The UI can be generated dynamically at runtime and be any picture thing that you can draw.

image.png.185106caad170f8ca66cfc6891df1be1.png

Using Standard layout techniques that you might find in other GUI libraries. The hierarchy generation can always be simplified by using some type of templating string.

image.png.cda376a59cd456e34ae613b30af62a60.png 

 

 

Looks interesting. Reminds me a little of the layout principle that Java GUis have. Needs a bit getting used to when you are familiar with systems like the LabVIEW GUI where you put everything at absolute (or relative absolute) positions.

And as Mikael says, those class constants are making this all look unnecessarily bulky. And they are in fact unnecessary if you build your class instantiation properly. The Class Instantiation methods should not need to be dynamic dispatch and then you can make that input optional or possibly even omit it. The control data type of your Create method already defines the class without a need for a class constant.

Edited by Rolf Kalbermatter
Link to comment
On 7/3/2021 at 3:51 AM, Taylorh140 said:

1. Does something like this already exist?

Not from NI, that I know of.

I did make a similar API that wraps the Qt framework. That involves creating external windows though; your toolkit has the benefit of being integrated with VI front panels.

As Mikael and Rolf said, class constants are not needed:

svg_zoom_n_scroll.png.8771824f26b6d202e34063e327258412.png

 

On 7/3/2021 at 3:51 AM, Taylorh140 said:

2. Is this something that could be useful?

Definitely! LabVIEW's built-in support for dynamic GUIs is very poor. NXG was starting to show some promise with dynamic controls, but that's now dead. So, community-built tools are sorely needed.

Are you planning to make public releases of your work?

 

On 7/5/2021 at 3:57 PM, Rolf Kalbermatter said:

Reminds me a little of the layout principle that Java GUis have. Needs a bit getting used to when you are familiar with systems like the LabVIEW GUI where you put everything at absolute (or relative absolute) positions.

Layouts are common concept in a wide variety of GUI toolkits. Makes it so much easier to create resizable GUIs and support a variety of screen resolutions.

Link to comment
Quote

FYI you don't need to wire an empty class constant to the create methods 🙂

This is true. bad habit I guess. I used openGDS for this w/ EndevoGoop400, so far I like it. But it is still new to me so there are possibly design 
The enabling technology for this was from @Norm Kirchner so respect where it is due. Being able to translate images allows one to build a UI component and move it into place. 

 

Each drawn component can now pretend it is the only UI component on the picture control. I'll try to get a GitHub page published soonish.
 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.