585,974 active members*
4,162 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > UCCNC Control Software > How to attach C# script to a screen button ??
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    287

    How to attach C# script to a screen button ??

    I don't know if it's staring me in the face, but I can't find out how to attach a script to a screen button.

    Looking at the screen making documentation, a button is added as follows:

    Function: void Addbutton(double xposition, double yposition, double width, double height, bool toggletype, bool blinktype, int picturenumber, int buttonnumber, int layernumber)
    Description: This function adds one button object to the screen. The first 2 parameters are the X and Y position in pixels of the top-left corner of the button.
    The width and height are also in pixels and they define how wide and how tall the button will be.
    If the toggletype parameter is true then the button is toggling between the on and off states with rendering the left side half image onto the button in the off state and rendering the right side half image in the on state of the button.
    If the blinktype parameter is true then in the on state of the button the rendering of the left and right side images is rendered periodically creating a blinking effect.
    The picturenumber is the identifier of the image used to render this button,
    this identifier was set in the Loadpicture functions and any picture which was loaded previously can be selected.
    The buttonnumber is an identifier for this button and this identifier also defines the function of this button. For example code 128. is the cycle start button code.
    The different button codes are listed and described in a separated document.
    The layernumber defines on which tab layer will the button appear on.
    Example: AS3.Addbutton(50, 60, 100, 100, 18, 128, 2);


    So the buttonnumber is the identifier that defines the function of this button. I've looked at the list of the button functions and can't find anything related to running a script. So far the only way I can think of running a custom script is to put it in a macro and call the macro from the MDI line.

    Am I missing something ?

    Keith

  2. #2
    Join Date
    Jun 2015
    Posts
    943

    Re: How to attach C# script to a screen button ??

    The button IDs 20000 to 20999 call the macros. I tried that and it worked.

  3. #3
    Join Date
    Sep 2005
    Posts
    287

    Re: How to attach C# script to a screen button ??

    Thanks very much OlfCNC.

    I tried it and it worked great. I have to ask though, where did you find that info, or did you just randomly try and see what happened. I can't see that documented anywhere.

    Keith.

  4. #4
    Join Date
    Jun 2015
    Posts
    943

    Re: How to attach C# script to a screen button ??

    Asked the developers.

  5. #5
    Join Date
    Jun 2014
    Posts
    777
    Quote Originally Posted by Beefy View Post
    I don't know if it's staring me in the face, but I can't find out how to attach a script to a screen button.

    Looking at the screen making documentation, a button is added as follows:

    Function: void Addbutton(double xposition, double yposition, double width, double height, bool toggletype, bool blinktype, int picturenumber, int buttonnumber, int layernumber)
    Description: This function adds one button object to the screen. The first 2 parameters are the X and Y position in pixels of the top-left corner of the button.
    The width and height are also in pixels and they define how wide and how tall the button will be.
    If the toggletype parameter is true then the button is toggling between the on and off states with rendering the left side half image onto the button in the off state and rendering the right side half image in the on state of the button.
    If the blinktype parameter is true then in the on state of the button the rendering of the left and right side images is rendered periodically creating a blinking effect.
    The picturenumber is the identifier of the image used to render this button,
    this identifier was set in the Loadpicture functions and any picture which was loaded previously can be selected.
    The buttonnumber is an identifier for this button and this identifier also defines the function of this button. For example code 128. is the cycle start button code.
    The different button codes are listed and described in a separated document.
    The layernumber defines on which tab layer will the button appear on.
    Example: AS3.Addbutton(50, 60, 100, 100, 18, 128, 2);


    So the buttonnumber is the identifier that defines the function of this button. I've looked at the list of the button functions and can't find anything related to running a script. So far the only way I can think of running a custom script is to put it in a macro and call the macro from the MDI line.

    Am I missing something ?

    Keith
    Having the same trouble.

  6. #6
    Join Date
    Oct 2005
    Posts
    1145

    Re: How to attach C# script to a screen button ??

    Create a macro and name it M20000 thru M20999 then assign the number of the macro to the button where it wants a button number.

    If you used M20000 Then in the button you tell it to use button 20000.

    (;-) TP

Similar Threads

  1. Edit button script
    By dukedunham in forum Mach Mill
    Replies: 4
    Last Post: 01-25-2015, 01:28 AM
  2. starting a wizard from a screen button
    By ptegler in forum Mach Wizards, Macros, & Addons
    Replies: 2
    Last Post: 02-24-2014, 02:07 AM
  3. Easiest way to make button run VB script
    By adamchapman in forum Mach Software (ArtSoft software)
    Replies: 9
    Last Post: 08-16-2010, 08:38 PM
  4. Changing screen size or a keyboard trigger for the reset button
    By maxboostbusa in forum Mach Software (ArtSoft software)
    Replies: 3
    Last Post: 03-16-2008, 07:54 PM
  5. Changed screen, now Start button doesn't work.
    By jderou in forum Screen Layouts, Post Processors & Misc
    Replies: 0
    Last Post: 03-20-2006, 02:57 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •