Beispiel #1
0
        /// <summary>Initialize RPD. Please be careful with threads - run only in the UI thread! Otherwise there will be bugs</summary>
        /// <param name="filename">The both files' name</param>
        public ReplaceQuestionDialog(string filename)
        {
            /* Why the warning about threads? When calling the RPD form thread, different than that where it's created,
             * an exception throws (due to illegal cross-thread call). If the RPD is created in a thread,
             * that is not the program's main thread (UI thread), the RPD works, but the window's or widgets'
             * sizes may be (and, at many times, are) invalid. To prevent this, the best practice is
             * to create & use the RPD instances only in the UI thread. A.T. 14 jun 2014. */

            this.Content = Layout;
            Layout.Add(cmdReplace, 0, 1);
            Layout.Add(cmdReplaceAll, 0, 2);
            Layout.Add(cmdSkip, 1, 1);
            Layout.Add(cmdSkipAll, 1, 2);
            Layout.Add(cmdReplaceOld, 2, 2);
            Layout.Add(cmdCompare, 2, 1);
            Layout.Add(lblAsk, 0, 0, 1, 3);
            this.Buttons.Add(Xwt.Command.Cancel);

            Title               = Locale.GetString("ReplaceQDTitle");
            lblAsk.Text         = String.Format(Locale.GetString("ReplaceQDText"), filename);
            cmdReplace.Label    = Locale.GetString("ReplaceQDReplace");
            cmdReplaceAll.Label = Locale.GetString("ReplaceQDReplaceAll");
            cmdReplaceOld.Label = Locale.GetString("ReplaceQDReplaceOld");
            cmdSkip.Label       = Locale.GetString("ReplaceQDSkip");
            cmdSkipAll.Label    = Locale.GetString("ReplaceQDSkipAll");
            cmdCompare.Label    = Locale.GetString("ReplaceQDCompare");

            cmdReplace.Clicked    += (o, ea) => { Choose(ClickedButton.Replace); };
            cmdReplaceAll.Clicked += (o, ea) => { Choose(ClickedButton.ReplaceAll); };
            cmdReplaceOld.Clicked += (o, ea) => { Choose(ClickedButton.ReplaceOld); };
            cmdSkip.Clicked       += (o, ea) => { Choose(ClickedButton.Skip); };
            cmdSkipAll.Clicked    += (o, ea) => { Choose(ClickedButton.SkipAll); };
            Buttons[0].Clicked    += (o, ea) => { Choose(ClickedButton.Cancel); };
        }
Beispiel #2
0
        public PlainText()         //constructor
        {
            ScrollBox = new Xwt.ScrollView(RTV);
            Layout.Add(ScrollBox, 0, 1, 1, 3, true, true);

            Layout.Add(lblFileName, 0, 0);
            Layout.Add(mbMode, 1, 0);
            Layout.Add(mbCodepage, 2, 0);

            foreach (EncodingInfo cp in Encoding.GetEncodings())
            {
                Xwt.MenuItem mi = new Xwt.MenuItem();
                mi.Tag      = cp.CodePage;
                mi.Label    = "CP" + cp.CodePage + " - " + cp.DisplayName;
                mi.Clicked += new EventHandler(Codepage_Clicked);
                mnuFormat.Items.Add(mi);
            }
            mbCodepage.Menu = mnuFormat;
        }
Beispiel #3
0
        protected override void OnDataChanged(ResXData data)
        {
            base.OnDataChanged(data);

            container.Clear();

            int row = 0;
            int col = 0;

            // smart resizing
            foreach (var node in data.Nodes)
            {
                names.Add(node.Name);
                if (SkipNode(node))
                {
                    continue;
                }

                var image = GetImage(node);
                if (image == null)
                {
                    continue;
                }

#if TABLE
                container.Add(CreateItem(node.Name, image), col++, row);
                if (col == 3)
                {
                    col = 0;
                    row++;
                }
#else
                container.PackStart(CreateItem(node.Name, image));
#endif
            }
        }
Beispiel #4
0
        public swtMainWindowColumns()
        {
            box.PackStart(fraExtensions);
            box.PackStart(fraTabs);
            box.PackStart(fraOther);
            fraExtensions.Content = fraExtensionsBox;
            fraExtensions.Label   = Locale.GetString("SWTMWCFileExtView");
            fraTabs.Content       = fraTabsBox;
            fraTabs.Label         = Locale.GetString("SWTMWCCollumns");
            fraOther.Content      = fraOtherBox;

            optDisplayExtTogether.Group = rbgExtensionDisplayStyle;
            optDisplayExtFar.Group      = rbgExtensionDisplayStyle;
            optDisplayExtTogether.Label = Locale.GetString("SWTMWCExtTogether");
            optDisplayExtFar.Label      = Locale.GetString("SWTMWCExtFar");
            fraExtensionsBox.PackStart(optDisplayExtTogether);
            fraExtensionsBox.PackStart(optDisplayExtFar);

            fraTabsBox.Add(new Xwt.Label(Locale.GetString("SWTMWCExt")), 0, 0);
            fraTabsBox.Add(txtTabExtension, 1, 0);

            fraTabsBox.Add(new Xwt.Label(Locale.GetString("SWTMWCSize")), 0, 1);
            fraTabsBox.Add(txtTabSize, 1, 1);

            fraTabsBox.Add(new Xwt.Label(Locale.GetString("SWTMWCDate")), 0, 2);
            fraTabsBox.Add(txtTabDate, 1, 2);

            fraTabsBox.Add(new Xwt.Label(Locale.GetString("SWTMWCFileMode")), 0, 3);
            fraTabsBox.Add(txtTabFilemode, 1, 3);


            chkExpandName.Label       = Locale.GetString("SWTMWCExpandName");
            chkShowCentury.Label      = Locale.GetString("SWTMWCShowCentury");
            chkShowTimeAs12h.Label    = Locale.GetString("SWTMWCShowTimeAs12h");
            chkShowDirsInStatus.Label = Locale.GetString("SWTMWCShowDirsInStatus");

            fraOtherBox.Add(chkExpandName, 0, 0);
            fraOtherBox.Add(chkShowCentury, 0, 1);
            fraOtherBox.Add(chkShowTimeAs12h, 0, 2);
            fraOtherBox.Add(chkShowDirsInStatus, 0, 3);

            cmbPanelSizeDisplay.Items.Add("000", Locale.GetString("SizeDisplayPolicy000"));
            cmbPanelSizeDisplay.Items.Add("100", Locale.GetString("SizeDisplayPolicy100"));
            cmbPanelSizeDisplay.Items.Add("200", Locale.GetString("SizeDisplayPolicy200"));
            cmbPanelSizeDisplay.Items.Add("111", Locale.GetString("SizeDisplayPolicy111"));
            cmbPanelSizeDisplay.Items.Add("222", Locale.GetString("SizeDisplayPolicy222"));
            cmbPanelSizeDisplay.Items.Add("110", Locale.GetString("SizeDisplayPolicy110"));
            cmbPanelSizeDisplay.Items.Add("220", Locale.GetString("SizeDisplayPolicy220"));

            /*
             * SizeDisplayPolicy000=bytes
             * SizeDisplayPolicy100=kbytes
             * SizeDisplayPolicy200=kbytes (x.xx KB)
             * SizeDisplayPolicy111=dynamic (x.x К/М/Г)
             * SizeDisplayPolicy222=dynamic (x.xx К/М/Г)
             * SizeDisplayPolicy110=dynamic (x.x К/М)
             * SizeDisplayPolicy220=dynamic (x.xx K/M)
             */

            fraOtherBox.Add(new Xwt.Label(Locale.GetString("SWTMWCSizeDisplay")), 0, 4);
            fraOtherBox.Add(cmbPanelSizeDisplay, 1, 4);
            fraOtherBox.Add(new Xwt.Label(Locale.GetString("SWTMWCMaxHumanSizeStatus")), 0, 5);
            fraOtherBox.Add(txtMaxHumanySizeInStatus, 1, 5);


            //load settings

            switch (fcmd.Properties.Settings.Default.SizeShorteningPolicy)
            {
            case "000":
                cmbPanelSizeDisplay.SelectedIndex = 0;
                break;

            case "100":
                cmbPanelSizeDisplay.SelectedIndex = 1;
                break;

            case "200":
                cmbPanelSizeDisplay.SelectedIndex = 2;
                break;

            case "111":
                cmbPanelSizeDisplay.SelectedIndex = 3;
                break;

            case "222":
                cmbPanelSizeDisplay.SelectedIndex = 4;
                break;

            case "110":
                cmbPanelSizeDisplay.SelectedIndex = 5;
                break;

            case "220":
                cmbPanelSizeDisplay.SelectedIndex = 6;
                break;
            }
        }