Skip to content

Commit 5c3aa31

Browse files
tomptomp
authored andcommitted
after 1st commit i checked github abd did not see the new pyvcpwidgets.py, so i added a space to make it dirty, then git add'ed it, then made this commit, then will check github again
1 parent dd88dc5 commit 5c3aa31

File tree

4 files changed

+101
-1
lines changed

4 files changed

+101
-1
lines changed

grfx/hbardiamond01.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/python3
2+
# dwgf file for pybcp_widget class horz bar
3+
#
4+
# scratch py to see if spreadshgett vbar and hnar value are ok
5+
# 21oct2023 by using a file for the 'thumb' of the pyvcp_widget call bar
6+
# the user can make any shape move alonmg the bar's 'rail'(aka elevator)
7+
# Imagine a musioc clef drawing for volume
8+
# and a faucet pourinbf water
9+
# or the word "Hz" for frequency
10+
# i had to cjeclk. was that Hz or hZ or hz... ok Big H little z
11+
#
12+
from tkinter import *
13+
14+
def createMarker(self,cw,bh,max_,min_,value):
15+
#
16+
#12nov this is only for horz bars
17+
#
18+
range = self.max_ - self.min_
19+
#
20+
my = int(self.ch /2)
21+
#
22+
#mx = int( ( (self.value-self.min_) / range) * self.bw )
23+
#
24+
#print("in hbardiamond01 createMarker value = ",self.value," min = ", self.min_, " range ", range, " self.bw ", self.bw, "mx = ",mx)
25+
originPxls = 0 # 0 from bar top is same pxls as self.max
26+
originPxls = originPxls #+ self.pxPadVert # accomopdate canvas to bar margin
27+
mx= originPxls
28+
#
29+
hh = int(self.ch/4)
30+
hw = int(hh/3) # for horz make sure marker is taller than wide
31+
#
32+
self.marker = self.create_polygon(
33+
mx, my+hh,
34+
mx+hw, my,
35+
mx, my-hh,
36+
mx-hw, my,
37+
mx, my+hh,
38+
width=1
39+
)
40+
#22oct iwhy is the shape filled? its dark
41+
# well red works, so the dark color is some default of i set it dunno how where
42+
# buty i see the thumb is BEHIND the raiul!
43+
self.itemconfig(self.marker,fill="red")

grfx/vbarRect01.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/python3
2+
# scratch py to see if spreadshgett vbar and hnar value are ok
3+
# 21oct2023 by using a file for the 'thumb' of the pyvcp_widget call bar
4+
# the user can make any shape move alonmg the bar's 'rail'(aka elevator)
5+
# Imagine a musioc clef drawing for volume
6+
# and a faucet pourinbf water
7+
# or the word "Hz" for frequency
8+
# i had to cjeclk. was that Hz or hZ or hz... ok Big H little z
9+
#
10+
from tkinter import *
11+
12+
#def drawMarker(canvas):
13+
#17nov i padd self, so all data is supplied, dont pass parts of self
14+
def createMarker(self):
15+
print("in createMarker vbarRect-1.py")
16+
#
17+
mx = int(self.cw/2)
18+
#
19+
range = (self.max_ - self.min_)/2
20+
my = int((self.value/range)*range)
21+
my=my-self.pxPadVert
22+
#
23+
qw = int(mx/2) # for horz make sure marker is taller than wide
24+
#
25+
#print("in createMarker value = ",self.value," mx = ", mx, " my = ", my, " qw = ", qw)
26+
#
27+
self.marker = self.create_polygon(
28+
qw , my+2,
29+
mx+qw, my+2,
30+
mx+qw, my-2,
31+
qw , my-2,
32+
qw , my+2,
33+
width=1
34+
)
35+
#22oct iwhy is the shape filled? its dark
36+
# well red works, so the dark color is some default of i set it dunno how where
37+
# buty i see the thumb is BEHIND the raiul!
38+
self.itemconfig(self.marker,fill="red")

grfx/vbardiamond01.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/python3
2+
from tkinter import *
3+
def createMarker(self):
4+
range = self.max_ - self.min_
5+
mx = int(self.cw/2)
6+
originPxls = 0
7+
originPxls = originPxls
8+
my= ((self.max_-self.value) / range) * self.bh
9+
hw = int(self.cw/2)
10+
hh=int(hw/2)
11+
self.marker = self.create_polygon(
12+
mx, my+hh,
13+
mx+mx, my,
14+
mx, my-hh,
15+
mx-mx, my,
16+
mx, my+hh,
17+
width=1
18+
)
19+
self.itemconfig(self.marker,fill="red")

lib/python/pyvcp_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# this file ius found in /home/tomp/linuxnc-barwidgets/configs/tomp/nuPyvcpBars
1+
# this file ius found in /home/tomp/linuxnc-barwidgets/configs/tomp/nuPyvcpBars
22
# fname is pyvcp_widgets18nov2023.py
33
# ot is the only src
44
# it needs to be stored in 2 plavces

0 commit comments

Comments
 (0)