Documentation
¶
Index ¶
- Constants
- type Font
- type Font_mgr
- type Gen_colour
- type Qt_api
- func (qt *Qt_api) Clear()
- func (qt *Qt_api) Clear_subpage(pname string)
- func (qt *Qt_api) Close()
- func (qt *Qt_api) Delete_subpage(pname string)
- func (qt *Qt_api) Draw_arc(x float64, y float64, radius float64, a1 float64, a2 float64)
- func (qt *Qt_api) Draw_circle(xo float64, yo float64, radius float64, outline bool)
- func (qt *Qt_api) Draw_line(x1 float64, y1 float64, x2 float64, y2 float64)
- func (qt *Qt_api) Draw_pie(xo float64, yo float64, radius float64, alpha1 float64, alpha2 float64, ...)
- func (qt *Qt_api) Draw_poly(point []*sktools.Point, outline bool)
- func (qt *Qt_api) Draw_rect(xo float64, yo float64, height float64, width float64, outline bool)
- func (qt *Qt_api) Draw_text(xo float64, yo float64, text string)
- func (qt *Qt_api) Engague()
- func (qt *Qt_api) Mk_page(name string, h int, w int, title string) error
- func (qt *Qt_api) Mk_subpage(name string, ox float64, oy float64, h float64, w float64)
- func (qt *Qt_api) Paint_all()
- func (qt *Qt_api) Pop_state()
- func (qt *Qt_api) Push_state()
- func (qt *Qt_api) Rotate(degrees float64)
- func (qt *Qt_api) Select_page(name string)
- func (qt *Qt_api) Select_subpage(pname string)
- func (qt *Qt_api) Selelect_sub_page(name string)
- func (qt *Qt_api) Set_colour(name string)
- func (qt *Qt_api) Set_dimensions(height float64, width float64)
- func (qt *Qt_api) Set_fill_attrs(cname string, fill_style int)
- func (qt *Qt_api) Set_font(font_name string, size int, weight int, ital bool)
- func (qt *Qt_api) Set_line_style(pattern []int)
- func (qt *Qt_api) Set_line_width(width int)
- func (qt *Qt_api) Set_page_colour(cname string)
- func (qt *Qt_api) Set_scale(xscale float64, yscale float64)
- func (qt *Qt_api) Show()
- func (qt *Qt_api) Translate_delta(dx float64, dy float64)
- type Qt_drawport
- func (dp *Qt_drawport) Add_font(ref_name string, name string, size int, weight int, ital bool)
- func (dp *Qt_drawport) Draw_arc(xo float64, yo float64, radius float64, alpha1 float64, alpha2 float64)
- func (dp *Qt_drawport) Draw_line(x1 float64, y1 float64, x2 float64, y2 float64, colour *Gen_colour)
- func (dp *Qt_drawport) Draw_rect(x1 float64, y1 float64, h float64, w float64, colour *Gen_colour)
- func (dp *Qt_drawport) Draw_text(x float64, y float64, value string, font string, cname string)
- func (dp *Qt_drawport) Get_object() *widgets.QWidget
- func (dp *Qt_drawport) Paint()
- func (dp *Qt_drawport) Render()
- func (dp *Qt_drawport) Set_bg(colour *Gen_colour, style int)
- func (dp *Qt_drawport) Set_colour(cname string)
- func (dp *Qt_drawport) Set_fill(colour *Gen_colour, style int)
- func (dp *Qt_drawport) Set_stylus()
- type Qt_window
- func (win *Qt_window) Add_drawport(name string, ox int, oy int, h int, w int)
- func (win *Qt_window) Add_font(ref_name string, font_name string, size int, weight int, ital bool)
- func (win *Qt_window) Draw_line(x1 float64, y1 float64, x2 float64, y2 float64)
- func (win *Qt_window) Draw_text(x float64, y float64, text string, font string, colour string)
- func (win *Qt_window) Paint_all()
- func (win *Qt_window) Sel_drawport(name string) (dp *Qt_drawport)
- func (win *Qt_window) Set_colour(name string)
- func (win *Qt_window) Set_dp_colour(cname string, mode int)
- func (win *Qt_window) Set_fill(name string, style int)
Constants ¶
const ( FILL_NONE int = iota FILL_SOLID FILL_OP_0 FILL_OP_1 FILL_OP_2 FILL_OP_3 FILL_OP_4 FILL_OP_5 FILL_OP_6 FILL_HORIZ FILL_VERT )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Font_mgr ¶
type Font_mgr struct {
// contains filtered or unexported fields
}
type Gen_colour ¶
type Gen_colour struct {
// contains filtered or unexported fields
}
QT seems to have mutiple ways to refernece colour and none are compatable with each other. Damn C++ programmers. So, we manage a generic colour struct which can be used to track a colour in various shapes and sizes to be passed to QT in what ever fashion it fancies.
func Mk_gen_colour ¶
func Mk_gen_colour(cvalue string, alpha int) *Gen_colour
Given a string (#rrggbb, 0xrrggbb or name)
func (*Gen_colour) Get_global_colour ¶
func (gc *Gen_colour) Get_global_colour() core.Qt__GlobalColor
Return the equiv qt core global colour object.
func (*Gen_colour) Get_gui_colour ¶
func (gc *Gen_colour) Get_gui_colour() *gui.QColor
Return the equiv qt colour object.
type Qt_api ¶
type Qt_api struct {
// contains filtered or unexported fields
}
The qt context struct passed round bwtween user and functions here.
func (*Qt_api) Clear ¶
func (qt *Qt_api) Clear()
These funcitons must exist, if only as dummies, to implement as sketch interface. The following are unimplemented or will always be dummies as they really aren't supported.
func (*Qt_api) Clear_subpage ¶
func (*Qt_api) Delete_subpage ¶
func (*Qt_api) Draw_arc ¶
Draw_arc draws an arc centered at x,y with the given readius. Angles a1 and a2 are the start and ending points of the arc measured in degrees anticlokwise from the x-axis.
func (*Qt_api) Draw_circle ¶
func (*Qt_api) Engague ¶
func (qt *Qt_api) Engague()
Pass control to the QT driver; all remaining interaction once the user calls this Function is through call backs.
func (*Qt_api) Mk_page ¶
Add a new 'page' (window) with the given height, width and title. Returns error if unable. Name is the reference string that is used to select or address the window.
func (*Qt_api) Mk_subpage ¶
Add a drawport to the active window.
func (*Qt_api) Push_state ¶
func (qt *Qt_api) Push_state()
func (*Qt_api) Select_page ¶
Set the active window for operations.
func (*Qt_api) Select_subpage ¶
func (*Qt_api) Selelect_sub_page ¶
Select the named drawport in the active window. All drawing commands following the selection, until another is selected, are applied to this drawport.
func (*Qt_api) Set_colour ¶
Set the foreground colour for the current window's ative drawport
func (*Qt_api) Set_dimensions ¶
func (*Qt_api) Set_fill_attrs ¶
Set the colour and fill style to use when filling objects.
func (*Qt_api) Set_font ¶
Define a font and add it to the active drawport. Future: add to all drawports
func (*Qt_api) Set_line_style ¶
func (*Qt_api) Set_line_width ¶
func (*Qt_api) Set_page_colour ¶
Set the background colour for the active drawport in the active window. Cname is any valid colour name or hex rgb string. Mode is any of the FILL_ mode constants.
func (*Qt_api) Translate_delta ¶
type Qt_drawport ¶
type Qt_drawport struct {
// contains filtered or unexported fields
}
A portion of the window that can be drawn into independently forom other drawports.
func Mk_drawport ¶
func Mk_drawport(ox int, oy int, h int, w int) *Qt_drawport
func (*Qt_drawport) Draw_arc ¶
func (dp *Qt_drawport) Draw_arc(xo float64, yo float64, radius float64, alpha1 float64, alpha2 float64)
Draw_arc paintes an arc centered at xo,yo with the given radius. The angles alpha1 and alpha2 define the starting (a1) and ending (a2) points in degrees anticlockwise from the X-axis.
func (*Qt_drawport) Draw_line ¶
func (dp *Qt_drawport) Draw_line(x1 float64, y1 float64, x2 float64, y2 float64, colour *Gen_colour)
Draw a line from x1,y1 to x2,y2 using the indicated colour..
func (*Qt_drawport) Draw_rect ¶
func (dp *Qt_drawport) Draw_rect(x1 float64, y1 float64, h float64, w float64, colour *Gen_colour)
Draw a rectangle from with a lower left corner of x1, y1 and a height and width. Future: allow fill parms to be referenced with a name as a final parm.
func (*Qt_drawport) Draw_text ¶
Add the text string with value to the canvas at the current position. Font is the reference name that was added to the canvas. The cname var may be a recognised name, or #rrggbb/0xrrggbb value string.
func (*Qt_drawport) Get_object ¶
func (dp *Qt_drawport) Get_object() *widgets.QWidget
Returns the "outermost" QT object that is represnted by the drawport.
func (*Qt_drawport) Set_bg ¶
func (dp *Qt_drawport) Set_bg(colour *Gen_colour, style int)
Set the background colour for the drawport. Mode is one of the FILL_* constants.
func (*Qt_drawport) Set_colour ¶
func (dp *Qt_drawport) Set_colour(cname string)
Set the current drawport colour. The colour value (cv) may be a name (e.g. bluegreen) that is known to the colour package, or a hex rgb value in either of the forms #rrggbb or 0xrrggbb.
func (*Qt_drawport) Set_fill ¶
func (dp *Qt_drawport) Set_fill(colour *Gen_colour, style int)
Set the fill (colour and style) for things that are filled (rectangle etc)
func (*Qt_drawport) Set_stylus ¶
func (dp *Qt_drawport) Set_stylus()
Set the drawing stylus:
colour (r,g,b)
type Qt_window ¶
type Qt_window struct {
// contains filtered or unexported fields
}
Manages the main window.
func (*Qt_window) Add_drawport ¶
Add a drawport to the window with origin ox,oy.
func (*Qt_window) Sel_drawport ¶
func (win *Qt_window) Sel_drawport(name string) (dp *Qt_drawport)
Sel_drawport selects the named drawport, making it active, and returns a pointer so that it can be used directly if desired.
func (*Qt_window) Set_colour ¶
func (*Qt_window) Set_dp_colour ¶
Set the bg colour for the active drawport. Name is any valid colour name or hex rgb string. Mode is one of the fill mode constants