/// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Memobox"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        /// <param name="p_label">Texto exibido no rótulo.</param>
        /// <param name="p_width">Largura.</param>
        /// <param name="p_height">Altura.</param>
        public Memobox(Spartacus.Forms.Container p_parent, string p_label, int p_width, int p_height)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.v_isfrozen = false;

            this.v_width         = p_width;
            this.v_control.Width = p_width - 5;

            this.SetHeight(p_height);
            this.SetLocation(0, p_parent.v_offsety);

            this.v_label          = new System.Windows.Forms.Label();
            this.v_label.Text     = p_label;
            this.v_label.Location = new System.Drawing.Point(10, 10);
            this.v_label.AutoSize = true;
            this.v_label.Parent   = this.v_control;

            this.v_textbox           = new System.Windows.Forms.TextBox();
            this.v_textbox.Location  = new System.Drawing.Point(5, 35);
            this.v_textbox.Width     = this.v_width - 10 - this.v_textbox.Location.X;
            this.v_textbox.Height    = this.v_height - 35;
            this.v_textbox.Parent    = this.v_control;
            this.v_textbox.Multiline = true;
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Progressbar"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        public Progressbar(Spartacus.Forms.Container p_parent)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.v_isfrozen = false;

            this.SetWidth(p_parent.v_width);
            this.SetHeight(80);
            this.SetLocation(0, p_parent.v_offsety);

            this.v_label          = new System.Windows.Forms.Label();
            this.v_label.Text     = "";
            this.v_label.Location = new System.Drawing.Point(10, 10);
            this.v_label.AutoSize = true;
            this.v_label.Parent   = this.v_control;

            this.v_progressbar          = new System.Windows.Forms.ProgressBar();
            this.v_progressbar.Location = new System.Drawing.Point(5, 35);
            this.v_progressbar.Width    = this.v_width - 10 - this.v_progressbar.Location.X;
            this.v_progressbar.Height   = this.v_height - 35;
            this.v_progressbar.Parent   = this.v_control;
            this.v_progressbar.Minimum  = 0;
            this.v_progressbar.Maximum  = 100;
            this.v_progressbar.Value    = 0;
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Container"/>.
        /// </summary>
        public Container()
        {
            this.v_parent = null;

            this.v_containers = new System.Collections.Generic.List <Container>();

            this.v_offsety = 0;

            this.v_frozenheight = 0;

            this.v_isfrozen = true;
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Container"/>.
        /// </summary>
        /// <param name="p_parent">Container pai do Container atual.</param>
        public Container(Spartacus.Forms.Container p_parent)
        {
            this.v_parent = p_parent;

            this.v_containers = new System.Collections.Generic.List <Container>();

            this.v_offsety = 0;

            this.v_frozenheight = 0;

            this.v_isfrozen = true;
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Buttons"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        public Buttons(Spartacus.Forms.Container p_parent)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.SetWidth(p_parent.v_width);
            this.SetHeight(40);
            this.SetLocation(0, p_parent.v_offsety);

            this.v_list = new System.Collections.Generic.List <System.Windows.Forms.Button>();

            this.v_offsetx = this.v_width - 10;
        }
Example #6
0
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Menu"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        public Menu(Spartacus.Forms.Container p_parent)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.SetWidth(p_parent.v_width);
            this.SetHeight(40);
            this.SetLocation(0, p_parent.v_offsety);

            v_menustrip        = new System.Windows.Forms.MenuStrip();
            v_menustrip.Width  = p_parent.v_width;
            v_menustrip.Parent = this.v_control;
        }
        /// <summary>
        /// Adiciona um Container ao Container atual.
        /// </summary>
        /// <param name="p_container">Container a ser adicionado.</param>
        public void Add(Spartacus.Forms.Container p_container)
        {
            this.v_containers.Add(p_container);

            p_container.v_control.Parent = this.v_control;

            this.v_offsety += p_container.v_height;

            if (p_container.v_isfrozen)
            {
                this.v_frozenheight += p_container.v_height;
            }
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Filepicker"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        /// <param name="p_type">Tipo do diálogo do Filepicker.</param>
        /// <param name="p_label">Texto exibido no rótulo.</param>
        /// <param name="p_filter">Filtro de arquivos a serem exibidos no diálogo do Filepicker.</param>
        public Filepicker(Spartacus.Forms.Container p_parent, Spartacus.Forms.Filepicker.Type p_type, string p_label, string p_filter)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.SetWidth(p_parent.v_width);
            this.SetHeight(40);
            this.SetLocation(0, p_parent.v_offsety);

            this.v_label          = new System.Windows.Forms.Label();
            this.v_label.Text     = p_label;
            this.v_label.Location = new System.Drawing.Point(10, 10);
            this.v_label.AutoSize = true;
            this.v_label.Parent   = this.v_control;

            this.v_button          = new System.Windows.Forms.Button();
            this.v_button.Text     = "...";
            this.v_button.Width    = 30;
            this.v_button.Location = new System.Drawing.Point(this.v_width - 10 - this.v_button.Width, 5);
            this.v_button.Click   += new System.EventHandler(this.OnClick);
            this.v_button.Parent   = this.v_control;

            this.v_proportion = 40;

            this.v_textbox          = new System.Windows.Forms.TextBox();
            this.v_textbox.Location = new System.Drawing.Point((int)(this.v_width * ((double)this.v_proportion / (double)100)), 5);
            this.v_textbox.Width    = this.v_width - 10 - this.v_button.Width - this.v_textbox.Location.X;
            this.v_textbox.Parent   = this.v_control;

            this.v_type = p_type;
            if (this.v_type == Spartacus.Forms.Filepicker.Type.OPEN)
            {
                this.v_filedialog = new System.Windows.Forms.OpenFileDialog();
            }
            else
            {
                this.v_filedialog = new System.Windows.Forms.SaveFileDialog();
            }
            this.v_filedialog.Title  = p_label;
            this.v_filedialog.Filter = p_filter;
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Lookup"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        /// <param name="p_label">Rótulo do componente.</param>
        public Lookup(Spartacus.Forms.Container p_parent, string p_label)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.SetWidth(p_parent.v_width);
            this.SetHeight(40);
            this.SetLocation(0, p_parent.v_offsety);

            this.v_label = new System.Windows.Forms.Label();
            this.v_label.Text = p_label;
            this.v_label.Location = new System.Drawing.Point(10, 10);
            this.v_label.AutoSize = true;
            this.v_label.Parent = this.v_control;

            this.v_proportion1 = 40;
            this.v_proportion2 = 70;

            this.v_textbox = new System.Windows.Forms.TextBox();
            this.v_textbox.Enabled = false;
            this.v_textbox.Location = new System.Drawing.Point((int) (this.v_width * ((double) this.v_proportion2 / (double) 100)), 5);
            this.v_textbox.Width = this.v_width - 10 - this.v_textbox.Location.X;
            this.v_textbox.Parent = this.v_control;

            this.v_lookup = new ThirdParty.MultiColumnComboBox();
            this.v_lookup.AutoComplete = true;
            this.v_lookup.AutoDropdown = true;
            this.v_lookup.BackColorEven = System.Drawing.Color.White;
            this.v_lookup.BackColorOdd = System.Drawing.Color.Silver;
            this.v_lookup.ColumnWidthDefault = 75;
            this.v_lookup.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
            this.v_lookup.FormattingEnabled = true;
            this.v_lookup.LinkedColumnIndex = 1;
            this.v_lookup.LinkedTextBox = this.v_textbox;
            this.v_lookup.Location = new System.Drawing.Point((int) (this.v_width * ((double) this.v_proportion1 / (double) 100)), 5);
            this.v_lookup.Width = this.v_textbox.Location.X - this.v_lookup.Location.X - 5;
            this.v_lookup.Parent = this.v_control;

            this.v_database = null;
            this.v_sql = null;
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Textbox"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        /// <param name="p_label">Texto exibido no rótulo.</param>
        /// <param name="p_proportion">Proporção entre o Label e o Textbox.</param>
        public Textbox(Spartacus.Forms.Container p_parent, string p_label, int p_proportion)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.SetWidth(p_parent.v_width);
            this.SetHeight(40);
            this.SetLocation(0, p_parent.v_offsety);

            this.v_label          = new System.Windows.Forms.Label();
            this.v_label.Text     = p_label;
            this.v_label.Location = new System.Drawing.Point(10, 10);
            this.v_label.Parent   = this.v_control;

            this.v_proportion = p_proportion;

            this.v_textbox          = new System.Windows.Forms.TextBox();
            this.v_textbox.Location = new System.Drawing.Point((int)(this.v_width * ((double)this.v_proportion / (double)100)), 5);
            this.v_textbox.Width    = this.v_width - 10 - this.v_textbox.Location.X;
            this.v_textbox.Parent   = this.v_control;
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Datetimepicker"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        /// <param name="p_label">Texto exibido no rótulo.</param>
        /// <param name="p_format">Formato a ser exibido no DateTimePicker.</param>
        /// <param name="p_proportion">Proporção entre o Label e o DateTimePicker.</param>
        public Datetimepicker(Spartacus.Forms.Container p_parent, string p_label, string p_format, int p_proportion)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.SetWidth(p_parent.v_width);
            this.SetHeight(40);
            this.SetLocation(0, p_parent.v_offsety);

            this.v_label          = new System.Windows.Forms.Label();
            this.v_label.Text     = p_label;
            this.v_label.Location = new System.Drawing.Point(10, 10);
            this.v_label.Parent   = this.v_control;

            this.v_proportion = p_proportion;

            this.v_datetimepicker              = new System.Windows.Forms.DateTimePicker();
            this.v_datetimepicker.Location     = new System.Drawing.Point((int)(this.v_width * ((double)this.v_proportion / (double)100)), 5);
            this.v_datetimepicker.Width        = this.v_width - 10 - this.v_datetimepicker.Location.X;
            this.v_datetimepicker.Format       = System.Windows.Forms.DateTimePickerFormat.Custom;
            this.v_datetimepicker.CustomFormat = p_format;
            this.v_datetimepicker.Parent       = this.v_control;
        }
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Forms.Grid"/>.
        /// </summary>
        /// <param name="p_parent">Container pai.</param>
        /// <param name="p_height">Altura.</param>
        public Grid(Spartacus.Forms.Container p_parent, int p_height)
            : base(p_parent)
        {
            this.v_control = new System.Windows.Forms.Panel();

            this.v_isfrozen = false;

            this.v_width         = p_parent.v_width;
            this.v_control.Width = p_parent.v_width - 5;

            this.SetHeight(p_height);
            this.SetLocation(0, p_parent.v_offsety);

            this.v_grid = new System.Windows.Forms.DataGridView();
            this.v_grid.RowHeadersVisible         = false;
            this.v_grid.EnableHeadersVisualStyles = false;
            this.v_grid.ColumnHeadersHeight       = 20;
            this.v_grid.ColumnHeadersBorderStyle  = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
            this.v_grid.AutoGenerateColumns       = true;
            this.v_grid.ReadOnly      = true;
            this.v_grid.MultiSelect   = false;
            this.v_grid.EditMode      = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
            this.v_grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this.v_grid.DoubleBuffered(true);
            this.v_grid.BorderStyle              = System.Windows.Forms.BorderStyle.None;
            this.v_grid.AllowDrop                = false;
            this.v_grid.AllowUserToAddRows       = false;
            this.v_grid.AllowUserToDeleteRows    = false;
            this.v_grid.AllowUserToOrderColumns  = true;
            this.v_grid.AllowUserToResizeColumns = true;
            this.v_grid.Dock   = System.Windows.Forms.DockStyle.Fill;
            this.v_grid.Parent = this.v_control;

            this.v_database = null;
            this.v_sql      = null;
        }