Laminar 1.0 - flow chart creator

Post your working scripts, libraries and tools for AHK v1.1 and older
wbm1113
Posts: 18
Joined: 28 Aug 2018, 11:19

Laminar 1.0 - flow chart creator

20 Aug 2020, 11:09

I made a flow chart program for work to help train new employees in work-from-home environments.

Code, exe:
https://github.com/wbm1113/Laminar

Chart creation UI:
Image Broken Link for safety

Sample chart:
Image Broken Link for safety
  • Simple, click-to-draw interface
  • Undo/redo
  • Add colors, text, screenshots to shapes
  • Rectangles, rounded rectangles, circles, diamonds, arrows
  • Guide lines help align shapes to the grid and to each other
  • Connect shapes automatically
  • Projects save to .ini (avoids having to install/register a custom file type, which is often prohibited on work machines with tight security). Saved images are converted to string format to keep it all in one file.
  • Export to .jpg
Some helpful classes in the repository:

layeredWindow (no gdip_all):

Code: Select all

canvas := new layeredWindow("canvas")
canvas.create()
canvas.setDimensions(desktop.topLeftX, desktop.topLeftY, desktop.w, desktop.h)
canvas.getCanvas()
canvas.fillRect(fillColor, this.x, this.y, this.w, this.h)
canvas.drawRect(borderColor, 1, this.x, this.y, this.w, this.h)
canvas.update()
Path / "stencil" class (using the arrow class extension as an example):

Code: Select all

r := new rect().setDimensions(100, 100, 100, 100)
arrowRight := new arrow()
arrowRight.updateCoords(r,,, pointsToward := "right")
arrowRight.draw(canvas, "black", 1)
arrowRight.fill(canvas, "blue")
eventManager class to make windows messagehandling easier:

Code: Select all

; register the event
onMessage(0x200, "onMouseMove")
eventMgr.add("mouseMove")
eventMgr.events["mouseMove"].throttle := 10
onMouseMove(wParam, lParam, msg, hwnd) {
    eventMgr.events["mouseMove"].invoke()
}

; add actions to the event
eventMgr.events["mouseMove"].addAction("ex1", objBindMethod(class1, "method1"))
eventMgr.events["mouseMove"].addAction("ex2", objBindMethod(class2, "method2"))
eventMgr.events["mouseMove"].enabled := 1

; initialize the event with a default action (accepts variadic parameters)
eventMgr.events["mouseMove"].setDefault("ex1").resetToDefault()

; disable the event, swap the first action in its queue to the other added action, re-enable
eventMgr.events["mouseMove"].enabled := 0
eventMgr.events["mouseMove"].swap(1, "ex2")
eventMgr.events["mouseMove"].enabled := 1
cursor class to easily change between built-in cursor types

Code: Select all

    static cursorDescriptions := { "helpArrow"         : 32512
                                 , "iBeam"             : 32513
                                 , "wait"              : 32514 
                                 , "cross"             : 32515 
                                 , "upArrow"           : 32516
                                 , "resizeUpLeft"      : 32642 
                                 , "resizeUpRight"     : 32643
                                 , "resizeSideToSide"  : 32644 
                                 , "resizeUpDown"      : 32645
                                 , "pan"               : 32646 
                                 , "no"                : 32648
                                 , "fingerPoint"       : 32649
                                 , "mouseWait"         : 32650 }
cursor.reset()
cursor.setAll(cursor.cursorDescriptions[yourChoice])
Oh boy, that didn't take long. Known issues:
  • Text doesn't always render correctly when exporting. If this happens, save your file, close the program, reopen your file, and re-export.
Last edited by wbm1113 on 21 Aug 2020, 23:41, edited 2 times in total.
User avatar
tidbit
Posts: 1272
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Laminar 1.0 - flow chart creator

20 Aug 2020, 11:20

"Laminar" "flow" ... I see what you did there :thumbup:
Spoiler
Mind posting a screenshot? or 3? it's nice to see what you get before downloading/running code.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
wbm1113
Posts: 18
Joined: 28 Aug 2018, 11:19

Re: Laminar 1.0 - flow chart creator

20 Aug 2020, 11:26

I posted these in the OP. I'm not very good with computers, so I couldn't figure out how to get them to turn into actual links.

Chart creation UI:
Image

Sample chart:
Image
Last edited by gregster on 20 Aug 2020, 11:32, edited 1 time in total.
User avatar
tidbit
Posts: 1272
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Laminar 1.0 - flow chart creator

20 Aug 2020, 12:25

ah, so you did. Sorry. I'll edit your first post so they get embedded.
Also, impressive!

edit, done. Made them linked thumbnails so they don't take as much space. but clicking it goes to the full size.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
Relayer
Posts: 160
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Re: Laminar 1.0 - flow chart creator

21 Aug 2020, 07:43

wbm1113 wrote:
I'm not very good with computers

That's pretty complex programming you've done! :? :eh: :wtf:

Relayer

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Thalon and 164 guests