How to create lines or outlines in V2?
In AHK v1 I often used a function to draw a line or an outline in GUI:s
In the call to the function(), it is specified which GUI the line belongs to (if several GUIs exist)
and coordinates etc.
This is some code from AHK v1 (use progressbar)
Code: Select all
GUI
...
DrawLine( NameGui := 1, x := 70, y := 55, w := 600, h := 4, Color := 0xFFA500 ) ; Horoisontell linje - orange
DrawLine( NameGui := 1, x := 320, y := 55, w := 4, h := 620, Color := 0xFFA500 ) ; Vertikal linje - orange
...
; DrawOutline( Gui, x, y, w, h, Color1, Color2, Thickness )
DrawOutline( 1, 360, 160, 290, 310, "Green", "Green", 2 )
...
...
; Draw a line
DrawLine( NameGUI, x, y, w, h, Color )
{ GUI , % NameGUI ": Add" , Progress , % "X" X " Y" Y " W" W " H" H " Background" Color
}
; Draw a borderline as rectangle or square
DrawOutline( NameGUI, x, y, w, h, Color1 := "Black", Color2 := "Black", Thickness := 1 )
{ GUI , % NameGUI ": Add" , Progress , % "x" x " y" y " w" w " h" Thickness " Background" Color1
GUI , % NameGUI ": Add" , Progress , % "x" x " y" y " w" Thickness " h" h " Background" Color1
GUI , % NameGUI ": Add" , Progress , % "x" x " y" y + h - Thickness " w" w " h" Thickness " Background" Color2
GUI , % NameGUI ": Add" , Progress , % "x" x + w - Thickness " y" y " w" Thickness " h" h " Background" Color2
}
Draw a colored outline on a GUI - AHK v1