[LDCad] Addon
2019-09-19, 11:37 (This post was last modified: 2019-09-19, 13:12 by Miguel Reizinho.)
2019-09-19, 11:37 (This post was last modified: 2019-09-19, 13:12 by Miguel Reizinho.)
Hello!
I've been doing some experiments and Roland suggested I shared them in this forum.
I've done some icons and themes in the past for LDCad. They are usually flat design themes, from several colors, with clear monochromatic icons
But I also wanted to be able to change the color of the titlebar of LDCad window from white, in the example above, to match the color of the menubar. I asked Roland about it but unfortunately that option was not available through the regular configuration files. But his reply about objects and windows class put me in the right track! I research a little and found out Autohotkey, a scripting language for Windows.
And what started as a pure cosmetic change turned out into a little addon that creates 4 extra buttons on the menubar, some additional hotkeys and the possibility to toggle on/off completely the window titlebar.
You can see a small video of the addon in action here: https://youtu.be/sDCpDDpfEWY
Requirements:
1. Install Autohotkey
Instructions:
I've been doing some experiments and Roland suggested I shared them in this forum.
I've done some icons and themes in the past for LDCad. They are usually flat design themes, from several colors, with clear monochromatic icons
But I also wanted to be able to change the color of the titlebar of LDCad window from white, in the example above, to match the color of the menubar. I asked Roland about it but unfortunately that option was not available through the regular configuration files. But his reply about objects and windows class put me in the right track! I research a little and found out Autohotkey, a scripting language for Windows.
And what started as a pure cosmetic change turned out into a little addon that creates 4 extra buttons on the menubar, some additional hotkeys and the possibility to toggle on/off completely the window titlebar.
Only works in windows unfortunately
You can see a small video of the addon in action here: https://youtu.be/sDCpDDpfEWY
Here is a brief technical explanation. Autohotkey script grabs LDcad class window and creates an overlay GUI, an extension of the menubar, at a certain position. It creates the extra buttons and show/hides them as necessary. Then registers the mouse clicks and position to change images, cursor and run actions. Pressing the new menubar button will maximize the window, remove titlebar and show additional window control buttons on the menubar (min, restore, close window). It will also register new hotkeys to enable/disable the titlebar, show/hide the menubar, reload script, etc. The autohotkey script is called by a new autorun.lua script also included. So once LDCad loads and finishes updating the PartBin, you'll see a CMD window flash briefly (due to limitations of the io.popen function in the lua script) and the new button will appear on the menubar. Feel free to open the autohotkey script and look around.
Features:
1. New Hotkeys
- CTRL+T to toggle titlebar
- F11 to toggle menubar (have to config LDCad hotkey show/hide menubar to F10)
- Left Double Click on menubar will maximize/restore window
Requirements:
1. Install Autohotkey
2. Download Addon
3. Download themes (optional)
- Blue
- Dark
- Gray
Instructions:
1. Unzip files inside Titlebar Addon.zip to your LDCad instalation folder
2. Copy autorun.lua to your profile LDCad global script folder i.e %appdata%\Roaming\LDCad\scripts\default\global
3. Edit autorun.lua and change path to your LDCad.exe accordingly
4. Depending on your buttons of the menu bar, you might have to adjust the origin of the new complement menubar.
- Open autorun.ahk with a text editor
- Find line 21, code "MenuPos = 1338"
- Change value "1338" for what suits you best. Increasing the number will move origin to the right. Decreasing will move to the left
Let me know if you need extra help in setting this up.
Hope you enjoy!