Exemplo n.º 1
0
Arquivo: Label.cs Projeto: drme/thw-ui
 /// <summary>
 /// Creates label control.
 /// </summary>
 /// <param name="window">window it belongs to.</param>
 /// <param name="creationFlags">creation flags.</param>
 public Label(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.BackColor = Colors.None;
     this.TextAlignment = ContentAlignment.MiddleLeft;
     this.Border = BorderStyle.None;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates tab page object.
 /// </summary>
 /// <param name="window">window it belong to.</param>
 /// <param name="creationFlags">creation flags.</param>
 public TabPage(Window window, CreationFlag creationFlags)
     : base(window, creationFlags)
 {
     this.Type = TypeName;
     this.Border = BorderStyle.None;
     this.BackColor = Colors.None;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates checkbox control.
 /// </summary>
 /// <param name="window">window it belongs to</param>
 /// <param name="creationFlags">creation flags</param>
 public CheckBox(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.Border = BorderStyle.BorderLoweredDouble;
     this.TextAlignment = ContentAlignment.MiddleLeft;
     this.BackColor = Colors.None;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Constructs font object.
 /// </summary>
 /// <param name="engine">ui engine.</param>
 /// <param name="window">window control belongs to.</param>
 /// <param name="settings">control default settings.</param>
 /// <param name="name">default font name.</param>
 /// <param name="size">default font size.</param>
 internal FontInfo(UIEngine engine, Window window, ControlSettings settings, String name, int size)
 {
     this.engine = engine;
     this.window = window;
     this.size = size;
     this.name = name;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates list box control
 /// </summary>
 /// <param name="window">window it belongs to</param>
 /// <param name="creationFlags">creation flags</param>
 public ListBox(Window window, CreationFlag creationFlags)
     : base(window, creationFlags)
 {
     this.BackColor = Colors.White;
     this.Border = BorderStyle.BorderLoweredDouble;
     this.Type = TypeName;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Constructs tab control.
 /// </summary>
 /// <param name="window">window it belongs to</param>
 /// <param name="creationFlags">creation flags</param>
 public TabControl(Window window, CreationFlag creationFlags)
     : base(window, creationFlags)
 {
     this.Skinned = false;
     this.Border = BorderStyle.BorderRaisedDouble;
     this.Type = TypeName;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Constructs property grid object.
 /// </summary>
 /// <param name="window">parent window</param>
 /// <param name="creationFlags">creation flags</param>
 public PropertyGrid(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.RowSeparatorColor = window.Desktop.Theme.Colors.Control;
     this.KeyValueSeparatorColor = window.Desktop.Theme.Colors.Control;
     this.Border = BorderStyle.Flat;
     this.BackColor = Colors.White;
     this.ShowSideBar = true;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Creates radio button object.
 /// </summary>
 /// <param name="window">window it belongs to.</param>
 /// <param name="creationFlags">creation flags.</param>
 public RadioButton(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.Selected = false;
     this.TextAlignment = ContentAlignment.MiddleLeft;
     this.IconAlignment = ContentAlignment.MiddleLeft;
     this.TextOffset.X = 16;
     this.TextOffset.Y = 0;
     this.BackColor = Colors.None;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Constructs button
 /// </summary>
 /// <param name="window">window it belongs to</param>
 /// <param name="creationFlags">creation flags</param>
 public Button(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.Bounds.X = 100;
     this.Bounds.Y = 100;
     this.Bounds.Width = 100;
     this.Bounds.Height = 23;
     this.Border = BorderStyle.BorderRaisedDouble;
     this.TabStop = true;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Constructs text box object.
 /// </summary>
 /// <param name="window">window it belongs to.</param>
 /// <param name="creationFlags">creation flags.</param>
 public TextBox(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.Border = BorderStyle.BorderLoweredDouble;
     this.Cursor = MousePointers.PointerText;
     this.NeedTranslation = false;
     this.TextOffset.X = 3;
     this.TextOffset.Y = 1;
     this.HintTextColor = window.Desktop.Theme.Colors.TextLight;
 }
Exemplo n.º 11
0
        public ScrollPanel(Window window, CreationFlag creationFlags)
            : base(window, creationFlags, TypeName)
        {
            this.verticalScrollBar = CreateControl<ScrollBar>(CreationFlag.InternalControl);
            this.horizontalScrollBar = CreateControl<ScrollBar>(CreationFlag.InternalControl);
            this.internalPanel = CreateControl<ScrollPanelInternal>(CreationFlag.InternalControl);

            this.horizontalScrollBar.Vertical = false;
            this.internalPanel.BackColor = Colors.None;

            base.AddControl(this.verticalScrollBar);
            base.AddControl(this.horizontalScrollBar);
            base.AddControl(this.internalPanel);
        }
Exemplo n.º 12
0
        public FilePicker(Window window, CreationFlag creationFlags)
            : base(window, creationFlags, TypeName)
        {
            this.selectButton = CreateControl<Button>(CreationFlag.InternalControl);

            this.Border = BorderStyle.Lowered;
            this.NeedTranslation = false;
            this.selectButton.NeedTranslation = false;
            this.selectButton.Text = "..";
            this.selectButton.Clicked += this.ButtonClicked;
            this.BackColor = window.Desktop.Theme.Colors.Window;
            this.TextAlignment = ContentAlignment.MiddleLeft;

            AddControl(this.selectButton);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Creates track bar control.
        /// </summary>
        /// <param name="window">window it belongs to.</param>
        /// <param name="creationFlags">creation flags.</param>
        public TrackBar(Window window, CreationFlag creationFlags)
            : base(window, creationFlags, TypeName)
        {
            this.backPanel = CreateControl<Panel>(CreationFlag.InternalControl);
            this.sliderButton = CreateControl<Button>(CreationFlag.InternalControl);

            this.sliderButton.MousePress += (x, y) => { this.trackerDragging = true; };
            this.sliderButton.MouseRelease += (x, y) => { this.trackerDragging = false; };
            this.sliderButton.MouseMoved += this.SliderButtonMouseMoved;

            this.backPanel.Border = BorderStyle.Lowered;
            this.BackColor = Colors.None;

            AddControl(this.backPanel);
            AddControl(this.sliderButton);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Creates file list item object.
        /// </summary>
        /// <param name="file">actual file it presents.</param>
        /// <param name="window">window it belongs to.</param>
        public FileListItem(IVirtualFile file, Window window)
            : base(window, CreationFlag.FlagsNone)
        {
            if (null == file)
            {
                throw new Exception("file can not be null");
            }

            this.file = file;
            this.NeedTranslation = false;
            this.Text = file.Name;
            this.Name = file.Name;
            this.ListStyle = ListStyle.Details;
            this.BackColor = Colors.None;

            SetFileIcon();
        }
Exemplo n.º 15
0
        /// <summary>
        /// Creates scrollbar control.
        /// </summary>
        /// <param name="window">window it belongs to.</param>
        /// <param name="creationFlags">creation falgs.</param>
        public ScrollBar(Window window, CreationFlag creationFlags)
            : base(window, creationFlags, TypeName)
        {
            this.increaseButton = CreateControl<Button>(CreationFlag.InternalControl);
            this.decreaseButton = CreateControl<Button>(CreationFlag.InternalControl);
            this.sliderButton = CreateControl<Button>(CreationFlag.InternalControl);

            AddControl(this.increaseButton);
            AddControl(this.decreaseButton);
            AddControl(this.sliderButton);

            this.increaseButton.Clicked += (x, Y) => { this.Position += this.stepSize; };
            this.decreaseButton.Clicked += (x, y) => { this.Position -= this.stepSize; };
            this.sliderButton.MouseMoved += new UIEventHandler<Button>(SliderMouseMoved);
            this.sliderButton.MousePress += (x, y) => { this.sliderDragging = true; };
            this.sliderButton.MouseRelease += (x, y) => { this.sliderDragging = false; };

            this.Vertical = true;
        }
Exemplo n.º 16
0
        /// <summary>
        /// Creates combo box control
        /// </summary>
        /// <param name="window">window it belongs to</param>
        /// <param name="creationFlags">creation flags</param>
        public ComboBox(Window window, CreationFlag creationFlags)
            : base(window, creationFlags, TypeName)
        {
            this.button = CreateControl<Button>(CreationFlag.InternalControl);

            this.TextAlignment = ContentAlignment.MiddleLeft;
            this.IconAlignment = ContentAlignment.MiddleLeft;
            this.IconSize = IconSize.IconSmall;
            this.IconImageOffset.X = 2;
            this.IconImageOffset.Y = 3;
            this.Border = BorderStyle.BorderLoweredDouble;

            this.button.IconAlignment = ContentAlignment.MiddleCenter;
            this.button.Icon = this.Window.Desktop.Theme.ThemeFolder + "/images/combobox_icon_down";

            this.button.Clicked += this.ButtonClicked;

            this.AddControl(this.button);
        }
Exemplo n.º 17
0
        public MenuRibbon(Window window, CreationFlag creationFlags)
            : base(window, creationFlags)
        {
            this.Type = TypeName;

            this.menuButton = CreateControl<Button>();

            this.menuButton.Height = 28;
            this.menuButton.Text = "Menu";
            this.menuButton.FontInfo.Name = "Calibri";
            this.menuButton.FontInfo.Bold = true;
            this.menuButton.FontInfo.Size = 20;
            this.menuButton.TextColor = Colors.White;
            this.menuButton.BackColor = Colors.None;
            this.menuButton.Border = BorderStyle.None;
            this.menuButton.Clicked += (x, y) => { this.Active = !this.Active; };

            AddControl(this.menuButton);

            this.BackColor = Colors.None;
        }
Exemplo n.º 18
0
 protected Control(Window window, CreationFlag creationFlags, String type)
     : this(null, window, creationFlags, type)
 {
 }
Exemplo n.º 19
0
        private void FileChooserClosing(Window sender, EventArgs args)
        {
            FileChooser fileChooser = (FileChooser)sender;

            if ((null != fileChooser) && (DialogResult.DialogResultOK == fileChooser.DialogResult))
            {
                this.SelectedFile = fileChooser.SelectedFilePath;
            }
        }
Exemplo n.º 20
0
Arquivo: Menu.cs Projeto: drme/thw-ui
 /// <summary>
 /// Creates menu object.
 /// </summary>
 /// <param name="window">window it belongs to.</param>
 /// <param name="creationFlags">creation flags.</param>
 public Menu(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.BackImageLayout = ImageLayout.ImageLayoutTile;
 }
Exemplo n.º 21
0
        private void NewWindowClick(object sender, EventArgs e)
        {
            if (true == this.hasChanges)
            {
                if (true == this.hasChanges)
                {
                    switch (System.Windows.Forms.MessageBox.Show("Save changes", "Unsaved window", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
                    {
                        case System.Windows.Forms.DialogResult.Cancel:
                            return;
                        case System.Windows.Forms.DialogResult.No:
                            break;
                        case System.Windows.Forms.DialogResult.Yes:
                            SaveClick(sender, e);
                            break;
                        default:
                            return;
                    }
                }
            }

            if (null != this.activeWindow)
            {
                this.activeWindow.ClearControls();
                this.activeWindow.Bounds = new Rectangle(10, 10, 300, 300);
                this.activeWindow.Text = "Window";
                this.activeWindow.Border = ThW.UI.Controls.BorderStyle.BorderRaisedDouble;
                this.activeWindow.Opacity = 1.0f;
                this.activeWindow.BackColor = this.activeWindow.Desktop.Theme.Colors.Control;
            }
            else
            {
                Window window = new Window(this.desktop, CreationFlag.SelectableInDesigner | CreationFlag.NeedLoading | CreationFlag.NeedSaving, "");
                window.Bounds = new Rectangle(10, 10, 300, 300);
                SetEditWindow(window);
                this.desktop.AddWindow(window);
            }

            this.activeFileName = "";
        }
Exemplo n.º 22
0
 public PropertyRow(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.BackColor = Colors.White;
     this.IconAlignment = ContentAlignment.MiddleLeft;
 }
Exemplo n.º 23
0
 /// <summary>
 /// Constructs poperty group obejct
 /// </summary>
 /// <param name="window">parent window</param>
 /// <param name="creationFlags">creation flags</param>
 public PropertyGroup(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
 }
Exemplo n.º 24
0
 /// <summary>
 /// Creates picture control.
 /// </summary>
 /// <param name="window">window it belongs to.</param>
 /// <param name="creationFlags">creation flags.</param>
 public Picture(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
 }
Exemplo n.º 25
0
        private void ColorChooserClosing(Window sender, EventArgs args)
        {
            ColorChooser window = (ColorChooser)sender;

            if ((null != window) && (DialogResult.DialogResultOK == window.DialogResult))
            {
                this.SelectedColor = window.SelectedColor;
            }
        }
Exemplo n.º 26
0
 private void SetEditWindow(Window window)
 {
     this.activeWindow = window;
     SetEditControl(window);
     FillControls();
 }
Exemplo n.º 27
0
 /// <summary>
 /// Creates iternal scoll panel object.
 /// </summary>
 /// <param name="window">window it belongs to.</param>
 /// <param name="creationFlags">creation flags.</param>
 public ScrollPanelInternal(Window window, CreationFlag creationFlags)
     : base(window, creationFlags)
 {
     this.Type = TypeName;
 }
Exemplo n.º 28
0
 public ProgressBar(Window window, CreationFlag creationFlags)
     : base(window, creationFlags, TypeName)
 {
     this.Border = BorderStyle.Lowered;
     this.ProgressBarColor = window.Desktop.Theme.Colors.Highlight;
 }
Exemplo n.º 29
0
        protected Control(Desktop desktop, Window window, CreationFlag creationFlags, String type)
            : base(type)
        {
            if (null != desktop)
            {
                this.uiEngine = desktop.Engine;
            }

            if (null != window)
            {
                this.uiEngine = window.Engine;
            }

            Theme theme = null;

            if (null != desktop)
            {
                theme = desktop.Theme;
            }
            else if (null != window)
            {
                theme = window.Desktop.Theme;
            }
            else
            {
                theme = this.Window.Desktop.Theme;
            }

            this.window = window;
            this.creationFlags = creationFlags;
            this.borderColor = theme.Colors.Window;

            ControlSettings settings = theme.GetControlSettings(this.Type);

            this.backColor = settings.ColorBack;
            this.borderColorDark1 = settings.ColorBorderDark1;
            this.borderColorDark2 = settings.ColorBorderDark2;
            this.borderColorLight1 = settings.ColorBorderLight1;
            this.borderColorLight2 = settings.ColorBorderLight2;
            this.skinned = settings.Skinned;

            if (settings.BackImage.Length > 0)
            {
                BackImage = theme.ThemeFolder + "/" + settings.BackImage;
            }

            this.font = new FontInfo(this.uiEngine, this.Window, settings, theme.DefaultFontName, theme.DefaultFontSize);

            this.uiEngine.Language.LanguageChanged += this.OnLanguageChanged;

            OnLanguageChanged();
        }
Exemplo n.º 30
0
        /// <summary>
        /// Creates info panel control.
        /// </summary>
        /// <param name="window">window it belongs to</param>
        /// <param name="creationFlags">creation flags</param>
        public InfoPanel(Window window, CreationFlag creationFlags)
            : base(window, creationFlags)
        {
            this.Type = TypeName;

            this.imageBorder = CreateControl<Button>();
            this.image = CreateControl<Button>();
            this.titleLabel = CreateControl<Button>();
            this.subTitleLabel = CreateControl<Button>();
            this.commentLabel = CreateControl<Button>();

            this.imageBorder.Bounds = new Rectangle(0, 0, 200, 120);
            this.imageBorder.BackColor = Colors.Black;
            this.imageBorder.Border = BorderStyle.None;
            this.imageBorder.BackImage = "";

            this.image.Bounds = new Rectangle(10, 10, 180, 100);
            this.image.BackImageLayout = ImageLayout.ImageLayoutStretch;
            this.image.Border = BorderStyle.None;

            this.titleLabel.FontInfo.SetFontInfo("Arial", 12, true, false);
            this.titleLabel.Bounds = new Rectangle(220, 0, 230, 20);
            this.titleLabel.TextAlignment = ContentAlignment.MiddleLeft;
            this.titleLabel.BackColor = Colors.None;
            this.titleLabel.Anchor = AnchorStyle.AnchorLeft | AnchorStyle.AnchorRight | AnchorStyle.AnchorTop;
            this.titleLabel.TextColor = this.TextColor;
            this.titleLabel.Border = BorderStyle.None;
            this.titleLabel.BackImage = "";

            this.subTitleLabel.FontInfo.SetFontInfo("Arial", 12, false, false);
            this.subTitleLabel.Bounds = new Rectangle(220, 20, 230, 20);
            this.subTitleLabel.TextAlignment = ContentAlignment.MiddleLeft;
            this.subTitleLabel.BackColor = Colors.None;
            this.subTitleLabel.Anchor = AnchorStyle.AnchorLeft | AnchorStyle.AnchorRight | AnchorStyle.AnchorTop;
            this.subTitleLabel.TextColor = this.TextColor;
            this.subTitleLabel.Border = BorderStyle.None;
            this.subTitleLabel.BackImage = "";

            this.commentLabel.FontInfo.SetFontInfo("Arial", 12, false, false);
            this.commentLabel.Bounds = new Rectangle(220, 40, 230, 20);
            this.commentLabel.TextAlignment = ContentAlignment.MiddleLeft;
            this.commentLabel.BackColor = Colors.None;
            this.commentLabel.Anchor = AnchorStyle.AnchorLeft | AnchorStyle.AnchorRight | AnchorStyle.AnchorTop;
            this.commentLabel.TextColor = this.TextColor;
            this.commentLabel.Border = BorderStyle.None;
            this.commentLabel.BackImage = "";

            this.MinSize = new Size2d(200, 100);
            this.Bounds = new Rectangle(0, 0, 470, 120);
            this.Border = BorderStyle.None;
            this.BackImage = "";

            this.AddControl(this.imageBorder);
            this.AddControl(this.titleLabel);
            this.AddControl(this.subTitleLabel);
            this.AddControl(this.commentLabel);

            this.imageBorder.AddControl(this.image);

            this.imageBorder.Clicked += this.ChildControlClicked;
            this.titleLabel.Clicked += this.ChildControlClicked;
            this.subTitleLabel.Clicked += this.ChildControlClicked;
            this.commentLabel.Clicked += this.ChildControlClicked;
            this.image.Clicked += this.ChildControlClicked;
        }