/// <summary> /// Creates a Gtk.Widget that's used to configure the service. This /// will be used in the Synchronization Preferences. Preferences should /// not automatically be saved by a GConf Property Editor. Preferences /// should be saved when SaveConfiguration () is called. /// </summary> public override Gtk.Widget CreatePreferencesControl() { Gtk.Table table = new Gtk.Table(1, 2, false); table.RowSpacing = 5; table.ColumnSpacing = 10; // Read settings out of gconf string syncPath; if (GetConfigSettings(out syncPath) == false) { syncPath = string.Empty; } Label l = new Label(Catalog.GetString("_Folder Path:")); l.Xalign = 1; table.Attach(l, 0, 1, 0, 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0); pathButton = new FileChooserButton(Catalog.GetString("Select Synchronization Folder..."), FileChooserAction.SelectFolder); l.MnemonicWidget = pathButton; pathButton.SetFilename(syncPath); table.Attach(pathButton, 1, 2, 0, 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0); table.ShowAll(); return(table); }
private EditorWindow(Builder builder) : base(builder.GetObject(Common.ID_MainWindow).Handle) { builder.Autoconnect(this); _rightVBox = builder.GetObject(Common.ID_RightVBox) as Box; _packageChooser = builder.GetObject(Common.ID_PackageChooser) as FileChooserButton; _packageSaveButton = builder.GetObject(Common.ID_PackageSaveButton) as Button; _packageCookButton = builder.GetObject(Common.ID_PackageCookButton) as Button; _packageSaver = builder.GetObject(Common.ID_PackageSaver) as FileChooserDialog; _packageSavePopover = builder.GetObject(Common.ID_PackageSavePopover) as Popover; _drawingArea = builder.GetObject(Common.ID_DrawingArea) as DrawingArea; _hierarchyTree = builder.GetObject(Common.ID_HierarchyTree) as TreeView; _aboutDialog = builder.GetObject(Common.ID_AboutDialog) as AboutDialog; _aboutTrigger = builder.GetObject(Common.ID_AboutDialogTrigger) as MenuItem; _templatePopover = builder.GetObject(Common.ID_TemplatePopover) as Popover; _templatePopoverTrigger = builder.GetObject(Common.ID_TemplatePopoverTrigger) as Button; _renderStats = builder.GetObject(Common.ID_FrameRenderStats) as Label; _hierarchyModel = _hierarchyTree.Model as ListStore; DeleteEvent += Window_DeleteEvent; _packageChooser.FileSet += PackageChooser_LoadFile; _packageSaveButton.Clicked += PackageSaveButton_Clicked; _packageCookButton.Clicked += PackageCookButton_Clicked; _packageSaver.FileActivated += PackageSaver_SaveFile; _aboutTrigger.Activated += AboutTrigger_Activated; _templatePopoverTrigger.Clicked += TemplatePopoverTrigger_Clicked; _actorTree = DefaultActorListFactory.New(); _gtkRenderer = new GtkRenderer(_drawingArea); _hydra = new HotSwappableHydraEngine(_actorTree, _gtkRenderer); _gtkRenderer.LinkTo(_hydra); _rendererLayer = new EditorLayer(_drawingArea, _renderStats); _gtkRenderer.RegisterRenderLayer(_rendererLayer); UpdateHierarchy(); }
public LibraryLocationButton(LibrarySource source) { this.source = source; preference = source.PreferencesPage["library-location"]["library-location"] as SchemaPreference <string>; preference.ShowLabel = false; preference.DisplayWidget = this; string dir = preference.Value ?? source.DefaultBaseDirectory; Spacing = 5; // FileChooserButton wigs out if the directory does not exist, // so create it if it doesn't and store the fact that we did // in case it ends up not being used, we can remove it try { if (!Banshee.IO.Directory.Exists(dir)) { Banshee.IO.Directory.Create(dir); created_directory = dir; Log.DebugFormat("Created library directory: {0}", created_directory); } } catch { } chooser = new FileChooserButton(Catalog.GetString("Select library location"), FileChooserAction.SelectFolder); // Only set the LocalOnly property if false; setting it when true // causes the "Other..." entry to be hidden in older Gtk+ if (!Banshee.IO.Provider.LocalOnly) { chooser.LocalOnly = Banshee.IO.Provider.LocalOnly; } chooser.SetCurrentFolder(dir); chooser.SelectionChanged += OnChooserChanged; HBox box = new HBox(); box.Spacing = 2; box.PackStart(new Image(Stock.Undo, IconSize.Button), false, false, 0); box.PackStart(new Label(Catalog.GetString("Reset")), false, false, 0); reset = new Button() { Sensitive = dir != source.DefaultBaseDirectory, TooltipText = String.Format(Catalog.GetString("Reset location to default ({0})"), source.DefaultBaseDirectory) }; reset.Clicked += OnReset; reset.Add(box); //Button open = new Button (); //open.PackStart (new Image (Stock.Open, IconSize.Button), false, false, 0); //open.Clicked += OnOpen; PackStart(chooser, true, true, 0); PackStart(reset, false, false, 0); //PackStart (open, false, false, 0); chooser.Show(); reset.ShowAll(); }
/// <summary> /// Initializes a new instance of the <see cref="Sharpend.GtkSharp.FileChooserWrapper"/> class. /// /// </summary> /// <param name='title'> /// Title. /// </param> /// <param name='chooser'> /// Chooser. /// </param> /// <param name='entryPath'> /// Entry to display selected path (optional, can be null) /// </param> /// <param name='action'> /// Action. /// </param> public FileChooserButtonWrapper(String title, FileChooserButton chooser, Entry entryPath, FileChooserAction action) { Chooser = chooser; EntryPath = entryPath; Chooser.Action = action; ConfigFile = null; CurrentFilter = null; Chooser.Title = title; init(); }
public CreateTorrentDialog(TorrentController torrentController) { this.Build(); this.torrentController = torrentController; newTorrentLocationButton = new FileChooserButton(_("Select file"), FileChooserAction.Open); selectFileHbox.Add(newTorrentLocationButton); newTorrentLocationButton.Show(); BuildTrackerWidgets(); }
private void buildImportPanel() { importLocationButton = new FileChooserButton(_("Import folder to scan"), FileChooserAction.SelectFolder); importLocationButton.SetCurrentFolder(prefSettings.ImportLocation); importLocationButton.CurrentFolderChanged += OnImportLocationFolderChanged; importDirectoryHbox.Add(importLocationButton); if (!importTorrentsCheckBox.Active) { importLocationButton.Sensitive = false; } importLocationButton.Show(); }
FileChooserButton CreateTestDllButton() { var entry = new FileChooserButton(_("Open..."), FileChooserAction.Open); var testDll = GetVariable <string>("test_dll"); entry.SetFilename(testDll.Value); entry.SelectionChanged += delegate { testDll.Value = entry.Filename ?? testDll.Value; }; return(entry); }
public ConfigDirectoryWidget(IConfigDirectoryFrontend viewModel) : base(viewModel) { this.viewModel = viewModel; var valueBox = new Box(Orientation.Horizontal, 0); valueBox.Add(chooser = CreateFileChooser()); valueBox.Add(CreateShowInFilesButton()); valueBox.SetSizeRequest(ElementWidth, chooser.AllocatedHeight); Add(valueBox); UpdateVisibleState(); chooser.FileSet += delegate { UpdateViewModel(); }; viewModel.PropertyChanged += delegate { UpdateVisibleState(); }; }
public DruidStoragePage() { this.Build(); torrentButton = new FileChooserButton("Select torrent storage directory...", FileChooserAction.SelectFolder); dataButton = new FileChooserButton("Select default download directory...", FileChooserAction.SelectFolder); torrentButton.ShowAll(); dataButton.ShowAll(); storageTable.Attach(dataButton, 1, 2, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); storageTable.Attach(torrentButton, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); torrentButton.SetCurrentFolder(System.IO.Path.Combine(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "monotorrent"), "torrents")); dataButton.SetCurrentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); }
public ProfileSetupDialog(Gtk.Window parent) : base("Profile Options", parent, DialogFlags.DestroyWithParent, Stock.Cancel, ResponseType.Cancel, Stock.Execute, ResponseType.Accept) { config = new ProfileConfiguration(); HBox box = new HBox(false, 6); box.PackStart(new Label("Assembly:"), false, false, 0); FileChooserButton assembly_button = new FileChooserButton("Select Assembly", FileChooserAction.Open); FileFilter filter = new FileFilter(); filter.AddPattern("*.exe"); assembly_button.Filter = filter; assembly_button.SelectionChanged += delegate { config.AssemblyPath = assembly_button.Filename; SetResponseSensitive(ResponseType.Accept, !String.IsNullOrEmpty(assembly_button.Filename)); }; box.PackStart(assembly_button, true, true, 0); box.ShowAll(); VBox.PackStart(box, false, false, 3); box = new HBox(false, 6); box.PackStart(new Label("Type:"), false, false, 0); ComboBox type_combo = ComboBox.NewText(); type_combo.AppendText("Allocations"); type_combo.AppendText("Calls/Instrumented"); type_combo.AppendText("Statistical"); type_combo.Active = 2; type_combo.Changed += delegate { config.Mode = (ProfileMode)(1 << type_combo.Active); }; box.PackStart(type_combo, false, false, 0); box.ShowAll(); VBox.PackStart(box, false, false, 3); box = new HBox(false, 6); CheckButton start_enabled_chkbtn = new CheckButton("Enabled at Startup"); start_enabled_chkbtn.Active = true; start_enabled_chkbtn.Toggled += delegate { config.StartEnabled = start_enabled_chkbtn.Active; }; box.PackStart(start_enabled_chkbtn, false, false, 0); box.ShowAll(); VBox.PackStart(box, false, false, 3); SetResponseSensitive(ResponseType.Accept, false); }
public Dialog(VariableSet variables) : base("Picture Frame", variables) { var vbox = new VBox(false, 12) { BorderWidth = 12 }; VBox.PackStart(vbox, true, true, 0); var entry = new FileChooserButton(_("Load Frame..."), FileChooserAction.Open); entry.SelectionChanged += delegate { GetVariable <string>("image_path").Value = entry.Filename; }; vbox.PackStart(entry, false, false, 0); }
private void buildFoldersPanel() { downloadLocationButton = new FileChooserButton(_("Download location"), FileChooserAction.SelectFolder); downloadLocationButton.SetCurrentFolder(engineSettings.SavePath); downloadLocationButton.CurrentFolderChanged += OnDownloadLocationButtonFolderChanged; foldersTable.Attach(downloadLocationButton, 1, 2, 0, 1); downloadLocationButton.Show(); torrentStorageLocationButton = new FileChooserButton(_("Torrage storage location"), FileChooserAction.SelectFolder); torrentStorageLocationButton.SetCurrentFolder(prefSettings.TorrentStorageLocation); torrentStorageLocationButton.CurrentFolderChanged += OnTorrentStorageLocationFolderChanged; foldersTable.Attach(torrentStorageLocationButton, 1, 2, 1, 2); torrentStorageLocationButton.Show(); }
private void BuildFilterPage() { TreeViewColumn filterColumn = new TreeViewColumn(); filterListStore = new ListStore(typeof(RssFilter)); CellRendererText textRenderer = new CellRendererText(); filterFeedCombobox.PackStart(textRenderer, true); filterFeedCombobox.AddAttribute(textRenderer, "text", 0); filterFeedListStore = new ListStore(typeof(string)); allIter = filterFeedListStore.AppendValues("All"); filterFeedCombobox.Model = filterFeedListStore; filterFeedCombobox.SetActiveIter(allIter); filterColumn.Title = "Filter"; Gtk.CellRendererText filterCell = new Gtk.CellRendererText(); filterColumn.PackStart(filterCell, true); filterColumn.SetCellDataFunc(filterCell, new Gtk.TreeCellDataFunc(RenderFilter)); filterTreeView.AppendColumn(filterColumn); filterTreeView.Model = filterListStore; savePathChooserButton = new FileChooserButton("Select a Save Path", FileChooserAction.SelectFolder); savePathChooserButton.SetCurrentFolder(controller.TorrentController.engine.Settings.SavePath); savePathChooserButton.ShowAll(); filterTable.Attach(savePathChooserButton, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); foreach (RssFilter filter in controller.Filters) { filterListStore.AppendValues(filter); } foreach (string feed in controller.Feeds) { filterFeedListStore.AppendValues(feed); } filterTreeView.Selection.Changed += OnFilterTreeViewSelectionChanged; }
void DrawScene(Scene scene) { this.scene = scene; var fileChooserAdd = new FileChooserButton("Select model", FileChooserAction.Open); fileChooserAdd.WidthRequest = 124; fileChooserAdd.Name = "filechooserbutton3"; fileChooserAdd.FileSet += (sender, e) => { var wait = core.AddNotyfyTask(() => { SceneNode modelNode = ResourcesManager.LoadAsset <ModelPrefab>(fileChooserAdd.Filename).CreateNode(); scene.AddNode2Root(modelNode); //Set name var path = System.IO.Path.GetDirectoryName(fileChooserAdd.Filename); modelNode.Name = path.Substring(path.LastIndexOf('\\') + 1) + "." + System.IO.Path.GetFileNameWithoutExtension(fileChooserAdd.Filename); }); wait.WaitOne(); ClearChildrens(fixedScene); DrawScene(scene); }; fixedScene.Put(fileChooserAdd, 0, 0); fileChooserAdd.Show(); int y = 35; foreach (var node in scene.GetNodes()) { Button btn = new Button(); btn.Label = node.Name; btn.TooltipText = node.Name; btn.Name = "btn"; btn.HeightRequest = 20; btn.Clicked += (sender, e) => { DrawComponents(node); }; fixedScene.Put(btn, 0, y); btn.Show(); y += 35; } var cont = fixedScene.CreatePangoContext(); }
void SetFileEntry(bool isDir) { if (_choose != null) { _choose.Hide(); } if (isDir) { _choose = new FileChooserButton(_("Open..."), FileChooserAction.SelectFolder); _choose.SelectionChanged += delegate { string directory = _choose.Filename; if (directory.Length > 0) { _loader.Value = new DirImageProviderFactory(directory, _recursive.Value); } }; } else { _choose = new FileChooserButton(_("Open..."), FileChooserAction.Open); _choose.SelectionChanged += delegate { string fileName = _choose.Filename; if (fileName.Length > 0) { _loader.Value = new FileImageProviderFactory(fileName); } }; } _choose.Show(); Table.Attach(_choose, 1, 2, 1, 2, AttachOptions.Shrink, AttachOptions.Fill, 0, 0); }
void build() { this.Title = "Einstellungen"; var mainBox = new VBox(); dbInfoLabel = new Label(); dbInfoLabel.Text = string.Format("Exestiert die Datenbank: {0}", System.IO.File.Exists(QuestionProvider.dbPath)); mainBox.Add(dbInfoLabel); newDbButton = new FileChooserButton("Question File Open", FileChooserAction.Open); mainBox.Add(newDbButton); dbLoadLabel = new Label(); mainBox.Add(dbLoadLabel); var createDbButton = new Button(new Label("Datenbank erstellen")); createDbButton.Clicked += HandleCreateDbButtonClicked; mainBox.Add(createDbButton); var removeDbButton = new Button(new Label("Datenbank löschen")); removeDbButton.Clicked += delegate { QuestionProvider.RemoveDb(); dbInfoLabel.Text = string.Format("Exestiert die Datenbank: {0}", System.IO.File.Exists(QuestionProvider.dbPath)); }; mainBox.Add(removeDbButton); this.VBox.Add(mainBox); this.AddButton("Schließen", ResponseType.Close); this.ShowAll(); }
private void InitUI() { try { //Init Local Vars _article = (_dataSourceRow as FIN_Article); if (_dialogMode != DialogMode.Insert) { //Get totalNumberOfFinanceDocuments to check if article has already used in Finance Documents, to protect name changes etc string sql = string.Format("SELECT COUNT(*) as Count FROM fin_documentfinancedetail WHERE Article = '{0}';", _article.Oid); var sqlResult = GlobalFramework.SessionXpo.ExecuteScalar(sql); _totalNumberOfFinanceDocuments = Convert.ToUInt16(sqlResult); } //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Tab1 VBox vboxTab1 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //Ord Entry entryOrd = new Entry(); BOWidgetBox boxLabel = new BOWidgetBox(Resx.global_record_order, entryOrd); vboxTab1.PackStart(boxLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true)); //Code Entry entryCode = new Entry(); BOWidgetBox boxCode = new BOWidgetBox(Resx.global_record_code, entryCode); vboxTab1.PackStart(boxCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexAlfaNumericArticleCode, true)); //CodeDealer Entry entryCodeDealer = new Entry(); BOWidgetBox boxCodeDealer = new BOWidgetBox(Resx.global_record_code_dealer, entryCodeDealer); vboxTab1.PackStart(boxCodeDealer, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCodeDealer, _dataSourceRow, "CodeDealer", SettingsApp.RegexAlfaNumeric, false)); //Designation Entry entryDesignation = new Entry(); BOWidgetBox boxDesignation = new BOWidgetBox(Resx.global_designation, entryDesignation); vboxTab1.PackStart(boxDesignation, false, false, 0); // Changed from RegexAlfaNumeric to RegexAlfaNumericExtended 2017-1011 _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true)); //ButtonLabel Entry entryButtonLabel = new Entry(); BOWidgetBox boxButtonLabel = new BOWidgetBox(Resx.global_button_name, entryButtonLabel); vboxTab1.PackStart(boxButtonLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxButtonLabel, _dataSourceRow, "ButtonLabel", SettingsApp.RegexAlfaNumericArticleButtonLabel, false)); //Family _xpoComboBoxFamily = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleFamily), (DataSourceRow as FIN_Article).Family, "Designation"); BOWidgetBox boxFamily = new BOWidgetBox(Resx.global_article_family, _xpoComboBoxFamily); vboxTab1.PackStart(boxFamily, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFamily, DataSourceRow, "Family", SettingsApp.RegexGuid, true)); //SubFamily _xpoComboBoxSubFamily = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleSubFamily), (DataSourceRow as FIN_Article).SubFamily, "Designation"); BOWidgetBox boxSubFamily = new BOWidgetBox(Resx.global_article_subfamily, _xpoComboBoxSubFamily); vboxTab1.PackStart(boxSubFamily, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxSubFamily, DataSourceRow, "SubFamily", SettingsApp.RegexGuid, true)); //Type XPOComboBox xpoComboBoxType = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleType), (DataSourceRow as FIN_Article).Type, "Designation"); BOWidgetBox boxType = new BOWidgetBox(Resx.global_article_type, xpoComboBoxType); vboxTab1.PackStart(boxType, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxType, DataSourceRow, "Type", SettingsApp.RegexGuid, true)); //ButtonImage FileChooserButton fileChooserButtonImage = new FileChooserButton(string.Empty, FileChooserAction.Open) { HeightRequest = 23 }; Image fileChooserImagePreviewButtonImage = new Image() { WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height }; Frame fileChooserFrameImagePreviewButtonImage = new Frame(); fileChooserFrameImagePreviewButtonImage.ShadowType = ShadowType.None; fileChooserFrameImagePreviewButtonImage.Add(fileChooserImagePreviewButtonImage); fileChooserButtonImage.SetFilename(((FIN_Article)DataSourceRow).ButtonImage); fileChooserButtonImage.Filter = Utils.GetFileFilterImages(); fileChooserButtonImage.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewButtonImage.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewButtonImage.WidthRequest, fileChooserImagePreviewButtonImage.HeightRequest)); BOWidgetBox boxfileChooserButtonImage = new BOWidgetBox(Resx.global_button_image, fileChooserButtonImage); HBox hboxfileChooserAndimagePreviewButtonImage = new HBox(false, _boxSpacing); hboxfileChooserAndimagePreviewButtonImage.PackStart(boxfileChooserButtonImage, true, true, 0); hboxfileChooserAndimagePreviewButtonImage.PackStart(fileChooserFrameImagePreviewButtonImage, false, false, 0); vboxTab1.PackStart(hboxfileChooserAndimagePreviewButtonImage, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserButtonImage, _dataSourceRow, "ButtonImage", string.Empty, false)); //Favorite CheckButton checkButtonFavorite = new CheckButton(Resx.global_favorite); vboxTab1.PackStart(checkButtonFavorite, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonFavorite, _dataSourceRow, "Favorite")); //UseWeighingBalance CheckButton checkButtonUseWeighingBalance = new CheckButton(Resx.global_use_weighing_balance); vboxTab1.PackStart(checkButtonUseWeighingBalance, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonUseWeighingBalance, _dataSourceRow, "UseWeighingBalance")); //Disabled CheckButton checkButtonDisabled = new CheckButton(Resx.global_record_disabled); if (_dialogMode == DialogMode.Insert) { checkButtonDisabled.Active = SettingsApp.BOXPOObjectsStartDisabled; } vboxTab1.PackStart(checkButtonDisabled, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonDisabled, _dataSourceRow, "Disabled")); //Append Tab _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail)); //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Tab2 _vboxTab2 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; int col1width = 100, col2width = 90, col3width = col2width, col4width = 160; //hboxPrices Label labelPriceEmpty = new Label(string.Empty) { WidthRequest = col1width }; Label labelPriceNormal = new Label(Resx.article_normal_price) { WidthRequest = col2width }; Label labelPricePromotion = new Label(Resx.article_promotion_price) { WidthRequest = col3width }; Label labelPriceUsePromotionPrice = new Label(Resx.article_use_promotion_price) { WidthRequest = col4width }; labelPriceNormal.SetAlignment(0.0F, 0.5F); labelPricePromotion.SetAlignment(0.0F, 0.5F); labelPriceUsePromotionPrice.SetAlignment(0.0F, 0.5F); VBox vboxPrices = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; HBox hboxPrices = new HBox(false, _boxSpacing); hboxPrices.PackStart(labelPriceEmpty, true, true, 0); hboxPrices.PackStart(labelPriceNormal, false, false, 0); hboxPrices.PackStart(labelPricePromotion, false, false, 0); hboxPrices.PackStart(labelPriceUsePromotionPrice, false, false, 0); //PackIt VBox vboxPrices.PackStart(hboxPrices, false, false, 0); //Get PriceType Collection : Require Criteria to exclude SettingsApp.XpoOidUndefinedRecord, else we get a Price0 here CriteriaOperator criteriaOperator = CriteriaOperator.Parse(string.Format("(Disabled IS NULL OR Disabled <> 1) OR (Oid <> '{0}')", SettingsApp.XpoOidUndefinedRecord)); XPCollection xpcConfigurationPriceType = new XPCollection(DataSourceRow.Session, typeof(FIN_ConfigurationPriceType), criteriaOperator); xpcConfigurationPriceType.Sorting = FrameworkUtils.GetXPCollectionDefaultSortingCollection(); //Define Max 5 Rows : 5 Prices int priceTypeCount = (xpcConfigurationPriceType.Count > 5) ? 5 : xpcConfigurationPriceType.Count; //Loop and Render Columns for (int i = 0; i < priceTypeCount; i++) { int priceTypeIndex = ((FIN_ConfigurationPriceType)xpcConfigurationPriceType[i]).EnumValue; //FieldNames string fieldNamePriceNormal = string.Format("Price{0}", priceTypeIndex); string fieldNamePricePromotion = string.Format("Price{0}Promotion", priceTypeIndex); string fieldNamePriceUsePromotionPrice = string.Format("Price{0}UsePromotionPrice", priceTypeIndex); //PriceType Label labelPriceType = new Label(((FIN_ConfigurationPriceType)xpcConfigurationPriceType[i]).Designation) { WidthRequest = col1width }; labelPriceType.SetAlignment(0.0F, 0.5F); //Entrys Entry entryPriceNormal = new Entry() { WidthRequest = col2width }; Entry entryPricePromotion = new Entry() { WidthRequest = col3width }; _crudWidgetList.Add(new GenericCRUDWidgetXPO(entryPriceNormal, _dataSourceRow, fieldNamePriceNormal, SettingsApp.RegexDecimalGreaterEqualThanZero, true)); _crudWidgetList.Add(new GenericCRUDWidgetXPO(entryPricePromotion, _dataSourceRow, fieldNamePricePromotion, SettingsApp.RegexDecimalGreaterEqualThanZero, true)); //UsePromotion CheckButton checkButtonUsePromotion = new CheckButton(string.Empty) { WidthRequest = col4width }; _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonUsePromotion, _dataSourceRow, fieldNamePriceUsePromotionPrice)); //PackIt hboxPrices = new HBox(false, _boxSpacing); hboxPrices.PackStart(labelPriceType, true, true, 0); hboxPrices.PackStart(entryPriceNormal, false, false, 0); hboxPrices.PackStart(entryPricePromotion, false, false, 0); hboxPrices.PackStart(checkButtonUsePromotion, false, false, 0); //PackIt VBox vboxPrices.PackStart(hboxPrices, false, false, 0); } _vboxTab2.PackStart(vboxPrices, false, false, 0); //PVPVariable CheckButton checkButtonPVPVariable = new CheckButton(Resx.global_variable_price); _vboxTab2.PackStart(checkButtonPVPVariable, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonPVPVariable, _dataSourceRow, "PVPVariable")); //PriceWithVat CheckButton checkButtonPriceWithVat = new CheckButton(Resx.global_price_with_vat); _vboxTab2.PackStart(checkButtonPriceWithVat, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonPriceWithVat, _dataSourceRow, "PriceWithVat")); //Discount Entry entryDiscount = new Entry(); BOWidgetBox boxDiscount = new BOWidgetBox(Resx.global_discount, entryDiscount); _vboxTab2.PackStart(boxDiscount, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscount, _dataSourceRow, "Discount", SettingsApp.RegexPercentage, false)); //Class XPOComboBox xpoComboBoxClass = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleClass), (DataSourceRow as FIN_Article).Class, "Designation"); BOWidgetBox boxClass = new BOWidgetBox(Resx.global_article_class, xpoComboBoxClass); _vboxTab2.PackStart(boxClass, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxClass, DataSourceRow, "Class", SettingsApp.RegexGuid, true)); //Normal App Mode if (SettingsApp.AppMode == AppOperationMode.Default) { //VatOnTable _xpoComboBoxVatOnTable = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatRate), (DataSourceRow as FIN_Article).VatOnTable, "Designation"); BOWidgetBox boxVatOnTable = new BOWidgetBox(Resx.global_vat_on_table, _xpoComboBoxVatOnTable); _vboxTab2.PackStart(boxVatOnTable, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatOnTable, DataSourceRow, "VatOnTable", SettingsApp.RegexGuid, true)); } //VatDirectSelling _xpoComboBoxVatDirectSelling = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatRate), (DataSourceRow as FIN_Article).VatDirectSelling, "Designation"); BOWidgetBox boxVatDirectSelling = new BOWidgetBox(Resx.global_vat_direct_selling, _xpoComboBoxVatDirectSelling); _vboxTab2.PackStart(boxVatDirectSelling, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatDirectSelling, DataSourceRow, "VatDirectSelling", SettingsApp.RegexGuid, true)); //VatExemptionReason _xpoComboBoxVatExemptionReason = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatExemptionReason), (DataSourceRow as FIN_Article).VatExemptionReason, "Designation"); BOWidgetBox boxVatExemptionReason = new BOWidgetBox(Resx.global_vat_exemption_reason, _xpoComboBoxVatExemptionReason); _vboxTab2.PackStart(boxVatExemptionReason, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatExemptionReason, DataSourceRow, "VatExemptionReason", SettingsApp.RegexGuid, true)); //Append Tab _notebook.AppendPage(_vboxTab2, new Label(Resx.dialog_edit_article_tab2_label)); //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Tab3 VBox vboxTab3 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //BarCode Entry entryBarCode = new Entry(); BOWidgetBox boxBarCode = new BOWidgetBox(Resx.global_barcode, entryBarCode); vboxTab3.PackStart(boxBarCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxBarCode, _dataSourceRow, "BarCode", SettingsApp.RegexEan12andEan4, false)); //Accounting Entry entryAccounting = new Entry(); BOWidgetBox boxAccounting = new BOWidgetBox(Resx.global_accounting, entryAccounting); vboxTab3.PackStart(boxAccounting, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAccounting, _dataSourceRow, "Accounting", SettingsApp.RegexDecimal, false)); //Tare Entry entryTare = new Entry(); BOWidgetBox boxTare = new BOWidgetBox(Resx.global_tare, entryTare); vboxTab3.PackStart(boxTare, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTare, _dataSourceRow, "Tare", SettingsApp.RegexDecimal, false)); //Weight Entry entryWeight = new Entry(); BOWidgetBox boxWeight = new BOWidgetBox(Resx.global_weight, entryWeight); vboxTab3.PackStart(boxWeight, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxWeight, _dataSourceRow, "Weight", SettingsApp.RegexDecimal, false)); //DefaultQuantity Entry entryDefaultQuantity = new Entry(); BOWidgetBox boxDefaultQuantity = new BOWidgetBox(Resx.global_article_default_quantity, entryDefaultQuantity); vboxTab3.PackStart(boxDefaultQuantity, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDefaultQuantity, _dataSourceRow, "DefaultQuantity", SettingsApp.RegexDecimal, false)); //UnitMeasure XPOComboBox xpoComboBoxUnitMeasure = new XPOComboBox(DataSourceRow.Session, typeof(CFG_ConfigurationUnitMeasure), (DataSourceRow as FIN_Article).UnitMeasure, "Designation"); BOWidgetBox boxUnitMeasure = new BOWidgetBox(Resx.global_unit_measure, xpoComboBoxUnitMeasure); vboxTab3.PackStart(boxUnitMeasure, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxUnitMeasure, DataSourceRow, "UnitMeasure", SettingsApp.RegexGuid, true)); //UnitSize XPOComboBox xpoComboBoxUnitSize = new XPOComboBox(DataSourceRow.Session, typeof(CFG_ConfigurationUnitSize), (DataSourceRow as FIN_Article).UnitSize, "Designation"); BOWidgetBox boxUnitSize = new BOWidgetBox(Resx.global_unit_size, xpoComboBoxUnitSize); vboxTab3.PackStart(boxUnitSize, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxUnitSize, DataSourceRow, "UnitSize", SettingsApp.RegexGuid, true)); //Printer XPOComboBox xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrinters), (DataSourceRow as FIN_Article).Printer, "Designation"); BOWidgetBox boxPrinter = new BOWidgetBox(Resx.global_device_printer, xpoComboBoxPrinter); vboxTab3.PackStart(boxPrinter, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, false)); //Template XPOComboBox xpoComboBoxTemplate = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrintersTemplates), (DataSourceRow as FIN_Article).Template, "Designation"); BOWidgetBox boxTemplate = new BOWidgetBox(Resx.global_ConfigurationPrintersTemplates, xpoComboBoxTemplate); vboxTab3.PackStart(boxTemplate, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplate, DataSourceRow, "Template", SettingsApp.RegexGuid, false)); if (GlobalApp.ScreenSize.Width > 800 && GlobalApp.ScreenSize.Height > 600) { //CommissionGroup XPOComboBox xpoComboBoxCommissionGroup = new XPOComboBox(DataSourceRow.Session, typeof(POS_UserCommissionGroup), (DataSourceRow as FIN_Article).CommissionGroup, "Designation"); BOWidgetBox boxCommissionGroup = new BOWidgetBox(Resx.global_commission_group, xpoComboBoxCommissionGroup); vboxTab3.PackStart(boxCommissionGroup, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCommissionGroup, DataSourceRow, "CommissionGroup", SettingsApp.RegexGuid, false)); //DiscountGroup XPOComboBox xpoComboBoxDiscountGroup = new XPOComboBox(DataSourceRow.Session, typeof(ERP_CustomerDiscountGroup), (DataSourceRow as FIN_Article).DiscountGroup, "Designation"); BOWidgetBox boxDiscountGroup = new BOWidgetBox(Resx.global_discount_group, xpoComboBoxDiscountGroup); vboxTab3.PackStart(boxDiscountGroup, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscountGroup, DataSourceRow, "DiscountGroup", SettingsApp.RegexGuid, false)); } //Append Tab _notebook.AppendPage(vboxTab3, new Label(Resx.dialog_edit_article_tab3_label)); //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Enable/Disable Components entryDesignation.Sensitive = (_totalNumberOfFinanceDocuments > 0) ? false : true; //Show or Hide vboxTab2 if (_article.Type != null) { _vboxTab2.Visible = _article.Type.HavePrice; } //Assign Initial Value for Family DefineInitialValueForXpoComboBoxFamily(); //Call UI Update for VatExemptionReason UpdateUIVatExemptionReason(); //Events _xpoComboBoxFamily.Changed += xpoComboBoxFamily_Changed; xpoComboBoxType.Changed += xpoComboBoxType_Changed; _xpoComboBoxVatDirectSelling.Changed += xpoComboBoxVatDirectSelling_Changed; if (_xpoComboBoxVatOnTable != null) { _xpoComboBoxVatOnTable.Changed += xpoComboBoxVatDirectSelling_Changed; } } catch (System.Exception ex) { _log.Error(ex.Message, ex); } }
public SampleAssistant() { SetSizeRequest(450, 300); Title = "Gtk.Assistant Sample"; // ANA SAYFA Label lbl = new Label("HELLO PEOPLE OF EKINOKS"); AppendPage(lbl); SetPageTitle(lbl, "Introduction"); SetPageType(lbl, AssistantPageType.Intro); SetPageComplete(lbl, true); // ZIP SECME SAYFASI FileChooserButton fileChooserButton = new FileChooserButton("Choose the instalation zip", 0); HBox box = new HBox(true, 1); box.PackStart(fileChooserButton); fileChooserButton.CurrentFolderChanged += new EventHandler(Deneme); AppendPage(box); SetPageTitle(box, "Choose zip, people of Ekinoks"); SetPageType(box, AssistantPageType.Content); //ESKI YAZI SEC SAYFASI //HBox box = new HBox(false, 6); //box.PackStart(new Label("Enter some text: "), false, false, 6); //Entry entry = new Entry(); //entry.Changed += new EventHandler(EntryChanged); //box.PackStart(entry, false, false, 6); //Entry entry2 = new Entry(); //entry2.Changed += new EventHandler(EntryChanged); //box.PackStart(entry2, false, false, 6); //AppendPage(box); //SetPageTitle(box, "Getting Some Input"); //SetPageType(box, AssistantPageType.Content); CheckButton chk = new CheckButton("I think Gtk# is awesome."); chk.Toggled += new EventHandler(ButtonToggled); AppendPage(chk); SetPageTitle(chk, "Provide Feedback"); SetPageType(chk, AssistantPageType.Content); Alignment al = new Alignment(0.5f, 0.5f, 0.0f, 0.0f); box = new HBox(false, 6); progress_bar = new ProgressBar(); box.PackStart(progress_bar, true, true, 6); Button btn = new Button("Make progress"); btn.Clicked += new EventHandler(ButtonClicked); box.PackStart(btn, false, false, 6); al.Add(box); AppendPage(al); SetPageTitle(al, "Show Some Progress"); SetPageType(al, AssistantPageType.Progress); lbl = new Label("In addition to being able to type,\nYou obviously have great taste in software."); AppendPage(lbl); SetPageTitle(lbl, "Congratulations"); SetPageType(lbl, AssistantPageType.Confirm); SetPageComplete(lbl, true); Cancel += new EventHandler(AssistantCancel); Close += new EventHandler(AssistantClose); }
void AnimatorWindow(Animator animator) { var timer = new Time(); ClearChildrens(fixed4); fileChooser = new FileChooserButton("Select a File", FileChooserAction.Open); fileChooser.WidthRequest = 124; fileChooser.Name = "filechooserbutton2"; fixed4.Put(fileChooser, 0, 19); fileChooser.Show(); // Container child fixed1.Gtk.Fixed+FixedChild var btnStart = new Button(); btnStart.WidthRequest = 109; btnStart.Name = "button2"; btnStart.Label = "Play"; fixed4.Put(btnStart, 0, 63); btnStart.Show(); // Container child fixed1.Gtk.Fixed+FixedChild var btn = new Button(); btn.WidthRequest = 110; btn.CanFocus = true; btn.Name = "button3"; btn.Label = "Stop"; fixed4.Put(btn, 0, 108); btn.Show(); // Container child fixed1.Gtk.Fixed+FixedChild var btnPR = new Button(); btnPR.WidthRequest = 110; btnPR.CanFocus = true; btnPR.Name = "button4"; btnPR.Label = "Pause"; fixed4.Put(btnPR, 0, 153); btnPR.Show(); fileChooser.FileSet += (sender, e) => { try { var an = AnimationLoader.Load(fileChooser.Filename); if (an != null) { animator.AnimationData = an; } } catch (Exception ex) { Console.WriteLine("cant load animation\n{0}\n{1}", ex.Message, ex.StackTrace); } }; //Play bool play = false; bool pause = false; btnStart.Clicked += (sender, e) => { animator.Play(); play = true; }; btn.Clicked += (sender, e) => { play = false; animator.Stop(); }; btnPR.Clicked += (sender, e) => { if (play && !pause) { animator.Pause(); btnPR.Label = "Resume"; pause = !pause; } else if (play) { animator.Resume(); btnPR.Label = "Pause"; pause = !pause; } }; }
private void Init() { Logger.Debug("Called Init"); this.Icon = Utilities.GetIcon("giver-48", 48); // Update the window title this.Title = string.Format("Giver Preferences"); //this.DefaultSize = new Gdk.Size (300, 500); this.VBox.Spacing = 0; this.VBox.BorderWidth = 0; this.SetDefaultSize(450, 100); this.AddButton(Stock.Close, Gtk.ResponseType.Ok); this.DefaultResponse = ResponseType.Ok; // Start with an event box to paint the background white EventBox eb = new EventBox(); eb.Show(); eb.BorderWidth = 0; eb.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255)); eb.ModifyBase(StateType.Normal, new Gdk.Color(255, 255, 255)); VBox mainVBox = new VBox(); mainVBox.BorderWidth = 10; mainVBox.Spacing = 5; mainVBox.Show(); eb.Add(mainVBox); this.VBox.PackStart(eb); Label label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment(0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "<span weight=\"bold\" size=\"large\">Your Name</span>"; mainVBox.PackStart(label, true, true, 0); // Name Box at the top of the Widget HBox nameBox = new HBox(); nameBox.Show(); nameEntry = new Entry(); nameEntry.Show(); nameBox.PackStart(nameEntry, true, true, 0); nameBox.Spacing = 10; mainVBox.PackStart(nameBox, false, false, 0); label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment(0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "<span weight=\"bold\" size=\"large\">Your Picture</span>"; mainVBox.PackStart(label, true, true, 0); Gtk.Table table = new Table(4, 3, false); table.Show(); // None Entry noneButton = new RadioButton((Gtk.RadioButton)null); noneButton.Show(); table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); VBox vbox = new VBox(); vbox.Show(); Gtk.Image image = new Image(Utilities.GetIcon("computer", 48)); image.Show(); vbox.PackStart(image, false, false, 0); label = new Label("None"); label.Show(); vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); table.Attach(vbox, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); // Local Entry localButton = new RadioButton(noneButton); localButton.Show(); table.Attach(localButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); localImage = new Image(Utilities.GetIcon("stock_person", 48)); localImage.Show(); vbox.PackStart(localImage, false, false, 0); label = new Label("File"); label.Show(); vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); photoButton = new Button("Change Photo"); photoButton.Show(); table.Attach(photoButton, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); // Web Entry webButton = new RadioButton(noneButton); webButton.Show(); table.Attach(webButton, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); image = new Image(Utilities.GetIcon("web-browser", 48)); image.Show(); vbox.PackStart(image, false, false, 0); label = new Label("Web Link"); label.Show(); vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); webEntry = new Entry(); webEntry.Show(); table.Attach(webEntry, 2, 3, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); // Gravatar Entry gravatarButton = new RadioButton(noneButton); gravatarButton.Show(); table.Attach(gravatarButton, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); image = new Image(Utilities.GetIcon("gravatar", 48)); image.Show(); vbox.PackStart(image, false, false, 0); label = new Label("Gravatar"); label.Show(); vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); gravatarEntry = new Entry(); gravatarEntry.Show(); table.Attach(gravatarEntry, 2, 3, 3, 4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); mainVBox.PackStart(table, true, true, 0); label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment(0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "<span weight=\"bold\" size=\"large\">Your File Location</span>"; mainVBox.PackStart(label, true, true, 0); fileLocationButton = new FileChooserButton("Select storage location", FileChooserAction.SelectFolder); fileLocationButton.Show(); mainVBox.PackStart(fileLocationButton, true, true, 0); table = new Table(2, 3, false); table.Show(); // Port number section label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment(0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "<span weight=\"bold\" size=\"large\">Port Number</span>"; mainVBox.PackStart(label, true, true, 0); // any port Entry anyPortButton = new RadioButton((Gtk.RadioButton)null); anyPortButton.Show(); table.Attach(anyPortButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment(0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "Any available port"; vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); // fixed port Entry fixedPortButton = new RadioButton(anyPortButton); fixedPortButton.Show(); table.Attach(fixedPortButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment(0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "Use a fixed port"; table.Attach(label, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); portNumberEntry = new Entry(); portNumberEntry.Show(); table.Attach(portNumberEntry, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); mainVBox.PackStart(table, true, true, 0); DeleteEvent += WindowDeleted; }
private void InitUI() { BOWidgetBox boxValue = null; BOWidgetBox ComboboxValue = null; try { cfg_configurationpreferenceparameter dataSourceRow = (cfg_configurationpreferenceparameter)_dataSourceRow; //Define Label for Value string valueLabel = (resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], dataSourceRow.ResourceString) != null) ? resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], dataSourceRow.ResourceString) : "LABEL NOT DEFINED IN Field [ResourceString]"; //Define RegEx for Value string valueRegEx = "REGULAR EXPRESSION NOT DEFINED IN Field [RegEx]"; if (dataSourceRow.RegEx != null) { //Try to get Value object objectValueRegEx = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), dataSourceRow.RegEx); if (objectValueRegEx != null) { valueRegEx = objectValueRegEx.ToString(); } } //Define Label for Value bool valueRequired = (dataSourceRow.Required) ? dataSourceRow.Required : false; //Override Db Regex with ConfigurationSystemCountry RegExZipCode and RegExFiscalNumber if (dataSourceRow.Token == "COMPANY_POSTALCODE") { valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExZipCode; } if (dataSourceRow.Token == "COMPANY_FISCALNUMBER") { valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExFiscalNumber; } //Tab1 VBox vboxTab1 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //Ord Entry entryOrd = new Entry(); BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_order"), entryOrd); vboxTab1.PackStart(boxLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true)); //Code Entry entryCode = new Entry(); BOWidgetBox boxCode = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), entryCode); vboxTab1.PackStart(boxCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true)); //Token Entry entryToken = new Entry(); BOWidgetBox boxToken = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_token"), entryToken); vboxTab1.PackStart(boxToken, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxToken, _dataSourceRow, "Token", SettingsApp.RegexAlfaNumericExtended, true)); //Get InputType PreferenceParameterInputType inputType = (PreferenceParameterInputType)Enum.Parse(typeof(PreferenceParameterInputType), dataSourceRow.InputType.ToString(), true); Entry entryValue = new Entry(); switch (inputType) { case PreferenceParameterInputType.Text: case PreferenceParameterInputType.TextPassword: boxValue = new BOWidgetBox(valueLabel, entryValue); vboxTab1.PackStart(boxValue, false, false, 0); // Turn entry into a TextPassword, curently we not use it, until we can turn Visibility = false into TreeView Cell if (inputType.Equals(PreferenceParameterInputType.TextPassword)) { entryValue.Visibility = false; } _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired)); // ValueTip if (!string.IsNullOrEmpty(dataSourceRow.ValueTip)) { entryValue.TooltipText = string.Format(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_prefparam_value_tip_format"), dataSourceRow.ValueTip); } break; case PreferenceParameterInputType.Multiline: EntryMultiline entryMultiline = new EntryMultiline(); entryMultiline.Value.Text = dataSourceRow.Value; entryMultiline.ScrolledWindow.BorderWidth = 1; entryMultiline.HeightRequest = 122; Label labelMultiline = new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes")); boxValue = new BOWidgetBox(valueLabel, entryMultiline); vboxTab1.PackStart(boxValue, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired)); // Override Default Window Height _windowHeight = _windowHeightForTextComponent + 100; break; case PreferenceParameterInputType.CheckButton: CheckButton checkButtonValue = new CheckButton(valueLabel); vboxTab1.PackStart(checkButtonValue, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonValue, _dataSourceRow, "Value")); // Override Default Window Height _windowHeight = _windowHeightForTextComponent - 20; break; //Mudar a lingua da Aplicação - Não é genérico //IN009296 BackOffice - Mudar a língua da aplicação case PreferenceParameterInputType.ComboBox: string getCultureFromDB; try { string sql = "SELECT value FROM cfg_configurationpreferenceparameter where token = 'CULTURE';"; getCultureFromDB = GlobalFramework.SessionXpo.ExecuteScalar(sql).ToString(); } catch { getCultureFromDB = GlobalFramework.Settings["customCultureResourceDefinition"]; } string[] getCulturesValues = new string[8]; getCulturesValues[0] = "pt-PT"; getCulturesValues[1] = "pt-AO"; getCulturesValues[2] = "pt-BR"; getCulturesValues[3] = "pt-MZ"; getCulturesValues[4] = "en-GB"; getCulturesValues[5] = "en-US"; getCulturesValues[6] = "fr-FR"; getCulturesValues[7] = "es-ES"; string[] getCulturesLabels = new string[8]; getCulturesLabels[0] = "Português(Portugal)"; getCulturesLabels[1] = "Português(Angola)"; getCulturesLabels[2] = "Português(Brasil)"; getCulturesLabels[3] = "Português(Moçambique)"; getCulturesLabels[4] = "English(GB)"; getCulturesLabels[5] = "English(USA)"; getCulturesLabels[6] = "Françes"; getCulturesLabels[7] = "Espanol"; TreeIter iter; TreeStore store = new TreeStore(typeof(string), typeof(string)); for (int i = 0; i < getCulturesLabels.Length; i++) { iter = store.AppendValues(getCulturesValues.GetValue(i), getCulturesLabels.GetValue(i)); } ComboBox xpoComboBoxInputType = new ComboBox(getCulturesLabels); xpoComboBoxInputType.Model.GetIterFirst(out iter); int cbox = 0; do { GLib.Value thisRow = new GLib.Value(); xpoComboBoxInputType.Model.GetValue(iter, 0, ref thisRow); //if ((thisRow.Val as string).Equals(getCultureFromDB)) if (getCulturesValues[cbox] == getCultureFromDB) { xpoComboBoxInputType.SetActiveIter(iter); break; } cbox++; } while (xpoComboBoxInputType.Model.IterNext(ref iter)); ComboboxValue = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_language"), xpoComboBoxInputType); vboxTab1.PackStart(ComboboxValue, false, false, 0); entryValue.Text = getCulturesValues[xpoComboBoxInputType.Active]; entryValue.Visibility = false; xpoComboBoxInputType.Changed += delegate { entryValue.Text = getCulturesValues[xpoComboBoxInputType.Active]; //GlobalFramework.CurrentCulture = new System.Globalization.CultureInfo(getCulturesValues[xpoComboBoxInputType.Active]); //GlobalFramework.Settings["customCultureResourceDefinition"] = getCulturesValues[xpoComboBoxInputType.Active]; //CustomResources.UpdateLanguage(getCulturesValues[xpoComboBoxInputType.Active]); //_crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false)); }; boxValue = new BOWidgetBox(valueLabel, entryValue); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false)); break; case PreferenceParameterInputType.FilePicker: case PreferenceParameterInputType.DirPicker: //FilePicker FileChooserAction fileChooserAction = (inputType.Equals(PreferenceParameterInputType.FilePicker)) ? FileChooserAction.Open : FileChooserAction.SelectFolder; FileChooserButton fileChooser = new FileChooserButton(string.Empty, fileChooserAction) { HeightRequest = 23 }; if (inputType.Equals(PreferenceParameterInputType.FilePicker)) { fileChooser.SetFilename(dataSourceRow.Value); fileChooser.Filter = Utils.GetFileFilterImages(); } else { fileChooser.SetCurrentFolder(dataSourceRow.Value); } boxValue = new BOWidgetBox(valueLabel, fileChooser); vboxTab1.PackStart(boxValue, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false)); break; default: break; } //Append Tab _notebook.AppendPage(vboxTab1, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail"))); //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Disable Components entryToken.Sensitive = false; //Protect PreferenceParameterInputType : Disable if is COMPANY_FISCALNUMBER or Other Sensitive Data cfg_configurationpreferenceparameter parameter = (_dataSourceRow as cfg_configurationpreferenceparameter); if (entryValue != null) { entryValue.Sensitive = ( parameter.Token != "COMPANY_NAME" && parameter.Token != "COMPANY_BUSINESS_NAME" && parameter.Token != "COMPANY_COUNTRY" && parameter.Token != "COMPANY_COUNTRY" && parameter.Token != "COMPANY_COUNTRY_CODE2" && parameter.Token != "COMPANY_FISCALNUMBER" && parameter.Token != "SYSTEM_CURRENCY" //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION" //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION_ID" ); } } catch (System.Exception ex) { _log.Error(ex.Message, ex); } }
public AddSuperDomainWizard(Repository repository) { this.repository = repository; this.Title = Mono.Unix.Catalog.GetString("Add Super Domain Wizard"); this.Icon = Gdk.Pixbuf.LoadFromResource("Allors.R1.Development.GtkSharp.Icons.allors.ico"); this.WindowPosition = WindowPosition.CenterOnParent; this.DefaultWidth = 640; this.DefaultHeight = 1; var headerBox = new VBox { Spacing = 10, BorderWidth = 10 }; this.VBox.PackStart(headerBox, false, false, 0); headerBox.PackStart(new HtmlLabel("<span size=\"large\">Welcome to the Allors Add Super Domain Wizard</span>", 0.5f)); headerBox.PackStart(new HtmlLabel("This wizard makes this domain inherit from a new super domain.", 0.5f)); var form = new Form(); this.VBox.PackStart(form); this.fileChooserButton = new FileChooserButton(Mono.Unix.Catalog.GetString("Select a Domain"), 0); this.superDomainErrorMessage = new ErrorMessage(); this.ActionArea.Spacing = 10; this.ActionArea.BorderWidth = 5; this.ActionArea.LayoutStyle = ButtonBoxStyle.End; var buttonCancel = new Button { CanDefault = true, CanFocus = true, UseStock = true, UseUnderline = true, Label = "gtk-cancel" }; this.AddActionWidget(buttonCancel, -6); var buttonOk = new Button { CanDefault = true, CanFocus = true, UseStock = true, UseUnderline = true, Label = "gtk-ok" }; buttonOk.Clicked += this.OnButtonOkClicked; this.ActionArea.PackStart(buttonOk); // Layout form.Attach(this.fileChooserButton, 0, 1, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); form.Attach(this.superDomainErrorMessage, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0); this.ShowAll(); this.ResetErrorMessages(); var filter = new FileFilter { Name = "Allors repository (*.repository)" }; filter.AddPattern("*.repository"); this.fileChooserButton.AddFilter(filter); }
private void InitUI() { try { //Tab1 VBox vboxTab1 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //Ord Entry entryOrd = new Entry(); BOWidgetBox boxLabel = new BOWidgetBox(Resx.global_record_order, entryOrd); vboxTab1.PackStart(boxLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true)); //Code Entry entryCode = new Entry(); BOWidgetBox boxCode = new BOWidgetBox(Resx.global_record_code, entryCode); vboxTab1.PackStart(boxCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true)); //Designation Entry entryDesignation = new Entry(); BOWidgetBox boxDesignation = new BOWidgetBox(Resx.global_designation, entryDesignation); vboxTab1.PackStart(boxDesignation, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumeric, true)); //ButtonLabel Entry entryButtonLabel = new Entry(); BOWidgetBox boxButtonLabel = new BOWidgetBox(Resx.global_button_name, entryButtonLabel); vboxTab1.PackStart(boxButtonLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxButtonLabel, _dataSourceRow, "ButtonLabel", SettingsApp.RegexAlfaNumericExtended, false)); //Family XPOComboBox xpoComboBoxFamily = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleFamily), (DataSourceRow as FIN_ArticleSubFamily).Family, "Designation"); BOWidgetBox boxFamily = new BOWidgetBox(Resx.global_families, xpoComboBoxFamily); vboxTab1.PackStart(boxFamily, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFamily, DataSourceRow, "Family", SettingsApp.RegexGuid, true)); //ButtonImage FileChooserButton fileChooserButtonImage = new FileChooserButton(string.Empty, FileChooserAction.Open) { HeightRequest = 23 }; Image fileChooserImagePreviewButtonImage = new Image() { WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height }; Frame fileChooserFrameImagePreviewButtonImage = new Frame(); fileChooserFrameImagePreviewButtonImage.ShadowType = ShadowType.None; fileChooserFrameImagePreviewButtonImage.Add(fileChooserImagePreviewButtonImage); fileChooserButtonImage.SetFilename(((FIN_ArticleSubFamily)DataSourceRow).ButtonImage); fileChooserButtonImage.Filter = Utils.GetFileFilterImages(); fileChooserButtonImage.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewButtonImage.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewButtonImage.WidthRequest, fileChooserImagePreviewButtonImage.HeightRequest)); BOWidgetBox boxfileChooserButtonImage = new BOWidgetBox(Resx.global_button_image, fileChooserButtonImage); HBox hboxfileChooserAndimagePreviewButtonImage = new HBox(false, _boxSpacing); hboxfileChooserAndimagePreviewButtonImage.PackStart(boxfileChooserButtonImage, true, true, 0); hboxfileChooserAndimagePreviewButtonImage.PackStart(fileChooserFrameImagePreviewButtonImage, false, false, 0); vboxTab1.PackStart(hboxfileChooserAndimagePreviewButtonImage, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserButtonImage, _dataSourceRow, "ButtonImage", string.Empty, false)); //Disabled CheckButton checkButtonDisabled = new CheckButton(Resx.global_record_disabled); if (_dialogMode == DialogMode.Insert) { checkButtonDisabled.Active = SettingsApp.BOXPOObjectsStartDisabled; } vboxTab1.PackStart(checkButtonDisabled, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonDisabled, _dataSourceRow, "Disabled")); //Append Tab _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail)); //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Tab2 VBox vboxTab2 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //CommissionGroup XPOComboBox xpoComboBoxCommissionGroup = new XPOComboBox(DataSourceRow.Session, typeof(POS_UserCommissionGroup), (DataSourceRow as FIN_ArticleSubFamily).CommissionGroup, "Designation"); BOWidgetBox boxCommissionGroup = new BOWidgetBox(Resx.global_commission_group, xpoComboBoxCommissionGroup); vboxTab2.PackStart(boxCommissionGroup, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCommissionGroup, DataSourceRow, "CommissionGroup", SettingsApp.RegexGuid, false)); //Printer XPOComboBox xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrinters), (DataSourceRow as FIN_ArticleSubFamily).Printer, "Designation"); BOWidgetBox boxPrinter = new BOWidgetBox(Resx.global_device_printer, xpoComboBoxPrinter); vboxTab2.PackStart(boxPrinter, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, false)); //Template XPOComboBox xpoComboBoxTemplate = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrintersTemplates), (DataSourceRow as FIN_ArticleSubFamily).Template, "Designation"); BOWidgetBox boxTemplate = new BOWidgetBox(Resx.global_ConfigurationPrintersTemplates, xpoComboBoxTemplate); vboxTab2.PackStart(boxTemplate, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplate, DataSourceRow, "Template", SettingsApp.RegexGuid, false)); //DiscountGroup XPOComboBox xpoComboBoxDiscountGroup = new XPOComboBox(DataSourceRow.Session, typeof(ERP_CustomerDiscountGroup), (DataSourceRow as FIN_ArticleSubFamily).DiscountGroup, "Designation"); BOWidgetBox boxDiscountGroup = new BOWidgetBox(Resx.global_discount_group, xpoComboBoxDiscountGroup); vboxTab2.PackStart(boxDiscountGroup, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscountGroup, DataSourceRow, "DiscountGroup", SettingsApp.RegexGuid, false)); //VatOnTable XPOComboBox xpoComboBoxVatOnTable = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatRate), (DataSourceRow as FIN_ArticleSubFamily).VatOnTable, "Designation"); BOWidgetBox boxVatOnTable = new BOWidgetBox(Resx.global_vat_on_table, xpoComboBoxVatOnTable); vboxTab2.PackStart(boxVatOnTable, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatOnTable, DataSourceRow, "VatOnTable", SettingsApp.RegexGuid, false)); //VatDirectSelling XPOComboBox xpoComboBoxVatDirectSelling = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatRate), (DataSourceRow as FIN_ArticleSubFamily).VatDirectSelling, "Designation"); BOWidgetBox boxVatDirectSelling = new BOWidgetBox(Resx.global_vat_direct_selling, xpoComboBoxVatDirectSelling); vboxTab2.PackStart(boxVatDirectSelling, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatDirectSelling, DataSourceRow, "VatDirectSelling", SettingsApp.RegexGuid, false)); //Append Tab _notebook.AppendPage(vboxTab2, new Label(Resx.dialog_edit_articlesubfamily_tab2_label)); } catch (System.Exception ex) { _log.Error(ex.Message, ex); } }
public SampleAssistant() { SetSizeRequest(450, 300); Title = "Gtk.Assistant Sample"; // ANA SAYFA Label lbl = new Label("HELLO PEOPLE OF EKINOKS"); AppendPage(lbl); SetPageTitle(lbl, "Introduction"); SetPageType(lbl, AssistantPageType.Intro); SetPageComplete(lbl, true); // ZIP SECME SAYFASI FileChooserButton fileChooserButton = new FileChooserButton("Choose the instalation zip", 0); HBox box = new HBox(true, 1); box.PackStart(fileChooserButton); fileChooserButton.CurrentFolderChanged += new EventHandler(Deneme); AppendPage(box); SetPageTitle(box, "Choose zip, people of Ekinoks"); SetPageType(box, AssistantPageType.Content); // MODULE CHOOSER //HBox moduleBox = new HBox(true, 1); Gtk.TreeView tree = new Gtk.TreeView(); //moduleBox.PackStart(tree); Gtk.TreeViewColumn moduleColumn = new Gtk.TreeViewColumn(); moduleColumn.Title = "Module"; Gtk.CellRendererText moduleColumnCell = new Gtk.CellRendererText(); moduleColumn.PackStart(moduleColumnCell, true); Gtk.TreeViewColumn includeColumn = new Gtk.TreeViewColumn(); includeColumn.Title = "Include"; Gtk.CellRendererToggle includeColumnCell = new Gtk.CellRendererToggle(); includeColumn.PackStart(includeColumnCell, true); // Add the columns to the TreeView tree.AppendColumn(moduleColumn); tree.AppendColumn(includeColumn); Gtk.ListStore moduleList = new Gtk.ListStore(typeof(string), typeof(bool)); tree.Model = moduleList; AppendPage(tree); moduleList.AppendValues("Garbage", "DEDELER"); moduleColumn.AddAttribute(moduleColumnCell, "text", 0); includeColumn.AddAttribute(includeColumnCell, "text", 1); // Done Done Tum dosyaları ekle //SetPageTitle(moduleBox, "Choose The Modules"); //SetPageType(moduleBox, AssistantPageType.Content); //ESKI YAZI SEC SAYFASI //HBox box = new HBox(false, 6); //box.PackStart(new Label("Enter some text: "), false, false, 6); //Entry entry = new Entry(); //entry.Changed += new EventHandler(EntryChanged); //box.PackStart(entry, false, false, 6); //Entry entry2 = new Entry(); //entry2.Changed += new EventHandler(EntryChanged); //box.PackStart(entry2, false, false, 6); //AppendPage(box); //SetPageTitle(box, "Getting Some Input"); //SetPageType(box, AssistantPageType.Content); //CHECKBOXLI EKRAN //CheckButton chk = new CheckButton("I think Gtk# is awesome."); //chk.Toggled += new EventHandler(ButtonToggled); //AppendPage(chk); //SetPageTitle(chk, "Provide Feedback"); //SetPageType(chk, AssistantPageType.Content); Alignment al = new Alignment(0.5f, 0.5f, 0.0f, 0.0f); box = new HBox(false, 6); progress_bar = new ProgressBar(); box.PackStart(progress_bar, true, true, 6); Button btn = new Button("Make progress"); btn.Clicked += new EventHandler(ButtonClicked); box.PackStart(btn, false, false, 6); al.Add(box); AppendPage(al); SetPageTitle(al, "Show Some Progress"); SetPageType(al, AssistantPageType.Progress); lbl = new Label("In addition to being able to type,\nYou obviously have great taste in software."); AppendPage(lbl); SetPageTitle(lbl, "Congratulations"); SetPageType(lbl, AssistantPageType.Confirm); SetPageComplete(lbl, true); Cancel += new EventHandler(AssistantCancel); Close += new EventHandler(AssistantClose); }
private void InitUI() { try { //Tab1 VBox vboxTab1 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //Ord Entry entryOrd = new Entry(); BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_order"), entryOrd); vboxTab1.PackStart(boxLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true)); //Code Entry entryCode = new Entry(); BOWidgetBox boxCode = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), entryCode); vboxTab1.PackStart(boxCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true)); //Designation Entry entryDesignation = new Entry(); BOWidgetBox boxDesignation = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation); vboxTab1.PackStart(boxDesignation, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumeric, true)); //ButtonLabel Entry entryButtonLabel = new Entry(); BOWidgetBox boxButtonLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_button_name"), entryButtonLabel); vboxTab1.PackStart(boxButtonLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxButtonLabel, _dataSourceRow, "ButtonLabel", SettingsApp.RegexAlfaNumericExtended, false)); //ButtonImage FileChooserButton fileChooserButtonImage = new FileChooserButton(string.Empty, FileChooserAction.Open) { HeightRequest = 23 }; Image fileChooserImagePreviewButtonImage = new Image() { WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height }; Frame fileChooserFrameImagePreviewButtonImage = new Frame(); fileChooserFrameImagePreviewButtonImage.ShadowType = ShadowType.None; fileChooserFrameImagePreviewButtonImage.Add(fileChooserImagePreviewButtonImage); fileChooserButtonImage.SetFilename(((fin_articlefamily)DataSourceRow).ButtonImage); fileChooserButtonImage.Filter = Utils.GetFileFilterImages(); fileChooserButtonImage.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewButtonImage.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewButtonImage.WidthRequest, fileChooserImagePreviewButtonImage.HeightRequest)); BOWidgetBox boxfileChooserButtonImage = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_button_image"), fileChooserButtonImage); HBox hboxfileChooserAndimagePreviewButtonImage = new HBox(false, _boxSpacing); hboxfileChooserAndimagePreviewButtonImage.PackStart(boxfileChooserButtonImage, true, true, 0); hboxfileChooserAndimagePreviewButtonImage.PackStart(fileChooserFrameImagePreviewButtonImage, false, false, 0); vboxTab1.PackStart(hboxfileChooserAndimagePreviewButtonImage, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserButtonImage, _dataSourceRow, "ButtonImage", string.Empty, false)); //CommissionGroup XPOComboBox xpoComboBoxCommissionGroup = new XPOComboBox(DataSourceRow.Session, typeof(pos_usercommissiongroup), (DataSourceRow as fin_articlefamily).CommissionGroup, "Designation", null); BOWidgetBox boxCommissionGroup = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_commission_group"), xpoComboBoxCommissionGroup); vboxTab1.PackStart(boxCommissionGroup, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCommissionGroup, DataSourceRow, "CommissionGroup", SettingsApp.RegexGuid, false)); //Printer XPOComboBox xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinters), (DataSourceRow as fin_articlefamily).Printer, "Designation", null); BOWidgetBox boxPrinter = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_device_printer"), xpoComboBoxPrinter); vboxTab1.PackStart(boxPrinter, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, false)); //Template XPOComboBox xpoComboBoxTemplate = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinterstemplates), (DataSourceRow as fin_articlefamily).Template, "Designation", null); BOWidgetBox boxTemplate = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationPrintersTemplates"), xpoComboBoxTemplate); vboxTab1.PackStart(boxTemplate, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplate, DataSourceRow, "Template", SettingsApp.RegexGuid, false)); //Disabled CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_disabled")); if (_dialogMode == DialogMode.Insert) { checkButtonDisabled.Active = SettingsApp.BOXPOObjectsStartDisabled; } vboxTab1.PackStart(checkButtonDisabled, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonDisabled, _dataSourceRow, "Disabled")); //Append Tab _notebook.AppendPage(vboxTab1, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail"))); } catch (System.Exception ex) { _log.Error(ex.Message, ex); } }
/// <summary> /// Initializes a new instance of the <see cref="Sharpend.GtkSharp.FileChooserWrapper"/> class. /// </summary> /// <param name='title'> /// Title. /// </param> /// <param name='chooser'> /// Chooser. /// </param> /// <param name='action'> /// Action. /// </param> public FileChooserButtonWrapper(String title, FileChooserButton chooser, FileChooserAction action) : this(title, chooser, null, action) { }
private void InitUI() { BOWidgetBox boxValue = null; try { CFG_ConfigurationPreferenceParameter dataSourceRow = (CFG_ConfigurationPreferenceParameter)_dataSourceRow; //Define Label for Value string valueLabel = (Resx.ResourceManager.GetString(dataSourceRow.ResourceString) != null) ? Resx.ResourceManager.GetString(dataSourceRow.ResourceString) : "LABEL NOT DEFINED IN Field [ResourceString]"; //Define RegEx for Value string valueRegEx = "REGULAR EXPRESSION NOT DEFINED IN Field [RegEx]"; if (dataSourceRow.RegEx != null) { //Try to get Value object objectValueRegEx = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), dataSourceRow.RegEx); if (objectValueRegEx != null) { valueRegEx = objectValueRegEx.ToString(); } } //Define Label for Value bool valueRequired = (dataSourceRow.Required) ? dataSourceRow.Required : false; //Override Db Regex with ConfigurationSystemCountry RegExZipCode and RegExFiscalNumber if (dataSourceRow.Token == "COMPANY_POSTALCODE") { valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExZipCode; } if (dataSourceRow.Token == "COMPANY_FISCALNUMBER") { valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExFiscalNumber; } //Tab1 VBox vboxTab1 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //Ord Entry entryOrd = new Entry(); BOWidgetBox boxLabel = new BOWidgetBox(Resx.global_record_order, entryOrd); vboxTab1.PackStart(boxLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true)); //Code Entry entryCode = new Entry(); BOWidgetBox boxCode = new BOWidgetBox(Resx.global_record_code, entryCode); vboxTab1.PackStart(boxCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true)); //Token Entry entryToken = new Entry(); BOWidgetBox boxToken = new BOWidgetBox(Resx.global_token, entryToken); vboxTab1.PackStart(boxToken, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxToken, _dataSourceRow, "Token", SettingsApp.RegexAlfaNumericExtended, true)); //Get InputType PreferenceParameterInputType inputType = (PreferenceParameterInputType)Enum.Parse(typeof(PreferenceParameterInputType), dataSourceRow.InputType.ToString(), true); Entry entryValue = new Entry(); switch (inputType) { case PreferenceParameterInputType.Text: case PreferenceParameterInputType.TextPassword: boxValue = new BOWidgetBox(valueLabel, entryValue); vboxTab1.PackStart(boxValue, false, false, 0); // Turn entry into a TextPassword, curently we not use it, until we can turn Visibility = false into TreeView Cell if (inputType.Equals(PreferenceParameterInputType.TextPassword)) { entryValue.Visibility = false; } _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired)); // ValueTip if (!string.IsNullOrEmpty(dataSourceRow.ValueTip)) { entryValue.TooltipText = string.Format(Resx.global_prefparam_value_tip_format, dataSourceRow.ValueTip); } break; case PreferenceParameterInputType.Multiline: EntryMultiline entryMultiline = new EntryMultiline(); entryMultiline.Value.Text = dataSourceRow.Value; entryMultiline.ScrolledWindow.BorderWidth = 1; entryMultiline.HeightRequest = 122; Label labelMultiline = new Label(Resx.global_notes); boxValue = new BOWidgetBox(valueLabel, entryMultiline); vboxTab1.PackStart(boxValue, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired)); // Override Default Window Height _windowHeight = _windowHeightForTextComponent + 100; break; case PreferenceParameterInputType.CheckButton: CheckButton checkButtonValue = new CheckButton(valueLabel); vboxTab1.PackStart(checkButtonValue, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonValue, _dataSourceRow, "Value")); // Override Default Window Height _windowHeight = _windowHeightForTextComponent - 20; break; case PreferenceParameterInputType.ComboBox: break; case PreferenceParameterInputType.FilePicker: case PreferenceParameterInputType.DirPicker: //FilePicker FileChooserAction fileChooserAction = (inputType.Equals(PreferenceParameterInputType.FilePicker)) ? FileChooserAction.Open : FileChooserAction.SelectFolder; FileChooserButton fileChooser = new FileChooserButton(string.Empty, fileChooserAction) { HeightRequest = 23 }; if (inputType.Equals(PreferenceParameterInputType.FilePicker)) { fileChooser.SetFilename(dataSourceRow.Value); fileChooser.Filter = Utils.GetFileFilterImages(); } else { fileChooser.SetCurrentFolder(dataSourceRow.Value); } boxValue = new BOWidgetBox(valueLabel, fileChooser); vboxTab1.PackStart(boxValue, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false)); break; default: break; } //Append Tab _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail)); //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Disable Components entryToken.Sensitive = false; //Protect PreferenceParameterInputType : Disable if is COMPANY_FISCALNUMBER or Other Sensitive Data CFG_ConfigurationPreferenceParameter parameter = (_dataSourceRow as CFG_ConfigurationPreferenceParameter); if (entryValue != null) { entryValue.Sensitive = ( parameter.Token != "COMPANY_NAME" && parameter.Token != "COMPANY_BUSINESS_NAME" && parameter.Token != "COMPANY_COUNTRY" && parameter.Token != "COMPANY_COUNTRY" && parameter.Token != "COMPANY_COUNTRY_CODE2" && parameter.Token != "COMPANY_FISCALNUMBER" && parameter.Token != "SYSTEM_CURRENCY" //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION" //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION_ID" ); } } catch (System.Exception ex) { _log.Error(ex.Message, ex); } }
private void InitUI() { try { //Tab1 VBox vboxTab1 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //Ord Entry entryOrd = new Entry(); BOWidgetBox boxLabel = new BOWidgetBox(Resx.global_record_order, entryOrd); vboxTab1.PackStart(boxLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true)); //Code Entry entryCode = new Entry(); BOWidgetBox boxCode = new BOWidgetBox(Resx.global_record_code, entryCode); vboxTab1.PackStart(boxCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true)); //Designation Entry entryDesignation = new Entry(); BOWidgetBox boxDesignation = new BOWidgetBox(Resx.global_designation, entryDesignation); vboxTab1.PackStart(boxDesignation, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true)); //FileTemplate FileChooserButton fileChooserFileTemplate = new FileChooserButton(string.Empty, FileChooserAction.Open) { HeightRequest = 23 }; Image fileChooserImagePreviewFileTemplate = new Image() { WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height }; Frame fileChooserFrameImagePreviewFileTemplate = new Frame(); fileChooserFrameImagePreviewFileTemplate.ShadowType = ShadowType.None; fileChooserFrameImagePreviewFileTemplate.Add(fileChooserImagePreviewFileTemplate); fileChooserFileTemplate.SetFilename(((SYS_ConfigurationPrintersTemplates)DataSourceRow).FileTemplate); fileChooserFileTemplate.Filter = Utils.GetFileFilterTemplates(); fileChooserFileTemplate.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewFileTemplate.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewFileTemplate.WidthRequest, fileChooserImagePreviewFileTemplate.HeightRequest)); BOWidgetBox boxfileChooserFileTemplate = new BOWidgetBox(Resx.global_file, fileChooserFileTemplate); HBox hboxfileChooserAndimagePreviewFileTemplate = new HBox(false, _boxSpacing); hboxfileChooserAndimagePreviewFileTemplate.PackStart(boxfileChooserFileTemplate, true, true, 0); hboxfileChooserAndimagePreviewFileTemplate.PackStart(fileChooserFrameImagePreviewFileTemplate, false, false, 0); vboxTab1.PackStart(hboxfileChooserAndimagePreviewFileTemplate, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserFileTemplate, _dataSourceRow, "FileTemplate", string.Empty, false)); //FinancialTemplate CheckButton checkButtonFinancialTemplate = new CheckButton(Resx.global_financialtemplate); vboxTab1.PackStart(checkButtonFinancialTemplate, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonFinancialTemplate, _dataSourceRow, "FinancialTemplate")); //Disabled CheckButton checkButtonDisabled = new CheckButton(Resx.global_record_disabled); if (_dialogMode == DialogMode.Insert) { checkButtonDisabled.Active = SettingsApp.BOXPOObjectsStartDisabled; } vboxTab1.PackStart(checkButtonDisabled, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonDisabled, _dataSourceRow, "Disabled")); //Append Tab _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail)); } catch (System.Exception ex) { _log.Error(ex.Message, ex); } }
public static void Main() { Application.Init(); var window = new Window("Sharp Test"); window.Resize(600, 400); //window.SetIconFromFile("/home/hubert/SharpTest/SharpTest/images/icon.png"); window.DeleteEvent += Window_Delete; //File choosing components var labelOsName = new Label("OS Version: " + OsVersion); var labelPyhtonVer = new Label("Python ver: " + PythonVer); var labelChoose = new Label("Choose python file."); var labelFileStatus = new Label { Markup = "<span color=\"red\">Wrong file.</span>" }; var fileButton = new FileChooserButton("Choose file", FileChooserAction.Open); var scanButton = new Button("Scan file"); scanButton.SetSizeRequest(100, 50); var boxStart = new VBox(); boxStart.PackStart(labelOsName, false, false, 5); boxStart.PackStart(labelPyhtonVer, false, false, 5); boxStart.PackStart(labelChoose, false, false, 5); boxStart.PackStart(fileButton, false, false, 5); boxStart.PackStart(labelFileStatus, false, false, 5); boxStart.PackStart(scanButton, false, false, 100); //Scaning window components var labelTest = new Label("Error while scanning file"); labelTest.SetPadding(5, 5); var scrolledWin = new ScrolledWindow(); scrolledWin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); scrolledWin.Add(labelTest); var boxScan = new VBox(); boxScan.PackStart(scrolledWin, true, true, 5); scanButton.Clicked += (sender, args) => { var result = ScanFile(fileButton.Filename); if (result == null) { labelFileStatus.Show(); } else { labelFileStatus.Hide(); var structure = ""; var classes = new List <string>(result.Keys); //Add classes foreach (var _class in classes) { structure += "Class: " + _class + "\n"; foreach (var method in result[_class]) { //Add method name structure += "|__ Method: " + method["name"] + "\n"; //Add params var parameters = ""; int i = 0; foreach (var param in (IEnumerable)method["param"]) { if (i > 0) { parameters += ","; } parameters += " " + param; i++; } structure += "|____ Params: " + parameters + "\n"; //Add return structure += "|____ Return: " + method["return"] + "\n"; } structure += "\n"; } labelTest.Text = structure; window.Remove(boxStart); window.Add(boxScan); window.ShowAll(); } }; window.Add(boxStart); window.ShowAll(); //Hide some widgets labelFileStatus.Hide(); Application.Run(); }