static IupHandle LabelText(string caption) { return(Iup.Hbox( Iup.Label(caption), Iup.Text(null), Iup.Button("...") ).SetAttributes("NGAP=4")); }
public Dialog(string title = null) : base(null, Iup.Dialog(null)) { Handle.SetCallback("SHOW_CB", new CBShow((h, state) => { return(_internalOnShow(h, state)); })); Handle.SetCallback("CLOSE_CB", new CBDefault((h) => { return(OnClose(h)); })); Handle.SetCallback("COPYDATA_CB", new CBCopyData((h, cmdlin, size) => { return(OnCopyData(h, cmdlin, size)); })); Handle.SetCallback("MOVE_CB", new CBMove((h, x, y) => { return(OnMove(h, x, y)); })); Handle.SetCallback("RESIZE_CB", new CBResize((h, wi, he) => { return(OnResize(h, wi, he)); })); Handle.SetCallback("TRAYCLICK_CB", new CBTrayClick((h, butidx, pressed, dclick) => { return(OnTrayClick(h, butidx, pressed, dclick)); })); if (title != null) { this.Title = title; } }
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(); }
private void Create(int w, int h, GlyphMode mode, byte[] pixelData, Color[] palette) { switch (mode) { case GlyphMode.RGB: Init(Iup.ImageRGB(w, h, pixelData)); break; case GlyphMode.RGBA: Init(Iup.ImageRGBA(w, h, pixelData)); break; case GlyphMode.Indexed: default: Init(Iup.Image(w, h, pixelData)); if (palette != null) { for (int i = 0; i < palette.Length; i++) { Handle.SetStrAttribute(Format.Int(i), Format.Color(palette[i])); } } break; } }
public IupVBox(params IupObject[] children) : base(Iup.IupVboxv(), children) { }
public Text(IupComposite parent) : base(parent, Iup.Text()) { }
public IupDialog(IupObject child) : base(Iup.IupDialog(child.Handle)) { SetCallback("CLOSE_CB", CloseCallback); SetCallback("RESIZE_CB", ResizeCallback); }
public Button(IupComposite parent, string title) : base(parent, Iup.Button(title)) { Handle.SetCallback("ACTION", new CBDefault((h) => { return(OnClick(h)); })); Handle.SetCallback("BUTTON_CB", new CBButton((h, btn, down, x, y, status) => { return(OnMouseUpDown(h, btn, down, x, y, status)); })); }
static void Main() { Iup.Open(); Dialog dlg = new Dialog("My dialog") { Expand = Expand.Yes }; Glyph gl = Glyph.FromFile("c:\\temp\\egg24.bmp"); VBox vbox = new VBox(dlg) { Align = HAlign.Center, Margin = new Size(18, 8), Gap = 4 }; Button escbtn = new Button(vbox, "esc") { BackColor = Color.Red, Expand = Expand.Yes, Alignment = Alignment.BottomRight }; Button enterbtn = new Button(vbox, "enter") { Expand = Expand.No }; new Button(vbox, "gamma") { BackColor = Color.Red, Expand = Expand.Yes, Alignment = Alignment.BottomRight, Flat = true }; Button btn = new Button(vbox, "delta") { Expand = Expand.No, Flat = true, Glyph = gl }; Text txt = new Text(vbox); btn.CBClick += delegate { Point p = dlg.ScreenPosition; Point p2 = btn.ScreenPosition; int debug = 0; }; dlg.MenuBox = true; dlg.Shrink = false; // dlg.CBDropFiles += dlg_CBDropFiles; dlg.Tray = true; dlg.TrayTip = "Hello world"; dlg.TrayGlyph = gl; dlg.CBMove += dlg_CBMove; dlg.CBClose += dlg_CBClose; dlg.CBResize += dlg_CBResize; dlg.StartFocus = btn; dlg.CBTrayClick += dlg_CBTrayClick; dlg.Show(); Iup.MainLoop(); dlg.Dispose(); dlg = null; GC.Collect(); }
public IupButton(string title = "") : base(Iup.IupFlatButton(title)) { SetCallback("FLAT_ACTION", FlatActionCallback); }
public HBox(IupComposite parent) : base(parent, Iup.Hbox()) { }
public VBox(IupComposite parent) : base(parent, Iup.Vbox()) { }
public DrawArea(IupComposite parent) : base(parent, Iup.Canvas()) { }