예제 #1
0
파일: Class1.cs 프로젝트: JustJal/Sandbox
        public SharpApp() : base("First Application")
        {
            SetDefaultSize(250, 200);
            SetPosition(WindowPosition.Center);
            SetIconFromFile("Dolphin.png");
            DeleteEvent += delegate { Application.Quit(); };

            Fixed fix = new Fixed();

            Button Mine1 = new Button("Nope");

            Mine1.Sensitive = false;
            Button Mine2 = new Button("Click Me HAHA");
            Button Mine3 = new Button(Stock.Close);
            Button Mine4 = new Button("Nah you cannot click me");

            Mine4.SetSizeRequest(90, 100);

            fix.Put(Mine1, 20, 30);
            fix.Put(Mine2, 100, 30);
            fix.Put(Mine3, 20, 80);
            fix.Put(Mine4, 100, 80);

            Add(fix);
            ShowAll();
        }
예제 #2
0
    public MainWindow() :
        base(Gtk.WindowType.Toplevel)
    {
        // Populating the fixed container
        @fixed.Put(lblDashboardMain, 10, 10);

        @fixed.Put(lblDashboardLoadExisting, 10, 60);
        @fixed.Put(cmbDashboardLoadExisting, 10, 90);
        @fixed.Put(btnDashboardLoadTournament, 200, 90);

        @fixed.Put(btnDashboardCreateTournament, 110, 180);

        // Assigning widget colours and fonts
        GeneralMethods.LabelColoursFonts(@fixed,
                                         new byte[] { 255, 255, 255 }, new Label[] { lblDashboardMain });

        // Window setup
        ModifyBg(StateType.Normal, new Gdk.Color(36, 36, 36));
        SetDefaultSize(350, 300);
        SetPosition(WindowPosition.Center);
        Title = "Dashboard";

        hBox.Add(@fixed);

        Add(hBox);

        ShowAll();
    }
        public void final()
        {
            Application.Init();
            ventana = new Window("Juego");

            Label nombreJuego = new Label();

            nombreJuego.Text = "Guason te pega su mejor ataque... HAZ PERDIDO";

            Button btnSalir = new Button("Salir");

            btnSalir.Clicked += salir;

            Image imagenFondo = new Image("joke_win.gif");

            Fixed capaFix = new Fixed();

            capaFix.Put(nombreJuego, 150, 10);
            capaFix.Put(imagenFondo, 5, 30);
            capaFix.Put(btnSalir, 450, 10);

            ventana.SetPosition(WindowPosition.Center);
            ventana.Add(capaFix);
            ventana.Resize(200, 170);
            ventana.ShowAll();

            Application.Run();
        }
        public void inicio()
        {
            Application.Init();
            ventana = new Window("Juego");

            Label nombreJuego = new Label();

            nombreJuego.Text = "Juego de Batman";

            Button entrar = new Button("Entrar");

            entrar.Clicked += ventanaJuego;
            Button btnSalir = new Button("Salir");

            btnSalir.Clicked += salir;

            Image imagenFondo = new Image("fondo.jpg");

            Fixed capaFix = new Fixed();

            capaFix.Put(nombreJuego, 150, 10);
            capaFix.Put(imagenFondo, 5, 30);
            capaFix.Put(entrar, 180, 90);
            capaFix.Put(btnSalir, 300, 200);

            ventana.SetPosition(WindowPosition.Center);
            ventana.Add(capaFix);
            ventana.Resize(200, 170);
            ventana.ShowAll();

            Application.Run();
        }
        public void final3()
        {
            Application.Init();
            ventana = new Window("Juego");

            Label nombreJuego = new Label();

            nombreJuego.Text = "Mutuamente se pegaron al final... EMPATE";

            Button btnSalir = new Button("Salir");

            btnSalir.Clicked += salir;

            Image imagenFondo = new Image("draw.gif");

            Fixed capaFix = new Fixed();

            capaFix.Put(nombreJuego, 10, 10);
            capaFix.Put(imagenFondo, 5, 30);
            capaFix.Put(btnSalir, 250, 10);

            ventana.SetPosition(WindowPosition.Center);
            ventana.Add(capaFix);
            ventana.Resize(200, 170);
            ventana.ShowAll();

            Application.Run();
        }
예제 #6
0
        public void final2()
        {
            Application.Init();
            ventana = new Window("Juego");

            Label nombreJuego = new Label();

            nombreJuego.Text = "Lo haz derrotado... GANASTE!!!";

            Button btnSalir = new Button("Salir");

            btnSalir.Clicked += salir;

            Image imagenFondo = new Image("bat_win.gif");

            Fixed capaFix = new Fixed();

            capaFix.Put(nombreJuego, 150, 10);
            capaFix.Put(imagenFondo, 5, 30);
            capaFix.Put(btnSalir, 350, 310);

            ventana.SetPosition(WindowPosition.Center);
            ventana.Add(capaFix);
            ventana.Resize(200, 170);
            ventana.ShowAll();

            Application.Run();
        }
예제 #7
0
        protected void ScreenChange(SceneData screen, params object[] options)
        {
            f.Remove(current);
            current.Destroy();
            current = screen.CreateInstance(options);
            f.Put(current, 0, 0);

            f.Remove(side);
            side.Destroy();
            side = new MySideBar();
            f.Put(side, 0, 20);
            side.Show();

            if (currentScene == "Logger")
            {
                var logScreen = current as LoggerWindow;
                if (logScreen != null)
                {
                    side.ExpandEvent += (sender, e) => {
                        logScreen.tv.Visible = false;
                        logScreen.tv.QueueDraw();
                    };

                    side.CollapseEvent += (sender, e) => {
                        logScreen.tv.Visible = true;
                        logScreen.tv.QueueDraw();
                    };
                }
            }
            else if (currentScene == "Alarms")
            {
                var alarmScreen = current as AlarmWindow;
                if (alarmScreen != null)
                {
                    side.ExpandEvent += (sender, e) => {
                        alarmScreen.tv.Visible = false;
                        alarmScreen.tv.QueueDraw();
                    };

                    side.CollapseEvent += (sender, e) => {
                        alarmScreen.tv.Visible = true;
                        alarmScreen.tv.QueueDraw();
                    };
                }
            }

            f.Remove(notification);
            notification = new MyNotificationBar();
            f.Put(notification, 0, 0);
            notification.Show();

            QueueDraw();
        }
예제 #8
0
        public void InitObject(Window pSourceWindow, DialogFlags pDialogFlags, string pWindowTitle, decimal pInitialValue = 0.0m, decimal pTotalOrder = 0.0m)
        {
            Size   windowSize            = new Size(524, 497);
            String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_payments.png");

            //Init MoneyPad
            _moneyPad = new MoneyPad(pSourceWindow, pInitialValue);
            _moneyPad.EntryChanged += _moneyPad_EntryChanged;
            //If pInitialValue defined, Assign it
            _amount = (pInitialValue > 0) ? pInitialValue : 0.0m;

            //Init Content
            Fixed fixedContent = new Fixed();

            fixedContent.Put(_moneyPad, 0, 0);

            //ActionArea Buttons
            _buttonOk     = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok);
            _buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel);
            //Start Enable or Disable
            _buttonOk.Sensitive = (pInitialValue > 0 && pInitialValue > pTotalOrder) ? true : false;

            //ActionArea
            ActionAreaButtons actionAreaButtons = new ActionAreaButtons();

            actionAreaButtons.Add(new ActionAreaButton(_buttonOk, ResponseType.Ok));
            actionAreaButtons.Add(new ActionAreaButton(_buttonCancel, ResponseType.Cancel));

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, pWindowTitle, windowSize, fixedContent, actionAreaButtons);
        }
예제 #9
0
        public PosTemplateDialog(Window pSourceWindow, DialogFlags pDialogFlags)
            : base(pSourceWindow, pDialogFlags)
        {
            //Init Local Vars
            String windowTitle           = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_template");
            Size   windowSize            = new Size(600, 340);
            String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_default.png");

            //Init Content
            Fixed fixedContent = new Fixed();

            fixedContent.Put(new Label("Place content here"), 0, 0);

            //ActionArea Buttons
            TouchButtonIconWithText buttonOk     = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok);
            TouchButtonIconWithText buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel);

            //ActionArea
            ActionAreaButtons actionAreaButtons = new ActionAreaButtons();

            actionAreaButtons.Add(new ActionAreaButton(buttonOk, ResponseType.Ok));
            actionAreaButtons.Add(new ActionAreaButton(buttonCancel, ResponseType.Cancel));

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, windowSize, fixedContent, actionAreaButtons);
        }
예제 #10
0
        /// <summary>Display an entry box for the user to edit cell data.</summary>
        private void ShowEntryBox()
        {
            Selection.GetSelection(out int selectedColumnIndex, out int selectedRowIndex);
            var cellBounds = sheet.CalculateBounds(selectedColumnIndex, selectedRowIndex);

            entry = new Entry();
            entry.SetSizeRequest((int)cellBounds.Width - 3, (int)cellBounds.Height - 10);
            entry.WidthChars     = 5;
            entry.Text           = sheet.DataProvider.GetCellContents(selectedColumnIndex, selectedRowIndex);
            entry.KeyPressEvent += OnEntryKeyPress;
            if (!sheet.CellPainter.TextLeftJustify(selectedColumnIndex, selectedRowIndex))
            {
                entry.Alignment = 1; // right
            }
            if (sheet.Children.Length == 1)
            {
                fix = (Fixed)sheet.Child;
            }
            else
            {
                fix = new Fixed();
                sheet.Add(fix);
            }
            fix.Put(entry, (int)cellBounds.Left + 1, (int)cellBounds.Top + 1);

            sheet.ShowAll();
            sheet.Refresh();

            entry.GrabFocus();
        }
예제 #11
0
    protected void ReparentCameraControls(Fixed parent)
    {
        // Re-parent camera picture box and toggle buttons
        cameraImageEvent.Reparent(parent);
        grabButton.Reparent(parent);
        stopButton.Reparent(parent);
        restartButton.Reparent(parent);
        clearButton.Reparent(parent);
        saveButton.Reparent(parent);
        ellipseBoxToggle.Reparent(parent);

        // Move picture box and buttons to default locations
        parent.Move(cameraImageEvent, 20, 20);
        parent.Move(grabButton, 20, 520);
        parent.Move(stopButton, 80, 520);
        parent.Move(restartButton, 140, 520);
        parent.Move(clearButton, 220, 520);
        parent.Move(saveButton, 350, 520);
        parent.Move(ellipseBoxToggle, 410, 520);

        // Reparent and layout fix for edit region panel
        prevParent.Remove(editRegionLayout);
        parent.Put(editRegionLayout, 670, 20);
        prevParent = parent;
    }
예제 #12
0
        protected void SwapTypeComboToTop()
        {
            int x = typeCombo.Allocation.Left;
            int y = typeCombo.Allocation.Top;

            fix.Remove(typeCombo);
            fix.Put(typeCombo, x, y);
        }
예제 #13
0
    private void AddWindowContent()
    {
        container = new Fixed();
        Button addGameButton = new Button();

        addGameButton.Label    = "Add Games";
        addGameButton.Clicked += OnAddGameClicked;

        _tempGameListLabel      = new Label();
        _tempGameListLabel.Text = "Games will show here once added";


        container.Put(_tempGameListLabel, 20, 50);
        container.Put(addGameButton, 20, 20);

        Add(container);
    }
예제 #14
0
        void BuildClient()
        {
            fixed5 = new Fixed();

            label1 = new Label("Hosts");
            fixed5.Put(label1, 5, 0);
            var btnStart = new Button();

            btnStart.WidthRequest = 109;
            btnStart.Label        = "ScanServers";
            btnStart.Clicked     += BtnStart_Clicked;
            fixed5.Put(btnStart, 5, 30);
            hbox1 = new Box(Orientation.Vertical, 30);
            fixed5.Put(hbox1, 5, 70);

            var label2 = new Label("Methods");
            var label3 = new Label("DataMethods");

            hbox2         = new Box(Orientation.Vertical, 10);
            hbox3         = new Box(Orientation.Vertical, 10);
            hbox2.Spacing = 5;
            hbox3.Spacing = 5;
            fixed5.Put(hbox2, 200, 40);
            fixed5.Put(hbox3, 350, 40);
            fixed5.Put(label2, 200, 10);
            fixed5.Put(label3, 350, 10);
            notebook.AppendPage(fixed5, new Label("StreamClient"));
        }
예제 #15
0
        private void AddWindowContent()
        {
            Label  label = new Label("Add game"), titleLabel = new Label("Host address"), saveLabel = new Label("Save path");
            Button btn = new Button();

            _hostPathBox = new Entry();
            Fixed fix = new Fixed();

            btn.Label    = "Add game";
            btn.Clicked += OnAddGame;

            fix.Put(label, 5, 10);
            fix.Put(titleLabel, 5, 30);
            fix.Put(_hostPathBox, 5, 50);
            fix.Put(btn, 5, 140);

            Add(fix);
        }
예제 #16
0
        private void InitTablePadUsers()
        {
            //Colors
            //Color colorPosButtonArticleBackground = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosButtonArticleBackground"]);

            //Scrollers
            TouchButtonIcon buttonPosScrollersPlacePrev = new TouchButtonIcon("buttonPosScrollersTablePrev", Color.White, _fileScrollLeftImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);
            TouchButtonIcon buttonPosScrollersPlaceNext = new TouchButtonIcon("buttonPosScrollersTableNext", Color.White, _fileScrollRightImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);

            buttonPosScrollersPlacePrev.Relief      = ReliefStyle.None;
            buttonPosScrollersPlaceNext.Relief      = ReliefStyle.None;
            buttonPosScrollersPlacePrev.BorderWidth = 0;
            buttonPosScrollersPlaceNext.BorderWidth = 0;
            buttonPosScrollersPlacePrev.CanFocus    = false;
            buttonPosScrollersPlaceNext.CanFocus    = false;
            HBox hboxPlaceScrollers = new HBox(true, 0);

            hboxPlaceScrollers.PackStart(buttonPosScrollersPlacePrev);
            hboxPlaceScrollers.PackStart(buttonPosScrollersPlaceNext);

            //TablePad Places
            String sqlUsers = @"SELECT Oid as id, Name as name, NULL as label, NULL as image FROM sys_userdetail WHERE (Disabled IS NULL or Disabled  <> 1)";

            _tablePadUsers = new TablePadUser(
                sqlUsers,
                "ORDER BY Ord",
                "",
                GlobalFramework.LoggedUser.Oid,
                true,
                5,
                4,
                "buttonUserId",
                Color.Transparent,
                _sizePosUserButton.Width,
                _sizePosUserButton.Height,
                buttonPosScrollersPlacePrev,
                buttonPosScrollersPlaceNext
                );
            //Click Event
            _tablePadUsers.Clicked += _tablePadUsers_Clicked;
            //Pack It
            _fixedContent.Put(_tablePadUsers, 0, 0);
            _fixedContent.Put(hboxPlaceScrollers, 0, 411);
        }
예제 #17
0
        static Entry PutSingleInput(Component component, PropertyInfo field, InputPurpose fillter, Fixed fixd, ref int offset)
        {
            //Label
            Label lbl = new Label();

            lbl.Name = "lbl";
            lbl.Text = field.Name;

            fixd.Put(lbl, 0, offset);
            lbl.Show();
            offset += 20;

            //Field
            Entry entry = new Entry();

            entry.WidthRequest = 180;
            entry.Name         = "entry";
            fixd.Put(entry, 0, offset);
            entry.Show();
            entry.InputPurpose = fillter;
            offset            += 40;
            entry.Text         = field.GetValue(component).ToString();

            entry.Changed += (s, e) => {
                if (field.PropertyType == typeof(int))
                {
                    int value = 0;
                    int.TryParse(entry.Text, out value);
                    field.SetValue(component, value);
                }
                else if (field.PropertyType == typeof(float))
                {
                    float value = 0;
                    float.TryParse(entry.Text, out value);
                    field.SetValue(component, value);
                }
                else if (field.PropertyType == typeof(string))
                {
                    field.SetValue(component, entry.Text);
                }
            };

            return(entry);
        }
예제 #18
0
        private void InitUI()
        {
            //Initial Values
            FIN_ConfigurationPaymentMethod initialValueConfigurationPaymentMethod = (FIN_ConfigurationPaymentMethod)FrameworkUtils.GetXPGuidObject(typeof(FIN_ConfigurationPaymentMethod), SettingsApp.XpoOidConfigurationPaymentMethodDefaultInvoicePaymentMethod);
            CFG_ConfigurationCurrency      intialValueConfigurationCurrency       = SettingsApp.ConfigurationSystemCurrency;
            string initialPaymentDate = FrameworkUtils.CurrentDateTimeAtomic().ToString(SettingsApp.DateTimeFormat);

            //ConfigurationPaymentMethod
            string           filterValidPaymentMethod = "(Token = 'CREDIT_CARD' OR Token = 'BANK_CHECK' OR Token = 'MONEY' OR Token = 'BANK_TRANSFER' OR Token = 'CASH_MACHINE' OR Token = 'VISA' OR Token = 'OTHER')";
            CriteriaOperator criteriaOperatorConfigurationPaymentMethod = CriteriaOperator.Parse(string.Format("(Disabled IS NULL OR Disabled  <> 1)  AND Oid <> '{0}' AND {1}", SettingsApp.XpoOidConfigurationPaymentMethodCurrentAccount.ToString(), filterValidPaymentMethod));

            _entryBoxSelectConfigurationPaymentMethod = new XPOEntryBoxSelectRecordValidation <FIN_ConfigurationPaymentMethod, TreeViewConfigurationPaymentMethod>(_sourceWindow, Resx.global_payment_method, "Designation", "Oid", initialValueConfigurationPaymentMethod, criteriaOperatorConfigurationPaymentMethod, SettingsApp.RegexGuid, true);
            _entryBoxSelectConfigurationPaymentMethod.EntryValidation.Changed   += delegate { Validate(); };
            _entryBoxSelectConfigurationPaymentMethod.EntryValidation.IsEditable = false;

            //ConfigurationCurrency
            CriteriaOperator criteriaOperatorConfigurationCurrency = CriteriaOperator.Parse(string.Format("(Disabled IS NULL OR Disabled  <> 1) AND (ExchangeRate IS NOT NULL OR Oid = '{0}')", SettingsApp.ConfigurationSystemCurrency.Oid.ToString()));

            _entryBoxSelectConfigurationCurrency = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCurrency, TreeViewConfigurationCurrency>(_sourceWindow, Resx.global_currency, "Designation", "Oid", intialValueConfigurationCurrency, criteriaOperatorConfigurationCurrency, SettingsApp.RegexGuid, false);
            _entryBoxSelectConfigurationCurrency.EntryValidation.Changed   += _entryBoxSelectConfigurationCurrency_Changed;
            _entryBoxSelectConfigurationCurrency.EntryValidation.IsEditable = false;

            //PaymentAmount
            _entryPaymentAmount = new EntryBoxValidation(_sourceWindow, Resx.global_total_deliver, KeyboardMode.Numeric, SettingsApp.RegexDecimalGreaterEqualThanZero, true);
            _entryPaymentAmount.EntryValidation.Text = FrameworkUtils.DecimalToString(_paymentAmountTotal);
            _entryPaymentAmount.EntryValidation.Validate();
            _entryPaymentAmount.EntryValidation.Changed += delegate {
                Validate();
                UpdateTitleBar();
            };

            //PaymentDate
            _entryBoxPaymentDate = new EntryBoxValidation(_sourceWindow, Resx.global_date, KeyboardMode.Alfa, SettingsApp.RegexDateTime, true);
            _entryBoxPaymentDate.EntryValidation.Text = initialPaymentDate;
            _entryBoxPaymentDate.EntryValidation.Validate();
            _entryBoxPaymentDate.EntryValidation.Changed += delegate { Validate(); };

            //PaymentNotes
            _entryBoxDocumentPaymentNotes = new EntryBoxValidation(_sourceWindow, Resx.global_notes, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            _entryBoxDocumentPaymentNotes.EntryValidation.Changed += delegate { Validate(); };

            //Pack VBOX
            VBox vbox = new VBox(false, 0);

            vbox.PackStart(_entryBoxSelectConfigurationPaymentMethod, true, true, 0);
            vbox.PackStart(_entryBoxSelectConfigurationCurrency, false, false, 0);
            vbox.PackStart(_entryPaymentAmount, false, false, 0);
            vbox.PackStart(_entryBoxPaymentDate, false, false, 0);
            vbox.PackStart(_entryBoxDocumentPaymentNotes, false, false, 0);
            vbox.PackStart(_entryBoxDocumentPaymentNotes, false, false, 0);
            vbox.WidthRequest = _windowSize.Width - 14;

            //Put in FinishContent
            _fixedContent = new Fixed();
            _fixedContent.Put(vbox, 0, 0);
        }
예제 #19
0
        public PosInputTextDialog(Window pSourceWindow, DialogFlags pDialogFlags, Size pSize, string pWindowTitle, string pWindowIcon, string pEntryLabel, string pInitialValue, KeyboardMode pKeyboardMode, string pRule, bool pRequired)
            : base(pSourceWindow, pDialogFlags)
        {
            //Init Local Vars
            String windowTitle = pWindowTitle;
            Size   windowSize  = pSize;

            if (!File.Exists(pWindowIcon))
            {
                pWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_system.png");
            }

            //Always assign  pInitialValue to Dialog.Value
            _value = pInitialValue;

            //Entry
            _entryBoxValidation = new EntryBoxValidation(this, pEntryLabel, pKeyboardMode, pRule, pRequired);
            if (pInitialValue != string.Empty)
            {
                _entryBoxValidation.EntryValidation.Text = pInitialValue;
            }

            //VBox
            _vbox = new VBox(false, 0)
            {
                WidthRequest = windowSize.Width - 12
            };
            _vbox.PackStart(_entryBoxValidation, false, false, 0);

            //Init Content
            Fixed fixedContent = new Fixed();

            fixedContent.Put(_vbox, 0, 0);

            //ActionArea Buttons
            TouchButtonIconWithText buttonOk     = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok);
            TouchButtonIconWithText buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel);

            buttonOk.Sensitive = _entryBoxValidation.EntryValidation.Validated;

            //After Button Construction
            _entryBoxValidation.EntryValidation.Changed += delegate {
                _value             = _entryBoxValidation.EntryValidation.Text;
                buttonOk.Sensitive = _entryBoxValidation.EntryValidation.Validated;
            };

            //ActionArea
            ActionAreaButtons actionAreaButtons = new ActionAreaButtons();

            actionAreaButtons.Add(new ActionAreaButton(buttonOk, ResponseType.Ok));
            actionAreaButtons.Add(new ActionAreaButton(buttonCancel, ResponseType.Cancel));

            //Init Object
            this.InitObject(this, pDialogFlags, pWindowIcon, windowTitle, windowSize, fixedContent, actionAreaButtons);
        }
예제 #20
0
        private void InitUI()
        {
            //Init Font Description
            Pango.FontDescription fontDescription = Pango.FontDescription.FromString(GlobalFramework.Settings["fontEntryBoxValue"]);
            //Init Calendar
            _calendar      = new Calendar();
            _calendar.Date = _dateTime;
            _calendar.ModifyFont(fontDescription);
            _calendar.SetSizeRequest(_windowSize.Width - 13, _windowSize.Height - 120);

            _fixedContent.Put(_calendar, 0, 0);
        }
        protected void OnComboButtonPressed(object sender, ButtonPressEventArgs args)
        {
            Fixed p = Parent as Fixed;

            if (p != null)
            {
                int x = Allocation.Left;
                int y = Allocation.Top;
                p.Remove(this);
                p.Put(this, x, y);
            }
        }
예제 #22
0
        private void InitUserInterface()
        {
            Fixed fix        = new Fixed();
            Label loginTitle = new Label("Login");

            usernameEntry            = new Entry();
            passwordEntry            = new Entry();
            passwordEntry.Visibility = false;
            errorLabel = new Label();
            Button loginBtn = new Button("Login");

            loginBtn.Clicked += HandleLogin;

            fix.Put(loginTitle, 374, 142);
            fix.Put(usernameEntry, 285, 236);
            fix.Put(passwordEntry, 285, 287);
            fix.Put(loginBtn, 285, 344);
            fix.Put(errorLabel, 285, 400);

            Add(fix);
        }
예제 #23
0
        static HScale PutScale(string name, Fixed fixd, ref int offset)
        {
            Label lbl = new Label();

            lbl.Name = "lbl";
            lbl.Text = name;

            fixd.Put(lbl, 0, offset);
            lbl.Show();
            offset += 20;

            HScale scale = new HScale(0, 1, 0.1);

            scale.WidthRequest = 180;
            scale.Name         = "scale";

            fixd.Put(scale, 0, offset);
            scale.Show();
            offset += 40;

            return(scale);
        }
예제 #24
0
        static CheckButton PutCheckBox(string name, Fixed fixd, ref int offset)
        {
            CheckButton check = new CheckButton(name);

            check.WidthRequest = 180;
            check.Name         = "check";

            fixd.Put(check, 0, offset);
            check.Show();
            offset += 40;

            return(check);
        }
        private void InitUI(DialogFlags pDialogFlags, DateTime pDateStart, DateTime pDateEnd)
        {
            //Parameters
            _dateStart = pDateStart;
            _dateEnd   = pDateEnd;

            //Init Local Vars
            String windowTitle           = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_datepicket_startend");
            Size   windowSize            = new Size(300, 255);
            String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_date_picker.png");

            //Init Content
            _fixedContent = new Fixed();

            //Init DateEntry Start
            _entryBoxDateStart = new EntryBoxValidationDatePickerDialog(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date_start"), _dateStart, SettingsApp.RegexDate, true);
            _entryBoxDateStart.EntryValidation.Text = _dateStart.ToString(SettingsApp.DateFormat);
            _entryBoxDateStart.EntryValidation.Validate();
            _entryBoxDateStart.ClosePopup += entryBoxDateStart_ClosePopup;
            //Init DateEntry End
            _entryBoxDateEnd = new EntryBoxValidationDatePickerDialog(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date_end"), _dateEnd, SettingsApp.RegexDate, true);
            _entryBoxDateEnd.EntryValidation.Text = _dateEnd.ToString(SettingsApp.DateFormat);
            _entryBoxDateEnd.EntryValidation.Validate();
            _entryBoxDateEnd.ClosePopup += entryBoxDateEnd_ClosePopup;

            VBox vbox = new VBox(true, 0)
            {
                WidthRequest = 290
            };

            vbox.PackStart(_entryBoxDateStart, true, true, 2);
            vbox.PackStart(_entryBoxDateEnd, true, true, 2);

            _fixedContent.Put(vbox, 0, 0);

            //ActionArea Buttons
            _buttonOk     = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok);
            _buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel);

            //ActionArea
            ActionAreaButtons actionAreaButtons = new ActionAreaButtons();

            actionAreaButtons.Add(new ActionAreaButton(_buttonOk, ResponseType.Ok));
            actionAreaButtons.Add(new ActionAreaButton(_buttonCancel, ResponseType.Cancel));

            //Start Validated
            Validate();

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, windowSize, _fixedContent, actionAreaButtons);
        }
예제 #26
0
        public Widget Retrieve(T obj)
        {
            ObjectWidgetPair <T> pair = cache.Find((element) => obj == element.obj);

            if (pair.obj == null)
            {
                pair = new ObjectWidgetPair <T>(obj, Generator(obj));
                pair.widget.Destroyed += (o, a) => cache.Remove(pair);
                contents.Put(pair.widget, 0, 0);
                contents.ShowAll();
                cache.Add(pair);
            }
            return(pair.widget);
        }
예제 #27
0
        public MainWindow(string title) : base(title)
        {
            SetDefaultSize(800, 600);
            SetPosition(WindowPosition.Center);
            Resizable = false;
            SetIconFromFile("icon.png");

            DeleteEvent += OnDelete;

            _container = new Fixed();

            _send       = new Button("Button");
            _send.Label = "Send";

            _send.Clicked += OnSendClicked;

            _output = new Label("");
            _output.SetSizeRequest(650, 400);
            _output.LineWrap = true;
            _output.Justify  = Justification.Left;

            _input = new Entry();
            _input.SetSizeRequest(600, 25);

            _buffer = File.ReadAllBytes("icon.png");

            _pixbuf = new Pixbuf(_buffer, 64, 64);

            _icon = new Image(_pixbuf);
            _icon.SetSizeRequest(64, 64);

            _connect = new Button(_icon);
            _connect.SetSizeRequest(64, 64);


            _connect.Clicked += Connect;

            _container.Put(_connect, 0, 0);

            _connString = new Entry();

            _container.Put(_connString, 192, 0);

            _container.Put(_icon, 0, 0);

            _container.Put(_input, 50, 550);
            _container.Put(_output, 50, 50);
            _container.Put(_send, 700, 550);


            Add(_container);


            _client = new Client();

            ShowAll();
        }
예제 #28
0
        public PosPinPadDialog(Window pSourceWindow, DialogFlags pDialogFlags, sys_userdetail pUserDetail)
            : base(pSourceWindow, pDialogFlags)
        {
            //Dialog compile time preferences
            Boolean showCancel   = false;
            int     DialogHeight = (showCancel) ? 465 : 440;//465 : 400;

            //Init Local Vars Parameters
            _selectedUserDetail = pUserDetail;
            //Init Local Vars
            String            windowTitle           = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_request_user_pin");
            Size              windowSize            = new Size(332, DialogHeight);
            String            fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_users.png");
            String            fontNumberPadPinButtonKeysTextAndLabel = GlobalFramework.Settings["fontNumberPadPinButtonKeysTextAndLabel"];
            ActionAreaButtons actionAreaButtons;

            //Init Content
            Fixed fixedContent = new Fixed();

            //NumberPadPin
            _numberPadPin = new NumberPadPin(pSourceWindow, "numberPadPin", System.Drawing.Color.Transparent, fontNumberPadPinButtonKeysTextAndLabel, "12", Color.White, Color.Black, 100, 67);
            _numberPadPin.ButtonKeyOK.Clicked += ButtonKeyOK_Clicked;

            fixedContent.Put(_numberPadPin, 0, 0);

            if (showCancel)
            {
                //ActionArea Buttons
                TouchButtonIconWithText buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel);

                //ActionArea
                actionAreaButtons = new ActionAreaButtons();
                actionAreaButtons.Add(new ActionAreaButton(buttonCancel, ResponseType.Cancel));
            }
            else
            {
                actionAreaButtons = new ActionAreaButtons();
            }

            //Init Mode
            _numberPadPin.Mode = (_selectedUserDetail.PasswordReset) ? NumberPadPinMode.PasswordOld :
                                 NumberPadPinMode.Password;

            //Events
            this.KeyReleaseEvent += PosPinPadDialog_KeyReleaseEvent;

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, windowSize, fixedContent, actionAreaButtons);
        }
예제 #29
0
        public void InitObject(
            Window pSourceWindow,
            DialogFlags pDialogFlags,
            string pWindowsTitle,
            Size pSize,
            //Type pTreeViewType,
            //CriteriaOperator pCriteria,
            T3 pGenericTreeView,
            GenericTreeViewMode pGenericTreeViewMode,
            ActionAreaButtons pActionAreaButtons
            )
        {
            //Init private Vars from Parameters
            String windowTitle = pWindowsTitle;
            Size   windowSize  = pSize;// new Size(900, 700);

            _genericTreeView     = pGenericTreeView;
            _genericTreeViewMode = pGenericTreeViewMode;
            //_actionAreaButtons = (pActionAreaButtons != null) ? pActionAreaButtons : GetDefaultActionAreaButtons();
            _actionAreaButtons = pActionAreaButtons;

            //Init Local Vars
            String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_select_record.png");
            Size   usefullAreaSize       = new Size(windowSize.Width - 14, windowSize.Height - 124);

            //Modify default genericTreeView properties
            _genericTreeView.SetSizeRequest(usefullAreaSize.Width, usefullAreaSize.Height);
            _genericTreeView.AllowRecordUpdate = false;
            //Format Columns FontSizes for Touch
            _genericTreeView.FormatColumnPropertiesForTouch();


            //Init Content
            Fixed fixedContent = new Fixed();

            fixedContent.Put(_genericTreeView, 0, 0);

            //Events
            this.KeyReleaseEvent += PosSelectRecordDialog_KeyReleaseEvent;

            //Capture EventHandlers from GenericTreeView
            _genericTreeView.CursorChanged   += _genericTreeView_CursorChanged;
            _genericTreeView.CheckBoxToggled += _genericTreeView_CheckBoxToggled;

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, windowSize, fixedContent, _genericTreeView.Navigator.TreeViewSearch, _actionAreaButtons);
        }
예제 #30
0
        //Constructor
        public PosKeyboardDialog(Window pSourceWindow, DialogFlags pDialogFlags, KeyboardMode pKeyboardMode, String pTextEntry, String pValidationRule) : base(pSourceWindow, pDialogFlags)
        {
            //Init Local Vars
            String windowTitle           = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_virtual_keyboard");
            Size   windowSize            = new Size(916, 358);
            String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_keyboard.png");
            String fileKeyboardXML       = FrameworkUtils.OSSlash(GlobalFramework.Path["keyboards"] + @"163.xml");

            //Init Content
            Fixed fixedContent = new Fixed();

            //Initialize Virtual Keyboard
            _keyboardPad = new KeyBoardPad(fileKeyboardXML);

            //Pack It
            fixedContent.Put(_keyboardPad, 0, 10);

            //Assign dialog to keyboard ParentDialog Public Properties
            _keyboardPad.ParentDialog = this;
            _keyboardPad.KeyboardMode = pKeyboardMode;

            //Assign Parameters
            if (pTextEntry != string.Empty)
            {
                _keyboardPad.TextEntry.Text = pTextEntry;
            }
            if (pValidationRule != string.Empty)
            {
                _keyboardPad.TextEntry.Rule = pValidationRule;
            }
            _keyboardPad.TextEntry.Validate();

            if (pKeyboardMode == KeyboardMode.AlfaPassword)
            {
                _keyboardPad.TextEntry.InvisibleChar = '*';
                _keyboardPad.TextEntry.Visibility    = false;
            }

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, windowSize, fixedContent, null);
        }