示例#1
0
        private void buttonAddAction_Click(object sender, EventArgs e)
        {
            Type t = AvailableActions.SelectedItem as Type;

            if (t != null)
            {
                object           o      = Activator.CreateInstance(t);
                IReflectorButton button = o as IReflectorButton;
                xperdex.core.osalot.AssemblyObject ao = new osalot.AssemblyObject(t, o);
                editing_macro.buttons.Add(ao);
                Actions.DataSource = null;
                Actions.DataSource = editing_macro.buttons;
            }
        }
示例#2
0
        private void buttonClone_Click(object sender, EventArgs e)
        {
            IReflectorButton button = core_common.clone_control.o as IReflectorButton;

            if (button != null)
            {
                object o = Activator.CreateInstance(core_common.clone_control.Type);

                //IReflectorButton newbutton = o as IReflectorButton;
                xperdex.core.osalot.AssemblyObject ao = new osalot.AssemblyObject(core_common.clone_control.Type, o);
                editing_macro.buttons.Add(ao);
                Actions.DataSource = null;
                Actions.DataSource = editing_macro.buttons;
            }
        }
示例#3
0
 bool IReflectorButton.OnClick()
 {
     foreach (osalot.AssemblyObject o in buttons)
     {
         IReflectorButton i = o.o as IReflectorButton;
         if (!i.OnClick())
         {
             // execute macro backwards?!
             return(false);
             // abort?
         }
     }
     return(true);
     //throw new Exception( "The method or operation is not implemented." );
 }
示例#4
0
        void Init(Canvas canvas, IReflectorButton click_interface)
        {
            AllowShowUsers = new List <string>();
            AllowShow      = new List <string>();
            DisallowShow   = new List <string>();
            this.canvas    = canvas;
            buttons        = new buttons_class();
            gs             = new GlareSet("default", "default");

            FontTracker       = FontEditor.GetFontTracker("Default");
            allowed_on_system = true;

            InitializeComponent();
            if (click_interface == null)
            {
                _click = this as IReflectorButton;
            }
            else
            {
                _click = click_interface;
            }
#if no_PSI_Base_class
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            //SetStyle(ControlStyles.Opaque, false);  // no background
            //SetStyle(ControlStyles.UserPaint, true); // generate paint
            //SetStyle(ControlStyles.AllPaintingInWmPaint, true); // skip paintbackground
            this.SetStyle(ControlStyles.Opaque, false);
            this.BackColor      = Color.Transparent;
            this.DoubleBuffered = true;
#endif
            this.security_tags = new List <object>();
            this.MouseUp      += new System.Windows.Forms.MouseEventHandler(this.CanvasButtonUp);
            this.MouseMove    += new System.Windows.Forms.MouseEventHandler(this.CanvasClick);
            this.MouseDown    += new System.Windows.Forms.MouseEventHandler(this.CanvasButtonDown);

            this.Paint += new PaintEventHandler(PSI_Button_Paint);
            //SetStyle(ControlStyles.
            //this.SetStyle(ControlStyles.
            //BackColor = Color.Transparent; // Color.FromArgb(0, 1, 0, 0);
        }
示例#5
0
 public PSI_Button(Canvas canvas, IReflectorButton click_interface)
 {
     Init(canvas, click_interface);
 }