Exemple #1
0
        void InitCanvas(IReflectorCanvas i)
        {
            StaticInit();
            //keyboard = new Keyboard();
            ICanvas          = i;
            flags            = new canvas_flags();
            pages            = new List <page>();
            ContextMenuStrip = null;

            InitializeComponent();
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            SetStyle(ControlStyles.Opaque, false);              // no background
            SetStyle(ControlStyles.UserPaint, true);            // generate paint
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // skip paintbackground

            this.MouseMove += new MouseEventHandler(Canvas_MouseMove);
            //this.BackgroundImage = current_page.background_image;
            this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;

            this.ControlAdded += new ControlEventHandler(Canvas_ControlAdded);

            buttons = new buttons_class();              // mouse buttons
        }
Exemple #2
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);
        }
Exemple #3
0
        public static List <Type> buttons;        // just controls that implement IReflectorButton (for macros)
        static core_common()
        {
            try
            {
                buttons                 = new List <Type>();
                systems                 = new List <string>();
                drop_acceptors          = new List <IReflectorPluginDropFileTarget>();
                directors               = new List <IReflectorDirectionShow>();
                security_modules        = new List <TypeName>();
                plugin_module_acceptors = new List <IReflectorPluginModule>();
                persistant_plugins      = new List <object>();
                assemblies              = new List <osalot.AssemblyTracker>();
                flags     = new _flags();
                glaresets = new List <GlareSetData>();
                mouse_b   = new buttons_class();

                //fonts = new List<font_tracker>();
                layouts = new List <TextLayout>();
                //controls = new List<Control>();

                glare_attribs = new List <GlareSetAttributes>();
                GlareSetAttributes DefaultAttrib = core_common.GetGlareSetAttributes("default");
                DefaultAttrib.Primary   = Color.FromArgb(64, Color.Red);
                DefaultAttrib.Secondary = Color.LightCoral;
                DefaultAttrib.TextColor = Color.White;


                core_common.other_drop          = new ToolStripMenuItem("More Properties");
                core_common.other_drop.DropDown = new ToolStripDropDown();
                // items is expected to be a single toolstrip dropdown type widget
                // it then points at a dropdown of more layers...
                core_common.plugin_drop          = new ToolStripMenuItem("Create Other");
                core_common.plugin_drop.DropDown = new ToolStripDropDown();

                {
                    string workpath = Environment.CurrentDirectory;
                    string s        = Application.ExecutablePath;
                    int    end1     = s.LastIndexOf('/');
                    int    end2     = s.LastIndexOf('\\');
                    string program;
                    if (end1 > end2)
                    {
                        program = s.Substring(end1 + 1);
                    }
                    else
                    {
                        program = s.Substring(end2 + 1);
                    }
                    end1    = program.LastIndexOf('.');
                    program = program.Substring(0, end1);

                    ConfigName = workpath + "/" + program + ".config.xml";

                    if (Environment.OSVersion.Platform == PlatformID.Unix)
                    {
                        if (ConfigName[0] != '/')
                        {
                            ConfigName = "/" + ConfigName;
                        }
                    }
                    xperdex.classes.Log.log("Config name is " + ConfigName);
                }


                core_common.LoadAssembly(Application.ExecutablePath); // load me, myself and I
                core_common.LoadAssembly("xperdex.core.dll");
                core_common.LoadAssembly(null);                       // load me, myself and I : xperdex.core.common.dll

                foreach (osalot.AssemblyTracker tracker in core_common.assemblies)
                {
                    tracker.default_load = true;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Local failed init: " + e.Message);
            }
            //local.LoadAssembly( Application.ExecutablePath ); // load me, myself and I
        }