Jump to content

Table/Listbox sort symbol/glyph/character


Recommended Posts

Posted

In many modern non-LabVIEW UIs, tables can be sorted by clicking on the header.  There is then usually a glyph to communicate this feature.  Non-LabVIEW example:

image.png.d78be7f2c2b80106e13cd011b6001454.png

 

I'm trying to reproduce this behavior in LabVIEW, but I keep hitting roadblocks.  Notably:

  • LabVIEW doesn't allow for symbols in table headers
  • LabVIEW ascii table doesn't have any up or down arrows.  There is an up carrot ^, but not a down carrot.

I'd love to know if anyone has any suggestions or workarounds.

 

Posted

OOooo, I think I might have a solution.

The font package "Symbols" has a bunch of symbols and arrows in it:

image.png.4919ed56aa0309df809bad026d9669a0.png

This font package ships with Win 10, which is the only OS this product needs to run on right now, so that should work

Posted

Just be careful. Weird things sometimes happen when you change the font of just some of the text in a table. I recall trying to get some Greek characters into a table and header and I could not make it work properly. This was waaay back in 2010 so things might have changed.

Please let us know if you get it working nicely!

Posted

Oh, really?

Ok, I'll give this a try and report back any issues.

If it doesn't work, I'll just go with your /\ idea, I didn't think of that

Posted

Argh, you're right, there is a limitation.

It looks text properties (size, color, style, fontname) are global for each individual cell.  i.e. I can't have a cell with both Segoe UI font and then also some text using Symbol font in the same cell.  This means if I put Symbol arrows in a header cell, then I can't place descriptive text next to the arrow.

Posted

Yeah that sounds familiar.

A terrible workaround would be to make a transparent button with your cool symbol on it and overlay it on the row header, and have it intercept the click event. I have to do crap like this so often in LabVIEW to get nice looking GUIs 😞

Posted

Yeah I've gone down issues like that in an attempt to make a better looking multicolumn listbox.  In my case I wanted to have custom control options in my cells.  Maybe have a Boolean cell that toggles from one color to another when clicked which is easy enough.  But I also wanted drop downs for discrete cell values, numeric controls with increment decrement, color selection with a color box, and Tab and Return key navigation.

It turned out okay in limited usages.  But when you do things like resize a column, put it in a resizable pane, or subpanel, then lots more work was needed to ensure things looked normal.  I suspect you can get away with a cool transparent boolean, that reads the column locations and moves it there.  Just be sure and take into account the resizing nature, and hide the control when resizing or moving, then show it back once the resizing is done.

Posted

The least painful way managed to do this was to detect the column header was clicked on then change the background color of the header appropriately. It's not great, but users understood what was going on once they were shown it.

Posted

I ended up copying VIPM verbatim:

  • Use /\ and \/
  • Make the active column BOLD

I agree that overlaid buttons are better and feasible, but would take alot of work to get correct with things like column resizing.

The VIPM solution is low effort, robust, and not thaaat bad looking.

image.png.8005f060c857588dd919af70fa3b37a5.png

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.