protected virtual void DisposeUnmanaged() { if (Handle != null) { _handle.Destroy(); _handle = null; } }
public IupControl(IupComposite parent, IupHandle handle) : base(handle) { if (parent != null) { parent.Append(this); } }
protected override CBResult OnInternalDestroyCallback(IupHandle sender) { // be nice to garbage collector _glyph = null; _glyphInactive = null; _glyphPress = null; return(base.OnInternalDestroyCallback(sender)); }
protected CBResult OnHelp(IupHandle sender) { IupEventArgs ea = new IupEventArgs(); if (CBHelp != null) { CBHelp(this, ea); } return(ea.Result); }
public virtual CBResult OnShow(IupHandle sender, ShowState state) { ShowEventArgs ea = new ShowEventArgs(state); if (CBShow != null) { CBShow(this, ea); } return(ea.Result); }
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); }
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); }
public virtual CBResult OnCopyData(IupHandle sender, string cmdline, int size) { CopyDataEventArgs ea = new CopyDataEventArgs(cmdline); if (CBCopyData != null) { CBCopyData(this, ea); } return(ea.Result); }
public virtual CBResult OnClose(IupHandle sender) { IupEventArgs ea = new IupEventArgs(); if (CBClose != null) { CBClose(this, ea); } return(ea.Result); }
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)); }
protected CBResult OnKey(IupHandle sender, Key key) { KeyEventArgs ea = new KeyEventArgs(key); if (CBKey != null) { CBKey(this, ea); } return(ea.Result); }
protected CBResult OnEnterWindow(IupHandle sender) { IupEventArgs ea = new IupEventArgs(); if (CBEnterWindow != null) { CBEnterWindow(this, ea); } return(ea.Result); }
protected CBResult OnGetFocus(IupHandle sender) { IupEventArgs ea = new IupEventArgs(); if (CBGetFocus != null) { CBGetFocus(this, ea); } return(ea.Result); }
protected virtual CBResult OnClick(IupHandle sender) { IupEventArgs ea = new IupEventArgs(); if (CBClick != null) { CBClick(this, ea); } return(ea.Result); }
protected CBResult OnDestroy(IupHandle sender) { IupEventArgs ea = new IupEventArgs(); if (CBDestroy != null) { CBDestroy(this, ea); } return(ea.Result); }
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); }
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); }
protected void LogRawObject() { var h = Handle; if (h != null) { IntPtr ch = IupHandle.GetCHandle(h); if (ch != IntPtr.Zero) { rawObjects.Add(ch, h.GetClassName()); } } }
protected void UnlogRawObject() { var h = Handle; if (h != null) { IntPtr ch = IupHandle.GetCHandle(h); if (ch != IntPtr.Zero) { rawObjects.Remove(ch); } } }
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); }
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)); }
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)); }
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(); }
protected IupObject(IupHandle handle) { Init(handle); }
static CBResult OnButton(IupHandle sender) { //throw new NotImplementedException (); return(CBResult.Default); }
private static CBResult ButtonClick(IupHandle sender) { return(CBResult.Default); }
/// <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); }
internal InternalVHBox(IupComposite parent, IupHandle handle) : base(parent, handle) { }
protected virtual void Init(IupHandle handle) { this._handle = handle; LogRawObject(); }
public IupComposite(IupComposite parent, IupHandle handle) : base(parent, handle) { }