Пример #1
0
        public override Gtk.Widget CreatePanelWidget ()
        {
            Gtk.VBox box = new Gtk.VBox ();
            box.Spacing = 6;

            Gtk.HBox labelBox = new Gtk.HBox ();

            Gtk.Label label = CreateLabel ("Android studio executable location:");

            labelBox.PackStart (label, false, false, 0);

            entry = new FileEntry ();
            entry.Path = AddInPreferences.AndroidStudioLocation;


            Gtk.HBox sdkVersions = new Gtk.HBox ();
            Gtk.Label minSdkLabel = CreateLabel ("Min SDK version:");
            MinSdkEntry = new Gtk.Entry (AddInPreferences.MinSdkVersion);
            Gtk.Label targetSdkLabel = CreateLabel ("Target/Compile SDK version:");
            TargetSdkEntry = new Gtk.Entry (AddInPreferences.CompileSdkVersion);


            sdkVersions.PackStart (minSdkLabel, false, false, 0);
            sdkVersions.PackStart (MinSdkEntry, true, false, 0);
            sdkVersions.PackStart (targetSdkLabel, false, false, 0);
            sdkVersions.PackStart (TargetSdkEntry, true, false, 0);


            Gtk.HBox otherVersions = new Gtk.HBox ();
            Gtk.Label supportVersionLabel = CreateLabel ("Support library versions:");
            SupportVersionEntry = new Gtk.Entry (AddInPreferences.SupportVersion);
            Gtk.Label buildToolsVersionLabel = CreateLabel ("Build tools version:");
            BuildToolsVersionEntry = new Gtk.Entry (AddInPreferences.BuildToolsVersion);


            otherVersions.PackStart (supportVersionLabel, false, false, 0);
            otherVersions.PackStart (SupportVersionEntry, true, false, 0);
            otherVersions.PackStart (buildToolsVersionLabel, false, false, 0);
            otherVersions.PackStart (BuildToolsVersionEntry, true, false, 0);

            box.PackStart (labelBox, false, false, 0);
            box.PackStart (entry, false, false, 0);
            box.PackStart (sdkVersions, false, false, 0);
            box.PackStart (otherVersions, false, false, 0);
            box.ShowAll ();
            return box;

        }
		void Build ()
		{
			Title = "Tizen SDK Info";
			BorderWidth = 6;

			deviceEntry = new Entry () { ActivatesDefault = true };
			sdkFolderEntry = new FolderEntry ();
			monoX86Entry = new FileEntry ();
			monoArmEntry = new FileEntry ();
			authorKeyEntry = new FileEntry ();
			authorPassEntry = new Entry () { Visibility = false, ActivatesDefault = true };

			var sdkFolderLabel = new Label ("_SDK Installation Folder:") {
				Xalign = 0,
				Justify = Justification.Left,
				UseUnderline = true,
				MnemonicWidget = sdkFolderEntry
			};
			var monoX86Label = new Label ("_Mono Runtime Bundle (x86):") {
				Xalign = 0,
				Justify = Justification.Left,
				UseUnderline = true,
				MnemonicWidget = monoX86Entry
			};
			var monoArmLabel = new Label ("_Mono Runtime Bundle (ARM):") {
				Xalign = 0,
				Justify = Justification.Left,
				UseUnderline = true,
				MnemonicWidget = monoArmEntry
			};
			var authorKeyLabel = new Label ("_Author Key:") {
				Xalign = 0,
				Justify = Justification.Left,
				UseUnderline = true,
				MnemonicWidget = authorKeyEntry
			};
			var authorPassLabel = new Label ("_Author Key Password:"******"_Device ID:") {
				Xalign = 0,
				Justify = Justification.Left,
				UseUnderline = true,
				MnemonicWidget = deviceEntry
			};

			var table = new Table (2, 5, false);
			var fill = AttachOptions.Expand | AttachOptions.Fill;
			var none = AttachOptions.Shrink;
			var expand = AttachOptions.Expand;

			table.Attach (sdkFolderLabel,   0, 1, 0, 1, expand, none, 2, 2);
			table.Attach (sdkFolderEntry,   1, 2, 0, 1, fill,   none, 2, 2);
			table.Attach (monoX86Label,     0, 1, 1, 2, expand, none, 2, 2);
			table.Attach (monoX86Entry,     1, 2, 1, 2, fill,   none, 2, 2);
			table.Attach (monoArmLabel,     0, 1, 2, 3, expand, none, 2, 2);
			table.Attach (monoArmEntry,     1, 2, 2, 3, fill,   none, 2, 2);
			table.Attach (authorKeyLabel,   0, 1, 3, 4, expand, none, 2, 2);
			table.Attach (authorKeyEntry,   1, 2, 3, 4, fill,   none, 2, 2);
			table.Attach (authorPassLabel,  0, 1, 4, 5, expand, none, 2, 2);
			table.Attach (authorPassEntry,  1, 2, 4, 5, fill,   none, 2, 2);
			table.Attach (deviceLabel,      0, 1, 5, 6, expand, none, 2, 2);
			table.Attach (deviceEntry,      1, 2, 5, 6, fill,   none, 2, 2);

			VBox.PackStart (new Label ("Tizen Project Setup:"), true, false, 6);
			VBox.PackStart (table, true, false, 6);

			cancelButton = new Button (Gtk.Stock.Cancel);
			this.AddActionWidget (cancelButton, ResponseType.Cancel);
			okButton = new Button (Gtk.Stock.Ok) { CanDefault = true };
			this.AddActionWidget (okButton, ResponseType.Ok);
			okButton.HasDefault = true;

			ShowAll ();

			Resize (400, 80);
			Resizable = false;
		}
		public NewProjectOptionsWidget ()
		{
			Stetic.BinContainer.Attach (this);
			
			AttachOptions fill = AttachOptions.Fill;
			AttachOptions expand = AttachOptions.Expand | fill;
			AttachOptions shrink = AttachOptions.Shrink;
			
			var table = new Table (5, 3, false) {
				ColumnSpacing = 4,
				RowSpacing = 4,
			};
			uint row = 0;
			
			var header = new Label (GettextCatalog.GetString ("<b>Project Options</b>")) {
				Xalign = 0,
				UseMarkup = true,
			};
			table.Attach (header, 0, 3, row, row + 1, expand, shrink, 0, 0);
			
			row++;
			
			nameEntry = new Entry ();
			nameEntry.Changed += NameChanged;
			var nameLabel = new Label (GettextCatalog.GetString ("N_ame:")) {
				UseUnderline = true,
				MnemonicWidget = nameEntry,
				Xalign = 0,
			};
			table.Attach (nameLabel, 0, 1, row, row+1, fill, shrink, 0, 0);
			table.Attach (nameEntry, 1, 3, row, row+1, expand, shrink, 0, 0);
			
			row++;
			
			locationEntry = new FileEntry ();
			locationEntry.PathChanged += delegate {
				UpdateState ();
			};
			var locationLabel = new Label (GettextCatalog.GetString ("L_ocation:")) {
				UseUnderline = true,
				MnemonicWidget = locationEntry,
				Xalign = 0,
			};
			table.Attach (locationLabel, 0, 1, row, row+1, fill, shrink, 0, 0);
			table.Attach (locationEntry, 1, 3, row, row+1, expand, shrink, 0, 0);
			
			solutionNameEntry = new Entry ();
			solutionNameEntry.Sensitive = false;
			solutionNameEntry.Changed += delegate {
				UpdateState ();
			};
			solutionNameLabel = new Label (GettextCatalog.GetString ("_Solution name:")) {
				UseUnderline = true,
				MnemonicWidget = solutionNameEntry,
				Xalign = 0,
			};
			createSolutionDirectoryCheck = new CheckButton (GettextCatalog.GetString ("_Create directory for solution")) {
				UseUnderline = true,
			};
			createSolutionDirectoryCheck.Toggled += delegate {
				solutionNameEntry.Sensitive = createSolutionDirectoryCheck.Active;
				UpdateState ();
			};
			
			row++;
			
			table.Attach (solutionNameLabel, 0, 1, row, row+1, fill, shrink, 0, 0);
			table.Attach (solutionNameEntry, 1, 2, row, row+1, expand, shrink, 0, 0);
			table.Attach (createSolutionDirectoryCheck, 2, 3, row, row+1, fill, shrink, 0, 0);
			
			row++;
			
			saveInLabel = new Label () {
				Xalign = 0,
			};
			table.Attach (saveInLabel, 1, 3, row, row+1, fill, shrink, 0, 0);
			
			table.ShowAll ();
			this.Add (table);
		}