• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Gtk.Dialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Gtk.Dialog的典型用法代码示例。如果您正苦于以下问题:C# Dialog类的具体用法?C# Dialog怎么用?C# Dialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Dialog类属于Gtk命名空间,在下文中一共展示了Dialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnAddPls

 public void OnAddPls()
 {
     Hyena.Log.Information ("add playlist");
     Gtk.Dialog dlg=new Gtk.Dialog();
     dlg.Title="Add Playlist";
     Gtk.Entry pls=new Gtk.Entry();
     pls.WidthChars=40;
     Gtk.Label lbl=new Gtk.Label("Playlist name:");
     Gtk.HBox hb=new Gtk.HBox();
     hb.PackStart (lbl,false,false,1);
     hb.PackEnd (pls);
     dlg.VBox.PackStart (hb);
     dlg.AddButton (Gtk.Stock.Cancel,0);
     dlg.AddButton (Gtk.Stock.Ok,1);
     dlg.VBox.ShowAll ();
     string plsname="";
     while (plsname=="") {
         int response=dlg.Run ();
         if (response==0) {
             dlg.Hide ();
             dlg.Destroy ();
             return;
         } else {
             plsname=pls.Text.Trim ();
         }
     }
     dlg.Hide ();
     dlg.Destroy ();
     _pls=_col.NewPlayList(plsname);
     _model.Reload ();
     _pls_model.SetPlayList (_pls);
 }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:32,代码来源:CS_PlayListAdmin.cs


示例2: BookEditor

 public BookEditor()
 {
     Glade.XML gxml = new Glade.XML (Util.GladePath("contact-browser.glade"),
      "BookEditor", null);
        gxml.Autoconnect (this);
        beDlg = (Gtk.Dialog) gxml.GetWidget("BookEditor");
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:7,代码来源:BookEditor.cs


示例3: Create

		public static Gtk.Window Create ()
		{
			window = new Dialog ();
			window.Title = "Bi-directional flipping";
			window.SetDefaultSize (200, 100);

			label = new Label ("Label direction: <b>Left-to-right</b>");
			label.UseMarkup = true;
			label.SetPadding (3, 3);
			window.VBox.PackStart (label, true, true, 0);

			check_button = new CheckButton ("Toggle label direction");
			window.VBox.PackStart (check_button, true, true, 2);

			if (window.Direction == TextDirection.Ltr)
				check_button.Active = true;

			check_button.Toggled += new EventHandler (Toggle_Flip);
			check_button.BorderWidth = 10;

			button = new Button (Stock.Close);
			button.Clicked += new EventHandler (Close_Button);
			button.CanDefault = true;
			
			window.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			window.ShowAll ();
			return window;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:30,代码来源:TestFlipping.cs


示例4: Main

        public static void Main(string[] args)
        {
            Application.Init ();

             			try {
                InfoManager.Init ();
            } catch (Exception e) {
                Dialog d = new Dialog ("Error", null, DialogFlags.Modal, new object [] {
                    "OK", ResponseType.Ok });
                d.VBox.Add (new Label ("There was a problem while trying to initialize the InfoManager\n\n" + e.ToString ()));
                d.VBox.ShowAll ();
                d.Run ();
                return;
            }

            string profile_path = null;
            if (args.Length != 0 && args[0].StartsWith ("--profile-path="))
                profile_path = args[0].Substring (15);

            MainWindow win = new MainWindow (profile_path);
            win.Show ();
            if (args.Length == 2 && File.Exists (args [0]) && File.Exists (args [1])){
                win.ComparePaths (args [0], args [1]);
            }
            Application.Run ();
        }
开发者ID:FreeBSD-DotNet,项目名称:mono-tools,代码行数:26,代码来源:Main.cs


示例5: Create

		public static Gtk.Window Create ()
		{
			window = new Dialog ();
			window.Response += new ResponseHandler (Print_Response);
			window.SetDefaultSize (200, 100);

			window.Title = "GtkDialog";
			Button button = new Button (Stock.Ok);
			button.Clicked += new EventHandler (Close_Button);
			button.CanDefault = true;
			window.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			ToggleButton toggle_button = new ToggleButton ("Toggle Label");
			toggle_button.Clicked += new EventHandler (Label_Toggle);
			window.ActionArea.PackStart (toggle_button, true, true, 0);

			toggle_button = new ToggleButton ("Toggle Separator");
			toggle_button.Clicked += new EventHandler (Separator_Toggle);
			window.ActionArea.PackStart (toggle_button, true, true, 0);

			window.ShowAll ();

			return window;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:25,代码来源:TestDialog.cs


示例6: Init

	/* Protected members */

	protected void Init (Gtk.Dialog dialog) {
		this.dialog = dialog;
		Util.SetBaseWindowFromUi(dialog);

		dialog.Response += OnResponse;
		dialog.DeleteEvent += OnDeleteEvent;
	}
开发者ID:GNOME,项目名称:gnome-subtitles,代码行数:9,代码来源:BaseDialog.cs


示例7: EditPlayer

        public override void EditPlayer(Text text)
        {
            playerText = text;
            if (playerDialog == null) {
                Gtk.Dialog d = new Gtk.Dialog (Catalog.GetString ("Select player"),
                                   this, DialogFlags.Modal | DialogFlags.DestroyWithParent,
                                   Stock.Cancel, ResponseType.Cancel);
                d.WidthRequest = 600;
                d.HeightRequest = 400;

                DrawingArea da = new DrawingArea ();
                TeamTagger tagger = new TeamTagger (new WidgetWrapper (da));
                tagger.ShowSubstitutionButtons = false;
                tagger.LoadTeams ((ViewModel.Project as ProjectLongoMatch).LocalTeamTemplate, (ViewModel.Project as ProjectLongoMatch).VisitorTeamTemplate,
                                  (ViewModel.Project as ProjectLongoMatch).Dashboard.FieldBackground);
                tagger.PlayersSelectionChangedEvent += players => {
                    if (players.Count == 1) {
                        Player p = players [0];
                        playerText.Value = p.ToString ();
                        d.Respond (ResponseType.Ok);
                    }
                    tagger.ResetSelection ();
                };
                d.VBox.PackStart (da, true, true, 0);
                d.ShowAll ();
                playerDialog = d;
            }
            if (playerDialog.Run () != (int)ResponseType.Ok) {
                text.Value = null;
            }
            playerDialog.Hide ();
        }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:32,代码来源:SportDrawingTool.cs


示例8: onClick

 private void onClick(object Sender, EventArgs e)
 {
     Dialog d = new Dialog ("Test", this, DialogFlags.DestroyWithParent);
     d.Modal = true;
     d.AddButton ("Close", ResponseType.Close);
     d.Run ();
     d.Destroy ();
 }
开发者ID:MASGAU,项目名称:gtk-sharp-ribbon,代码行数:8,代码来源:DropdownGroupTest.cs


示例9: PreferencesDialog

        public PreferencesDialog(Settings set, Window parent,
				 string argsOver)
        {
            settings = set;
            argsOverride = argsOver;

            dialog = new Dialog("Preferences", parent,
            DialogFlags.Modal | DialogFlags.DestroyWithParent,
            new object[]{Gtk.Stock.Close, -1});

            var table = new Table(4, 3, false);

            sUseBundledDebugger = new CheckButton("Use bundled MSPDebug");
            sUseBundledDebugger.Clicked += OnBundledState;
            table.Attach(sUseBundledDebugger, 0, 3, 0, 1,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            Label lbl;

            lbl = new Label("MSPDebug path:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 1, 2, AttachOptions.Fill, 0, 4, 4);
            sMSPDebugPath = new Entry();
            table.Attach(sMSPDebugPath, 1, 2, 1, 2,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);
            chooseMSPDebug = new Button("Choose...");
            chooseMSPDebug.Clicked += OnChoose;
            table.Attach(chooseMSPDebug, 2, 3, 1, 2,
             AttachOptions.Fill, 0, 4, 4);

            lbl = new Label("MSPDebug arguments:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 2, 3, AttachOptions.Fill, 0, 4, 4);
            sMSPDebugArgs = new Entry();
            sMSPDebugArgs.Sensitive = (argsOverride == null);
            table.Attach(sMSPDebugArgs, 1, 3, 2, 3,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            lbl = new Label("Console font:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 3, 4, AttachOptions.Fill, 0, 4, 4);
            sConsoleFont = new FontButton();
            table.Attach(sConsoleFont, 1, 3, 3, 4,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            table.ShowAll();
            ((Container)dialog.Child).Add(table);

            chooseDialog = new FileChooserDialog("Choose MSPDebug binary",
            dialog, FileChooserAction.Open,
            new object[]{Stock.Cancel, ResponseType.Cancel,
                 Stock.Ok, ResponseType.Ok});
            chooseDialog.DefaultResponse = ResponseType.Ok;
        }
开发者ID:dlbeer,项目名称:olishell,代码行数:58,代码来源:PreferencesDialog.cs


示例10: Dispose

		public void Dispose ()
		{
			if (GotoLineDialog != null) {
				GotoLineDialog.Dispose ();
				GotoLineDialog = null;
				line_number_entry = null;
				IsVisible = false;
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:9,代码来源:GotoLineNumberDialog.cs


示例11: ErrorDialog

 static ErrorDialog()
 {
     XML gxml = new Glade.XML (null,
                   WorkbenchSingleton.GLADEFILE,
                   "ErrorDialog",
                   null);
     dialog = (Dialog) gxml["ErrorDialog"];
     Gtk.TextView errorTextView = (TextView) gxml["errorTextView"];
     errorBuffer = errorTextView.Buffer;
 }
开发者ID:BackupTheBerlios,项目名称:simetron,代码行数:10,代码来源:ErrorDialog.cs


示例12: Initialize

 void Initialize(Window parent)
 {
     Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LadderLogic.Presentation.OpenFileDialog.glade");
     Glade.XML glade = new Glade.XML(stream, "OpenFileDialog", null);
     stream.Close();
     glade.Autoconnect(this);
     thisDialog = ((Gtk.Dialog)(glade.GetWidget("OpenFileDialog")));
     thisDialog.Modal = true;
     thisDialog.TransientFor = parent;
     thisDialog.SetPosition (WindowPosition.Center);
 }
开发者ID:jdpillon,项目名称:ArduinoLadder,代码行数:11,代码来源:OpenFileDialog.cs


示例13: GladeDialog

        public GladeDialog(string name)
            : base(name)
        {
            dialog = base.Window as Dialog;

            if (dialog != null) {
                dialog.Response += delegate (object o, ResponseArgs args) {
                    OnResponse (args.ResponseId);
                };
            }
        }
开发者ID:manicolosi,项目名称:questar,代码行数:11,代码来源:GladeDialog.cs


示例14: ImportDialog

 static ImportDialog()
 {
     gxml = new Glade.XML (null,
                   WorkbenchSingleton.GLADEFILE,
                   "ImportDialog",
                   null);
     importDialog = (Dialog) gxml["ImportDialog"];
     typeCombo = (Combo) gxml["typeCombo"];
     formatCombo = (Combo) gxml["formatCombo"];
     okButton = (Button) gxml["okButton"];
 }
开发者ID:BackupTheBerlios,项目名称:simetron,代码行数:11,代码来源:ImportDialog.cs


示例15: RunDialog

		private bool RunDialog (Dialog dlg)
		{
			bool result = false;
			try {	
				if (dlg.Run () == (int)ResponseType.Ok)
					result = true;
			} finally {
				dlg.Destroy ();
			}
			return result;
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:10,代码来源:SqlServerGuiProvider.cs


示例16: Create

		public static Gtk.Window Create ()
		{
			window = new Dialog ();
			window.Title = "Sized groups";
			window.Resizable = false;
			
			VBox vbox = new VBox (false, 5);
			window.VBox.PackStart (vbox, true, true, 0);
			vbox.BorderWidth = 5;

			size_group = new SizeGroup (SizeGroupMode.Horizontal);

			Frame frame = new Frame ("Color Options");
			vbox.PackStart (frame, true, true, 0);

			Table table = new Table (2, 2, false);
			table.BorderWidth = 5;
			table.RowSpacing = 5;
			table.ColumnSpacing = 10;
			frame.Add (table);

			string [] colors = {"Red", "Green", "Blue", };
			string [] dashes = {"Solid", "Dashed", "Dotted", };
			string [] ends = {"Square", "Round", "Arrow", };

			Add_Row (table, 0, size_group, "_Foreground", colors);
			Add_Row (table, 1, size_group, "_Background", colors);

			frame = new Frame ("Line Options");
			vbox.PackStart (frame, false, false, 0);

			table = new Table (2, 2, false);
			table.BorderWidth = 5;
			table.RowSpacing = 5;
			table.ColumnSpacing = 10;
			frame.Add (table);

			Add_Row (table, 0, size_group, "_Dashing", dashes);
			Add_Row (table, 1, size_group, "_Line ends", ends);

			CheckButton check_button = new CheckButton ("_Enable grouping");
			vbox.PackStart (check_button, false, false, 0);
			check_button.Active = true;
			check_button.Toggled += new EventHandler (Button_Toggle_Cb);

			Button close_button = new Button (Stock.Close);
			close_button.Clicked += new EventHandler (Close_Button);
			window.ActionArea.PackStart (close_button, false, false, 0);
			
			window.ShowAll ();
			return window;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:52,代码来源:TestSizeGroup.cs


示例17: Run

 public int Run()
 {
     int rc = 0;
        if(NewSlogDialog != null)
        {
     rc = NewSlogDialog.Run();
     name = NameEntry.Text;
     NewSlogDialog.Hide();
     NewSlogDialog.Destroy();
     NewSlogDialog = null;
        }
        return rc;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:13,代码来源:SlogEditor.cs


示例18: HandleUnhandledException

 private static void HandleUnhandledException(UnhandledExceptionArgs e)
 {
     Exception ex = e.ExceptionObject as Exception;
     string message = ex == null ? e.ExceptionObject.ToString() : ex.ToString();
     string title = "Unhandled exception";
     DialogFlags flags = DialogFlags.Modal | DialogFlags.DestroyWithParent;
     Dialog dialog = new Dialog(title, MainWindow, flags);
     Label label = new Label(message);
     VBox vBox = (VBox)dialog.Child;
     vBox.Add(label);
     dialog.ShowAll();
     e.ExitApplication = false;
 }
开发者ID:karldickman,项目名称:XCAnalyze,代码行数:13,代码来源:MainClass.cs


示例19: buttonOKClickedHandler

        protected void buttonOKClickedHandler (object sender, EventArgs e)
        {
           
            string fileName = tbx_fileName.Text.Trim ();
            string fileNameAndPath;
            if (!fileName.EndsWith (s_fileExtension)) {
                fileName += s_fileExtension;
            }
            fileNameAndPath = tbx_dirPath.Text + System.IO.Path.DirectorySeparatorChar + fileName;

            //warn the user if the file already exists
            if (System.IO.File.Exists (fileNameAndPath)) {
                //show message dialog
                Dialog dialog = null;
                ResponseType response = ResponseType.None;

                try {
                    dialog = new Dialog (
                        "Warning",
                        this,
                        DialogFlags.DestroyWithParent | DialogFlags.Modal,
                        "Ok", ResponseType.Yes,
                        "No", ResponseType.No
                    );
                    dialog.VBox.Add (new Label ("\n\n" + OVERWIRTE_WARNING_MESSAGE + "  \n"));
                    dialog.ShowAll ();

                    response = (ResponseType)dialog.Run ();
      
                    dialog.Destroy ();
                    if (response == ResponseType.No)
                        Results = false;
                    else 
                        Results = true;
                
                } catch (Exception ex) {
                    Console.WriteLine (ex.ToString ());
                }            
            } else {
                Results = true;
            } 

                _experiment.ExperimentInfo.Name = tbx_experimentName.Text;
                //_experiment.ExperimentInfo.FilePath= flw_choseFile.CurrentFolder +"/"+ fileName;
                _experiment.ExperimentInfo.FilePath = fileNameAndPath;//tbx_dirPath.Text +"/"+ fileName;
                _experiment.ExperimentInfo.Author = tbx_author.Text;
                _experiment.ExperimentInfo.Description = tbx_description.Buffer.Text;

                this.Destroy ();
      
        }
开发者ID:CoEST,项目名称:TraceLab,代码行数:51,代码来源:NewExperimentDialog.cs


示例20: Alert

        private static Gtk.Dialog Alert(string primary, string secondary, Image aImage, Gtk.Window parent)
        {
            Gtk.Dialog retval = new Gtk.Dialog("", parent, Gtk.DialogFlags.DestroyWithParent);

              // graphic items
              Gtk.HBox hbox;
              		Gtk.VBox labelBox;
              		Gtk.Label labelPrimary;
              		Gtk.Label labelSecondary;

            // set-up dialog
            retval.Modal=true;
            retval.BorderWidth=6;
            retval.HasSeparator=false;
            retval.Resizable=false;

            retval.VBox.Spacing=12;

            hbox=new Gtk.HBox();
            hbox.Spacing=12;
            hbox.BorderWidth=6;
            retval.VBox.Add(hbox);

            // set-up image
            aImage.Yalign=0.0F;
            hbox.Add(aImage);

            // set-up labels
            labelPrimary=new Gtk.Label();
            labelPrimary.Yalign=0.0F;
            labelPrimary.Xalign=0.0F;
            labelPrimary.UseMarkup=true;
            labelPrimary.Wrap=true;

            labelSecondary=new Gtk.Label();
            labelSecondary.Yalign=0.0F;
            labelSecondary.Xalign=0.0F;
            labelSecondary.UseMarkup=true;
            labelSecondary.Wrap=true;

            labelPrimary.Markup="<span weight=\"bold\" size=\"larger\">"+primary+"</span>";
            labelSecondary.Markup="\n"+secondary;

            labelBox=new VBox();
            labelBox.Add(labelPrimary);
            labelBox.Add(labelSecondary);

            hbox.Add(labelBox);

            return retval;
        }
开发者ID:BackupTheBerlios,项目名称:beline-svn,代码行数:51,代码来源:Simple.cs



注:本文中的Gtk.Dialog类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Funq.Container类代码示例发布时间:2022-05-26
下一篇:
C# Gtk.DeleteEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap