Box Maker is a simple but long program that creates a box for a Laser Cutter or a CNC Mill.
Here is an example:
What is inside the boxes?
You will notice that the boxes were cut with a CNC mill thus the inside corners are "dog boned", that is drilled out. Here is the "box maker design" that I used at the time:
The dialog form designer that DeltaCAD macro uses is "dlgdsn". It does not appear to be available for C:
So I have used xForms instead. Now I have looked at other GUI libraries but xForms has documentation, worked examples, a form designer and is not hard to compile (i.e. not too many dependencies).
Linking xForms is easy too:
- -lforms -lX11 -lm
But this is for a shared library.
I have realised that to share the program I have to use the static library and compile with:
- -l:libforms.a -lX11 -lm
Why? Because it is very likely and user will not have xForms installed on there system.
So here is the xForms dialog for Box Maker:
"fdesign" is the form designer for xForms. After laying out and setting the widget types, the form designer exports the "main", the "form", the "callbacks" and the "header" files. This can be compiled for a "look and feel".
In theory you just edit the code for the final product. That did not work for me as I did not understand the structures used that well. In the end I used the "choice" example as a based and built up that code using bits and pieces produced by the form designer.
I am not really trying to build a GUI program but a console program with a GUI dialog box.
As you may have noticed, the dialog has a number of options. Some to suit a laser cutter and others to suit a CNC mill. The "Cut Width' is used both for the laser beam cut width and for the CNC mill bit width, depending on the "CNC Type" selected.
Typically the lase beam width (i.e kerf) varies between 0.1 mm to 0.3 mm.
The "Hole Options" refers to the bolt hole locations. They can be on the inside of the box, one the outside (i.e. in the flange) or none.