コード例 #1
0
ファイル: Program.cs プロジェクト: sergueik/xwt_swd
        static void Main(string[] args)
        {
            string dataFolderPath = Directory.GetCurrentDirectory();
            string database = String.Format("{0}\\data.db", dataFolderPath);
            dataSource = "data source=" + database;
            tableName = "product";

            tableName = "product";

            PlotHelper.createTable(dataSource,tableName);
            PlotHelper.TestConnection(dataSource);

            // TODO: add Xwt.WPF.dll to vendor directory
            Application.Initialize(ToolkitType.Gtk);
            Window MainWindow = new Window()
            {
                Title = "Xwt Demo Application",
                Width = 500,
                Height = 400
            };
            MainWindow.CloseRequested += (o, e) =>
            {
                Application.Exit();
            };
            Menu MainMenu = new Menu();
            RichTextView TextView = new RichTextView();
            MenuItem FileOpenMenuItem = new MenuItem("???????");
            Menu FileMenu = new Menu();
            FileOpenMenuItem.Clicked += (o, e) =>
            {
                OpenFileDialog Dialog = new OpenFileDialog("??????? ????");
                if (Dialog.Run(MainWindow))
                {
                    TextView.LoadFile(Dialog.FileName, Xwt.Formats.TextFormat.Markdown);
                }
            };
            MenuItem FileMenuItem = new MenuItem("????") { SubMenu = FileMenu };
            FileMenu.Items.Add(FileOpenMenuItem);
            MainMenu.Items.Add(FileMenuItem);

            MainWindow.MainMenu = MainMenu;
            var n = new NotebookSample();

            MainWindow.Content = n;

            MainWindow.Show();
            Application.Run();
        }
コード例 #2
0
ファイル: HelpWindow.cs プロジェクト: residuum/MonoMultiJack
 public HelpWindow()
 {
     VBox mainContent = new VBox ();
     _messageDisplay = new RichTextView {
         WidthRequest = 500
     };
     ScrollView scroller = new ScrollView (_messageDisplay) {
         VerticalScrollPolicy = ScrollPolicy.Automatic,
                      HorizontalScrollPolicy = ScrollPolicy.Never,
                      HeightRequest = 500
     };
     mainContent.PackStart (scroller);
     HBox buttonRow = new HBox ();
     Button ok = new Button {
         Label = I18N._ ("Close"),
               Image = Icons.Ok
     };
     ok.Clicked += (sender, args) => Close ();
     buttonRow.PackEnd (ok);
     mainContent.PackEnd (buttonRow);
     Content = mainContent;
     Width = 400;
 }
コード例 #3
0
ファイル: TextViewerWindow.cs プロジェクト: fourtf/4Plug
        public TextViewerWindow(string path)
        {
            Icon = App.Icon;

            Title = path + " (ESC to close)";

            bool isMd = path.ToUpper().EndsWith(".MD");

            var rtv = new RichTextView();
            var scroll = new ScrollView(rtv);
            Content = scroll;

            try
            {
                rtv.LoadFile(path, isMd ? TextFormat.Markdown : ProperPlainTextFormat.Proper);
            }
            catch { }

            rtv.KeyPressed += (s, e) => { if (e.Key == Key.Escape) Close(); };

            Width = 800;
            Height = 550;
        }
コード例 #4
0
            void BuildContent(string license)
            {
                double textWidth = 480;
                double textHeight = 480;
                VBox mainContent = new VBox ();

                RichTextView textView = new RichTextView ();
                textView.LoadText (license, TextFormat.Markdown);
                textView.MinWidth = textWidth;
                ScrollView scroller = new ScrollView (textView);
                scroller.HorizontalScrollPolicy = ScrollPolicy.Never;
                scroller.VerticalScrollPolicy = ScrollPolicy.Automatic;
                scroller.MinHeight = textHeight;
                scroller.MinWidth = textWidth + textView.MarginLeft + textView.MarginRight + 20;
                mainContent.PackStart (scroller);

                HBox buttonRow = new HBox ();
                Button ok = new Button { Label = I18N._ ("Close"), Image = Icons.Ok };
                ok.Clicked += (sender, args) => Close ();
                buttonRow.PackEnd (ok);
                mainContent.PackEnd (buttonRow);

                Content = mainContent;
            }
コード例 #5
0
ファイル: LicensesWindow.cs プロジェクト: fourtf/4Plug
        public LicensesWindow()
        {
            Icon = App.Icon;

            var vbox = new VBox();
            var scroll = new ScrollView(vbox);
            Content = scroll;

            Width = 600;
            Height = 500;

            Title = "Licenses";

            Font labelFont;
            RichTextView rtv;

            // XWT FRAMEWORK
            var lbl = new LinkLabel() { Text = "Xwt Framework", Uri = new Uri("https://github.com/mono/xwt/") };
            labelFont = lbl.Font = lbl.Font.WithScaledSize(2);
            vbox.PackStart(lbl);
            vbox.PackStart(rtv = new RichTextView() { MarginLeft = 8 });
            rtv.LoadText(@"The MIT License (MIT)

            Copyright (c) 2014 Xamarin, Inc

            Permission is hereby granted, free of charge, to any person obtaining a copy
            of this software and associated documentation files (the ""Software""), to deal
            in the Software without restriction, including without limitation the rights
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
            copies of the Software, and to permit persons to whom the Software is
            furnished to do so, subject to the following conditions:

            The above copyright notice and this permission notice shall be included in all
            copies or substantial portions of the Software.

            THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
            SOFTWARE.", ProperPlainTextFormat.Proper);

            //vbox.PackStart(new LinkLabel() { Font = labelFont, Text = "Splashy Icons", Uri = new Uri("http://splashyfish.com/icons/") });
            //vbox.PackStart(rtv = new RichTextView() { MarginLeft = 8 });
            //rtv.LoadText(@"It's free as in free.", ProperPlainTextFormat.Proper);

            //            vbox.PackStart(new LinkLabel() { Font = labelFont, Text = "DefaultIcon", Uri = new Uri("http://www.defaulticon.com/") });
            //            vbox.PackStart(rtv = new RichTextView() { MarginLeft = 8 });
            //            rtv.LoadText(@"Released under ""Creative Commons Attribution-No Derivative Works 3.0.""
            //No changes where made to the images.", ProperPlainTextFormat.Proper);
            //
            //            vbox.PackStart(new LinkLabel(){ MarginLeft = 14, Text="http://creativecommons.org/licenses/by-nd/3.0/", Uri = new Uri("http://creativecommons.org/licenses/by-nd/3.0/")});
            //            vbox.PackStart(new LinkLabel() { MarginLeft = 14, Text = "http://creativecommons.org/licenses/by-nd/3.0/legalcode", Uri = new Uri("http://creativecommons.org/licenses/by-nd/3.0/legalcode") });

            vbox.PackStart(new LinkLabel() { Font = labelFont, Text = "ZipStorer", Uri = new Uri("http://zipstorer.codeplex.com/") });
            vbox.PackStart(rtv = new RichTextView() { MarginLeft = 8 });
            rtv.LoadText(@"The code/library supplied is totally free for either personal or commercial use, with no warranties.
            Please use the ""Powered by ZipStorer"" logo (below) wherever is possible, pointing to this site.", ProperPlainTextFormat.Proper);
            ImageView imgView;
            vbox.PackStart(imgView = new ImageView(Resources.GetImage("zipstorer.png")));
        }
コード例 #6
0
ファイル: builder.cs プロジェクト: sharpend/Sharpend
	  /******************************************
			THIS IS AUTO GENERATED CODE BY GLADEBUILDER
			DO NOT EDIT
			USE THE IMPLEMENTATION CLASS INSTEAD
	  *******************************************/
	  namespace GladeBuilder
コード例 #7
0
        void BuildWidget()
        {
            VBox vbox = new VBox {
                ExpandVertical = true,
                           ExpandHorizontal = true
            };

            HBox buttonBox = new HBox ();
            _connectButton = new Button (Icons.Connect, I18N._ ("Connect"));
            buttonBox.PackStart (_connectButton);
            _disconnectButton = new Button (Icons.Disconnect, I18N._ ("Disconnect"));
            buttonBox.PackStart (_disconnectButton);
            vbox.PackStart (buttonBox);

            _inTreeView = new ConnectableTreeView ();
            _outTreeView = new ConnectableTreeView ();

            _connectionArea = new ConnectionArea (_outTreeView, _inTreeView) {
                MinWidth = 200,
                     MinHeight = 200,
                     ExpandVertical = true,
                     ExpandHorizontal = true
            };
            HBox connectionBox = new HBox {
                ExpandVertical = true,
                           ExpandHorizontal = true
            };
            connectionBox.PackStart (_outTreeView, false, false);
            connectionBox.PackStart (_connectionArea, true, true);
            connectionBox.PackStart (_inTreeView, false, false);
            vbox.PackStart (connectionBox, true, true);

            _messageDisplay = new RichTextView ();
            _messageContainer = new ScrollView (_messageDisplay) {
                HorizontalScrollPolicy = ScrollPolicy.Never,
                               VerticalScrollPolicy = ScrollPolicy.Automatic,
                               HeightRequest = 40,
                               BorderVisible = true,
                               Margin = 2
            };
            _messageContainer.Hide ();
            vbox.PackEnd (_messageContainer);

            Content = vbox;
            ExpandHorizontal = true;
            ExpandVertical = true;
        }
コード例 #8
0
ファイル: CharDialog.GUI.cs プロジェクト: cra0zy/SFEditor
        private void Build(Image icon, char start, char end)
        {
            if (icon != null)
                this.Icon = icon;

            this.Title = "Character Region Selection Dialog";
            this.Padding = 0;
            this.Width = 400;
            this.Height = 300;

            vbox1 = new VBox();

            if(Toolkit.CurrentEngine.Type == ToolkitType.Wpf)
                vbox1.BackgroundColor = (new Button()).BackgroundColor;

            hbox1 = new HBox();
            hbox1.MarginTop = 6;
            hbox1.MarginRight = 6;
            hbox1.MarginLeft = 6;
            hbox1.Spacing = 8;

            vbox2 = new VBox();

            label1 = new Label("Start Character:");
            vbox2.PackStart(label1);

            char1 = new CharWidget(start);
            vbox2.PackStart(char1);

            hbox1.PackStart(vbox2, true);

            hbox1.PackStart(new VSeparator());

            vbox3 = new VBox();

            label2 = new Label("End Character:");
            vbox3.PackStart(label2);

            char2 = new CharWidget(end);
            vbox3.PackStart(char2, true);

            hbox1.PackStart(vbox3, true);

            vbox1.PackStart(hbox1);

            label3 = new Label("Preview of characters to include (Max 300):");
            label3.MarginLeft = 4;
            vbox1.PackStart(label3);

            rich1 = new RichTextView();

            scroll1 = new ScrollView();
            scroll1.Content = rich1;

            vbox1.PackStart(scroll1, true);

            this.Content = vbox1;
            rich1.SetFocus();

            buttonOk = new DialogButton(Command.Ok);
            this.Buttons.Add(buttonOk);

            buttonCancel = new DialogButton(Command.Cancel);
            this.Buttons.Add(buttonCancel);
        }