pyVCP - Fancy Buttons and labels

More
10 years 11 months ago #64976 by Askjerry
I was tinkering and found out you can do some really nice decorating to the labels and the buttons. :woohoo:

Both buttons and labels (including multilables) support multiple lines and some special characters too.
They also support both foreground and background colors: <fg>color</fg> and <bg>color</bg>

Here is a snippet from my test pyvcp panel... :)
Code:
<!-- ========================================================================= --> <label> <wraplength>"250"</wraplength> <justify>"left"</justify> <text>"Look what I found \n \a \b \f \v \1 \2 \3 \4 \5"</text> <font>("Helvetica",10)</font> <width>22</width> <bg>"#000000"</bg> <fg>"#ffffff"</fg> </label> <!-- ========================================================================= --> <hbox> <button> <font>("Helvetica",8)</font> <width>10</width> <padx>29</padx> <halpin>"btn-left"</halpin> <text>"DIRECTION\n\1 LEFT"</text> <bg>"#005C94"</bg> <fg>"#ffffff"</fg> </button> <button> <font>("Helvetica",8)</font> <width>10</width> <padx>29</padx> <halpin>"btn-right"</halpin> <text>"DIRECTION\nRIGHT \3"</text> <bg>"#005C94"</bg> <fg>"#ffffff"</fg> </button> </hbox> <!-- ========================================================================= -->
And here it is on my test pyvcp panel... B)

Attachment not found



So far I found the following characters by experimentation...
\n = new line
\a = telephone
\b = checkmark
\f = music 1/4 note
\v = music 1/8 note
\1 = left triangle
\2 = left underline triangle
\3 = right triangle
\4 = right underline triangle
\5 = three dots (therefore)

These were all the ones i found to be useful in the Helvetica font... other fonts may differ.

Please Log in to join the conversation.

More
10 years 11 months ago #64978 by cncbasher
nice find Jerry .

look forward to your next graphical update LOL
all i need now is to remember all this

Please Log in to join the conversation.

More
10 years 11 months ago #64979 by BigJohnT
Your too fast Jerry, I can't keep up updating the manual with all your neat finds.

JT

Please Log in to join the conversation.

More
10 years 11 months ago #64984 by Askjerry
@ cncbasher - Yeah... me too. :blush:

@ BigJohnT - Well... semi-annually then... :P

I have to get out into my shop and rewire the mill... then install the new panel. Once that's done... I'll update the MONSTER learning thread so others can follow along as well. Still trying to decide if I want to install hall-effect sensors and magnets into the spindle for speed reporting. The panel is getting pretty full. I may wait until I tackle my second 1960 Sears Craftsman Lathe and convert it to CNC.

That's going to be a whole new learning curve... programming for a lathe... I don't think my software, Vectric Aspire handles those functions. (I'm sure it doesn't.)

Here are the current panels... as of November 8, 2015

Attachment not found

Please Log in to join the conversation.

More
10 years 11 months ago #64985 by BigJohnT
I seldom program for my lathe and 95% of the time I use ngcgui to build my programs.

JT

Please Log in to join the conversation.

More
10 years 11 months ago #65025 by andypugh
You have certainly managed to make PyVCP look pretty, but that seems to be going a little against the stream when GladeVCP exists and offers so much more.

Please Log in to join the conversation.

More
10 years 11 months ago #65038 by Askjerry
I just haven't figured Glade out. I mean... I can make a spiffy panel... but I can't seem to figure out how to add the functionality. pyVCP just seems easy to me. Maybe I'm wired different.

Please Log in to join the conversation.

More
10 years 11 months ago #65039 by andypugh

Askjerry wrote: I just haven't figured Glade out. I mean... I can make a spiffy panel... but I can't seem to figure out how to add the functionality.


To get HAL functionality you need to use the HAL widgets that end up at the bottom of the toolbox

But for other actions, you need a Python file that you add to the HAL command line that loads the panel, and then in the Glade properties you add the Python subroutine name as a handler for the specific widget action. (because any on-screen thing can interact in a number of ways)

Please Log in to join the conversation.

More
10 years 11 months ago #65050 by BigJohnT

Askjerry wrote: I just haven't figured Glade out. I mean... I can make a spiffy panel... but I can't seem to figure out how to add the functionality. pyVCP just seems easy to me. Maybe I'm wired different.


I have a rather simple gladevcp tutorial here:

gnipsel.com/linuxcnc/gladevcp/index.html

JT

Please Log in to join the conversation.

Time to create page: 0.174 seconds
Powered by Kunena Forum