public LoginRegisterDialog(Gtk.Window parentWindows) { if (parentWindows != null) { this.TransientFor = parentWindows; } else { this.TransientFor = MainClass.MainWindow; } this.BorderWidth = 10; this.WindowPosition = Gtk.WindowPosition.CenterOnParent; notebook1 = new Notebook(); btnInfo = new Button(); btnInfo.Label = "Login"; btnInfo.UseUnderline = true; btnInfo.CanFocus = true; btnClose = new Button(); btnClose.CanDefault = true; btnClose.CanFocus = true; btnClose.Name = "buttonCancel"; btnClose.UseStock = true; btnClose.UseUnderline = true; btnClose.Label = "gtk-cancel"; btnClose.Clicked += delegate(object sender, EventArgs e) { this.Respond(Gtk.ResponseType.Close); }; entrLoginR = new Entry(); entrPasswordR1 = new Entry(); entrPasswordR1.Visibility = false; entrPasswordR2 = new Entry(); entrPasswordR2.Visibility = false; entrEmailR = new Entry(); entrLogin = new Entry(); entrPassword = new Entry(); entrPassword.Visibility = false; chbRemember = new CheckButton(); chbRemember.Label = MainClass.Languages.Translate("loginDialog_remember"); linkbutton1 = new Components.LinkButton(); linkbutton1.HeightRequest = 25; linkbutton1.UseWebStile = true; linkbutton1.LinkUrl = "http://moscrif.com/request-new-password"; linkbutton1.Label = MainClass.Languages.Translate("loginDialog_forgot_password"); Table mainTbl = new Table(2, 1, false); mainTbl.RowSpacing = 6; mainTbl.ColumnSpacing = 6; //mainTbl.BorderWidth = 6; this.Title = MainClass.Languages.Translate("moscrif_ide_title_f1"); if (MainClass.Settings.Account != null) { if (!String.IsNullOrEmpty(MainClass.Settings.Account.Login)) { entrLogin.Text = MainClass.Settings.Account.Login; } chbRemember.Active = MainClass.Settings.Account.Remember; } bannerImage.WidthRequest = 400; bannerImage.HeightRequest = 120; mainTbl.Attach(bannerImage, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); Table tblPage1 = new Table(5, 2, false); tblPage1.BorderWidth = 6; tblPage1.ColumnSpacing = 6; tblPage1.RowSpacing = 6; AddControl(ref tblPage1, 0, entrLogin, MainClass.Languages.Translate("loginDialog_login")); AddControl(ref tblPage1, 1, entrPassword, MainClass.Languages.Translate("loginDialog_password")); AddControl(ref tblPage1, 2, chbRemember, ""); AddControl(ref tblPage1, 3, linkbutton1, ""); notebook1.AppendPage(tblPage1, new Label("Login")); Table tblPage2 = new Table(5, 2, false); tblPage2.ColumnSpacing = 6; tblPage2.RowSpacing = 6; tblPage2.BorderWidth = 6; AddControl(ref tblPage2, 0, entrLoginR, MainClass.Languages.Translate("loginDialog_login")); AddControl(ref tblPage2, 1, entrPasswordR1, MainClass.Languages.Translate("loginDialog_reg_password1")); AddControl(ref tblPage2, 2, entrPasswordR2, MainClass.Languages.Translate("loginDialog_reg_password2")); AddControl(ref tblPage2, 3, entrEmailR, MainClass.Languages.Translate("loginDialog_reg_email")); notebook1.AppendPage(tblPage2, new Label("Register")); Gtk.Notebook.NotebookChild nchT1 = (Gtk.Notebook.NotebookChild) this.notebook1[tblPage1]; nchT1.TabExpand = true; nchT1.TabFill = false; Gtk.Notebook.NotebookChild nchT2 = (Gtk.Notebook.NotebookChild) this.notebook1[tblPage2]; nchT2.TabExpand = true; nchT2.TabFill = false; mainTbl.Attach(notebook1, 0, 1, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 0, 0); LoadDefaultBanner(); Thread BannerThread = new Thread(new ThreadStart(BannerThreadLoop)); BannerThread.Name = "BannerThread"; BannerThread.IsBackground = true; BannerThread.Start(); entrPassword.GrabFocus(); //entrLogin.GrabFocus(); this.VBox.Add(mainTbl); this.ActionArea.Add(btnClose); this.ActionArea.Add(btnInfo); btnInfo.Clicked += new System.EventHandler(this.OnBtnInfoClicked); this.notebook1.SwitchPage += new Gtk.SwitchPageHandler(this.OnNotebook1SwitchPage); this.entrPassword.KeyReleaseEvent += new Gtk.KeyReleaseEventHandler(this.OnEntrPasswordKeyReleaseEvent); this.entrLogin.KeyReleaseEvent += new Gtk.KeyReleaseEventHandler(this.OnEntrLoginKeyReleaseEvent); //this.BorderWidth = 6; this.HeightRequest = 370; this.ShowAll(); }
public LoginRegisterDialog(Gtk.Window parentWindows) { if(parentWindows!=null) this.TransientFor = parentWindows; else this.TransientFor = MainClass.MainWindow; this.BorderWidth = 10; this.WindowPosition = Gtk.WindowPosition.CenterOnParent; notebook1 = new Notebook(); btnInfo = new Button(); btnInfo.Label = "Login"; btnInfo.UseUnderline = true; btnInfo.CanFocus = true; btnClose = new Button(); btnClose.CanDefault = true; btnClose.CanFocus = true; btnClose.Name = "buttonCancel"; btnClose.UseStock = true; btnClose.UseUnderline = true; btnClose.Label = "gtk-cancel"; btnClose.Clicked+= delegate(object sender, EventArgs e) { this.Respond(Gtk.ResponseType.Close); }; entrLoginR = new Entry(); entrPasswordR1 = new Entry(); entrPasswordR1.Visibility = false; entrPasswordR2 = new Entry(); entrPasswordR2.Visibility = false; entrEmailR = new Entry(); entrLogin = new Entry(); entrPassword = new Entry(); entrPassword.Visibility = false; chbRemember = new CheckButton(); chbRemember.Label = MainClass.Languages.Translate("loginDialog_remember"); linkbutton1 = new Components.LinkButton(); linkbutton1.HeightRequest=25; linkbutton1.UseWebStile = true; linkbutton1.LinkUrl = "http://moscrif.com/request-new-password"; linkbutton1.Label = MainClass.Languages.Translate("loginDialog_forgot_password"); Table mainTbl = new Table(2,1,false); mainTbl.RowSpacing = 6; mainTbl.ColumnSpacing = 6; //mainTbl.BorderWidth = 6; this.Title = MainClass.Languages.Translate("moscrif_ide_title_f1"); if(MainClass.Settings.Account != null){ if(!String.IsNullOrEmpty(MainClass.Settings.Account.Login)) entrLogin.Text = MainClass.Settings.Account.Login; chbRemember.Active =MainClass.Settings.Account.Remember; } bannerImage.WidthRequest = 400; bannerImage.HeightRequest = 120; mainTbl.Attach(bannerImage,0,1,0,1,AttachOptions.Fill,AttachOptions.Shrink,0,0); Table tblPage1 = new Table(5,2,false); tblPage1.BorderWidth = 6; tblPage1.ColumnSpacing = 6; tblPage1.RowSpacing = 6; AddControl(ref tblPage1, 0,entrLogin,MainClass.Languages.Translate("loginDialog_login")); AddControl(ref tblPage1, 1,entrPassword,MainClass.Languages.Translate("loginDialog_password")); AddControl(ref tblPage1, 2,chbRemember,""); AddControl(ref tblPage1, 3,linkbutton1,""); notebook1.AppendPage(tblPage1,new Label ("Login")); Table tblPage2 = new Table(5,2,false); tblPage2.ColumnSpacing = 6; tblPage2.RowSpacing = 6; tblPage2.BorderWidth = 6; AddControl(ref tblPage2, 0,entrLoginR,MainClass.Languages.Translate("loginDialog_login")); AddControl(ref tblPage2, 1,entrPasswordR1,MainClass.Languages.Translate("loginDialog_reg_password1")); AddControl(ref tblPage2, 2,entrPasswordR2,MainClass.Languages.Translate("loginDialog_reg_password2")); AddControl(ref tblPage2, 3,entrEmailR,MainClass.Languages.Translate("loginDialog_reg_email")); notebook1.AppendPage(tblPage2,new Label ("Register")); Gtk.Notebook.NotebookChild nchT1 = (Gtk.Notebook.NotebookChild)this.notebook1[tblPage1]; nchT1.TabExpand = true; nchT1.TabFill = false; Gtk.Notebook.NotebookChild nchT2 = (Gtk.Notebook.NotebookChild)this.notebook1[tblPage2]; nchT2.TabExpand = true; nchT2.TabFill = false; mainTbl.Attach(notebook1,0,1,1,2,AttachOptions.Fill|AttachOptions.Expand,AttachOptions.Fill|AttachOptions.Expand,0,0); LoadDefaultBanner(); Thread BannerThread = new Thread(new ThreadStart(BannerThreadLoop)); BannerThread.Name = "BannerThread"; BannerThread.IsBackground = true; BannerThread.Start(); entrPassword.GrabFocus(); //entrLogin.GrabFocus(); this.VBox.Add(mainTbl); this.ActionArea.Add(btnClose); this.ActionArea.Add(btnInfo); btnInfo.Clicked += new System.EventHandler (this.OnBtnInfoClicked); this.notebook1.SwitchPage += new Gtk.SwitchPageHandler (this.OnNotebook1SwitchPage); this.entrPassword.KeyReleaseEvent += new Gtk.KeyReleaseEventHandler (this.OnEntrPasswordKeyReleaseEvent); this.entrLogin.KeyReleaseEvent += new Gtk.KeyReleaseEventHandler (this.OnEntrLoginKeyReleaseEvent); //this.BorderWidth = 6; this.HeightRequest = 370; this.ShowAll(); }