added more color functionality to pyvcp widgets
- Aaroncnc
- Offline
- Elite Member
Less
More
- Posts: 204
- Thank you received: 45
20 May 2021 15:13 - 20 May 2021 21:07 #209658
by Aaroncnc
added more color functionality to pyvcp widgets was created by Aaroncnc
Hello,
in my quest to make a dark theme ui for axis i needed to add more color functionality to pyvcp_widget.py
I added elements to most widgets.
overview of the elements added
<fg>"colorname"</fg> Font color Default "black"
<bg>"colorname"</bg> background color, Default "#e4e4e4"
<hbc>"colorname"</hbc> Highlight background color "#e4e4e4" this is kinda like a border color
<hbt>1</hbt> Highlight background thickness this is kinda like a border
<sel>"colorname"</sel> radio/check button color
Without these options you could not create a dark theme ui because around all the widgets you would see the default bright gray (the leds and bars were the worst offenders as the entire blank space around them aka the entire canvas would be the default color )colors. With the added option above you can set them to be a rainbow or just to a dark gray such as gray16.
I added to the comments of each widget so one can see what options they can set.
I have attached the file and a picture of the options.
It looks like a bit terrible but was needed to test things out.
The axis.txt is a tcl file rename to axis.tcl
File is located at /usr/share/axis/
pyvcp_widgets.py file is located at
/usr/lib/python2.7/dist-packages/
in my quest to make a dark theme ui for axis i needed to add more color functionality to pyvcp_widget.py
I added elements to most widgets.
overview of the elements added
<fg>"colorname"</fg> Font color Default "black"
<bg>"colorname"</bg> background color, Default "#e4e4e4"
<hbc>"colorname"</hbc> Highlight background color "#e4e4e4" this is kinda like a border color
<hbt>1</hbt> Highlight background thickness this is kinda like a border
<sel>"colorname"</sel> radio/check button color
Without these options you could not create a dark theme ui because around all the widgets you would see the default bright gray (the leds and bars were the worst offenders as the entire blank space around them aka the entire canvas would be the default color )colors. With the added option above you can set them to be a rainbow or just to a dark gray such as gray16.
I added to the comments of each widget so one can see what options they can set.
I have attached the file and a picture of the options.
It looks like a bit terrible but was needed to test things out.
The axis.txt is a tcl file rename to axis.tcl
File is located at /usr/share/axis/
pyvcp_widgets.py file is located at
/usr/lib/python2.7/dist-packages/
Last edit: 20 May 2021 21:07 by Aaroncnc. Reason: add files
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- Aaroncnc
- Offline
- Elite Member
Less
More
- Posts: 204
- Thank you received: 45
20 May 2021 18:01 - 20 May 2021 18:50 #209673
by Aaroncnc
Replied by Aaroncnc on topic added more color functionality to pyvcp widgets
Last edit: 20 May 2021 18:50 by Aaroncnc.
Please Log in or Create an account to join the conversation.
- Aaroncnc
- Offline
- Elite Member
Less
More
- Posts: 204
- Thank you received: 45
20 May 2021 22:31 #209702
by Aaroncnc
Replied by Aaroncnc on topic added more color functionality to pyvcp widgets
question whats the best way to change how much space things take up?
i would like to be able to make the preview window smaller and have more room for my pyvcp panel.
axis.tcl
axis.py
Im not super sure where to start.
i would like to be able to make the preview window smaller and have more room for my pyvcp panel.
axis.tcl
axis.py
Im not super sure where to start.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23558
- Thank you received: 4858
21 May 2021 18:44 #209777
by andypugh
Replied by andypugh on topic added more color functionality to pyvcp widgets
I think that the layout is in the Tcl, but haven't looked as hard as you probably have.
Please Log in or Create an account to join the conversation.
- Aaroncnc
- Offline
- Elite Member
Less
More
- Posts: 204
- Thank you received: 45
21 May 2021 19:13 #209781
by Aaroncnc
Replied by Aaroncnc on topic added more color functionality to pyvcp widgets
Yea just got into that today and its a bit hard to wrap my head around but i am getting there.
Would it be possible to have 2 pyvcp widgets?
i would like to have one on the bottom and one on the right side.
I know enough to modify the UI slowly but going much past that is out of my skill set. wont stop me from trying but maybe someone with more skill could point it out in a few min vs the week it may take me to kludge some sort of fix.
Would it be possible to have 2 pyvcp widgets?
i would like to have one on the bottom and one on the right side.
I know enough to modify the UI slowly but going much past that is out of my skill set. wont stop me from trying but maybe someone with more skill could point it out in a few min vs the week it may take me to kludge some sort of fix.
Please Log in or Create an account to join the conversation.
- cakeslob
- Offline
- Platinum Member
Less
More
- Posts: 785
- Thank you received: 230
29 May 2021 18:55 #210642
by cakeslob
Replied by cakeslob on topic added more color functionality to pyvcp widgets
My suggestion would be to not use axis.tcl or axis.py, or use it as little as possible, as it makes compartmentalization a lot more difficult, and makes update/distribution a lot less manageable. Most things can be done from the usercommand.py file, which keeps your axis mods contained, and makes updates/configs way easier.
2 pyvcp spots? probably need another instance or something like that if you want 2 individual pyvcp windows. My suggestion would be to keep the right side pyvcp and use the usercommand.py to add everything else. It seems like you want to do more things with axis anyways, so you might as well just jump over to usercommand. While trivial to add a button in usercommand, adding a second pyvcp seems more difficult.
Make a usercommand.py file
the docs for usercommand are here linuxcnc.org/docs/devel/html/gui/axis.html#_user_command_file
add it to your iniand include this line in the file.
the docs for usercommand are here linuxcnc.org/docs/devel/html/gui/axis.html#_user_command_file
what does it all mean? dont know exactly, but I can explain this much
2 pyvcp spots? probably need another instance or something like that if you want 2 individual pyvcp windows. My suggestion would be to keep the right side pyvcp and use the usercommand.py to add everything else. It seems like you want to do more things with axis anyways, so you might as well just jump over to usercommand. While trivial to add a button in usercommand, adding a second pyvcp seems more difficult.
while I cannot verify at the moment, one of my files has this line. which should do the trick, but modify the size as neededi would like to be able to make the preview window smaller and have more room for my pyvcp panel.
W('.pane.top.right','configure','-width','580')
Make a usercommand.py file
the docs for usercommand are here linuxcnc.org/docs/devel/html/gui/axis.html#_user_command_file
add it to your ini
[DISPLAY]USER_COMMAND_FILE = usercommand.py
the docs for usercommand are here linuxcnc.org/docs/devel/html/gui/axis.html#_user_command_file
W = root_window.tk.call
#W('.pane.top.right','configure','-width','580','-arcradius','8','-font','mono 12','-tabpady','1''1')
W('.pane.top.right','configure','-width','580')
what does it all mean? dont know exactly, but I can explain this much
# this is to save fingers
W = root_window.tk.call
W('.pane.top.right','configure','-width','580','-arcradius','8','-font','mono 12','-tabpady','1''1')
# .pane is the parent widget
# .top is the top halfish widget , it includes the manual tabs, the preview tabs, and the over ride sliders/mid commands
# .right is the widget we are modifying, right is for right side
# 'configure' to configure the widget '.pane.top.right'
# '-width','580', is to configure the width. 580 is the pixels
# the rest of the stuff is for the actual tabs for the noteboomk widget, arc radius sets the "radius" for the tab, and font and padding
Please Log in or Create an account to join the conversation.
- cakeslob
- Offline
- Platinum Member
Less
More
- Posts: 785
- Thank you received: 230
29 May 2021 19:14 #210643
by cakeslob
Replied by cakeslob on topic added more color functionality to pyvcp widgets
Adding buttons is a little more involved, but once you do it, it is trivial after. I will post a more detailed explanation later, but heres some references to use for now,
forum.linuxcnc.org/21-axis/40373-search-bar-and-gcode-scroll
forum.linuxcnc.org/21-axis/38188-solved-...mand?start=10#192009
the usercommand files posted in these threads, have examples of my usercommand files where I have added buttons to the bottom, I most copied phillc's plasmac gui for axis, it is a much cleaner version of what I want mine to be. My intention is to make a version called regular-mac, where is has the plasma components stripped away, so one can use the userframe in the bottom left in a similar way its used for plasmac with userbuttons and i/o status
github.com/LinuxCNC/linuxcnc/blob/master...smac/plasmac_axis.py
this is my main reference for what can be done with the usercommand file.
the usercommand file is a very powerful tool for axis mods, and can do most things. I strongly recomend using it, as anytime there is an axis update, it can be a painful time updating your axis.py /axis.tlc to match the updates
Here is a good file i found as a starting point, I think ive only packed and configured new buttons/user frames for the buttons, but left all the button commands undefined
put this file in your config and add this line to your ini
forum.linuxcnc.org/21-axis/40373-search-bar-and-gcode-scroll
forum.linuxcnc.org/21-axis/38188-solved-...mand?start=10#192009
the usercommand files posted in these threads, have examples of my usercommand files where I have added buttons to the bottom, I most copied phillc's plasmac gui for axis, it is a much cleaner version of what I want mine to be. My intention is to make a version called regular-mac, where is has the plasma components stripped away, so one can use the userframe in the bottom left in a similar way its used for plasmac with userbuttons and i/o status
github.com/LinuxCNC/linuxcnc/blob/master...smac/plasmac_axis.py
this is my main reference for what can be done with the usercommand file.
the usercommand file is a very powerful tool for axis mods, and can do most things. I strongly recomend using it, as anytime there is an axis update, it can be a painful time updating your axis.py /axis.tlc to match the updates
Here is a good file i found as a starting point, I think ive only packed and configured new buttons/user frames for the buttons, but left all the button commands undefined
put this file in your config and add this line to your ini
[DISPLAY]USER_COMMAND_FILE = usercommand_just_bottombutt.py
Attachments:
Please Log in or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
Less
More
- Posts: 529
- Thank you received: 139
11 Feb 2023 19:32 #264305
by chris@cnc
Replied by chris@cnc on topic added more color functionality to pyvcp widgets
Has someone an example how to change color of pyvcp panel. I attached my usercomand file.
Please Log in or Create an account to join the conversation.
- cakeslob
- Offline
- Platinum Member
Less
More
- Posts: 785
- Thank you received: 230
14 Feb 2023 00:42 #264476
by cakeslob
Replied by cakeslob on topic added more color functionality to pyvcp widgets
uhh personally I dont know, check some of the threads from askjerry a few pages back, he has some good looking pyvcp';s
to do it like aaron has, we probably need to push his updates for pyvcp_widgets.py
linuxcnc.org/docs/2.9/html/gui/axis.html..._x_resource_database
this way might change the pyvcp colours...
to do it like aaron has, we probably need to push his updates for pyvcp_widgets.py
linuxcnc.org/docs/2.9/html/gui/axis.html..._x_resource_database
this way might change the pyvcp colours...
Please Log in or Create an account to join the conversation.
Time to create page: 0.066 seconds