public LauncherWindow() { this.Title = "TrueCraft Launcher"; this.Width = 1200; this.Height = 576; this.User = new TrueCraftUser(); MainContainer = new HBox(); WebScrollView = new ScrollView(); WebView = new WebView("http://truecraft.io/updates"); LoginView = new LoginView(this); OptionView = new OptionView(this); MultiplayerView = new MultiplayerView(this); SingleplayerView = new SingleplayerView(this); InteractionBox = new VBox(); using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft_logo.svg")) TrueCraftLogoImage = new ImageView(Image.FromStream(stream)); WebScrollView.Content = WebView; MainContainer.PackStart(WebScrollView, true); InteractionBox.PackStart(TrueCraftLogoImage); InteractionBox.PackEnd(LoginView); MainContainer.PackEnd(InteractionBox); this.Content = MainContainer; }
public WebViewSample() { var wb = new WebView ("http://www.xamarin.com"); wb.WidthRequest = 600; wb.HeightRequest = 900; PackStart (wb, true); }
public LauncherWindow() { this.Title = "TrueCraft Launcher"; this.Width = 1200; this.Height = 576; this.User = new TrueCraftUser(); MainContainer = new HBox(); WebScrollView = new ScrollView(); WebView = new WebView("http://truecraft.io/updates"); LoginView = new LoginView(this); OptionView = new OptionView(this); MultiplayerView = new MultiplayerView(this); SingleplayerView = new SingleplayerView(this); WebScrollView.Content = WebView; MainContainer.PackStart(WebScrollView, true); MainContainer.PackEnd(LoginView); this.Content = MainContainer; }
public WebViewSample() { var wb = new WebView ("http://www.xamarin.com"); PackStart (wb, true); }
private void Build() { this.Icon = Xwt.Drawing.Image.FromResource("URMSimulator.Resources.urm.png"); this.Title = "URM Simulator"; this.Width = 800; this.Height = 600; this.Padding = 0; vbox1 = new VBox(); vpanned1 = new VPaned(); te1 = new TextEditor(); te1.Document.MimeType = "text/x-urm"; te1.Document.Text = savedContent; te1.OnUndoRedoStackChanged += (sender, e) => ReloadMenuAndTitleEnding(); vpanned1.Panel1.Content = te1; vpanned1.Panel1.Resize = true; vbox2 = new VBox(); label1 = new Label("Input:"); label1.MarginLeft = 5; vbox2.PackStart(label1, false); entry1 = new TextEntry(); entry1.PlaceholderText = "0 0 0 0 0 0 0 0 0 0"; vbox2.PackStart(entry1, false); hbox1 = new HBox(); label2 = new Label("Output:"); label2.MarginLeft = 5; hbox1.PackStart(label2, true); label3 = new Label("Register length:"); hbox1.PackStart(label3, false); sb1 = new SpinButton(); sb1.MinimumValue = 1; sb1.Digits = 0; sb1.IncrementValue = 1; sb1.MaximumValue = 100; sb1.Value = regCount; sb1.ValueChanged += (sender, e) => regCount = (int)sb1.Value; sb1.TextInput += (sender, e) => regCount = (int)sb1.Value; hbox1.PackStart(sb1, false); vbox2.PackStart(hbox1, false); scroll1 = new ScrollView(); scroll1.HeightRequest = 80; scroll1.VerticalScrollPolicy = ScrollPolicy.Never; scroll1.BorderVisible = true; web1 = new WebView(); web1.WidthRequest = 2000; scroll1.Content = web1; vbox2.PackStart(scroll1, true); vpanned1.Panel2.Content = vbox2; vpanned1.Panel2.Resize = false; if (Toolkit.CurrentEngine.Type == ToolkitType.Wpf) vpanned1.Position = this.Height - 120; vbox1.PackStart(vpanned1, true); button1 = new Button("Continue Debugging"); button1.Visible = false; button1.Clicked += (sender, e) => ContinueDebugging(); vbox1.PackStart(button1, false); this.Content = vbox1; te1.SetFocus(); BuildMenu(); }
private void Build() { if(Toolkit.CurrentEngine.Type == ToolkitType.Wpf) this.BackgroundColor = (new Button()).BackgroundColor; vbox1 = new VBox(); label1 = new Label("Select Font:"); label1.MarginTop = 4; label1.MarginRight = 4; label1.MarginLeft = 4; vbox1.PackStart(label1); table1 = new Table(); table1.MarginRight = 4; table1.MarginLeft = 4; radioButton1 = new RadioButton("From System: "); table1.Add(radioButton1, 0, 0); combo_font = new ComboBox(); List<string> fonts = new List<string>(); foreach (System.Drawing.FontFamily font in System.Drawing.FontFamily.Families) fonts.Add(font.Name); fonts.Sort(); foreach (string font in fonts) combo_font.Items.Add(font); if(combo_font.Items.Contains("Arial")) combo_font.SelectedText = "Arial"; else if(combo_font.Items.Count > 0) combo_font.SelectedIndex = 0; combo_font.Font = Xwt.Drawing.Font.FromName(combo_font.SelectedText).WithSize(combo_font.Font.Size); table1.Add(combo_font, 1, 0, 1, 1, true); radioButton2 = new RadioButton(); radioButton2.Label = "From File: "; radioButton2.Sensitive = true; radioButton2.Group = radioButton1.Group; table1.Add(radioButton2, 0, 1); hbox1 = new HBox(); entry_font = new TextEntry(); entry_font.Sensitive = false; hbox1.PackStart(entry_font, true); button_font = new Button("Browse"); button_font.Sensitive = false; hbox1.PackStart(button_font); table1.Add(hbox1, 1, 1); vbox1.PackStart(table1); notebook1 = new Notebook(); notebook1.ExpandHorizontal = true; notebook1.ExpandVertical = true; table2 = new Table(); table2.Margin = 4; label4 = new Label("Style:"); table2.Add(label4, 0, 0); hbox2 = new HBox(); check_bold = new CheckBox("Bold "); check_bold.BackgroundColor = Color.FromBytes(0, 0, 0, 0); hbox2.PackStart(check_bold); check_italic = new CheckBox("Italic "); check_italic.BackgroundColor = Color.FromBytes(0, 0, 0, 0); hbox2.PackStart(check_italic); check_kerning = new CheckBox("Kerning "); check_kerning.BackgroundColor = Color.FromBytes(0, 0, 0, 0); hbox2.PackStart(check_kerning); table2.Add(hbox2, 0, 1, 1, 1); label2 = new Label("Size:"); table2.Add(label2, 0, 2); entry_size = new NumericEntry("0", "WARNING: Size needs to be a number"); table2.Add(entry_size, 0, 3, 1, 1, true); label3 = new Label("Spacing:"); table2.Add(label3, 0, 4); entry_spacing = new NumericEntry("0", "WARNING: Spacing needs to be a number"); table2.Add(entry_spacing, 0, 5, 1, 1, true); check_defchar = new CheckBox("Default Character:"); check_defchar.BackgroundColor = Color.FromBytes(0, 0, 0, 0); table2.Add(check_defchar, 0, 6); entry_defchar = new TextEntry(); entry_defchar.Sensitive = false; entry_defchar.TextAlignment = Alignment.Center; table2.Add(entry_defchar, 0, 7, 1, 1, true); notebook1.Add(table2, "Global"); hbox3 = new HBox(); listView1 = new ListView(); hbox3.PackStart(listView1, true); vbox2 = new VBox(); vbox2.MarginRight = 5; vbox2.MarginTop = 5; label8 = new Label(" Main:"); vbox2.PackStart(label8); button_plus = new Button("Add"); vbox2.PackStart(button_plus); button_minus = new Button("Remove"); button_minus.Sensitive = false; vbox2.PackStart(button_minus); button_edit = new Button("Edit"); button_edit.Sensitive = false; vbox2.PackStart(button_edit); vbox2.PackStart(new HSeparator()); label9 = new Label(" Move:"); vbox2.PackStart(label9); button_up = new Button("Up"); button_up.Sensitive = false; vbox2.PackStart(button_up); button_down = new Button("Down"); button_down.Sensitive = false; vbox2.PackStart(button_down); hbox3.PackStart(vbox2); notebook1.Add(hbox3, "Characters"); var pa = new VBox(); textEditor1 = new TextEditor(); textEditor1.Document.MimeType = "application/xml"; pa.PackStart(textEditor1, true); notebook1.Add(pa, "Xml"); vbox3 = new VBox(); hbox4 = new HBox(); hbox4.Margin = 5; label5 = new Label("Font Color: "); hbox4.PackStart(label5); color_font = new ColorPicker(); color_font.Color = Color.FromBytes(0, 0, 0); color_font.SupportsAlpha = false; hbox4.PackStart(color_font); label6 = new Label("Background Color: "); hbox4.PackStart(label6); color_back = new ColorPicker(); color_back.Color = Color.FromBytes(224, 224, 209); color_back.SupportsAlpha = false; hbox4.PackStart(color_back); vbox3.PackStart(hbox4); hbox5 = new HBox(); hbox5.MarginLeft = 5; hbox5.MarginRight = 5; label7 = new Label("Text: "); hbox5.PackStart(label7); entry_text = new TextEntry(); entry_text.Text = "The quick brown fox jumps over the lazy dog"; hbox5.PackStart(entry_text, true); button_preview = new Button("Preview"); hbox5.PackStart(button_preview); vbox3.PackStart(hbox5); web1 = new WebView(); scrollView2 = new ScrollView(); scrollView2.HorizontalScrollPolicy = ScrollPolicy.Automatic; scrollView2.VerticalScrollPolicy = ScrollPolicy.Automatic; if (Toolkit.CurrentEngine.Type != ToolkitType.Gtk) scrollView2.Content = web1; vbox3.PackStart(scrollView2, true); notebook1.Add(vbox3, "Preview"); vbox1.PackStart(notebook1, true); this.Content = vbox1; }