private void btnConfigPodd_Click(object sender, EventArgs e) { var selectedInput = (string)cbPods.SelectedItem; Podcast aPod = new Podcast(); try { Validation.checkIfNull(selectedInput); foreach (var entry in podcastList.GetPodcastList()) //loopar igenom podcasts som finns i minnet och //hämtar objektet som ska ändras { if (entry.Name == selectedInput) { aPod = entry; } } //Skapar en ny dialogruta och matar in ett podcast objekt till konstruktorn //Som att köra in en bil till service där den ska målas om och få nytt regnummer DialogForm dialogForm = new DialogForm(aPod, podcastList); dialogForm.Show(); } catch (Exception) { MessageBox.Show("Vänligen välj en pod att konfiguera"); } }
private void gvMembers_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == gvMembers.Columns["editButton"].Index) { //Do something with your button. Member member = StorageManager.GetSingleton().GetMemeberById((int)gvMembers.CurrentRow.Cells[4].Value); var mForm = new MemberForm(member); mForm.m_registryiSdone = FinishCallback; mForm.ShowDialog(); } if (e.ColumnIndex == gvMembers.Columns["courseButton"].Index) { //Do something with your button. //Member member = (Member)gvMembers.CurrentRow.DataBoundItem; Member member = StorageManager.GetSingleton().GetMemeberById((int)gvMembers.CurrentRow.Cells[4].Value); var mForm = new DialogNeedApplyCourse(member, null); mForm.ShowDialog(); } if (e.ColumnIndex == gvMembers.Columns["delButton"].Index) { Member member = StorageManager.GetSingleton().GetMemeberById((int)gvMembers.CurrentRow.Cells[4].Value); var mForm = new DialogForm("ยืนยันการลบสมาชิก?", $"ลบ {member.Name} {member.LastName}"); if (mForm.ShowDialog() == DialogResult.OK) { StorageManager.GetSingleton().RemoveMember(member); InitMember(); MessageBox.Show("ลบข้อมูลเรียบร้อยแล้ว"); } } }
private void ModificarAfiliado(Afiliado Paciente) { if (!SQL_Methods.Afiliado_ModificarDatos(Paciente)) { MessageBox.Show(Paciente.Cod_Afiliado.ToString() + " no pudo ser modificado."); return; } if (PlanMedico_Familiar != -1 && PlanMedico_Familiar != Paciente.Cod_PlanMedico) { DialogForm dialogForm = new DialogForm(this, "Ingrese Motivo Cambio de Plan", "Por favor ingrese el motivo del cambio de plan"); return; } if (FamiliaresACargo < Paciente.CantFamiliaresACargo) { ModificarFamiliares(Paciente); this.Visible = false; return; } MessageBox.Show(Paciente.Cod_Afiliado.ToString() + " ha sido Modificado."); menu.Visible = true; this.Dispose(); return; }
public static async Task Install() { Program.mainForm.Enabled = false; DialogForm dialog = new DialogForm("Installing resources...\nThis only needs to be done once."); await Task.Delay(20); Directory.CreateDirectory(path); path7za = Path.Combine(path, "7za.exe"); File.WriteAllBytes(path7za, Resources.x64_7za); File.WriteAllBytes(Path.Combine(IOUtils.GetAppDataDir(), "esrgan.7z"), Resources.esrgan); File.WriteAllBytes(Path.Combine(IOUtils.GetAppDataDir(), "ncnn.7z"), Resources.esrgan_ncnn); File.WriteAllBytes(Path.Combine(IOUtils.GetAppDataDir(), "av.7z"), Resources.av); dialog.ChangeText("Installing ESRGAN resources..."); await UnSevenzip(Path.Combine(IOUtils.GetAppDataDir(), "esrgan.7z")); dialog.ChangeText("Installing ESRGAN-NCNN-Vulkan resources..."); await UnSevenzip(Path.Combine(IOUtils.GetAppDataDir(), "ncnn.7z")); dialog.ChangeText("Installing Audio/Video/Image resources..."); await UnSevenzip(Path.Combine(IOUtils.GetAppDataDir(), "av.7z")); File.WriteAllText(Path.Combine(IOUtils.GetAppDataDir(), "shipped_files_version"), Resources.shipped_files_version); dialog.Close(); Program.mainForm.Enabled = true; Program.mainForm.WindowState = System.Windows.Forms.FormWindowState.Maximized; Program.mainForm.BringToFront(); }
public async void ReloadImage(bool allowFail = true) // Returns false on error { string path = Program.lastImgPath; DialogForm loadingBox = new DialogForm($"Loading {Path.GetFileName(path)}", 20); await Task.Delay(10); try { File.Copy(path, Paths.tempImgPath, true); bool fillAlpha = !bool.Parse(Config.Get("alpha")); await ImageProcessing.ConvertImage(path, ImageProcessing.Format.PngRaw, fillAlpha, ImageProcessing.ExtMode.UseNew, false, Paths.tempImgPath, true); previewImg.Image = ImgUtils.GetImage(Paths.tempImgPath); PreviewUI.currentScale = 1; previewImg.ZoomToFit(); lastZoom = previewImg.Zoom; } catch (Exception e) { Logger.Log("Failed to reload image from source path - Maybe image is from clipboard or has been deleted. " + e.Message); if (!allowFail) { Logger.ErrorMessage("Failed to load image:", e); failed = true; } } if (loadingBox != null) { loadingBox.Close(); } }
public static DialogResult ShowDialog(string message, MessageBoxButtons messageBoxButtons) { DialogForm dialogForm = new DialogForm(message, messageBoxButtons); dialogForm.ShowDialog(); return(dialogForm.DialogResult); }
static async Task DownloadAndInstall(int version, string filename, bool showDialog = true) { string savePath = Path.Combine(IOUtils.GetAppDataDir(), filename); string url = $"https://dl.nmkd.de/cupscale/shippedfiles/{version}/{filename}"; Logger.Log($"[Installer] Downloading {url}"); var client = new WebClient(); currentDlDialog = new DialogForm($"Downloading {filename}…"); sw.Restart(); client.DownloadProgressChanged += DownloadProgressChanged; await client.DownloadFileTaskAsync(new Uri(url), savePath); if (Path.GetExtension(filename).ToLower() == ".7z") // Only run extractor if it's a 7z archive { if (currentDlDialog != null) { currentDlDialog.ChangeText($"Installing {filename}..."); } await UnSevenzip(Path.Combine(IOUtils.GetAppDataDir(), filename)); } if (currentDlDialog != null) { currentDlDialog.Close(); } currentDlDialog = null; }
private async void offlineInterpBtn_Click(object sender, EventArgs e) { if (MainUIHelper.currentMode == Mode.Interp) { try { string mdl1 = Program.currentModel1; string mdl2 = Program.currentModel2; if (string.IsNullOrWhiteSpace(mdl1) || string.IsNullOrWhiteSpace(mdl2)) { return; } ModelData mdl = new ModelData(mdl1, mdl2, ModelData.ModelMode.Interp, interpValue); DialogForm loadingForm = new DialogForm("Interpolating..."); await Task.Delay(50); string outPath = ESRGAN.Interpolate(mdl); loadingForm.Close(); Program.ShowMessage("Saved interpolated model to:\n\n" + outPath); } catch (Exception interpException) { Logger.ErrorMessage("Error trying to create an interpolated model:", interpException); Program.CloseTempForms(); } } else { Program.ShowMessage("Please select \"Interpolate Between Two Models\" and select two models."); } }
public static async Task ConvertNcnnModel(string modelPath) { string modelName = Path.GetFileName(modelPath); ncnnDir = Path.Combine(Config.Get("modelPath"), ".ncnn"); Directory.CreateDirectory(ncnnDir); string outPath = Path.Combine(ncnnDir, Path.ChangeExtension(modelName, null)); Logger.Log("Checking for NCNN model: " + outPath); if (IOUtils.GetAmountOfFiles(outPath, false) < 2) { Logger.Log("Running model converter..."); DialogForm dialog = new DialogForm("Converting ESRGAN model to NCNN format..."); await RunConverter(modelPath); string moveFrom = Path.Combine(Config.Get("esrganPath"), Path.ChangeExtension(modelName, null)); Logger.Log("Moving " + moveFrom + " to " + outPath); IOUtils.Copy(moveFrom, outPath, "*", true); Directory.Delete(moveFrom, true); dialog.Close(); } else { Logger.Log("NCNN Model is cached - Skipping conversion."); } ESRGAN.currentNcnnModel = outPath; }
private void btnDone_Click(object sender, EventArgs e) { this.CloseWithoutPrompt = true; LastJob(); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = System.Windows.Forms.Application.ExecutablePath; startInfo.Verb = "runas"; try { Process.Start(new ProcessStartInfo() { FileName = Path.Combine(InstallDir, this.AppName + ".exe") }); } catch (Win32Exception ex) { // 操作被用户取消 DialogForm.Show($"{ProductName}安装程序", "需要以管理员身份进行安装"); } this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
public override async Task <bool> OnActionCallback() { this.IsEnabled = false; await base.OnActionCallback(); var item = this.Context as Inspector; var mailItem = item?.CurrentItem as MailItem; if (mailItem == null) { return(false); } var dialogWindow = new DialogForm(); DialogResult result = dialogWindow.ShowDialog(); if (result == DialogResult.OK) { IProgress <int> progress = new Progress <int>(ProgressUpdate); int maxNumber = 100; Int32.TryParse(dialogWindow.MaxNumber, out maxNumber); using (var mail = new OutlookMailItem(mailItem)) { await mail.ChangeEmailBodyWithEratosthenesSieveNumbers(maxNumber, progress); } } dialogWindow.Dispose(); this.IsEnabled = true; return(true); }
// 点击关闭窗体 private void WizardForm_FormClosing(object sender, FormClosingEventArgs e) { if (CloseWithoutPrompt) { return; } if (worker != null && worker.IsBusy) { manualEvent.Reset(); DialogResult quitDr = DialogForm.Show("问题", "要退出安装吗?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (quitDr == DialogResult.Yes) { worker.CancelAsync(); e.Cancel = false; manualEvent.Set(); } else { e.Cancel = true; manualEvent.Set(); } } else if (IsCompleted) { LastJob(); } else { } }
public void update() { string Edition = GetVersion("IClipboard"); Version curVersion = new Version(AssemblyVersion); //本地资源版本 Version lowVersion = new Version(Edition); //服务器资源版本 if (lowVersion > curVersion) { this.Invoke((EventHandler) delegate { DialogResult r = DialogForm.ShowMsg("检测到新版本,是否下载?", "提示", MessageFormIcon.Doubt, MessageFormButtons.YesNo); if (r == DialogResult.Yes) { string url = "http://itiit.cn/file/IClipboard.exe"; try { System.Diagnostics.Process.Start(url); } catch (Exception) { System.Diagnostics.Process.Start("iexplore.exe", url); } AutoExit = true; Application.Exit(); } }); } }
public static string ShowDialog(string caption, string text) { var prompt = new DialogForm { Text = caption, LabelText = text }; prompt.ShowDialog(); return(prompt.ResultText); }
public PrintDialog () { form = new DialogForm (this); help_button = null; installed_printers = System.Drawing.Printing.PrinterSettings.InstalledPrinters; form.Text = "Print"; CreateFormControls (); Reset (); }
public PrintDialog() { form = new DialogForm(this); help_button = null; installed_printers = System.Drawing.Printing.PrinterSettings.InstalledPrinters; form.Text = "Print"; CreateFormControls(); Reset(); }
/// <summary> /// 弹出信息对话框 /// </summary> /// <param name="message"></param> /// <param name="subForm"></param> public static void ShowErr(string message, MyWindow.AfterCloseDelegate afterClose = null) { var model = new DialogModel(); model._Message = message; var form = new DialogForm(MessageBoxButton.OK, MessageBoxImage.Error, model); //form.Width = 400; form.Height = 160; ShowDialogForm("错误信息", form, model, afterClose); }
private static bool ConfirmYesNoDialog(string message, string title, string yesButtonLabel, string noButtonLabel) { DialogForm dialogBoxForm = new DialogForm(message, title, yesButtonLabel, noButtonLabel); if (title != "") { dialogBoxForm.Text = title; } dialogBoxForm.ShowDialog(); return(dialogBoxForm.ReturnValue == dialogBoxForm.YesButtonLabel); }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (!AutoExit) { DialogResult r = DialogForm.ShowMsg("关闭后剪贴板会清空,是否关闭软件?", "提示", MessageFormIcon.Doubt, MessageFormButtons.YesNo); if (r != DialogResult.Yes) { e.Cancel = true; } } }
/// <summary> /// 弹出信息对话框 /// </summary> /// <param name="message"></param> /// <param name="subForm"></param> public static void ShowDialog(string message, MyWindow.AfterCloseDelegate afterClose) { var model = new DialogModel(); model._Message = message; var form = new DialogForm(MessageBoxButton.YesNo, MessageBoxImage.Question, model); //form.Width = 400; form.Height = 160; ShowDialogForm("提示信息", form, model, afterClose); }
private void btnShowForm_Click(object sender, EventArgs e) { using (var form = new DialogForm()) { var result = form.ShowDialog(); if (result == DialogResult.Ok) { _stateManager.UpdatePatient(form.InputPatientName); } } }
async Task DragNDrop(string [] files) { Logger.Log("[MainUI] Dropped " + files.Length + " file(s), files[0] = " + files[0]); IOUtils.ClearDir(Paths.tempImgPath.GetParentDir()); string path = files[0]; DialogForm loadingDialogForm = null; if (IOUtils.IsPathDirectory(path)) { htTabControl.SelectedIndex = 1; int compatFilesAmount = IOUtils.GetAmountOfCompatibleFiles(path, true); batchDirLabel.Text = "Loaded " + path.Wrap() + " - Found " + compatFilesAmount + " compatible files."; BatchUpscaleUI.LoadDir(path); upscaleBtn.Text = "Upscale " + compatFilesAmount + " Images"; return; } if (files.Length > 1) { htTabControl.SelectedIndex = 1; int compatFilesAmount = IOUtils.GetAmountOfCompatibleFiles(files); BatchUpscaleUI.LoadImages(files); batchDirLabel.Text = "Loaded " + compatFilesAmount + " compatible files."; upscaleBtn.Text = "Upscale " + compatFilesAmount + " Images"; return; } upscaleBtn.Text = "Upscale And Save"; htTabControl.SelectedIndex = 0; previewImg.Text = ""; SetProgress(0f, "Loading image..."); loadingDialogForm = new DialogForm("Loading " + Path.GetFileName(path) + "..."); await Task.Delay(20); MainUIHelper.ResetCachedImages(); if (!MainUIHelper.DroppedImageIsValid(path)) { SetProgress(0f, "Ready."); await Task.Delay(1); Program.CloseTempForms(); return; } Program.lastFilename = path; ReloadImage(false); if (failed) { FailReset(); return; } SetHasPreview(false); loadingDialogForm.Close(); SetRefreshPreviewBtns(true); SetProgress(0f, "Ready."); }
private void btnAssign_Click(object sender, EventArgs e) { using (var df = new DialogForm()) { df.Text = "Assign Detail"; using (var c = new _ucAssignDetail(MachineId)) { df.mainPanel.Controls.Add(c); df.ShowDialog(); FillOlv(MachineId); } } }
public static void LoadDialogIntoWindow(DialogViewModel dialog, bool showCompletionScreen = true, bool isModal = false) { var window = new Window { Title = dialog.TabLabel }; var content = new WindowShell(); window.Content = content; var dialogControl = new DialogForm(); dialogControl.DataContext = dialog; content.Content = dialogControl; Action closeMethod = () => { dialog.DoOnMainThread(() => { window.Close(); }); }; if (dialog.ApplicationController is VsixApplicationController) { var vsixController = (VsixApplicationController)dialog.ApplicationController; vsixController.SetRemoveMethod((item) => { if (item == dialog) { closeMethod(); } }); } if (!showCompletionScreen) { dialog.OverideCompletionScreenMethod = closeMethod; } if (isModal) { window.ShowDialog(); } else { window.Show(); } }
private DialogForm GetDialogForm(UserControl view, string title = "MapMaker v2.0.1") { view.Dock = DockStyle.Fill; var frm = new DialogForm(); frm.Text = title; frm.Width = view.Width + 20; frm.Height = view.Height + 40; frm.ControlBox = true; frm.MinimizeBox = false; frm.MaximizeBox = false; frm.FormBorderStyle = FormBorderStyle.Sizable; frm.StartPosition = FormStartPosition.CenterParent; frm.Controls.Add(view); return(frm); }
public DialogPanel() { var label = Controls.Add(new Label { Left = 160, Top = 10, Width = 200 }); var button1 = Controls.Add(new Button { Text = "Show Dialog", Left = 10, Top = 10, Width = 130 }); button1.Click += async(o, e) => { label.Text = (await new DialogForm().ShowDialog(FindForm() !)).ToString(); }; // This dialog shouldn't show because the DialogResult has already been set var button2 = Controls.Add(new Button { Text = "Already Set Dialog", Left = 10, Top = 50, Width = 130 }); button2.Click += async(o, e) => { var dialog = new DialogForm { DialogResult = DialogResult.OK }; label.Text = (await dialog.ShowDialog(FindForm() !)).ToString(); }; var button3 = Controls.Add(new Button { Text = "Two Dialogs", Left = 10, Top = 90, Width = 130 }); button3.Click += async(o, e) => { label.Text = (await new DialogForm().ShowDialog(FindForm() !)).ToString(); label.Text = (await new DialogForm().ShowDialog(FindForm() !)).ToString(); }; }
private static string AskPlayerName() { string result = ""; DialogForm dialogForm = new DialogForm(); DialogResult res = dialogForm.ShowDialog(); if (res == DialogResult.OK) { result = dialogForm.Text; } dialogForm.Dispose(); if (String.IsNullOrEmpty(result)) { result = "unknown player"; } return(result); }
static async Task CreateVideo() { if (IOUtils.GetAmountOfFiles(Paths.framesOutPath, false) < 1) { return; } if (outputFormatBox.Text == Upscale.VidExportMode.MP4.ToStringTitleCase()) { outputFormat = Upscale.VidExportMode.MP4; } if (outputFormatBox.Text == Upscale.VidExportMode.GIF.ToStringTitleCase()) { outputFormat = Upscale.VidExportMode.GIF; } if (outputFormatBox.Text == Upscale.VidExportMode.SameAsSource.ToStringTitleCase()) { outputFormat = (Upscale.VidExportMode)Enum.Parse(typeof(Upscale.VidExportMode), Path.GetExtension(currentInPath).Replace(".", "").ToUpper()); } if (outputFormat == Upscale.VidExportMode.MP4) { DialogForm f = new DialogForm("Creating video from frames...", 300); await Task.Delay(10); await FFmpegCommands.FramesToMp4(Paths.framesOutPath, Config.GetBool("h265"), Config.GetInt("crf"), fps, "", false); if (Config.GetBool("vidEnableAudio")) { await FFmpegCommands.MergeAudio(Paths.framesOutPath + ".mp4", currentInPath); } f.Close(); } if (outputFormat == Upscale.VidExportMode.GIF) { DialogForm f = new DialogForm("Creating GIF from frames...\nThis can take a while for high-resolution GIFs.", 600); await Task.Delay(10); string outpath = Path.Combine(Paths.GetDataPath(), "frames-out.mp4").Wrap(); await FFmpeg.RunGifski($" -r {fps.RoundToInt()} -W 4096 -Q {Config.GetInt("gifskiQ")} -q -o {outpath} \"{Paths.framesOutPath}/\"*.\"png\""); f.Close(); } }
private async void saveMergedPreviewBtn_Click(object sender, EventArgs e) { DialogForm loadingForm = new DialogForm("Post-Processing And Saving..."); await Task.Delay(50); Upscale.currentMode = Upscale.UpscaleMode.Single; string ext = Path.GetExtension(Program.lastFilename); string outPath = Path.ChangeExtension(Program.lastFilename, null) + "[temp]" + ext + ".tmp"; previewImg.Image.Save(outPath); await Upscale.PostprocessingSingle(outPath, true); string outFilename = Upscale.FilenamePostprocess(MainUIHelper.lastOutfile); string finalPath = IOUtils.ReplaceInFilename(outFilename, "[temp]", ""); loadingForm.Close(); Program.ShowMessage("Saved to " + finalPath + ".", "Message"); }
public static async Task Install() { Program.mainForm.Enabled = false; DialogForm dialog = new DialogForm("Installing resources...\nThis only needs to be done once."); await Task.Delay(20); if (IOUtils.GetDirSize(path) > 0) { Logger.Log("[Installer] {path} is not 0 bytes - removing everything there to ensure a clean install."); dialog.ChangeText("Uninstalling older files..."); await Task.Delay(20); Uninstall(false); } Directory.CreateDirectory(path); path7za = Path.Combine(path, "7za.exe"); File.WriteAllBytes(path7za, Resources.x64_7za); try { await DownloadAndInstall(exeFilesVersion, "esrgan.7z"); await DownloadAndInstall(exeFilesVersion, "esrgan-ncnn.7z"); await DownloadAndInstall(exeFilesVersion, "av.7z"); await DownloadAndInstall(exeFilesVersion, "shipped-files-version.txt", false); } catch (Exception e) { MsgBox msg = Logger.ErrorMessage("Web Installer failed to run!\n", e); while (DialogQueue.IsOpen(msg)) { await Task.Delay(50); } Environment.Exit(1); return; } dialog.Close(); Program.mainForm.Enabled = true; Program.mainForm.WindowState = System.Windows.Forms.FormWindowState.Maximized; Program.mainForm.BringToFront(); }
private void gvPayments_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == gvPayments.Columns["printButton"].Index) { Payment.GetPayment().PrintRecipt((PaymentInfo)gvPayments.CurrentRow.DataBoundItem, true); } if (e.ColumnIndex == gvPayments.Columns["delButton"].Index) { ApplyCourseLog applylog = StorageManager.GetSingleton().GetPaymentByID((int)gvPayments.CurrentRow.Cells[0].Value); var mForm = new DialogForm("ยืนยันการลบ?", $"ลบ {applylog.CourseName} ราคา {applylog.CoursePrice}"); if (mForm.ShowDialog() == DialogResult.OK) { StorageManager.GetSingleton().RemovePayment(applylog); InitData(); MessageBox.Show("ลบข้อมูลเรียบร้อยแล้ว"); } } }
public ColorDialog () : base() { form = new DialogForm (this); form.SuspendLayout (); form.Text = "Color"; form.FormBorderStyle = FormBorderStyle.FixedDialog; form.MaximizeBox = false; satTextBox = new TextBox (); briTextBox = new TextBox (); blueTextBox = new TextBox (); greenTextBox = new TextBox (); redTextBox = new TextBox (); hueTextBox = new TextBox (); redLabel = new Label (); blueLabel = new Label (); greenLabel = new Label (); colorBaseLabel = new Label (); hueLabel = new Label (); satLabel = new Label (); briLabel = new Label (); okButton = new Button (); cancelButton = new Button (); form.CancelButton = cancelButton; helpButton = new Button (); defineColoursButton = new Button (); addColoursButton = new Button (); baseColorControl = new BaseColorControl (this); colorMatrixControl = new ColorMatrixControl (this); brightnessControl = new BrightnessControl (this); triangleControl = new TriangleControl (this); selectedColorPanel = new Panel (); // hueTextBox hueTextBox.Location = new Point (324, 203); hueTextBox.Size = new Size (27, 21); hueTextBox.TabIndex = 11; hueTextBox.MaxLength = 3; // satTextBox satTextBox.Location = new Point (324, 225); satTextBox.Size = new Size (27, 21); satTextBox.TabIndex = 15; satTextBox.MaxLength = 3; // greenTextBox greenTextBox.Location = new Point (404, 225); greenTextBox.Size = new Size (27, 21); greenTextBox.TabIndex = 18; greenTextBox.MaxLength = 3; // briTextBox briTextBox.Location = new Point (324, 247); briTextBox.Size = new Size (27, 21); briTextBox.TabIndex = 16; briTextBox.MaxLength = 3; // blueTextBox blueTextBox.Location = new Point (404, 247); blueTextBox.Size = new Size (27, 21); blueTextBox.TabIndex = 19; blueTextBox.MaxLength = 3; // redTextBox redTextBox.Location = new Point (404, 203); redTextBox.Size = new Size (27, 21); redTextBox.TabIndex = 17; redTextBox.MaxLength = 3; // redLabel redLabel.FlatStyle = FlatStyle.System; redLabel.Location = new Point (361, 206); redLabel.Size = new Size (40, 16); redLabel.TabIndex = 25; redLabel.Text = Locale.GetText ("Red") + ":"; redLabel.TextAlign = ContentAlignment.MiddleRight; // blueLabel blueLabel.FlatStyle = FlatStyle.System; blueLabel.Location = new Point (361, 250); blueLabel.Size = new Size (40, 16); blueLabel.TabIndex = 26; blueLabel.Text = Locale.GetText ("Blue") + ":"; blueLabel.TextAlign = ContentAlignment.MiddleRight; // greenLabel greenLabel.FlatStyle = FlatStyle.System; greenLabel.Location = new Point (361, 228); greenLabel.Size = new Size (40, 16); greenLabel.TabIndex = 27; greenLabel.Text = Locale.GetText ("Green") + ":"; greenLabel.TextAlign = ContentAlignment.MiddleRight; // colorBaseLabel colorBaseLabel.Location = new Point (228, 247); colorBaseLabel.Size = new Size (60, 25); colorBaseLabel.TabIndex = 28; colorBaseLabel.Text = Locale.GetText ("Color"); colorBaseLabel.TextAlign = ContentAlignment.MiddleCenter; // hueLabel hueLabel.FlatStyle = FlatStyle.System; hueLabel.Location = new Point (287, 206); hueLabel.Size = new Size (36, 16); hueLabel.TabIndex = 23; hueLabel.Text = Locale.GetText ("Hue") + ":"; hueLabel.TextAlign = ContentAlignment.MiddleRight; // satLabel satLabel.FlatStyle = FlatStyle.System; satLabel.Location = new Point (287, 228); satLabel.Size = new Size (36, 16); satLabel.TabIndex = 22; satLabel.Text = Locale.GetText ("Sat") + ":"; satLabel.TextAlign = ContentAlignment.MiddleRight; // briLabel briLabel.FlatStyle = FlatStyle.System; briLabel.Location = new Point (287, 250); briLabel.Size = new Size (36, 16); briLabel.TabIndex = 24; briLabel.Text = Locale.GetText ("Bri") + ":"; briLabel.TextAlign = ContentAlignment.MiddleRight; // defineColoursButton defineColoursButton.FlatStyle = FlatStyle.System; defineColoursButton.Location = new Point (5, 244); defineColoursButton.Size = new Size (210, 22); defineColoursButton.TabIndex = 6; // FIXME: update resource files defineColoursButton.Text = "Define Custom Colors >>"; //defineColoursButton.Text = Locale.GetText ("Define Custom Colors >>"); // okButton okButton.FlatStyle = FlatStyle.System; okButton.Location = new Point (5, 271); okButton.Size = new Size (66, 22); okButton.TabIndex = 0; okButton.Text = Locale.GetText ("OK"); // cancelButton cancelButton.FlatStyle = FlatStyle.System; cancelButton.Location = new Point (78, 271); cancelButton.Size = new Size (66, 22); cancelButton.TabIndex = 1; cancelButton.Text = Locale.GetText ("Cancel"); // helpButton helpButton.FlatStyle = FlatStyle.System; helpButton.Location = new Point (149, 271); helpButton.Size = new Size (66, 22); helpButton.TabIndex = 5; helpButton.Text = Locale.GetText ("Help"); helpButton.Hide (); // addColoursButton addColoursButton.FlatStyle = FlatStyle.System; addColoursButton.Location = new Point (227, 271); addColoursButton.Size = new Size (213, 22); addColoursButton.TabIndex = 7; // FIXME: update resource files addColoursButton.Text = "Add To Custom Colors"; //addColoursButton.Text = Locale.GetText ("Add To Custom Colors"); // baseColorControl baseColorControl.Location = new Point (3, 6); baseColorControl.Size = new Size (212, 231); baseColorControl.TabIndex = 13; // colorMatrixControl colorMatrixControl.Location = new Point (227, 7); colorMatrixControl.Size = new Size (179, 190); colorMatrixControl.TabIndex = 14; // triangleControl triangleControl.Location = new Point (432, 0); triangleControl.Size = new Size (16, 204); triangleControl.TabIndex = 12; // brightnessControl brightnessControl.Location = new Point (415, 7); brightnessControl.Size = new Size (14, 190); brightnessControl.TabIndex = 20; // selectedColorPanel selectedColorPanel.BackColor = SystemColors.Desktop; selectedColorPanel.BorderStyle = BorderStyle.Fixed3D; selectedColorPanel.Location = new Point (227, 202); selectedColorPanel.Size = new Size (60, 42); selectedColorPanel.TabIndex = 10; form.Controls.Add (hueTextBox); form.Controls.Add (satTextBox); form.Controls.Add (briTextBox); form.Controls.Add (redTextBox); form.Controls.Add (greenTextBox); form.Controls.Add (blueTextBox); form.Controls.Add (defineColoursButton); form.Controls.Add (okButton); form.Controls.Add (cancelButton); form.Controls.Add (addColoursButton); form.Controls.Add (helpButton); form.Controls.Add (baseColorControl); form.Controls.Add (colorMatrixControl); form.Controls.Add (brightnessControl); form.Controls.Add (triangleControl); form.Controls.Add (colorBaseLabel); form.Controls.Add (greenLabel); form.Controls.Add (blueLabel); form.Controls.Add (redLabel); form.Controls.Add (briLabel); form.Controls.Add (hueLabel); form.Controls.Add (satLabel); form.Controls.Add (selectedColorPanel); form.ResumeLayout (false); Color = Color.Black; defineColoursButton.Click += new EventHandler (OnClickButtonDefineColours); addColoursButton.Click += new EventHandler (OnClickButtonAddColours); helpButton.Click += new EventHandler (OnClickHelpButton); cancelButton.Click += new EventHandler (OnClickCancelButton); okButton.Click += new EventHandler (OnClickOkButton); hueTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); satTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); briTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); redTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); greenTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); blueTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); hueTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); satTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); briTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); redTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); greenTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); blueTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); hueTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); satTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); briTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); redTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); greenTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); blueTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); hueTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); satTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); briTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); redTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); greenTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); blueTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); ResetCustomColors (); }
public FontDialog( ) { form = new DialogForm (this); example_panel_text = char_sets [0]; okButton = new Button( ); cancelButton = new Button( ); applyButton = new Button( ); helpButton = new Button( ); fontTextBox = new TextBox( ); fontstyleTextBox = new TextBox( ); fontsizeTextBox = new TextBox( ); fontListBox = new MouseWheelListBox (); fontsizeListBox = new MouseWheelListBox (); fontstyleListBox = new MouseWheelListBox (); fontLabel = new Label( ); fontstyleLabel = new Label( ); sizeLabel = new Label( ); scriptLabel = new Label( ); exampleGroupBox = new GroupBox( ); effectsGroupBox = new GroupBox( ); underlinedCheckBox = new CheckBox( ); strikethroughCheckBox = new CheckBox( ); scriptComboBox = new ComboBox( ); examplePanel = new Panel( ); colorComboBox = new ColorComboBox( this ); exampleGroupBox.SuspendLayout( ); effectsGroupBox.SuspendLayout( ); form.SuspendLayout( ); form.FormBorderStyle = FormBorderStyle.FixedDialog; form.MaximizeBox = false; // fontsizeListBox fontsizeListBox.Location = new Point( 284, 47 ); fontsizeListBox.Size = new Size( 52, 95 ); fontsizeListBox.TabIndex = 10; fontListBox.Sorted = true; // fontTextBox fontTextBox.Location = new Point( 16, 26 ); fontTextBox.Size = new Size( 140, 21 ); fontTextBox.TabIndex = 5; fontTextBox.Text = ""; // fontstyleLabel fontstyleLabel.Location = new Point( 164, 10 ); fontstyleLabel.Size = new Size( 100, 16 ); fontstyleLabel.TabIndex = 1; fontstyleLabel.Text = "Font Style:"; // typesizeTextBox fontsizeTextBox.Location = new Point( 284, 26 ); fontsizeTextBox.Size = new Size( 52, 21 ); fontsizeTextBox.TabIndex = 7; fontsizeTextBox.Text = ""; fontsizeTextBox.MaxLength = 2; // schriftartListBox fontListBox.Location = new Point( 16, 47 ); fontListBox.Size = new Size( 140, 95 ); fontListBox.TabIndex = 8; fontListBox.Sorted = true; // exampleGroupBox exampleGroupBox.Controls.Add( examplePanel ); exampleGroupBox.FlatStyle = FlatStyle.System; exampleGroupBox.Location = new Point( 164, 158 ); exampleGroupBox.Size = new Size( 172, 70 ); exampleGroupBox.TabIndex = 12; exampleGroupBox.TabStop = false; exampleGroupBox.Text = "Example"; // fontstyleListBox fontstyleListBox.Location = new Point( 164, 47 ); fontstyleListBox.Size = new Size( 112, 95 ); fontstyleListBox.TabIndex = 9; // schriftartLabel fontLabel.Location = new Point( 16, 10 ); fontLabel.Size = new Size( 88, 16 ); fontLabel.TabIndex = 0; fontLabel.Text = "Font:"; // effectsGroupBox effectsGroupBox.Controls.Add( underlinedCheckBox ); effectsGroupBox.Controls.Add( strikethroughCheckBox ); effectsGroupBox.Controls.Add( colorComboBox ); effectsGroupBox.FlatStyle = FlatStyle.System; effectsGroupBox.Location = new Point( 16, 158 ); effectsGroupBox.Size = new Size( 140, 116 ); effectsGroupBox.TabIndex = 11; effectsGroupBox.TabStop = false; effectsGroupBox.Text = "Effects"; // strikethroughCheckBox strikethroughCheckBox.FlatStyle = FlatStyle.System; strikethroughCheckBox.Location = new Point( 8, 16 ); strikethroughCheckBox.TabIndex = 0; strikethroughCheckBox.Text = "Strikethrough"; // colorComboBox colorComboBox.Location = new Point( 8, 70 ); colorComboBox.Size = new Size( 130, 21 ); // sizeLabel sizeLabel.Location = new Point( 284, 10 ); sizeLabel.Size = new Size( 100, 16 ); sizeLabel.TabIndex = 2; sizeLabel.Text = "Size:"; // scriptComboBox scriptComboBox.Location = new Point( 164, 253 ); scriptComboBox.Size = new Size( 172, 21 ); scriptComboBox.TabIndex = 14; scriptComboBox.DropDownStyle = ComboBoxStyle.DropDownList; // okButton okButton.FlatStyle = FlatStyle.System; okButton.Location = new Point( 352, 26 ); okButton.Size = new Size( 70, 23 ); okButton.TabIndex = 3; okButton.Text = "OK"; // cancelButton cancelButton.FlatStyle = FlatStyle.System; cancelButton.Location = new Point( 352, 52 ); cancelButton.Size = new Size( 70, 23 ); cancelButton.TabIndex = 4; cancelButton.Text = "Cancel"; // applyButton applyButton.FlatStyle = FlatStyle.System; applyButton.Location = new Point( 352, 78 ); applyButton.Size = new Size( 70, 23 ); applyButton.TabIndex = 5; applyButton.Text = "Apply"; // helpButton helpButton.FlatStyle = FlatStyle.System; helpButton.Location = new Point( 352, 104 ); helpButton.Size = new Size( 70, 23 ); helpButton.TabIndex = 6; helpButton.Text = "Help"; // underlinedCheckBox underlinedCheckBox.FlatStyle = FlatStyle.System; underlinedCheckBox.Location = new Point( 8, 36 ); underlinedCheckBox.TabIndex = 1; underlinedCheckBox.Text = "Underlined"; // fontstyleTextBox fontstyleTextBox.Location = new Point( 164, 26 ); fontstyleTextBox.Size = new Size( 112, 21 ); fontstyleTextBox.TabIndex = 6; fontstyleTextBox.Text = ""; // scriptLabel scriptLabel.Location = new Point( 164, 236 ); scriptLabel.Size = new Size( 100, 16 ); scriptLabel.TabIndex = 13; scriptLabel.Text = "Script:"; // examplePanel examplePanel.Location = new Point( 8, 20 ); examplePanel.TabIndex = 0; examplePanel.Size = new Size( 156, 40 ); examplePanel.BorderStyle = BorderStyle.Fixed3D; form.AcceptButton = okButton; form.CancelButton = cancelButton; form.Controls.Add( scriptComboBox ); form.Controls.Add( scriptLabel ); form.Controls.Add( exampleGroupBox ); form.Controls.Add( effectsGroupBox ); form.Controls.Add( fontsizeListBox ); form.Controls.Add( fontstyleListBox ); form.Controls.Add( fontListBox ); form.Controls.Add( fontsizeTextBox ); form.Controls.Add( fontstyleTextBox ); form.Controls.Add( fontTextBox ); form.Controls.Add( cancelButton ); form.Controls.Add( okButton ); form.Controls.Add( sizeLabel ); form.Controls.Add( fontstyleLabel ); form.Controls.Add( fontLabel ); form.Controls.Add( applyButton ); form.Controls.Add( helpButton ); exampleGroupBox.ResumeLayout( false ); effectsGroupBox.ResumeLayout( false ); form.Size = new Size( 430, 318 ); form.FormBorderStyle = FormBorderStyle.FixedDialog; form.MaximizeBox = false; form.Text = "Font"; form.ResumeLayout( false ); scriptComboBox.BeginUpdate (); scriptComboBox.Items.AddRange (char_sets_names); scriptComboBox.SelectedIndex = 0; scriptComboBox.EndUpdate (); applyButton.Hide( ); helpButton.Hide( ); colorComboBox.Hide( ); cancelButton.Click += new EventHandler( OnClickCancelButton ); okButton.Click += new EventHandler( OnClickOkButton ); applyButton.Click += new EventHandler (OnApplyButton); examplePanel.Paint += new PaintEventHandler( OnPaintExamplePanel ); fontListBox.SelectedIndexChanged += new EventHandler( OnSelectedIndexChangedFontListBox ); fontsizeListBox.SelectedIndexChanged += new EventHandler( OnSelectedIndexChangedSizeListBox ); fontstyleListBox.SelectedIndexChanged += new EventHandler( OnSelectedIndexChangedFontStyleListBox ); underlinedCheckBox.CheckedChanged += new EventHandler( OnCheckedChangedUnderlinedCheckBox ); strikethroughCheckBox.CheckedChanged += new EventHandler( OnCheckedChangedStrikethroughCheckBox ); scriptComboBox.SelectedIndexChanged += new EventHandler (OnSelectedIndexChangedScriptComboBox); fontTextBox.KeyPress += new KeyPressEventHandler (OnFontTextBoxKeyPress); fontstyleTextBox.KeyPress += new KeyPressEventHandler (OnFontStyleTextBoxKeyPress); fontsizeTextBox.KeyPress += new KeyPressEventHandler (OnFontSizeTextBoxKeyPress); fontTextBox.TextChanged += new EventHandler (OnFontTextBoxTextChanged); fontstyleTextBox.TextChanged += new EventHandler (OnFontStyleTextTextChanged); fontsizeTextBox.TextChanged += new EventHandler (OnFontSizeTextBoxTextChanged); fontTextBox.KeyDown += new KeyEventHandler (OnFontTextBoxKeyDown); fontstyleTextBox.KeyDown += new KeyEventHandler (OnFontStyleTextBoxKeyDown); fontsizeTextBox.KeyDown += new KeyEventHandler (OnFontSizeTextBoxKeyDown); fontTextBox.MouseWheel += new MouseEventHandler (OnFontTextBoxMouseWheel); fontstyleTextBox.MouseWheel += new MouseEventHandler (OnFontStyleTextBoxMouseWheel); fontsizeTextBox.MouseWheel += new MouseEventHandler (OnFontSizeTextBoxMouseWheel); PopulateFontList (); }
public FolderBrowserDialog () { form = new DialogForm (this); Size formConfigSize = Size.Empty; Point formConfigLocation = Point.Empty; object formWidth = MWFConfig.GetValue (folderbrowserdialog_string, width_string); object formHeight = MWFConfig.GetValue (folderbrowserdialog_string, height_string); if (formHeight != null && formWidth != null) formConfigSize = new Size ((int)formWidth, (int)formHeight); object formLocationX = MWFConfig.GetValue (folderbrowserdialog_string, x_string); object formLocationY = MWFConfig.GetValue (folderbrowserdialog_string, y_string); if (formLocationX != null && formLocationY != null) formConfigLocation = new Point ((int)formLocationX, (int)formLocationY); newFolderButton = new Button (); folderBrowserTreeView = new FolderBrowserTreeView (this); okButton = new Button (); cancelButton = new Button (); descriptionLabel = new Label (); folderBrowserTreeViewContextMenu = new ContextMenu (); form.AcceptButton = okButton; form.CancelButton = cancelButton; form.SuspendLayout (); form.ClientSize = new Size (322, 324); form.MinimumSize = new Size (310, 254); form.Text = "Browse For Folder"; form.SizeGripStyle = SizeGripStyle.Show; newFolderMenuItem = new MenuItem("New Folder", new EventHandler (OnClickNewFolderButton)); folderBrowserTreeViewContextMenu.MenuItems.Add(newFolderMenuItem); // descriptionLabel descriptionLabel.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right))); descriptionLabel.Location = new Point (15, 14); descriptionLabel.Size = new Size (292, 40); descriptionLabel.TabIndex = 0; descriptionLabel.Text = string.Empty; // folderBrowserTreeView folderBrowserTreeView.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); folderBrowserTreeView.ImageIndex = -1; folderBrowserTreeView.Location = new Point (15, 60); folderBrowserTreeView.SelectedImageIndex = -1; folderBrowserTreeView.Size = new Size (292, 212); folderBrowserTreeView.TabIndex = 3; folderBrowserTreeView.ShowLines = false; folderBrowserTreeView.ShowPlusMinus = true; folderBrowserTreeView.HotTracking = true; folderBrowserTreeView.BorderStyle = BorderStyle.Fixed3D; folderBrowserTreeView.ContextMenu = folderBrowserTreeViewContextMenu; //folderBrowserTreeView.Indent = 2; // newFolderButton newFolderButton.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Left))); newFolderButton.FlatStyle = FlatStyle.System; newFolderButton.Location = new Point (15, 285); newFolderButton.Size = new Size (105, 23); newFolderButton.TabIndex = 4; newFolderButton.Text = "Make New Folder"; newFolderButton.Enabled = true; // okButton okButton.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right))); okButton.FlatStyle = FlatStyle.System; okButton.Location = new Point (135, 285); okButton.Size = new Size (80, 23); okButton.TabIndex = 1; okButton.Text = "OK"; // cancelButton cancelButton.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right))); cancelButton.DialogResult = DialogResult.Cancel; cancelButton.FlatStyle = FlatStyle.System; cancelButton.Location = new Point (227, 285); cancelButton.Size = new Size (80, 23); cancelButton.TabIndex = 2; cancelButton.Text = "Cancel"; form.Controls.Add (cancelButton); form.Controls.Add (okButton); form.Controls.Add (newFolderButton); form.Controls.Add (folderBrowserTreeView); form.Controls.Add (descriptionLabel); form.ResumeLayout (false); if (formConfigSize != Size.Empty) { form.Size = formConfigSize; } if (formConfigLocation != Point.Empty) { form.Location = formConfigLocation; } okButton.Click += new EventHandler (OnClickOKButton); cancelButton.Click += new EventHandler (OnClickCancelButton); newFolderButton.Click += new EventHandler (OnClickNewFolderButton); form.VisibleChanged += new EventHandler (OnFormVisibleChanged); RootFolder = rootFolder; }
internal FileDialog () { form = new DialogForm (this); vfs = new MWFVFS (); Size formConfigSize = Size.Empty; Point formConfigLocation = Point.Empty; object formWidth = MWFConfig.GetValue (filedialog_string, width_string); object formHeight = MWFConfig.GetValue (filedialog_string, height_string); if (formHeight != null && formWidth != null) formConfigSize = new Size ((int)formWidth, (int)formHeight); object formLocationX = MWFConfig.GetValue (filedialog_string, x_string); object formLocationY = MWFConfig.GetValue (filedialog_string, y_string); if (formLocationX != null && formLocationY != null) formConfigLocation = new Point ((int)formLocationX, (int)formLocationY); configFileNames = (string[])MWFConfig.GetValue (filedialog_string, filenames_string); fileTypeComboBox = new ComboBox (); backToolBarButton = new ToolBarButton (); newdirToolBarButton = new ToolBarButton (); searchSaveLabel = new Label (); mwfFileView = new MWFFileView (vfs); fileNameLabel = new Label (); fileNameComboBox = new ComboBox (); dirComboBox = new DirComboBox (vfs); smallButtonToolBar = new ToolBar (); menueToolBarButton = new ToolBarButton (); fileTypeLabel = new Label (); openSaveButton = new Button (); helpButton = new Button (); popupButtonPanel = new PopupButtonPanel (); upToolBarButton = new ToolBarButton (); cancelButton = new Button (); form.CancelButton = cancelButton; imageListTopToolbar = new ImageList (); menueToolBarButtonContextMenu = new ContextMenu (); readonlyCheckBox = new CheckBox (); form.SuspendLayout (); //imageListTopToolbar imageListTopToolbar.ColorDepth = ColorDepth.Depth32Bit; imageListTopToolbar.ImageSize = new Size (16, 16); // 16, 16 imageListTopToolbar.Images.Add (ResourceImageLoader.Get ("go-previous.png")); imageListTopToolbar.Images.Add (ResourceImageLoader.Get ("go-top.png")); imageListTopToolbar.Images.Add (ResourceImageLoader.Get ("folder-new.png")); imageListTopToolbar.Images.Add (ResourceImageLoader.Get ("preferences-system-windows.png")); imageListTopToolbar.TransparentColor = Color.Transparent; // searchLabel searchSaveLabel.FlatStyle = FlatStyle.System; searchSaveLabel.Location = new Point (6, 6); searchSaveLabel.Size = new Size (86, 22); searchSaveLabel.TextAlign = ContentAlignment.MiddleRight; // dirComboBox dirComboBox.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right))); dirComboBox.DropDownStyle = ComboBoxStyle.DropDownList; dirComboBox.Location = new Point (99, 6); dirComboBox.Size = new Size (261, 22); dirComboBox.TabIndex = 7; // smallButtonToolBar smallButtonToolBar.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right))); smallButtonToolBar.Appearance = ToolBarAppearance.Flat; smallButtonToolBar.AutoSize = false; smallButtonToolBar.Buttons.AddRange (new ToolBarButton [] { backToolBarButton, upToolBarButton, newdirToolBarButton, menueToolBarButton}); smallButtonToolBar.ButtonSize = new Size (24, 24); // 21, 16 smallButtonToolBar.Divider = false; smallButtonToolBar.Dock = DockStyle.None; smallButtonToolBar.DropDownArrows = true; smallButtonToolBar.ImageList = imageListTopToolbar; smallButtonToolBar.Location = new Point (372, 6); smallButtonToolBar.ShowToolTips = true; smallButtonToolBar.Size = new Size (140, 28); smallButtonToolBar.TabIndex = 8; smallButtonToolBar.TextAlign = ToolBarTextAlign.Right; // buttonPanel popupButtonPanel.Dock = DockStyle.None; popupButtonPanel.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left)))); popupButtonPanel.Location = new Point (6, 35); popupButtonPanel.Size = new Size (87, 338); popupButtonPanel.TabIndex = 9; // mwfFileView mwfFileView.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); mwfFileView.Location = new Point (99, 35); mwfFileView.Size = new Size (450, 283); mwfFileView.MultiSelect = false; mwfFileView.TabIndex = 10; mwfFileView.RegisterSender (dirComboBox); mwfFileView.RegisterSender (popupButtonPanel); // fileNameLabel fileNameLabel.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Left))); fileNameLabel.FlatStyle = FlatStyle.System; fileNameLabel.Location = new Point (101, 326); fileNameLabel.Size = new Size (70, 21); fileNameLabel.Text = "File name:"; fileNameLabel.TextAlign = ContentAlignment.MiddleLeft; // fileNameComboBox fileNameComboBox.Anchor = ((AnchorStyles)(((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right))); fileNameComboBox.Location = new Point (195, 326); fileNameComboBox.Size = new Size (246, 22); fileNameComboBox.TabIndex = 1; fileNameComboBox.MaxDropDownItems = MaxFileNameItems; fileNameComboBox.RestoreContextMenu (); UpdateRecentFiles (); // fileTypeLabel fileTypeLabel.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Left))); fileTypeLabel.FlatStyle = FlatStyle.System; fileTypeLabel.Location = new Point (101, 355); fileTypeLabel.Size = new Size (90, 21); fileTypeLabel.Text = "Files of type:"; fileTypeLabel.TextAlign = ContentAlignment.MiddleLeft; // fileTypeComboBox fileTypeComboBox.Anchor = ((AnchorStyles)(((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right))); fileTypeComboBox.DropDownStyle = ComboBoxStyle.DropDownList; fileTypeComboBox.Location = new Point (195, 355); fileTypeComboBox.Size = new Size (246, 22); fileTypeComboBox.TabIndex = 2; // backToolBarButton backToolBarButton.ImageIndex = 0; backToolBarButton.Enabled = false; backToolBarButton.Style = ToolBarButtonStyle.PushButton; mwfFileView.AddControlToEnableDisableByDirStack (backToolBarButton); // upToolBarButton upToolBarButton.ImageIndex = 1; upToolBarButton.Style = ToolBarButtonStyle.PushButton; mwfFileView.SetFolderUpToolBarButton (upToolBarButton); // newdirToolBarButton newdirToolBarButton.ImageIndex = 2; newdirToolBarButton.Style = ToolBarButtonStyle.PushButton; // menueToolBarButton menueToolBarButton.ImageIndex = 3; menueToolBarButton.DropDownMenu = menueToolBarButtonContextMenu; menueToolBarButton.Style = ToolBarButtonStyle.DropDownButton; // menueToolBarButtonContextMenu menueToolBarButtonContextMenu.MenuItems.AddRange (mwfFileView.ViewMenuItems); // openSaveButton openSaveButton.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right))); openSaveButton.FlatStyle = FlatStyle.System; openSaveButton.Location = new Point (474, 326); openSaveButton.Size = new Size (75, 23); openSaveButton.TabIndex = 4; openSaveButton.FlatStyle = FlatStyle.System; // cancelButton cancelButton.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right))); cancelButton.FlatStyle = FlatStyle.System; cancelButton.Location = new Point (474, 353); cancelButton.Size = new Size (75, 23); cancelButton.TabIndex = 5; cancelButton.Text = "Cancel"; cancelButton.FlatStyle = FlatStyle.System; // helpButton helpButton.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right))); helpButton.FlatStyle = FlatStyle.System; helpButton.Location = new Point (474, 353); helpButton.Size = new Size (75, 23); helpButton.TabIndex = 6; helpButton.Text = "Help"; helpButton.FlatStyle = FlatStyle.System; helpButton.Visible = false; // checkBox readonlyCheckBox.Anchor = ((AnchorStyles)(((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right))); readonlyCheckBox.Text = "Open Readonly"; readonlyCheckBox.Location = new Point (195, 350); readonlyCheckBox.Size = new Size (245, 21); readonlyCheckBox.TabIndex = 3; readonlyCheckBox.FlatStyle = FlatStyle.System; readonlyCheckBox.Visible = false; form.SizeGripStyle = SizeGripStyle.Show; form.AcceptButton = openSaveButton; form.MaximizeBox = true; form.MinimizeBox = true; form.FormBorderStyle = FormBorderStyle.Sizable; form.ClientSize = new Size (555, 385); form.MinimumSize = form.Size; form.Controls.Add (smallButtonToolBar); form.Controls.Add (cancelButton); form.Controls.Add (openSaveButton); form.Controls.Add (mwfFileView); form.Controls.Add (fileTypeLabel); form.Controls.Add (fileNameLabel); form.Controls.Add (fileTypeComboBox); form.Controls.Add (fileNameComboBox); form.Controls.Add (dirComboBox); form.Controls.Add (searchSaveLabel); form.Controls.Add (popupButtonPanel); form.Controls.Add (helpButton); form.Controls.Add (readonlyCheckBox); form.ResumeLayout (true); if (formConfigSize != Size.Empty) { form.ClientSize = formConfigSize; } if (formConfigLocation != Point.Empty) { form.Location = formConfigLocation; } openSaveButton.Click += new EventHandler (OnClickOpenSaveButton); cancelButton.Click += new EventHandler (OnClickCancelButton); helpButton.Click += new EventHandler (OnClickHelpButton); smallButtonToolBar.ButtonClick += new ToolBarButtonClickEventHandler (OnClickSmallButtonToolBar); fileTypeComboBox.SelectedIndexChanged += new EventHandler (OnSelectedIndexChangedFileTypeComboBox); mwfFileView.SelectedFileChanged += new EventHandler (OnSelectedFileChangedFileView); mwfFileView.ForceDialogEnd += new EventHandler (OnForceDialogEndFileView); mwfFileView.SelectedFilesChanged += new EventHandler (OnSelectedFilesChangedFileView); mwfFileView.ColumnClick += new ColumnClickEventHandler(OnColumnClickFileView); dirComboBox.DirectoryChanged += new EventHandler (OnDirectoryChangedDirComboBox); popupButtonPanel.DirectoryChanged += new EventHandler (OnDirectoryChangedPopupButtonPanel); readonlyCheckBox.CheckedChanged += new EventHandler (OnCheckCheckChanged); #if NET_2_0 form.FormClosed += new FormClosedEventHandler (OnFileDialogFormClosed); custom_places = new FileDialogCustomPlacesCollection (); #else form.Closed += new EventHandler (OnFileDialogFormClosed); #endif }
public PageSetupDialog () { form = new DialogForm (this); InitializeComponent(); Reset (); }