public MinimalHudEntity() { if (IsClient) { RootPanel.SetTemplate("/minimalhud.html"); } }
//[Microsoft.Practices.Unity.Dependency] //public ShellViewModel Shell { get; set; } /// <summary> /// Конструктор /// </summary> public ConstructorViewModel(IEventAggregator aggregator, IWindowManager windowManager) { _aggregator = aggregator; _windowManager = windowManager; Properties = new ObservableCollection<WebPageBaseViewModel>(); _rootPanel = new RootPanel(Properties); Properties.Add(_rootPanel); _diskPath = new DiskPath(); _diskPath.Add("SaveProject", new PathDialog("json (*.json)|*.json") { Description = "Сохранить проект" }) .Add("LoadProject", new PathDialog("json (*.json)|*.json") { DefaultPathName = "defaultProjectDir", Description = "Загрузить проект", OpenDialog = true }) .Add("BuildTables", new PathDialog() { IsFolder = true, Description = "Расположение таблицы", Cache = true }) .Add("LoadDocument", new PathDialog("resx(*.docx) | *.docx") { Description = "Загрузить ТЗ", OpenDialog = true }) .Add("BuildProcedures", new PathDialog() { IsFolder = true, Description = "Расположение процедур", Cache = true }) .Add("ViewPage", new PathDialog("resx(*.aspx) | *.aspx") { Description = "Расположение страницы View", Cache = true }) .Add("EditPage", new PathDialog("resx(*.aspx) | *.aspx") { Description = "Расположение страницы Edit", Cache = true }); DisplayName = "Конструктор страницы"; }
//containers.MouseMove += OnMouseMove; //containers.MouseLeave += OnMouseLeave; //containers.MouseLeftButtonDown += OnMousePress; //containers.MouseLeftButtonUp += OnMouseRelease; #else protected override void OnApplyTemplate() { Containers = this.GetTemplateChild("PART_containers") as ContainerCollection; if (Containers != null) { Containers.Chart = this; } RootDockPanel = this.GetTemplateChild("Part_rootDockPanel") as RootPanel; #endif #if WPF Containers.ClipToBounds = true; #else foreach (SeriesBase series in Series) { Binding dataContextBinding = new Binding { Path = new PropertyPath("DataContext"), Source = this }; BindingOperations.SetBinding(series, SeriesBase.DataContextProperty, dataContextBinding); } #endif BrushTheme(); base.OnApplyTemplate(); legend = (Legend.Legend) this.GetTemplateChild("Part_Legend"); InnerChartPanel = (Grid)this.GetTemplateChild("Part_InnerChartPanel"); OuterChartPanel = (Grid)this.GetTemplateChild("Part_OuterChartPanel"); RefreshLegend(); }
public SandboxHud() { if (!IsClient) { return; } RootPanel.StyleSheet.Load("/ui/SandboxHud.scss"); RootPanel.AddChild <NameTags>(); RootPanel.AddChild <CrosshairCanvas>(); RootPanel.AddChild <ChatBox>(); RootPanel.AddChild <VoiceList>(); RootPanel.AddChild <KillFeed>(); RootPanel.AddChild <Scoreboard <ScoreboardEntry> >(); var healthPanel = RootPanel.Add.Panel("health"); var icon = healthPanel.Add.Label("🩸", "icon"); var health = healthPanel.Add.Label("", "value"); health.Text = "100"; RootPanel.AddChild <InventoryBar>(); RootPanel.AddChild <SpawnMenu>(); }
public void Init() { ObservableCollection<WebPageBaseViewModel> properties = new ObservableCollection<WebPageBaseViewModel>(); _rootPanel = new RootPanel(properties); properties.Add(_rootPanel); _helper = new GridConstructorHelper(); }
public void Init() { ObservableCollection <WebPageBaseViewModel> properties = new ObservableCollection <WebPageBaseViewModel>(); _rootPanel = new RootPanel(properties); properties.Add(_rootPanel); }
private void InitializeCustomButtons() { int buttonWidth = 10; int buttonTopStep = 2; int buttonStartTopPointer = 0; var largestTextLength = _buttonsList.Select(i => i.Text.Length).Max(); buttonWidth = largestTextLength > 10 ? (largestTextLength + 2) : buttonWidth; foreach (var context in _buttonsList) { var button = new Button { Text = context.Text, Location = new Point { Left = this.Size.Width / 2 - (buttonWidth) / 2, Top = buttonStartTopPointer + 4 }, Width = buttonWidth, Tag = context.Data, IsEnabled = context.IsEnabled }; Debug.WriteLine(this.Size.Width); Debug.WriteLine(largestTextLength); RootPanel.AddChild(button); button.Pressed += button_Pressed; buttonStartTopPointer += buttonTopStep; } return; }
public override void ConsoleDump(int tab) { System.Diagnostics.Trace.Write(new string( ' ', tab * 4 )); System.Diagnostics.Trace.WriteLine("FloatingAnchorableWindow()"); RootPanel.ConsoleDump(tab + 1); }
public override void Show() { RootPanel.SetActive(true); isChanging = true; DesAlpha = 1; isShow = true; }
public void Init() { _properties = new ObservableCollection <WebPageBaseViewModel>(); _rootPanel = new RootPanel(_properties); _properties.Add(_rootPanel); _helper = new TableConstructorHelper(); }
public void DropTest2() { ObservableCollection <WebPageBaseViewModel> properties = new ObservableCollection <WebPageBaseViewModel>(); RootPanel rootPanel = new RootPanel(properties); ModalViewModel control = new ModalViewModel(rootPanel) { Type = "varchar", FieldInDb = "field2", RuDescription = "Комент", ControlIdView = "lb2" }; rootPanel.Children.Add(control); PanelViewModel panelViewModel = new PanelViewModel(rootPanel) { ControlIdView = "clId1", RuDescription = "Комент" }; rootPanel.Children.Add(panelViewModel); Assert.AreEqual(2, rootPanel.Children.Count); Assert.AreEqual(0, panelViewModel.Children.Count); //Перебрасываем контрол panelViewModel.Drop(control); Assert.AreEqual(1, panelViewModel.Children.Count); Assert.AreEqual(1, rootPanel.Children.Count); Assert.AreEqual(control.ParentCollection, panelViewModel.Children); }
/// <summary> /// </summary> /// <returns></returns> private object CreateNewItem() { var meta = ObjectAccessor.MetaInterface(BusinessObject.GetType()); var createAction = meta.Actions.Find(item => item.ActionType == ActionTypes.Create && item.PanelType == ActionsPanelType.Group); if (createAction == null) { return(null); } using (var manager = DbManagerFactory.Factory.Create(ModelUserContext.Instance)) { var actionResult = createAction.RunAction(manager, BusinessObject.Parent, GetParamsAction()).obj; if (actionResult != null) { RootPanel.UpdateControlsState(); /* * var layout = GetLayout() as LayoutGroup; * if ((layout != null) && (layout.TopGroupActionPanel != null)) * { * layout.TopGroupActionPanel.RaiseAfterActionExecuted(createAction, BusinessObject); * } */ } return(actionResult); } }
/// <summary> /// When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call <see cref="M:System.Windows.Controls.Control.ApplyTemplate" />. In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks. /// </summary> public override void OnApplyTemplate() { Containers = (ContainerCollection)this.GetTemplateChild("PART_containers"); if (Containers != null) { Containers.Chart = this; } RootDockPanel = (RootPanel)this.GetTemplateChild("Part_rootDockPanel");
public MinimalHudEntity() { if (IsClient) { RootPanel.SetTemplate("MinimalGamemode/minimalhud.html"); RootPanel.AddChild <ChatBox>(); } }
public void WriteXml(XmlWriter writer) { writer.WriteStartElement("RootPanel"); if (RootPanel != null) { RootPanel.WriteXml(writer); } writer.WriteEndElement(); writer.WriteStartElement("TopSide"); if (TopSide != null) { TopSide.WriteXml(writer); } writer.WriteEndElement(); writer.WriteStartElement("RightSide"); if (RightSide != null) { RightSide.WriteXml(writer); } writer.WriteEndElement(); writer.WriteStartElement("LeftSide"); if (LeftSide != null) { LeftSide.WriteXml(writer); } writer.WriteEndElement(); writer.WriteStartElement("BottomSide"); if (BottomSide != null) { BottomSide.WriteXml(writer); } writer.WriteEndElement(); // Write all floating windows (can be LayoutDocumentFloatingWindow or LayoutAnchorableFloatingWindow). // To prevent "can not create instance of abstract type", the type is retrieved with GetType().Name writer.WriteStartElement("FloatingWindows"); foreach (var layoutFloatingWindow in FloatingWindows) { writer.WriteStartElement(layoutFloatingWindow.GetType().Name); layoutFloatingWindow.WriteXml(writer); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("Hidden"); foreach (var layoutAnchorable in Hidden) { writer.WriteStartElement(layoutAnchorable.GetType().Name); layoutAnchorable.WriteXml(writer); writer.WriteEndElement(); } writer.WriteEndElement(); }
protected override void OnLoadTemplate() { RootPanel = (PanePanel)GetTemplateChild("RootPanel"); RootPanel.Init(CenterItem); _layout = new LayoutManager(this); Items.ItemsChanged += OnItemsChanged; SizeChanged += OnSizeChanged; }
public TypeSelectControl(bool disableIcons = false) { DisableIcons = disableIcons; // Select/deselect all types var allCheckBox = new PCheckBox("SelectAll") { Text = STRINGS.UI.UISIDESCREENS.TREEFILTERABLESIDESCREEN.ALLBUTTON, CheckSize = ROW_SIZE, InitialState = PCheckBox.STATE_CHECKED, OnChecked = OnCheck, TextStyle = PUITuning.Fonts.TextDarkStyle }; allCheckBox.OnRealize += (obj) => { allItems = obj; }; var cp = new PPanel("Categories") { Direction = PanelDirection.Vertical, Alignment = TextAnchor.UpperLeft, Spacing = ROW_SPACING, Margin = ELEMENT_MARGIN, FlexSize = Vector2.right, }; cp.AddChild(allCheckBox); cp.OnRealize += (obj) => { childPanel = obj; }; // Scroll to select elements var sp = new PScrollPane("Scroll") { Child = cp, ScrollHorizontal = false, ScrollVertical = true, AlwaysShowVertical = true, TrackSize = 8.0f, FlexSize = Vector2.one }; // Title bar var title = new PLabel("Title") { TextAlignment = TextAnchor.MiddleCenter, Text = SweepByTypeStrings. DIALOG_TITLE, FlexSize = Vector2.right, Margin = TITLE_MARGIN }.SetKleiPinkColor(); // Bottom border on the title for contrast title.OnRealize += (obj) => { var img = obj.AddOrGet <Image>(); img.sprite = PUITuning.Images.BoxBorder; img.type = Image.Type.Sliced; }; // 1px black border on the rest of the dialog for contrast var panel = new PRelativePanel("Border") { BackImage = PUITuning.Images.BoxBorder, ImageMode = Image.Type.Sliced, DynamicSize = false, BackColor = PUITuning.Colors.BackgroundLight }.AddChild(sp).AddChild(title); RootPanel = panel.SetMargin(sp, OUTER_MARGIN). SetLeftEdge(title, fraction: 0.0f).SetRightEdge(title, fraction: 1.0f). SetLeftEdge(sp, fraction: 0.0f).SetRightEdge(sp, fraction: 1.0f). SetTopEdge(title, fraction: 1.0f).SetBottomEdge(sp, fraction: 0.0f). SetTopEdge(sp, below: title).Build(); RootPanel.SetMinUISize(PANEL_SIZE); children = new SortedList <Tag, TypeSelectCategory>(16, TagAlphabetComparer. INSTANCE); Screen = RootPanel.AddComponent <TypeSelectScreen>(); }
protected override void Dispose(bool disposing) { if (disposing) { ClearEvents(); RootPanel.Dispose(); } base.Dispose(disposing); }
protected override void OnDestroy() { base.OnDestroy(); // // clean up the panel // or it'll stick around forever // RootPanel?.Delete(); RootPanel = null; }
public void Init() { //ObservableCollection<WebPageBaseViewModel> properties = new ObservableCollection<WebPageBaseViewModel>(); //_rootPanel = new RootPanel(properties); //properties.Add(_rootPanel); _model = new ConstructorViewModel(new EventAggregator(), new WindowManager()); _rootPanel = _model.RootPanel; //properties.Clear(); //foreach (WebPageBaseViewModel webPageBaseViewModel in _model.Properties) //{ // _model.Properties.Add(webPageBaseViewModel); //} _command = new GetResourceCommand(_model); }
public void Init() { //ObservableCollection<WebPageBaseViewModel> properties = new ObservableCollection<WebPageBaseViewModel>(); //_rootPanel = new RootPanel(properties); //properties.Add(_rootPanel); _model = new ConstructorViewModel(new EventAggregator(), new WindowManager()); _rootPanel = _model.RootPanel; //properties.Clear(); //foreach (WebPageBaseViewModel webPageBaseViewModel in _model.Properties) //{ // _model.Properties.Add(webPageBaseViewModel); //} _command = new GetResourceCommand(_model); }
public Hud() { Transmit = TransmitType.Always; Current = this; if (IsClient) { // // The root panel that holds // all the other controls. // RootPanel = new RootPanel(); RootPanel.Style.Set("pointer-events: none; width: 100%; height: 100%;"); RootPanel.AcceptsFocus = false; } }
//[Microsoft.Practices.Unity.Dependency] //public ShellViewModel Shell { get; set; } /// <summary> /// Конструктор /// </summary> public ConstructorViewModel(IEventAggregator aggregator, IWindowManager windowManager) { _aggregator = aggregator; _windowManager = windowManager; Properties = new ObservableCollection <WebPageBaseViewModel>(); _rootPanel = new RootPanel(Properties); Properties.Add(_rootPanel); _diskPath = new DiskPath(); _diskPath.Add("SaveProject", new PathDialog("json (*.json)|*.json") { Description = "Сохранить проект" }) .Add("LoadProject", new PathDialog("json (*.json)|*.json") { DefaultPathName = "defaultProjectDir", Description = "Загрузить проект", OpenDialog = true }) .Add("BuildTables", new PathDialog() { IsFolder = true, Description = "Расположение таблицы", Cache = true }) .Add("LoadDocument", new PathDialog("resx(*.docx) | *.docx") { Description = "Загрузить ТЗ", OpenDialog = true }) .Add("BuildProcedures", new PathDialog() { IsFolder = true, Description = "Расположение процедур", Cache = true }) .Add("ViewPage", new PathDialog("resx(*.aspx) | *.aspx") { Description = "Расположение страницы View", Cache = true }) .Add("EditPage", new PathDialog("resx(*.aspx) | *.aspx") { Description = "Расположение страницы Edit", Cache = true }); DisplayName = "Конструктор страницы"; }
public UI(UIConfig config) { DefaultFont = config.DefaultFont; RootPanel.SetBounds(config.Bounds); RootPanel.SetFont(config.DefaultFont); Inputs = config.Inputs; SceneManager = config.SceneManager; Catalog = config.Catalog; if (config.DefaultBackground != null) { DefaultBackground = config.DefaultBackground; } MouseMonitor = new MouseMonitor(); KeyboardMonitor = new KeyboardMonitor(); GamepadMonitor = new GamepadMonitor(); }
private void LoadFromFile(string path) { string json = File.ReadAllText(path); var pr = JsonConvert.DeserializeObject <ObservableCollection <WebPageBaseViewModel> >(json, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Objects }); Properties.Clear(); foreach (WebPageBaseViewModel webPageBaseViewModel in pr) { if (webPageBaseViewModel is RootPanel) { RootPanel = (RootPanel)webPageBaseViewModel; } Properties.Add(webPageBaseViewModel); } SetParentsCollections(RootPanel); }
public Hud() { if (!IsClient) { return; } RootPanel.StyleSheet.Load("/ui/Hud.scss"); RootPanel.AddChild <RoundInfo>(); RootPanel.AddChild <Vitals>(); RootPanel.AddChild <VoiceList>(); RootPanel.AddChild <Nameplates>(); RootPanel.AddChild <DamageIndicator>(); RootPanel.AddChild <HitIndicator>();; RootPanel.AddChild <ChatBox>(); RootPanel.AddChild <Scoreboard>(); RootPanel.AddChild <LoadingScreen>(); }
public SandboxHud() { if (!IsClient) { return; } RootPanel.StyleSheet.Load("/ui/SandboxHud.scss"); RootPanel.AddChild <NameTags>(); RootPanel.AddChild <CrosshairCanvas>(); RootPanel.AddChild <ChatBox>(); RootPanel.AddChild <VoiceList>(); RootPanel.AddChild <KillFeed>(); RootPanel.AddChild <Scoreboard <ScoreboardEntry> >(); RootPanel.AddChild <Health>(); RootPanel.AddChild <InventoryBar>(); RootPanel.AddChild <SpawnMenu>(); }
/// <summary> /// Create the user interface instance. /// </summary> public UserInterface() { // sanity test if (_content == null) { throw new System.Exception("Cannot create a UserInterface before calling UserInterface.Initialize()!"); } // create draw utils DrawUtils = new DrawUtils(); // create input helper _input = new InputHelper(); // create the root panel Root = new RootPanel(); // set default cursor SetCursor(CursorType.Default); }
public SledBuildHud() { if (!IsClient) { return; } RootPanel.StyleSheet.Load("/ui/Hud.scss"); RootPanel.AddChild <NameTags>(); RootPanel.AddChild <CrosshairCanvas>(); RootPanel.AddChild <ChatBox>(); RootPanel.AddChild <VoiceList>(); RootPanel.AddChild <KillFeed>(); RootPanel.AddChild <Scoreboard <ScoreboardEntry> >(); RootPanel.AddChild <InventoryBar>(); RootPanel.AddChild <OwnershipIndicator>(); RootPanel.AddChild <SpeedIndicator>(); RootPanel.AddChild <CurrentTool>(); RootPanel.AddChild <SpawnMenu>(); }
public override void Initialize() { base.Initialize(); var left = Size.Width / 2 - _message.Length / 2; left = left < 5 ? 5 : left; _labelMessage = new Label { Text = _message, Location = new Point { Top = 2, Left = left }, BackgroundColor = BackgroundColor, ForegroundColor = ForegroundColor }; RootPanel.AddChild(_labelMessage); InitializeButtons(); InitializeImage(); }
/// <summary> /// Create the user interface instance. /// </summary> public UserInterface() { // sanity test if (_content == null) { throw new Exceptions.InvalidStateException("Cannot create a UserInterface before calling UserInterface.Initialize()!"); } // create default input providers MouseInputProvider = new DefaultInputProvider(); KeyboardInputProvider = new DefaultInputProvider(); // create draw utils DrawUtils = new DrawUtils(); // create the root panel Root = new RootPanel(); // set default cursor SetCursor(CursorType.Default); }
public void DropTest2() { ObservableCollection<WebPageBaseViewModel> properties = new ObservableCollection<WebPageBaseViewModel>(); RootPanel rootPanel = new RootPanel(properties); ModalViewModel control = new ModalViewModel(rootPanel) { Type = "varchar", FieldInDb = "field2", RuDescription = "Комент", ControlIdView = "lb2" }; rootPanel.Children.Add(control); PanelViewModel panelViewModel = new PanelViewModel(rootPanel) { ControlIdView = "clId1", RuDescription = "Комент" }; rootPanel.Children.Add(panelViewModel); Assert.AreEqual(2, rootPanel.Children.Count); Assert.AreEqual(0, panelViewModel.Children.Count); //Перебрасываем контрол panelViewModel.Drop(control); Assert.AreEqual(1, panelViewModel.Children.Count); Assert.AreEqual(1, rootPanel.Children.Count); Assert.AreEqual(control.ParentCollection, panelViewModel.Children); }
public Hud() { if (!IsClient) { return; } RootPanel.StyleSheet = StyleSheet.FromFile("/ui/Hud.scss"); RootPanel.AddChild <RoundInfo>(); RootPanel.AddChild <Vitals>(); RootPanel.AddChild <Ammo>(); RootPanel.AddChild <NameTags>(); RootPanel.AddChild <DamageIndicator>(); RootPanel.AddChild <HitIndicator>(); RootPanel.AddChild <InventoryBar>(); RootPanel.AddChild <ChatBox>(); RootPanel.AddChild <Scoreboard>(); }
public override void ConsoleDump(int tab) { System.Diagnostics.Trace.Write(new string( ' ', tab * 4 )); System.Diagnostics.Trace.WriteLine("RootPanel()"); RootPanel.ConsoleDump(tab + 1); System.Diagnostics.Trace.Write(new string( ' ', tab * 4 )); System.Diagnostics.Trace.WriteLine("FloatingWindows()"); foreach (LayoutFloatingWindow fw in FloatingWindows) { fw.ConsoleDump(tab + 1); } System.Diagnostics.Trace.Write(new string( ' ', tab * 4 )); System.Diagnostics.Trace.WriteLine("Hidden()"); foreach (LayoutAnchorable hidden in Hidden) { hidden.ConsoleDump(tab + 1); } }
public void Init() { _properties = new ObservableCollection<WebPageBaseViewModel>(); _rootPanel = new RootPanel(_properties); _rootPanel.TableName = "MainTable"; _properties.Add(_rootPanel); _helper = new ProcedureConstructorHeler(); }