private void AppendButton(ITitleModuleController controller) { var btn = new PXToolBarButton { Key = "design", Text = "Design", ToggleMode = true, CommandSourceID = _dashContID, CommandName = PXDashboardContainer.CommandDesignMode }; controller.AppendToolbarItem(btn); btn = new PXToolBarButton { Key = "editLayout", Text = PX.Dashboards.Messages.EditLayout, PopupPanel = _layoutPanelID, Visible = false }; controller.AppendToolbarItem(btn); btn = new PXToolBarButton { Key = "editDashboard", CommandName = "editDashboard", CommandSourceID = _dataSourceID, }; controller.AppendToolbarItem(btn); btn = new PXToolBarButton { Key = "resetToDefault", CommandName = "resetToDefault", CommandSourceID = _dataSourceID, }; controller.AppendToolbarItem(btn); btn = new PXToolBarButton { Key = "addWidget", Text = "Add Widget", PopupPanel = _wizardID, Visible = false }; controller.AppendToolbarItem(btn); }
private void AppendButton(ITitleModuleController controller) { var btn = new PXToolBarButton { Key = "console", Text = "Console" }; //btn.Images.Normal = Sprite.Main.Design; btn.PopupPanel = _panelID; controller.AppendToolbarItem(btn); }
public void Initialize(ITitleModuleController controller) { if (controller == null) { throw new ArgumentNullException("controller"); } AppendButton(controller); AppendPanels(controller); }
public override void Initialize(ITitleModuleController controller) { if (controller == null) { throw new ArgumentNullException("controller"); } if (CanDesign(controller)) { AppendButton(controller); AppendPanels(controller); var tlb = ControlHelper.FindControl("tlbTools", controller.Page) as PXToolBar; if (tlb != null) { tlb.CallbackUpdatable = true; } controller.Page.LoadComplete += delegate(object sender, EventArgs e) { var dashSet = ControlHelper.FindControl(_dashContID, controller.Page) as PXDashboardContainer; if (dashSet != null) { dashSet.CallBackMode.RepaintControlsIDs = "tlbTools"; } var btnW = tlb.Items["addWidget"] as PXToolBarButton; var btnD = tlb.Items["design"] as PXToolBarButton; var btnL = tlb.Items["editLayout"] as PXToolBarButton; var btnR = tlb.Items["resetToDefault"] as PXToolBarButton; var btnC = tlb.Items["createUserCopy"] as PXToolBarButton; var btnU = tlb.Items["updateAll"] as PXToolBarButton; if (dashSet != null) { //if (btnW != null) btnW.Visible = dashSet.InDesignMode; if (btnL != null) { btnL.Visible = dashSet.InDesignMode; } if (btnD != null) { btnD.Pushed = dashSet.InDesignMode; } if (btnR != null) { btnR.Visible = !dashSet.InDesignMode; } if (btnU != null) { btnU.Visible = !dashSet.InDesignMode; } } }; } }
private bool IsDashboardPage(ITitleModuleController controller) { var path = controller.Page.Request.Path.ToLower(); return(path.EndsWith("default.aspx") || path.EndsWith("dashboardlauncher.aspx")); }
private bool CanDesign(ITitleModuleController controller) { return(IsDashboardPage(controller)); }
private void AppendPanels(ITitleModuleController controller) { }
private void AppendPanels(ITitleModuleController controller) { controller.Page.ClientScript.RegisterClientScriptInclude(controller.Page.GetType(), "Console", VirtualPathUtility.ToAbsolute("~/Scripts/console.js")); PXSmartPanel panel = new PXSmartPanel { ID = _panelID, Width = Unit.Pixel(750), Height = Unit.Pixel(350), Caption = "Acumatica Console", CaptionVisible = true, AutoRepaint = true, BlockPage = false, LoadOnDemand = true, //Needed otherwise ClientEvents.AfterShow won't run on 2nd open of the panel AutoReload = true, Position = PanelPosition.Manual, Overflow = OverflowType.Hidden }; panel.ClientEvents.BeforeLoad = "BeforeLoadConsolePanel"; panel.ClientEvents.BeforeLoad = "AfterLoadConsolePanel"; panel.ClientEvents.BeforeShow = "BeforeShowConsolePanel"; panel.ClientEvents.AfterShow = "AfterShowConsolePanel"; panel.ClientEvents.BeforeHide = "BeforeHideConsolePanel"; panel.ClientEvents.AfterHide = "AfterHideConsolePanel"; panel.ApplyStyleSheetSkin(controller.Page); var ds = PXPage.GetDefaultDataSource(controller.Page); var viewName = ds.DataGraph.PrimaryView; var form = new PXFormView() { ID = "frmAcuShell", SkinID = "Transparent", DataSourceID = ds.ID, DataMember = "ConsoleView", AutoRepaint = true }; form.ApplyStyleSheetSkin(controller.Page); form.AutoSize.Enabled = true; var cc = form.TemplateContainer.Controls; var consoleOutput = new PXHtmlView { ID = "pnlConsoleOutput", DataField = nameof(AcuShell.ConsoleFields.Output), Height = Unit.Percentage(100), Width = Unit.Percentage(100), SkinID = "Label" }; consoleOutput.AutoSize.Enabled = true; //TODO: Fix resizing of the console output... doesn't work right now consoleOutput.AutoSize.MinHeight = 500; consoleOutput.AutoSize.Container = DockContainer.Parent; cc.Add(consoleOutput); cc.Add(new PXTextEdit { ID = "pnlConsoleInput", DataField = nameof(AcuShell.ConsoleFields.Input) }); cc.Add(new PXTextEdit { ID = "pnlGraphType", DataField = nameof(AcuShell.ConsoleFields.GraphType) }); ((IParserAccessor)panel).AddParsedSubObject(form); var editor = new System.Web.UI.WebControls.Panel { ID = "pnlConsoleEditor", Height = Unit.Pixel(150), Width = Unit.Percentage(100) }; ((IParserAccessor)panel).AddParsedSubObject(editor); controller.AppendControl(panel); }