Adding user toolbar buttons in PlanetCNC TNG software

User can add user buttons to software toolbars. These custom buttons can execute any feature from File, View, Program, Machine and Help menu. Buttons can execute also custom procedures. This will make any software feature even more accessible and easier to use. Buttons can be added to top, bottom, left and right sided toolbars.

Button files are located in Profiles folder. Button files are named: BtnTop.txt, BtnBottom.txt, BtnLeft.txt, BtnRight.txt

User buttons located at the top toolbar will use file: BtnTop.txt

User buttons located at the bottom toolbar will use file: BtnBottom.txt

User buttons located at the left toolbar will use file: BtnLeft.txt

User buttons located at the right toolbar will use file: BtnRight.txt

 

 

Add new user button to top toolbar:

This example will demonstrate how to add button to top toolbar which would execute feature from Program menu, in this case, Edit feature:

Open BtnTop.txt file with your text editor.

Code which creates button is actually path to menu location of this feature, with difference that level is replaced with “.” and spaces are replaced with “_”. To name a button, use one space before name text and put name text into quotes (“name”).

So, to add button to top toolbar which will execute Edit feature and will be named EDIT, write this code:

Program.Edit_... "EDIT"

 

Add new custom feature button to left toolbar:

This example will demonstrate how to add button to left toolbar which would execute custom feature from Machine/User Defined menu, in this case, Square feature:

Open BtnLeft.txt file with your text editor.

Code which creates button is actually path to menu location of this feature, with difference that level is replaced with “.” and spaces are replaced with “_”. Since we are creating button for custom feature we also need to write name of user defined file, in our case this is UD1.gcode(Square).  To name a button, use one space before name text and put name text into quotes (“name”).

So, to add button to left toolbar which will execute UD1.gcode(Square)  feature and will be named SQR, write this code:

Machine.UserDefined_UD1 "SQR"

 

Buttons will appear at the top and left toolbars after you restart PlanetCNC TNG software:

 

 

Adding button icon

This example will demonstrate how to add custom button icon for  newly created user button, in this case, for our Edit button.

Button icons use .PNG files that are located in Icons folder of specified profile folder. Icons folder already includes default .PNG files but you can add your own .PNG files.

For this example we will use PNG file “Icons/IMG_BTN_FileOpen.png” that is already included in Icons folder.

 

So for our Edit button, to use FileOpen.png icon with no button name, write this code:

Program.Edit_... "" "Icons/IMG_BTN_FileOpen.png"

After software restart, EDIT button now uses File Open icon:

 

 

To use FileOpen.png icon with button name, write this code:

Program.Edit_... "EDIT" "Icons/IMG_BTN_FileOpen.png"

After software restart, EDIT button now uses File Open icon and EDIT name:

 

 

Hiding default toolbar buttons

User can also hide default toolbar buttons from being displayed.

To hide default toolbar buttons click: File/Settings/User Interface/Toolbar Buttons -> Hide

 

Now only user toolbar buttons are displayed:

 

User can completely remove all toolbar buttons and use only those which are needed, either default buttons or user buttons.