CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 13, 2018, 12:52:10 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Script Shortcut Buttons  (Read 1806 times)
csirocnc
Storm Trooper
***
Offline Offline

Posts: 146


Howell V4


View Profile
« on: February 08, 2014, 09:21:46 am »

Hi All
Has anyone seen or made (hint hint)  "user buttons" that can be on the tool bar and defined to open selected scripts.

Cheers
Paul
Logged

1st CamBam Licence sale
in Australia
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7677



View Profile
« Reply #1 on: February 08, 2014, 16:54:58 pm »

Um.... many plugins plant buttons on the toolbar!

A plugin is just a script wearing a tuxedo.

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
Bob La Londe
CNC Jedi
*****
Offline Offline

Posts: 3418


^ 8.5 pounds on my own hand poured bait.


View Profile WWW
« Reply #2 on: February 09, 2014, 18:27:12 pm »

Kinda like politicians and pigs. 
Logged

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com
gmoo
CNC Ewok
*
Offline Offline

Posts: 25

Jam it !


View Profile
« Reply #3 on: November 19, 2018, 09:37:48 am »

The question old, but I want to ask again.
Is it possible to start a python script just by clicking a simple button
instead of script-open script-select the script-F5 ?

Best regards

Bernhard
Logged

best regards

Bernhard
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3694



View Profile
« Reply #4 on: November 19, 2018, 09:53:15 am »

Try this plugin; http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Script_launcher.html
Logged
gmoo
CNC Ewok
*
Offline Offline

Posts: 25

Jam it !


View Profile
« Reply #5 on: November 19, 2018, 10:04:41 am »

Eddy, I guess you´re never sleeping...  Grin

THX for your extreme answer.

I´d rather had just a nice button to quick-start my magic script.
No SIMPLE way ?






* Zwischenablage01.jpg (15.73 KB, 421x241 - viewed 25 times.)
Logged

best regards

Bernhard
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3694



View Profile
« Reply #6 on: November 19, 2018, 10:29:20 am »

Make it a plugin then you can do that
Logged
onekk
Wookie
****
Offline Offline

Posts: 403


View Profile
« Reply #7 on: November 19, 2018, 11:02:47 am »

Code:
namespace YourNamespace
{
    public class YourMainClass
    {
        public YourMainClass()
        {
        }

        public static void InitPlugin(CamBamUI ui)
        {

            // Create a new menu item in the top Plugins menu
            ToolStripMenuItem mi = new ToolStripMenuItem();
            mi.Text = "Your_MenuText";

            mi.Click += new EventHandler(plugin_clicked);
            mi.ShortcutKeys = Keys.Control | Keys.Shift | Keys.M;
   mi.ShortcutKeyDisplayString = "Ctrl + Shift + M";
            ui.Menus.mnuPlugins.DropDownItems.Add(mi);
          
        }

        public static void plugin_clicked(object sender, EventArgs e)
        {
          
            YourMainForm iface = new YourMainForm();
            iface.Owner = CamBam.ThisApplication.TopWindow;
            iface.Show();

        }

        

    }

}

This is the base for a plugin, the part that put the plugin name in the plugins menu.
I assembled some code (the shortcut parts is from another plugin)

To create a button you have to populate the InitPlugin(CamBamUI ui) with the proper code to create a button,

At the moment I don't rember the proper code, as i haven't had the nedd to crete one  but generally it involves:

1) adding some icon that became the button
2) creating and adding a button to the ToolBar
3) adding an action that is executed when the button is pressed

The  usual thing is to write a plugin that do what you want, but it has to be written in C# or maybe in VB# (some other guys have writtens some plugins in VB# notably dh42 if i'm remeber well)

I doubt there is no way to make a button in a script, as the scripts are not auto-loadable if I remember well, for this someone have developed the launcher plugin, as noted in this thread.

Regards

Carlo D.
« Last Edit: November 19, 2018, 11:09:19 am by onekk » Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
gmoo
CNC Ewok
*
Offline Offline

Posts: 25

Jam it !


View Profile
« Reply #8 on: November 19, 2018, 11:08:00 am »

Thank you very much, but this is too complicated for me.
Just to save a few mouse-clicks I don´t want to
- Install Visual Studio
- Learning some C#

I prefer the KIS-principle : Keep it simple !  Grin

Logged

best regards

Bernhard
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3694



View Profile
« Reply #9 on: November 19, 2018, 13:48:49 pm »

The problem here is that a button has to exist BEFORE the script is started, that implies something else has to run first to make the button available.
With that in mind I think the "Script Launcher" plugin is your best option.
« Last Edit: November 19, 2018, 13:51:02 pm by EddyCurrent » Logged
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2044



View Profile
« Reply #10 on: November 19, 2018, 14:56:46 pm »

While we are at it there is a missing keyboard shortcut, not speak about a button for one of the most frequently used CB functions - Transform -> Align.
Logged

Before asking a question do some effort and walk through all menus and options in CamBam.  Maybe the answer is there. Please.
gmoo
CNC Ewok
*
Offline Offline

Posts: 25

Jam it !


View Profile
« Reply #11 on: November 20, 2018, 14:56:51 pm »


At first I want to apologize. I meant "extreme fast answer" instead of "extreme answer".

The Script launcher works like a charm, it´s only 1 mouse-click more than a launch button.

THX !

Bernhard

« Last Edit: November 21, 2018, 21:04:12 pm by gmoo » Logged

best regards

Bernhard
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.149 seconds with 19 queries.

Copyright © 2018 HexRay Ltd. | Sitemap