public static MenuGroup Create(ImageContextMenu cm, string text) { MenuGroup mg = new MenuGroup(cm, text); cm.menus.Add(mg); return(mg); }
private MenuButton(ImageContextMenu cm, string text, MenuButtonClickDelegate onclick = null) { this.cm = cm; this.text = text; this.onclick = onclick; }
public static MenuGroup Create(ImageContextMenu cm, string text) { MenuGroup mg = new MenuGroup(cm, text); cm.menus.Add(mg); return mg; }
private MenuGroup(ImageContextMenu cm, string text) { this.cm = cm; this.text = text; }
public static MenuButton Create(ImageContextMenu cm, string text, MenuButtonClickDelegate onclick = null) { MenuButton mb = new MenuButton(cm, text, onclick); return mb; }
protected void ShowContextMenu(ImageContextMenu.MenuGroup cm) { imageCloud.ShowContextMenu(cm); }
// Control functions protected ImageContextMenu.MenuButton CreateContextMenuButton(string text, ImageContextMenu.MenuButtonClickDelegate onclick = null) { return imageCloud.CreateContextMenuButton(text, onclick); }
public void Init(GLWindow glcontrol, GLTextureStream.ReadImageMetaDataDelegate ReadImageMetaData) { this.glcontrol = glcontrol; glcontrol.GotFocus += (object sender, EventArgs e) => { glcontrol_focused = true; }; glcontrol.LostFocus += (object sender, EventArgs e) => { glcontrol_focused = false; }; glcontrol_focused = true; // Define actions SetViewControlAction = ActionManager.CreateAction("Set View Control", this, "SetViewControl"); EnableDepthRenderingAction = ActionManager.CreateAction("Enable Depth Rendering", "enable depth", this, "EnableDepthRendering"); DisableDepthRenderingAction = ActionManager.CreateAction("Disable Depth Rendering", "disable depth", this, "DisableDepthRendering"); MoveAction = ActionManager.CreateAction("Move images", this, "Move"); /*ActionManager.CreateAction("Select all", "all", this, "SelectAll"); ActionManager.CreateAction("Select and focus all", "focus all", delegate(object[] parameters) { this.SelectAll(); this.FocusSelection(); });*/ // Load shaders sdrAabb = new GLShader(new string[] {AABB_SHADER.VS}, new string[] {AABB_SHADER.FS}); // Create mesh for non-depth rendering #if USE_GS_QUAD mesh2D = new GLMesh(new Vector3[] {new Vector3(0.0f, 0.0f, 0.0f)}, null, null, null, null, null, PrimitiveType.Points); // Use this when rendering geometry shader quads #else mesh2D = Common.meshQuad2; #endif texstream = new GLTextureStream(256*1024*1024, ReadImageMetaData); // Optimize for 1GB of VRAM //texstream = new GLTextureStream(64*1024*1024, ReadImageMetaData); // Optimize for 256MB of VRAM //texstream = new GLTextureStream(8*1024*1024, ReadImageMetaData); // Optimize for 32MB of VRAM //texstream = new GLTextureStream(1024*1024, ReadImageMetaData); // Optimize for 4MB of VRAM //texstream = new GLTextureStream(128*1024, ReadImageMetaData); // Optimize for 512KB of VRAM #if USE_ARG_IDX argIndex.Bounds = new Rectangle(250, 10, Width - 250, 16); //argIndex.Bounds = new Rectangle(150, 10, Width - 150, 16); argIndex.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; argIndex.Init(); argIndex.SelectionChanged += SelectionChanged;//() => { SelectionChanged(); }; //argIndex.ArgumentLabelMouseDown += ArgumentIndex_ArgumentLabelMouseDown; this.Controls.Add(argIndex); #endif #if USE_PARAM_IDX //paramIndex.Bounds = new Rectangle(200, 0, Width - 200, 16); //paramIndex.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; paramIndex.Bounds = new Rectangle(16, 0, 300, 16); paramIndex.Anchor = AnchorStyles.Top | AnchorStyles.Right; paramIndex.Init(); paramIndex.ParameterChanged += (Cinema.CinemaStore.Parameter parameter, int paramidx) => { foreach(TransformedImage image in images) image.OnParameterChanged(parameter, paramidx); }; this.Controls.Add(paramIndex); #endif #if USE_CUSTOM_CONTROLS ccContainer.Bounds = new Rectangle(250, 10, Width - 300, 16); ccContainer.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; ccContainer.Init(); /*ccContainer.CustomControlValueChanged += (int controlIdx, float value) => { //EDIT };*/ this.Controls.Add(ccContainer); #endif colorTableMgr = new ColorTableManager(glcontrol); colorTableMgr.Visible = false; this.Controls.Add(colorTableMgr); coordsys = new CoordinateSystem(); grid = new LineGrid(); ContextMenu = new ImageContextMenu(); fragmentcounter = GL.GenQuery(); //ccContainer.CreateSlider("testSlider", new float[] { 0.0f, 0.5f, 1.0f }); }
public void ShowContextMenu(ImageContextMenu.MenuGroup cm) { cm.Show(glcontrol.PointToClient(Control.MousePosition), backbuffersize); }
public ImageContextMenu.MenuButton CreateContextMenuButton(string text, ImageContextMenu.MenuButtonClickDelegate onclick = null) { return ImageContextMenu.MenuButton.Create(ContextMenu, text, onclick); }
public static MenuButton Create(ImageContextMenu cm, string text, MenuButtonClickDelegate onclick = null) { MenuButton mb = new MenuButton(cm, text, onclick); return(mb); }