Exemplo n.º 1
0
        void TaskFormResize()
        {
            // Resize tabs
            tabs.SetBounds(8, 8, this.Width - 25, this.Height - 87);
            shapeLine.SetBounds(8, 8 + tabs.Height + 7, this.Width - 25, 1);
            btnCancel.SetBounds(this.Width - 16 - btnCancel.Width, 7 + tabs.Height + 16, btnCancel.Width, btnCancel.Height);
            btnOk.SetBounds(btnCancel.Left - 8 - btnOk.Width, btnCancel.Top, btnOk.Width, btnOk.Height);

            // Resize notes tab controls
            if (this.tabs.SelectedTab != tabNotes)
            {
                return;
            }
            shapeAccordionLeft.SetBounds(16, 16, 1, tabNotes.Height - 62);
            shapeAccordionRight.SetBounds(tabNotes.Width - 16, 16, 1, tabNotes.Height - 62);
            shapeAccordionTop.SetBounds(16, 16, tabNotes.Width - 32, 1);
            shapeAccordionBottom.SetBounds(16, tabNotes.Height - 46, tabNotes.Width - 31, 1);
            panAccordion.SetBounds(18, 18, shapeAccordionTop.Width - 3, shapeAccordionLeft.Height - 3);
            scrollAccordion.SetBounds(panAccordion.Width - scrollAccordion.Width, 0, scrollAccordion.Width, panAccordion.Height);
            accordion.SetBounds(0, 0, scrollAccordion.Left - 1, panAccordion.Height);
            btnDeleteNote.SetBounds(shapeAccordionBottom.Left + shapeAccordionBottom.Width - btnDeleteNote.Width, shapeAccordionBottom.Top + 8, btnDeleteNote.Width, btnDeleteNote.Height);
            btnNewNote.SetBounds(btnDeleteNote.Left - 8 - btnNewNote.Width, btnDeleteNote.Top, btnNewNote.Width, btnNewNote.Height);
            chkMonospace.SetBounds(16, btnNewNote.Top, chkMonospace.Width, chkMonospace.Height);
            chkWordWrap.SetBounds(Settings.Get("lang").ToString().Equals("it") ? 104 : 112, btnNewNote.Top, chkWordWrap.Width, chkWordWrap.Height);

            // Store notes window size
            Settings.Set("note_form_width", this.Width);
            Settings.Set("note_form_height", this.Height);
        }
Exemplo n.º 2
0
        public UpdatesForm(Languages.Language language, Utils.AppSettings settings)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Show first panel
            ShowPanel(panChecking);

            // Setup settings reference
            Settings = settings;

            // Setup language for the form
            Lang          = language;
            Text          = Lang.Get("updates");
            btnClose.Text = Lang.Get("close");

            // Language setup
            lblChecking.Text = Lang.Get("updates_checking") + "...";
            lblUpdated.Text  = Lang.Get("updates_updated");
            lblError.Text    = Lang.Get("updates_error");
            chkAuto.Text     = Lang.Get("updates_auto");

            // Auto check
            chkAuto.Checked         = (Settings.Get("updates_auto").ToString() == "1");
            chkAuto.CheckedChanged += delegate { Settings.Set("updates_auto", chkAuto.Checked ? 1 : 0); };
        }
Exemplo n.º 3
0
        public UpdatesForm(Languages.Language language, Utils.AppSettings settings)
        {
            // Windows Forms designer support.
            InitializeComponent();

            // Show first panel
            ShowPanel(panChecking);

            // Setup settings reference
            Settings = settings;

            // Setup language for the form
            Lang = language;
            Text = Lang.Get("updates");
            btnClose.Text = Lang.Get("close");

            // Language setup
            lblChecking.Text = Lang.Get("updates_checking") + "...";
            lblUpdated.Text = Lang.Get("updates_updated");
            lblError.Text = Lang.Get("updates_error");
            chkAuto.Text = Lang.Get("updates_auto");

            // Auto check
            chkAuto.Checked = (Settings.Get("updates_auto").ToString() == "1");
            chkAuto.CheckedChanged += delegate { Settings.Set("updates_auto", chkAuto.Checked ? 1 : 0); };
        }
Exemplo n.º 4
0
        /// <summary>
        /// Save settings
        /// </summary>
        /// <returns></returns>
        public bool Save()
        {
            // Change GUI settings
            Settings.Set("style_menu", cmbMenuStyle.SelectedIndex);
            Settings.Set("style_toolbar", cmbToolbarStyle.SelectedIndex);
            Settings.Set("style_categories", cmbCategoriesStyle.SelectedIndex);
            if (cmbCurrency.SelectedIndex == 0)
            {
                Settings.Set("currency", "€");
            }
            if (cmbCurrency.SelectedIndex == 1)
            {
                Settings.Set("currency", "$");
            }
            if (cmbCurrency.SelectedIndex == 2)
            {
                Settings.Set("currency", "£");
            }
            if (cmbCurrency.SelectedIndex == 3)
            {
                Settings.Set("currency", "¥");
            }
            if (cmbCurrency.SelectedIndex == 4)
            {
                Settings.Set("currency", "R$");
            }
            if (cmbCurrency.SelectedIndex == 5)
            {
                Settings.Set("currency", "฿");
            }

            // Change language
            foreach (Languages.AvailableLanguage l in Languages.AvailableLanguage.GetAll())
            {
                if (((Languages.AvailableLanguage)cmbLanguage.SelectedItem).Code == l.Code)
                {
                    Settings.Set("lang", l.Code);
                }
            }

            // Change backup settings
            Settings.Set("backup_automatic", (chkAutomaticBackup.Checked ? 1 : 0));

            // Change minimize settings
            Settings.Set("window_minimize_when_closing", (optClosingMinimize.Checked ? 1 : 0));

            // Return TRUE
            return(true);
        }