Пример #1
0
 protected virtual void DisposeUnmanaged()
 {
     if (Handle != null)
     {
         _handle.Destroy();
         _handle = null;
     }
 }
Пример #2
0
 public IupControl(IupComposite parent, IupHandle handle)
     : base(handle)
 {
     if (parent != null)
     {
         parent.Append(this);
     }
 }
Пример #3
0
 protected override CBResult OnInternalDestroyCallback(IupHandle sender)
 {
     // be nice to garbage collector
     _glyph         = null;
     _glyphInactive = null;
     _glyphPress    = null;
     return(base.OnInternalDestroyCallback(sender));
 }
Пример #4
0
        protected CBResult OnHelp(IupHandle sender)
        {
            IupEventArgs ea = new IupEventArgs();

            if (CBHelp != null)
            {
                CBHelp(this, ea);
            }
            return(ea.Result);
        }
Пример #5
0
        public virtual CBResult OnShow(IupHandle sender, ShowState state)
        {
            ShowEventArgs ea = new ShowEventArgs(state);

            if (CBShow != null)
            {
                CBShow(this, ea);
            }
            return(ea.Result);
        }
Пример #6
0
        public virtual CBResult OnResize(IupHandle sender, int w, int h)
        {
            SizeEventArgs ea = new SizeEventArgs(w, h);

            if (CBResize != null)
            {
                CBResize(this, ea);
            }
            return(ea.Result);
        }
Пример #7
0
        protected virtual CBResult OnDropFiles(IupHandle sender, string filename, int index, int x, int y)
        {
            DropFilesEventArgs ea = new DropFilesEventArgs(filename, index, x, y);

            if (_cbDropFiles != null)
            {
                _cbDropFiles(this, ea);
            }
            return(ea.Result);
        }
Пример #8
0
        public virtual CBResult OnCopyData(IupHandle sender, string cmdline, int size)
        {
            CopyDataEventArgs ea = new CopyDataEventArgs(cmdline);

            if (CBCopyData != null)
            {
                CBCopyData(this, ea);
            }
            return(ea.Result);
        }
Пример #9
0
        public virtual CBResult OnClose(IupHandle sender)
        {
            IupEventArgs ea = new IupEventArgs();

            if (CBClose != null)
            {
                CBClose(this, ea);
            }
            return(ea.Result);
        }
Пример #10
0
 protected override CBResult OnInternalDestroyCallback(IupHandle sender)
 {
     //be nice to garbage collector:
     _enterbutton  = null;
     _escapebutton = null;
     _icon         = null;
     _parentdialog = null;
     _opacityimage = null;
     return(base.OnInternalDestroyCallback(sender));
 }
Пример #11
0
        protected CBResult OnKey(IupHandle sender, Key key)
        {
            KeyEventArgs ea = new KeyEventArgs(key);

            if (CBKey != null)
            {
                CBKey(this, ea);
            }
            return(ea.Result);
        }
Пример #12
0
        protected CBResult OnEnterWindow(IupHandle sender)
        {
            IupEventArgs ea = new IupEventArgs();

            if (CBEnterWindow != null)
            {
                CBEnterWindow(this, ea);
            }
            return(ea.Result);
        }
Пример #13
0
        protected CBResult OnGetFocus(IupHandle sender)
        {
            IupEventArgs ea = new IupEventArgs();

            if (CBGetFocus != null)
            {
                CBGetFocus(this, ea);
            }
            return(ea.Result);
        }
Пример #14
0
        protected virtual CBResult OnClick(IupHandle sender)
        {
            IupEventArgs ea = new IupEventArgs();

            if (CBClick != null)
            {
                CBClick(this, ea);
            }
            return(ea.Result);
        }
Пример #15
0
        protected CBResult OnDestroy(IupHandle sender)
        {
            IupEventArgs ea = new IupEventArgs();

            if (CBDestroy != null)
            {
                CBDestroy(this, ea);
            }
            return(ea.Result);
        }
Пример #16
0
        public virtual CBResult OnMove(IupHandle sender, int x, int y)
        {
            if (CBMove != null)
            {
                PointEventArgs ea = new PointEventArgs(x, y);
                CBMove(this, ea);
                return(ea.Result);
            }

            return(CBResult.Default);
        }
Пример #17
0
        private CBResult OnTrayClick(IupHandle h, int butidx, bool pressed, bool dclick)
        {
            MouseButton        btn = (MouseButton)'0' + butidx;
            TrayClickEventArgs ea  = new TrayClickEventArgs(btn, pressed, dclick);

            if (CBTrayClick != null)
            {
                CBTrayClick(this, ea);
            }
            return(ea.Result);
        }
Пример #18
0
        protected void LogRawObject()
        {
            var h = Handle;

            if (h != null)
            {
                IntPtr ch = IupHandle.GetCHandle(h);
                if (ch != IntPtr.Zero)
                {
                    rawObjects.Add(ch, h.GetClassName());
                }
            }
        }
Пример #19
0
        protected void UnlogRawObject()
        {
            var h = Handle;

            if (h != null)
            {
                IntPtr ch = IupHandle.GetCHandle(h);
                if (ch != IntPtr.Zero)
                {
                    rawObjects.Remove(ch);
                }
            }
        }
Пример #20
0
        protected CBResult OnMouseUpDown(IupHandle h, MouseButton btn, bool down, int x, int y, ModStatus status)
        {
            MouseEventArgs ea = new MouseEventArgs(btn, x, y, status);

            if (down && CBMouseDown != null)
            {
                CBMouseDown(this, ea);
            }
            else if (!down && CBMouseUp != null)
            {
                CBMouseUp(this, ea);
            }
            return(ea.Result);
        }
Пример #21
0
        private CBResult _internalOnShow(IupHandle sender, ShowState state)
        {
            // Keep track of visible dialogs.
            // we do this function to keep overriding the logic here from happning.
            if (state == ShowState.Show)
            {
                _visibleDialogs.Add(this);
            }
            else if (state == ShowState.Hide && _visibleDialogs.Contains(this))
            {
                _visibleDialogs.Remove(this);
            }

            // finally call the real OnShow function
            return(OnShow(sender, state));
        }
Пример #22
0
        protected override void Init(IupHandle handle)
        {
            base.Init(handle);

            //log raw objects thru LDESTROY_CB
            Handle.SetCallback("LDESTROY_CB", new CBDefault(OnInternalDestroyCallback));
            Handle.SetCallback("MAP_CB", new CBDefault(OnMap));
            Handle.SetCallback("UNMAP_CB", new CBDefault(OnUnmap));
            Handle.SetCallback("DESTROY_CB", new CBDefault(OnDestroy));
            Handle.SetCallback("GETFOCUS_CB", new CBDefault(OnGetFocus));
            Handle.SetCallback("KILLFOCUS_CB", new CBDefault(OnKillFocus));
            Handle.SetCallback("ENTERWINDOW_CB", new CBDefault(OnEnterWindow));
            Handle.SetCallback("LEAVEWINDOW_CB", new CBDefault(OnLeaveWindow));
            Handle.SetCallback("K_ANY", new CBKAny(OnKey));
            Handle.SetCallback("HELP_CB", new CBDefault(OnHelp));
        }
Пример #23
0
        static void Main()
        {
            Iup.Open();
            IupControls.Open();
            IupGL.Open();

            IupHandle button, bkbox;


            using (IupHandle dlg = Iup.Dialog(
                       Iup.Vbox(
                           LabelText("Namn:"),
                           LabelText("Adress:"),
                           LabelText("Gata:"),
                           button = Iup.Button("OK")
                           ).SetAttributes("ALIGNMENT=ARIGHT,NGAP=4")

                       )
                   )
            {
                //openitem.SetCallback ("K_cO", new CallbackKeyPressCB (OnKeyPress));


                byte[] img = new byte[100 * 100 * 3];
                img[10] = 25;
                IupHandle iupimg = Iup.ImageRGB(100, 100, img);



                var ep = Iup.ElementPropertiesDialog(button);
                ep.Show();


                dlg.Show();
                Iup.MainLoop();
            }



            Iup.Close();
        }
Пример #24
0
 protected IupObject(IupHandle handle)
 {
     Init(handle);
 }
Пример #25
0
        static CBResult OnButton(IupHandle sender)
        {
            //throw new NotImplementedException ();

            return(CBResult.Default);
        }
Пример #26
0
 private static CBResult ButtonClick(IupHandle sender)
 {
     return(CBResult.Default);
 }
Пример #27
0
 /// <summary>
 /// Called on event from IUP that control is destroyed, unlog our raw ptr. to debug memory management.
 /// </summary>
 protected virtual CBResult OnInternalDestroyCallback(IupHandle sender)
 {
     UnlogRawObject();
     _handle = null;
     return(CBResult.Default);
 }
Пример #28
0
 internal InternalVHBox(IupComposite parent, IupHandle handle)
     : base(parent, handle)
 {
 }
Пример #29
0
 protected virtual void Init(IupHandle handle)
 {
     this._handle = handle;
     LogRawObject();
 }
Пример #30
0
 public IupComposite(IupComposite parent, IupHandle handle)
     : base(parent, handle)
 {
 }