Ejemplo n.º 1
0
        private void InitializeComponent()
        {
            Width = 550;
            Height = 600;
            //Location = WindowLocation.CenterScreen;

            vbox2 = new VBox();
            vbox2.Visible = true;
            vbox2.Spacing = 3;

            notebook1 = new Notebook();
            notebook1.Visible = true;
            notebook1.CanGetFocus = true;

            image1 = new ImageView();
            string file = FileHelper.FindSupportFile("bygfoot_splash.png", false);
            image1.Image = Image.FromFile(file);

            treeview_splash_contributors = new TreeView();

            scrolledwindow2 = new ScrollView();
            scrolledwindow2.Content = treeview_splash_contributors;

            notebook1.Add(image1, "");
            notebook1.Add(scrolledwindow2, "");
            vbox2.PackStart(notebook1);

            Content = vbox2;
        }
		public DependenciesSectionWidget (IConfigurationSection section) 
		{
			this.section = section;

			widget = new VBox ();

			if (this.section.Service.Dependencies.Length == 0) {
				widget.PackStart (new Label { Text = GettextCatalog.GetString ("This service has no dependencies") });
				return;
			}

			bool firstCategory = true;

			foreach (var category in this.section.Service.Dependencies.Select (d => d.Category).Distinct ()) {
				var categoryIcon = new ImageView (category.Icon.WithSize (IconSize.Small));
				var categoryLabel = new Label (category.Name);
				var categoryBox = new HBox ();

				if (!firstCategory)
					categoryBox.MarginTop += 5;

				categoryBox.PackStart (categoryIcon);
				categoryBox.PackStart (categoryLabel);
				widget.PackStart (categoryBox);

				foreach (var dependency in this.section.Service.Dependencies.Where (d => d.Category == category)) {
					widget.PackStart (new DependencyWidget (section.Service, dependency) {
						MarginLeft = category.Icon.Size.Width / 2
					});
				}

				if (firstCategory)
					firstCategory = false;
			}
		}
        public MainView(IPresenterFactory presenterFactory)
        {
            _notebook = presenterFactory.InstantiatePresenter<MainNotebook>();
            _notebook.Add(presenterFactory.InstantiatePresenter<MenuPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<ModsPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<BlueprintsPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<SavegamesPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<TasksPageView>(this));

            PackStart(presenterFactory.InstantiatePresenter<MainHeaderView>());

            var sideBox = new VBox
            {
                MinWidth = 280,
                WidthRequest = 280
            };

            _sidebarContainer = new SidebarContainer();
            sideBox.PackStart(_sidebarContainer, true, true);
            var box = new HBox();

            box.PackStart(_notebook, true);
            box.PackEnd(sideBox);

            PackStart(box, true, true);

            _notebook.HandleSizeChangeOnTabChange = true;
            _notebook.HandleSizeUpdate();
        }
Ejemplo n.º 4
0
Archivo: Boxes.cs Proyecto: m13253/xwt
		public SpecialWidget ()
		{
			VBox bl = new VBox () { Spacing = 0 };
			bl.BackgroundColor = Colors.Gray;
			bl.PackStart (new Label ("Hi there"));
			Content = bl;
		}
Ejemplo n.º 5
0
 public ReliefFrameSample()
 {
     var box = new VBox ();
     box.PackStart (new ReliefFrame (new Button ("Hello")));
     box.PackStart (new ReliefFrame (new Button ("World")));
     PackStart (box);
 }
Ejemplo n.º 6
0
        private void InitializeComponent()
        {
            vbox28 = new VBox();

            this.Width = 300;
            //this.Location = WindowLocation.CenterParent;
        }
Ejemplo n.º 7
0
        private void Build()
        {
            this.Icon = Xwt.Drawing.Image.FromResource("URMSimulator.Resources.urm.png");
            this.Title = "About";
            this.Resizable = false;
            this.Buttons.Add(new DialogButton(Command.Close));

            vbox1 = new VBox();

            image1 = new ImageView();
            image1.WidthRequest = 320;
            image1.HeightRequest = 270;
            vbox1.PackStart(image1);

            labelProgramName = new Label();
            labelProgramName.TextAlignment = Alignment.Center;
            vbox1.PackStart(labelProgramName);

            labelComments = new Label();
            labelComments.TextAlignment = Alignment.Center;
            vbox1.PackStart(labelComments);

            hbox1 = new HBox();

            hbox1.PackStart(new HBox(), true);

            labelWebsite = new LinkLabel();
            labelWebsite.TextAlignment = Alignment.Center; //text aligment doesn't work with Xwt.WPF
            hbox1.PackStart(labelWebsite, false);

            hbox1.PackStart(new HBox(), true);
            vbox1.PackStart(hbox1);

            this.Content = vbox1;
        }
		public ExecutionModeSelectorDialog ()
		{
			Title = GettextCatalog.GetString ("Execution Mode Selector");
			
			Width = 500;
			Height = 400;

			var box = new VBox ();
			Content = box;

			box.PackStart (new Label (GettextCatalog.GetString ("Run Configurations:")));
		
			listConfigs = new RunConfigurationsList ();
			box.PackStart (listConfigs, true);

			box.PackStart (new Label (GettextCatalog.GetString ("Execution Modes:")));

			storeModes = new TreeStore (modeNameField, modeField, modeSetField);
			treeModes = new TreeView (storeModes);
			treeModes.HeadersVisible = false;
			treeModes.Columns.Add (GettextCatalog.GetString ("Name"), modeNameField);
			box.PackStart (treeModes, true);

			runButton = new DialogButton (new Command ("run", GettextCatalog.GetString ("Run")));

			Buttons.Add (Command.Cancel);
			Buttons.Add (runButton);

			listConfigs.SelectionChanged += (sender, e) => LoadModes ();
			treeModes.SelectionChanged += OnModeChanged;
		}
Ejemplo n.º 9
0
        public Splash()
        {
            Decorated = false;
            ShowInTaskbar = false;
            box = new VBox {
                Margin = -2,
            };
            imageView = new ImageView {
                Image = Image.FromResource (Resources.Splash),
            };
            progressBar = new ProgressBar {
                Indeterminate = true,
                TooltipText = Catalog.GetString ("Loading..."),
            };
            info = new Label {
                Text = Catalog.GetString ("Loading..."),
                TextAlignment = Alignment.Center,
            };
            box.PackStart (imageView);
            box.PackEnd (progressBar);
            box.PackEnd (info);

            Content = box;

            InitialLocation = WindowLocation.CenterScreen;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Baimp.PipelineController"/> class.
        /// </summary>
        /// <param name="project">Project.</param>
        /// <param name="pipelineShelf">Frame where the pipeline should be.</param>
        public PipelineController(Project project, VBox pipelineShelf)
        {
            this.pipelineShelf = pipelineShelf;

            pipelineScroller = new ScrollView();
            pipelineScroller.Content = currentPipeline;

            this.project = project;
            OnProjectDataChangged(new ProjectChangedEventArgs(null) { refresh = true });

            InitializeControllerbar();
            splitControllTab_pipelineScroller.PackEnd(pipelineScroller, true, true);

            algorithm = new AlgorithmTreeView(project.scanCollection);
            algorithm.MinWidth = 200; // TODO, save size as user property

            HPaned splitPipeline_Algorithm = new HPaned();
            splitPipeline_Algorithm.Panel1.Content = algorithm;
            splitPipeline_Algorithm.Panel1.Resize = false;
            splitPipeline_Algorithm.Panel1.Shrink = false;
            splitPipeline_Algorithm.Panel2.Content = splitControllTab_pipelineScroller;
            splitPipeline_Algorithm.Panel2.Resize = true;
            splitPipeline_Algorithm.Panel2.Shrink = false;

            pipelineShelf.PackStart(splitPipeline_Algorithm, true, true);

            InitializeEvents();
        }
        void BuildGui()
        {
            this.Title = GettextCatalog.GetString("Select Work Item");
            VBox content = new VBox();
            HBox mainBox = new HBox();
            queryView.Columns.Add(new ListViewColumn(string.Empty, new TextCellView(titleField)));
            queryView.DataSource = queryStore;
            queryView.WidthRequest = 200;
            BuildQueryView();
            mainBox.PackStart(queryView);

            workItemList.WidthRequest = 400;
            workItemList.HeightRequest = 400;
            workItemList.ShowCheckboxes = true;

            mainBox.PackStart(workItemList, true, true);

            content.PackStart(mainBox, true, true);

            HBox buttonBox = new HBox();

            Button okButton = new Button(GettextCatalog.GetString("Ok"));
            okButton.WidthRequest = Constants.ButtonWidth;
            okButton.Clicked += (sender, e) => Respond(Command.Ok);
            buttonBox.PackEnd(okButton);

            content.PackStart(buttonBox);
            //this.Resizable = false;
            this.Content = content;

            AttachEvents();
        }
Ejemplo n.º 12
0
        public MyTestWidget()
        {
            PackStart(new TextEntry() { PlaceholderText = "Placeholder Test" });
            PackStart(new Label("Scrollable Test:"));

            VBox ContentData = new VBox()
            {
                ExpandHorizontal = true,
                ExpandVertical = true
            };

            ScrollView ContentScroll = new ScrollView()
            {
                Content = ContentData,
                ExpandHorizontal = true,
                ExpandVertical = true
            };
            PackStart(ContentScroll, true, true);

            ContentData.PackStart(new TextEntry() { PlaceholderText = "Placeholder Test" }, true, true);
            ContentData.PackStart(new TextEntry(), true, true);
            ContentData.PackStart(new TextEntry() { PlaceholderText = "Placeholder Test" }, true, true);
            ContentData.PackStart(new TextEntry(), true, true);
            ContentData.PackStart(new TextEntry() { PlaceholderText = "Placeholder Test" }, true, true);
            ContentData.PackStart(new MyWidget(), true, true);
            ContentData.PackStart(new TextEntry() { PlaceholderText = "Placeholder Test" }, true, true);
            ContentData.PackStart(new TextEntry(), true, true);
            ContentData.PackStart(new TextEntry() { PlaceholderText = "Placeholder Test" }, true, true);
            ContentData.PackStart(new TextEntry(), true, true);
            ContentData.PackStart(new TextEntry() { PlaceholderText = "Placeholder Test" }, true, true);
            ContentData.PackStart(new TextEntry(), true, true);
        }
Ejemplo n.º 13
0
        public RadioButtonSample()
        {
            var b1 = new RadioButton ("Item 1");
            var b2 = new RadioButton ("Item 2");
            var b3 = new RadioButton ("Item 3");
            b2.Group = b3.Group = b1.Group;
            PackStart (b1);
            PackStart (b2);
            PackStart (b3);

            var la = new Label ();
            la.Hide ();
            b1.Group.ActiveRadioButtonChanged += delegate {
                la.Show ();
                la.Text = "Active: " + b1.Group.ActiveRadioButton.Label;
            };
            PackStart (la);

            PackStart (new HSeparator ());

            var box = new VBox ();
            box.PackStart (new Label ("First Option"));
            box.PackStart (new Label ("Second line"));

            var b4 = new RadioButton (box);
            var b5 = new RadioButton ("Second Option");
            PackStart (b4);
            PackStart (b5);
            b4.Group = b5.Group;
        }
Ejemplo n.º 14
0
		public RadioButtonSample ()
		{
			var b1 = new RadioButton ("Item 1");
			var b2 = new RadioButton ("Item 2 (red background)");
			b2.BackgroundColor = Xwt.Drawing.Colors.Red;
			var b3 = new RadioButton ("Item 3");
			b2.Group = b3.Group = b1.Group;
			PackStart (b1);
			PackStart (b2);
			PackStart (b3);

			var la = new Label ();
			la.Hide ();
			b1.Group.ActiveRadioButtonChanged += delegate {
				la.Show ();
				la.Text = "Active: " + b1.Group.ActiveRadioButton.Label;
			};
			PackStart (la);

			PackStart (new HSeparator ());

			var box = new VBox ();
			box.PackStart (new Label ("First Option"));
			box.PackStart (new Label ("Second line"));

			var b4 = new RadioButton (box);
			var b5 = new RadioButton ("Second Option");
			var b6 = new RadioButton ("Disabled Option") { Sensitive = false };
			PackStart (b4);
			PackStart (b5);
			PackStart (b6);
			b4.Group = b5.Group = b6.Group;
		}
Ejemplo n.º 15
0
		VBox GenerateFrameContents (bool useMnemonics)
		{
			var statusText = useMnemonics ? "with mnemonic" : "without mnemonic";
			var vbox = new VBox ();

			var button = new Button ("_Button");
			button.UseMnemonic = useMnemonics;
			button.Clicked += (sender, e) => MessageDialog.ShowMessage (string.Format ("Button {0} clicked.", statusText));
			vbox.PackStart (button);

			var toggleButton = new ToggleButton ("_Toggle Button");
			toggleButton.UseMnemonic = useMnemonics;
			toggleButton.Clicked += (sender, e) => MessageDialog.ShowMessage (string.Format ("Toggle Button {0} clicked.", statusText));
			vbox.PackStart (toggleButton);

			var menuButton = new MenuButton ("_Menu Button");
			menuButton.UseMnemonic = useMnemonics;
			menuButton.Label = "_Menu Button";
			var firstMenuItem = new MenuItem ("_First");
			firstMenuItem.UseMnemonic = useMnemonics;
			firstMenuItem.Clicked += (sender, e) => MessageDialog.ShowMessage (string.Format ("First Menu Item {0} clicked.", statusText));
			var secondMenuItem = new MenuItem ("_Second");
			secondMenuItem.UseMnemonic = useMnemonics;
			secondMenuItem.Clicked += (sender, e) => MessageDialog.ShowMessage (string.Format ("Second Menu Item {0} clicked.", statusText));
			var menu = new Menu ();
			menu.Items.Add (firstMenuItem);
			menu.Items.Add (secondMenuItem);
			menuButton.Menu = menu;
			vbox.PackStart (menuButton);

			return vbox;
		}
Ejemplo n.º 16
0
            public DialogWidget(params object[]data)
                : base()
            {
                box = new VBox ();
                actionArea = new HButtonBox ();
                actionArea.LayoutStyle = ButtonBoxStyle.End;
                buttons = new Button[data.Length / 2];
                response_ids = new int[data.Length / 2];

                for (int i = 0; i < data.Length; i += 2)
                  {
                      Button button =
                          new Button (data[i] as
                                  string);
                        button.Clicked += OnClicked;
                        actionArea.PackStart (button,
                                  false,
                                  false, 4);
                        buttons[i / 2] = button;
                        response_ids[i / 2] =
                          (int) data[i + 1];
                  }

                PackStart (box, true, true, 4);
                  PackStart (actionArea, false, true, 4);
                  ShowAll ();
            }
Ejemplo n.º 17
0
        public LauncherWindow()
        {
            this.Title = "TrueCraft Launcher";
            this.Width = 1200;
            this.Height = 576;
            this.User = new TrueCraftUser();

            MainContainer = new HBox();
            WebScrollView = new ScrollView();
            WebView = new WebView("http://truecraft.io/updates");
            LoginView = new LoginView(this);
            OptionView = new OptionView(this);
            MultiplayerView = new MultiplayerView(this);
            SingleplayerView = new SingleplayerView(this);
            InteractionBox = new VBox();

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft_logo.svg"))
                TrueCraftLogoImage = new ImageView(Image.FromStream(stream));

            WebScrollView.Content = WebView;
            MainContainer.PackStart(WebScrollView, true);
            InteractionBox.PackStart(TrueCraftLogoImage);
            InteractionBox.PackEnd(LoginView);
            MainContainer.PackEnd(InteractionBox);

            this.Content = MainContainer;
        }
Ejemplo n.º 18
0
 void CreateButtons(HPaned panel)
 {
     var panel2 = panel.Panel2;
     var box = new VBox ();
     panel2.Content = box;
     box.PackStart (CreateConnectButton ());
     box.PackStart (CreateListenButton ());
 }
 protected virtual void PopulateViewBoxWithTitle(VBox vBox, IAsset asset)
 {
     var title = new Label(asset.Name)
     {
         Font = Font.SystemFont.WithSize(17.5).WithWeight(FontWeight.Bold)
     };
     vBox.PackStart(title);
 }
Ejemplo n.º 20
0
        public MainWindow()
        {
            Menu menu = new Menu ();

            var file = new MenuItem ("File");
            file.SubMenu = new Menu ();
            file.SubMenu.Items.Add (new MenuItem ("Open"));
            file.SubMenu.Items.Add (new MenuItem ("New"));
            file.SubMenu.Items.Add (new MenuItem ("Close"));
            menu.Items.Add (file);

            var edit = new MenuItem ("Edit");
            edit.SubMenu = new Menu ();
            edit.SubMenu.Items.Add (new MenuItem ("Copy"));
            edit.SubMenu.Items.Add (new MenuItem ("Cut"));
            edit.SubMenu.Items.Add (new MenuItem ("Paste"));
            menu.Items.Add (edit);

            MainMenu = menu;

            HBox box = new HBox ();

            icon = Image.FromResource (typeof(App), "class.png");

            store = new TreeStore (nameCol, iconCol, widgetCol);
            samplesTree = new TreeView ();
            samplesTree.Columns.Add ("Name", iconCol, nameCol);

            AddSample (null, "Boxes", typeof(Boxes));
            AddSample (null, "Buttons", typeof(ButtonSample));
            AddSample (null, "ComboBox", typeof(ComboBoxes));
            //			AddSample (null, "Designer", typeof(Designer));
            AddSample (null, "Drag & Drop", typeof(DragDrop));
            var n = AddSample (null, "Drawing", null);
            AddSample (n, "Canvas with Widget", typeof(CanvasWithWidget));
            AddSample (n, "Chart", typeof(ChartSample));
            AddSample (n, "Transformations", typeof(DrawingTransforms));
            AddSample (null, "Images", typeof(Images));
            AddSample (null, "List View", typeof(ListView1));
            AddSample (null, "Notebook", typeof(NotebookSample));
            //			AddSample (null, "Scroll View", typeof(ScrollWindowSample));
            AddSample (null, "Text Entry", typeof(TextEntries));
            AddSample (null, "Windows", typeof(Windows));

            samplesTree.DataSource = store;

            box.PackStart (samplesTree);

            sampleBox = new VBox ();
            title = new Label ("Sample:");
            sampleBox.PackStart (title, BoxMode.None);

            box.PackStart (sampleBox, BoxMode.FillAndExpand);

            Content = box;

            samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged;
        }
Ejemplo n.º 21
0
        public SplashWindow()
        {
            Icon = App.Icon;

            Width = 550;

            Title = "4Plug First Use";
            Resizable = false;

            VBox V = new VBox();
            Content = V;

            Label lbl;

            lbl = new Label("A small introduction.") { Font = Font.FromName("Segoe UI Light 24"), TextColor = PluginType.Vpk.GetColor() };
            V.PackStart(lbl);

            lbl = new Label("This tool allows you to quickly enable/disable mods as well as install new ones.");
            V.PackStart(lbl);

            lbl = new Label(""); V.PackStart(lbl);

            lbl = new Label("This is what a mod looks like in 4Plug!") { Font = Font.FromName("Segoe UI Light 24"), TextColor = PluginType.Unknown.GetColor() };
            V.PackStart(lbl);

            lbl = new Label("You can enable/disable mods by clicking on the image.");
            V.PackStart(lbl);

            //lbl = new Label("Uninstalled mods are saved in the \"custom_\" instead of the \"custom\" folder of you game.");
            //V.PackStart(lbl);

            lbl = new Label("");

            DummyPluginWidget dummy = new DummyPluginWidget(lbl);
            dummy.MarginTop += 16;
            dummy.MarginBottom += 8;
            V.PackStart(dummy);

            V.PackStart(lbl);

            lbl = new Label(""); V.PackStart(lbl);

            {
                HBox box = new HBox();
                Button btn;

                btn = new Button(" Got it! ");
                box.PackEnd(btn);
                btn.Clicked += (s, e) => { Close(); };

                Label lbl2;
                lbl2 = new Label(" Feel free to leave feedback (mainmenu -> submit feedback) later ");
                box.PackStart(lbl2);
                //btn.Clicked += (s, e) => { new SubmitFeedbackWindow("via Splash Window").Run(); };

                V.PackStart(box);
            }
        }
Ejemplo n.º 22
0
        public SubmitFeedbackWindow(string category)
        {
            Icon = App.Icon;
            Title = "Thanks for your feedback!";

            Resizable = false;

            VBox vbox = new VBox();

            var text = new TextEntry()
            {
                MinWidth = 500,
                MinHeight = 200,
                MultiLine = true,
                Text = ""
            };

            vbox.PackStart(text);
            {
                HBox box = new HBox();

                Button btn;
                box.PackEnd(btn = new Button(" Cancel "));
                btn.Clicked += (s, e) => { Close(); };

                box.PackEnd(btn = new Button(" Submit "));
                btn.Clicked += (s, e) =>
                {
                    string feedback = text.Text;
                    new Task(() =>
                        {
                            if (feedback.Length > 10)
                            {
                                string URL = "http://yuhrney.square7.ch/4Plug/feedback.php";
                                WebClient webClient = new WebClient();
                                webClient.Proxy = null;

                                NameValueCollection formData = new NameValueCollection();

                                formData["feedback"] = string.Format("{3} - {1} {2}\n{5}\n{4}", App.WindowTitle, Environment.OSVersion.Platform, Xwt.Toolkit.CurrentEngine.Type, DateTime.Now.ToString("dd MMM HH:mm:ss", CultureInfo.InvariantCulture), feedback, category).Trim();

                                byte[] responseBytes = webClient.UploadValues(URL, "POST", formData);
                                string responsefromserver = Encoding.UTF8.GetString(responseBytes);
                                Console.WriteLine(responsefromserver);
                                webClient.Dispose();
                            }

                        }).Start();
                    Close();
                };

                vbox.PackStart(box);

                Content = vbox;
            }
        }
Ejemplo n.º 23
0
 public ExpanderSample()
 {
     expander = new Expander ();
     expander.Label = "A title here";
     var content = new VBox ();
     content.PackStart (new Label () { Text = "Label 1" });
     content.PackStart (new Button () { Label = "Button 2" });
     expander.Content = content;
     PackStart (expander);
 }
        protected LoadableDataTileView(ILogger log, string displayName)
        {
            _log = log;
            if (displayName == null) throw new ArgumentNullException(nameof(displayName));
            DisplayName = displayName;

            Content = _box = new VBox();
            PushNewRow();
            RefreshTiles();
        }
Ejemplo n.º 25
0
		public WidgetRendering ()
		{
			VBox box = new VBox ();
			Button b = new Button ("Click here to take a shot if this box");
			box.PackStart (b);
			box.PackStart (new CheckBox ("Test checkbox"));
			PackStart (box);
			b.Clicked += delegate {
				var img = Toolkit.CurrentEngine.RenderWidget (box);
				PackStart (new ImageView (img));
			};
		}
Ejemplo n.º 26
0
Archivo: Boxes.cs Proyecto: joncham/xwt
        public Boxes()
        {
            HBox box1 = new HBox ();

            VBox box2 = new VBox ();
            box2.PackStart (new SimpleBox (30), BoxMode.None);
            box2.PackStart (new SimpleBox (30), BoxMode.None);
            box2.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);

            box1.PackStart (box2, BoxMode.FillAndExpand);
            box1.PackStart (new SimpleBox (30), BoxMode.None);
            box1.PackStart (new SimpleBox (30), BoxMode.Expand);
            PackStart (box1, BoxMode.None);

            HBox box3 = new HBox ();
            box3.PackEnd (new SimpleBox (30));
            box3.PackStart (new SimpleBox (20) {Color = new Color (1, 0.5, 0.5)});
            box3.PackEnd (new SimpleBox (40));
            box3.PackStart (new SimpleBox (10) {Color = new Color (1, 0.5, 0.5)});
            box3.PackEnd (new SimpleBox (30));
            box3.PackStart (new SimpleBox (10) {Color = new Color (1, 0.5, 0.5)}, BoxMode.FillAndExpand);
            PackStart (box3);

            HBox box4 = new HBox ();
            Button b = new Button ("Click me");
            b.Clicked += delegate {
                b.Label = "Button has grown";
            };
            box4.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            box4.PackStart (b);
            box4.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            PackStart (box4);

            HBox box5 = new HBox ();
            Button b2 = new Button ("Hide / Show");
            box5.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            var hsb = new SimpleBox (20);
            box5.PackStart (hsb, BoxMode.None);
            box5.PackStart (b2);
            box5.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            b2.Clicked += delegate {
                hsb.Visible = !hsb.Visible;
            };
            PackStart (box5);

            HBox box6 = new HBox ();
            for (int n=0; n<15; n++) {
                var w = new Label ("TestLabel" + n);
                w.MinWidth = 10;
                box6.PackStart (w);
            }
            PackStart (box6);
        }
Ejemplo n.º 27
0
	static void SetUpGui ()
	{
		Window w = new Window ("Sign Up");
		
		firstname_entry = new Entry ();
		lastname_entry = new Entry ();
		email_entry = new Entry ();
		
		VBox outerv = new VBox ();
		outerv.BorderWidth = 12;
		outerv.Spacing = 12;
		w.Add (outerv);
		
		Label l = new Label ("Enter your name and preferred address");
		l.Xalign = 0;
		//l.UseMarkup = true;
		outerv.PackStart (l, false, false, 0);
		
		HBox h = new HBox ();
		//h.Spacing = 6;
		outerv.PackStart (h);
		
		VBox v = new VBox ();
		//v.Spacing = 6;
		h.PackStart (v, false, false, 0);
		
		Button l2;
		l2 = new Button ("First Name:");
		//l.Xalign = 0;
		v.PackStart (l2, true, false, 0);
		//l.MnemonicWidget = firstname_entry;
		
		l2 = new Button ("Last Name:");
		//l.Xalign = 0;
		v.PackStart (l2, true, false, 0);
		//l.MnemonicWidget = firstname_entry;
		
		l2 = new Button ("Email Address:");
		//l.Xalign = 0;
		v.PackStart (l2, true, false, 0);
		//l.MnemonicWidget = firstname_entry;

		v = new VBox ();
		//v.Spacing = 6;
		h.PackStart (v, true, true, 0);
		
		v.PackStart (firstname_entry, true, true, 0);
		v.PackStart (lastname_entry, true, true, 0);
		v.PackStart (email_entry, true, true, 0);
		
		w.ShowAll ();
	}
        void BuildGui()
        {
            this.Title = "Select Projects";
            this.Resizable = false;
            var vBox = new VBox();
            var hbox = new HBox();
            collectionsList.DataSource = collectionStore;
            collectionsList.Views.Add(new TextCellView(collectionName));
            collectionsList.MinWidth = 200;
            collectionsList.MinHeight = 300;
            hbox.PackStart(collectionsList);

            projectsList.DataSource = projectsStore;
            projectsList.MinWidth = 200;
            projectsList.MinHeight = 300;
            var checkView = new CheckBoxCellView(isProjectSelected) { Editable = true };
            checkView.Toggled += (sender, e) =>
            {
                var row = projectsList.CurrentEventRow;
                var node = projectsStore.GetNavigatorAt(row);
                var isSelected = !node.GetValue(isProjectSelected); //Xwt gives previous value
                var project = node.GetValue(projectItem);
                if (isSelected && !SelectedProjects.Any(p => string.Equals(p.Uri, project.Uri)))
                {
                    SelectedProjects.Add(project);
                }
                if (!isSelected && SelectedProjects.Any(p => string.Equals(p.Uri, project.Uri)))
                {
                    SelectedProjects.RemoveAll(p => string.Equals(p.Uri, project.Uri));
                }
            };
            projectsList.Columns.Add(new ListViewColumn("", checkView));
            projectsList.Columns.Add(new ListViewColumn("Name", new TextCellView(projectName)));
            hbox.PackEnd(projectsList);

            vBox.PackStart(hbox);

            Button ok = new Button(GettextCatalog.GetString("OK"));
            ok.Clicked += (sender, e) => Respond(Command.Ok);

            Button cancel = new Button(GettextCatalog.GetString("Cancel"));
            cancel.Clicked += (sender, e) => Respond(Command.Cancel);

            ok.MinWidth = cancel.MinWidth = Constants.ButtonWidth;

            var buttonBox = new HBox();
            buttonBox.PackEnd(ok);
            buttonBox.PackEnd(cancel);
            vBox.PackStart(buttonBox);

            this.Content = vBox;
        }
Ejemplo n.º 29
0
		public ExpanderSample ()
		{
			expander = new Expander ();
			expander.Label = "A title here";
			var content = new VBox ();
			content.PackStart (new Label () { Text = "Label 1" });
			content.PackStart (new Button () { Label = "Button 2" });
			content.BackgroundColor = Colors.Gray;
			expander.Content = content;
			PackStart (expander);

			PackStart (new Label ("This is shown below the expander"));
		}
        void BuildGui()
        {
            this.Title = GettextCatalog.GetString("Check In files");
            this.Resizable = false;
            notebook.TabOrientation = NotebookTabOrientation.Left;

            var checkInTab = new VBox();
            checkInTab.PackStart(new Label(GettextCatalog.GetString("Pending Changes") + ":"));
            filesView.WidthRequest = 500;
            filesView.HeightRequest = 150;
            var checkView = new CheckBoxCellView(isCheckedField);
            checkView.Editable = true;
            filesView.Columns.Add("Name", checkView, new TextCellView(nameField));
            filesView.Columns.Add("Changes", changesField);
            filesView.Columns.Add("Folder", folderField);
            filesView.DataSource = fileStore;
            checkInTab.PackStart(filesView, true, true);

            checkInTab.PackStart(new Label(GettextCatalog.GetString("Comment") + ":"));
            commentEntry.MultiLine = true;
            checkInTab.PackStart(commentEntry);

            notebook.Add(checkInTab, GettextCatalog.GetString("Pending Changes"));


            var workItemsTab = new HBox();
            var workItemsListBox = new VBox();
            workItemsListBox.PackStart(new Label(GettextCatalog.GetString("Work Items") + ":"));
            workItemsView.Columns.Add("Id", idField);
            workItemsView.Columns.Add("Title", titleField);
            workItemsView.DataSource = workItemsStore;
            workItemsListBox.PackStart(workItemsView, true);
            workItemsTab.PackStart(workItemsListBox, true, true);

            var workItemButtonBox = new VBox();
            var addWorkItemButton = new Button(GettextCatalog.GetString("Add Work Item"));
            addWorkItemButton.Clicked += OnAddWorkItem;
            workItemButtonBox.PackStart(addWorkItemButton);
            var removeWorkItemButton = new Button(GettextCatalog.GetString("Remove Work Item"));
            removeWorkItemButton.Clicked += OnRemoveWorkItem;
            workItemButtonBox.PackStart(removeWorkItemButton);
            workItemsTab.PackStart(workItemButtonBox);

            notebook.Add(workItemsTab, GettextCatalog.GetString("Work Items"));


            this.Buttons.Add(Command.Ok, Command.Cancel);


            this.Content = notebook;
        }
Ejemplo n.º 31
0
        public AccountLoginDialog(Account account, bool addCloseButton) : base()
        {
            Title       = Catalog.GetString("Log in to Last.fm");
            BorderWidth = 5;

            IconName = "gtk-dialog-authentication";

            accel_group = new AccelGroup();
            AddAccelGroup(accel_group);

            HBox hbox = new HBox(false, 12);
            VBox vbox = new VBox(false, 0);

            hbox.BorderWidth = 5;
            vbox.Spacing     = 5;
            hbox.Show();
            vbox.Show();

            Image image = new Image();

            image.Yalign   = 0.0f;
            image.IconName = "gtk-dialog-authentication";
            image.IconSize = (int)IconSize.Dialog;
            image.Show();

            hbox.PackStart(image, false, false, 0);
            hbox.PackStart(vbox, true, true, 0);

            Label header = new Label();

            header.Xalign = 0.0f;
            header.Markup = String.Format("<big><b>{0}</b></big>", Catalog.GetString("Last.fm Account Login"));
            header.Show();

            message        = new Label(Catalog.GetString("Please enter your Last.fm account credentials."));
            message.Xalign = 0.0f;
            message.Show();

            vbox.PackStart(header, false, false, 0);
            vbox.PackStart(message, false, false, 0);

            login_form = new AccountLoginForm(account);
            login_form.AddSignUpButton();
            login_form.AddAuthorizeButton();
            login_form.Show();

            vbox.PackStart(login_form, true, true, 0);

            ContentArea.PackStart(hbox, true, true, 0);
            ContentArea.Remove(ActionArea);
            ContentArea.Spacing = 10;

            HBox bottom_box = new HBox();

            bottom_box.PackStart(new Badge(account), true, true, 5);
            bottom_box.PackStart(ActionArea, false, false, 0);
            bottom_box.ShowAll();
            ContentArea.PackEnd(bottom_box, false, false, 0);

            if (addCloseButton)
            {
                AddButton(Stock.Cancel, ResponseType.Cancel);
                Button button = new Button();
                button.Label = Catalog.GetString("Save and Log In");
                button.Image = new Image("gtk-save", IconSize.Button);
                button.ShowAll();
                button.Activated += delegate {
                    login_form.Save();
                };
                button.Clicked += delegate {
                    login_form.Save();
                };
                AddActionWidget(button, ResponseType.Ok);
            }
        }
Ejemplo n.º 32
0
        void CreatePageWidget(SectionPage page)
        {
            List <PanelInstance> boxPanels = new List <PanelInstance> ();
            List <PanelInstance> tabPanels = new List <PanelInstance> ();

            foreach (PanelInstance pi in page.Panels)
            {
                if (pi.Widget == null)
                {
                    pi.Widget = pi.Panel.CreatePanelWidget();
                    if (pi.Widget == null)
                    {
                        continue;
                    }

                    //HACK: work around bug 469427 - broken themes match on widget names
                    if (pi.Widget.Name.IndexOf("Panel") > 0)
                    {
                        pi.Widget.Name = pi.Widget.Name.Replace("Panel", "_");
                    }
                }
                else if (pi.Widget.Parent != null)
                {
                    ((Gtk.Container)pi.Widget.Parent).Remove(pi.Widget);
                }

                if (pi.Node.Grouping == PanelGrouping.Tab)
                {
                    tabPanels.Add(pi);
                }
                else
                {
                    boxPanels.Add(pi);
                }
            }

            // Try to fit panels with grouping=box or auto in the main page.
            // If they don't fit. Move auto panels to its own tab page.

            int  mainPageSize;
            bool fits;

            do
            {
                PanelInstance lastAuto = null;
                mainPageSize = 0;
                foreach (PanelInstance pi in boxPanels)
                {
                    if (pi.Node.Grouping == PanelGrouping.Auto)
                    {
                        lastAuto = pi;
                    }
                    // HACK: This we are parenting/unparenting the widget here as a workaround
                    // for a layout issue. To properly calculate the size of the widget, the widget
                    // needs to have the style that it will have when added to the window.
                    pi.Widget.Parent = this;
                    mainPageSize    += pi.Widget.SizeRequest().Height + 6;
                    pi.Widget.Unparent();
                }
                fits = mainPageSize <= pageFrame.Allocation.Height;
                if (!fits)
                {
                    if (lastAuto != null && boxPanels.Count > 1)
                    {
                        boxPanels.Remove(lastAuto);
                        tabPanels.Insert(0, lastAuto);
                    }
                    else
                    {
                        fits = true;
                    }
                }
            } while (!fits);

            Gtk.VBox box = new VBox(false, 12);
            box.Show();
            for (int n = 0; n < boxPanels.Count; n++)
            {
                if (n != 0)
                {
                    HSeparator sep = new HSeparator();
                    sep.Show();
                    box.PackStart(sep, false, false, 0);
                }
                PanelInstance pi = boxPanels [n];
                box.PackStart(pi.Widget, pi.Node.Fill, pi.Node.Fill, 0);
                pi.Widget.Show();
            }

            box.BorderWidth = 12;

            if (tabPanels.Count > 0)
            {
                /*				SquaredNotebook nb = new SquaredNotebook ();
                 * nb.Show ();
                 * nb.AddTab (box, GettextCatalog.GetString ("General"));
                 * foreach (PanelInstance pi in tabPanels) {
                 *      Gtk.Alignment a = new Alignment (0, 0, 1, 1);
                 *      a.BorderWidth = 9;
                 *      a.Show ();
                 *      a.Add (pi.Widget);
                 *      nb.AddTab (a, GettextCatalog.GetString (pi.Node.Label));
                 *      pi.Widget.Show ();
                 * }*/
                Gtk.Notebook nb = new Notebook();
                nb.Show();
                if (box.Children.Length > 0)
                {
                    Gtk.Label blab = new Gtk.Label(GettextCatalog.GetString("General"));
                    blab.Show();
                    box.BorderWidth = 9;
                    nb.InsertPage(box, blab, -1);
                }
                foreach (PanelInstance pi in tabPanels)
                {
                    Gtk.Label lab = new Gtk.Label(GettextCatalog.GetString(pi.Node.Label));
                    lab.Show();
                    Gtk.Alignment a = new Alignment(0, 0, 1, 1);
                    a.BorderWidth = 9;
                    a.Show();
                    a.Add(pi.Widget);
                    nb.InsertPage(a, lab, -1);
                    pi.Widget.Show();
                }
                page.Widget    = nb;
                nb.BorderWidth = 12;
            }
            else
            {
                page.Widget = box;
            }
        }
Ejemplo n.º 33
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MainView(ViewBase owner = null) : base(owner)
        {
            MasterView      = this;
            numberOfButtons = 0;
            if ((uint)Environment.OSVersion.Platform <= 3)
            {
                Rc.Parse(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                                      ".gtkrc"));
            }
            baseFont        = Rc.GetStyle(new Label()).FontDescription.Copy();
            defaultBaseSize = baseFont.Size / Pango.Scale.PangoScale;
            FontSize        = Utility.Configuration.Settings.BaseFontSize;
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.MainView.glade");

            window1         = (Window)builder.GetObject("window1");
            progressBar     = (ProgressBar)builder.GetObject("progressBar");
            StatusWindow    = (TextView)builder.GetObject("StatusWindow");
            stopButton      = (Button)builder.GetObject("stopButton");
            notebook1       = (Notebook)builder.GetObject("notebook1");
            notebook2       = (Notebook)builder.GetObject("notebook2");
            vbox1           = (VBox)builder.GetObject("vbox1");
            vbox2           = (VBox)builder.GetObject("vbox2");
            hpaned1         = (HPaned)builder.GetObject("hpaned1");
            hbox1           = (HBox)builder.GetObject("hbox1");
            _mainWidget     = window1;
            window1.Icon    = new Gdk.Pixbuf(null, "ApsimNG.Resources.apsim logo32.png");
            listButtonView1 = new ListButtonView(this);
            listButtonView1.ButtonsAreToolbar = true;

            EventBox labelBox = new EventBox();
            Label    label    = new Label("NOTE: This version of APSIM writes .apsimx files as JSON, not XML. These files cannot be opened with older versions of APSIM.");

            labelBox.Add(label);
            labelBox.ModifyBg(StateType.Normal, new Gdk.Color(0xff, 0xff, 0x00)); // yellow
            vbox1.PackStart(labelBox, false, true, 0);
            vbox1.PackEnd(listButtonView1.MainWidget, true, true, 0);
            listButtonView2 = new ListButtonView(this);
            listButtonView2.ButtonsAreToolbar = true;
            vbox2.PackEnd(listButtonView2.MainWidget, true, true, 0);
            hpaned1.PositionSet = true;
            hpaned1.Child2.Hide();
            hpaned1.Child2.NoShowAll = true;

            notebook1.SetMenuLabel(vbox1, LabelWithIcon(indexTabText, "go-home"));
            notebook2.SetMenuLabel(vbox2, LabelWithIcon(indexTabText, "go-home"));
            hbox1.HeightRequest = 20;

            TextTag tag = new TextTag("error");

            tag.Foreground = "red";
            StatusWindow.Buffer.TagTable.Add(tag);
            tag            = new TextTag("warning");
            tag.Foreground = "brown";
            StatusWindow.Buffer.TagTable.Add(tag);
            tag            = new TextTag("normal");
            tag.Foreground = "blue";
            StatusWindow.ModifyBase(StateType.Normal, new Gdk.Color(0xff, 0xff, 0xf0));
            StatusWindow.Visible     = false;
            stopButton.Image         = new Gtk.Image(new Gdk.Pixbuf(null, "ApsimNG.Resources.MenuImages.Delete.png", 12, 12));
            stopButton.ImagePosition = PositionType.Right;
            stopButton.Image.Visible = true;
            stopButton.Clicked      += OnStopClicked;
            window1.DeleteEvent     += OnClosing;
            listButtonView1.ListView.MainWidget.ScrollEvent   += ListView_ScrollEvent;
            listButtonView2.ListView.MainWidget.ScrollEvent   += ListView_ScrollEvent;
            listButtonView1.ListView.MainWidget.KeyPressEvent += ListView_KeyPressEvent;
            listButtonView2.ListView.MainWidget.KeyPressEvent += ListView_KeyPressEvent;
            //window1.ShowAll();
            if (ProcessUtilities.CurrentOS.IsMac)
            {
                InitMac();
            }
        }
Ejemplo n.º 34
0
        public SearchResultWidget()
        {
            var vbox    = new VBox();
            var toolbar = new Toolbar()
            {
                Orientation  = Orientation.Vertical,
                IconSize     = IconSize.Menu,
                ToolbarStyle = ToolbarStyle.Icons,
            };

            this.PackStart(vbox, true, true, 0);
            this.PackStart(toolbar, false, false, 0);
            labelStatus = new Label()
            {
                Xalign  = 0,
                Justify = Justification.Left,
            };
            var hpaned = new HPaned();

            vbox.PackStart(hpaned, true, true, 0);
            vbox.PackStart(labelStatus, false, false, 0);
            var resultsScroll = new CompactScrolledWindow();

            hpaned.Pack1(resultsScroll, true, true);
            scrolledwindowLogView = new CompactScrolledWindow();
            hpaned.Pack2(scrolledwindowLogView, true, true);
            textviewLog = new TextView()
            {
                Editable = false,
            };
            scrolledwindowLogView.Add(textviewLog);

            store = new ListStore(typeof(SearchResult),
                                  typeof(bool) // didRead
                                  );

            treeviewSearchResults = new PadTreeView()
            {
                Model            = store,
                HeadersClickable = true,
                RulesHint        = true,
            };

            treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
            resultsScroll.Add(treeviewSearchResults);

            var projectColumn = new TreeViewColumn {
                Resizable    = true,
                SortColumnId = 1,
                Title        = GettextCatalog.GetString("Project"),
                Sizing       = TreeViewColumnSizing.Fixed,
                FixedWidth   = 100
            };

            var projectPixbufRenderer = new CellRendererImage();

            projectColumn.PackStart(projectPixbufRenderer, false);
            projectColumn.SetCellDataFunc(projectPixbufRenderer, ResultProjectIconDataFunc);

            var renderer = treeviewSearchResults.TextRenderer;

            renderer.Ellipsize = Pango.EllipsizeMode.End;
            projectColumn.PackStart(renderer, true);
            projectColumn.SetCellDataFunc(renderer, ResultProjectDataFunc);
            treeviewSearchResults.AppendColumn(projectColumn);

            var fileNameColumn = new TreeViewColumn {
                Resizable    = true,
                SortColumnId = 2,
                Title        = GettextCatalog.GetString("File"),
                Sizing       = TreeViewColumnSizing.Fixed,
                FixedWidth   = 200
            };

            var fileNamePixbufRenderer = new CellRendererImage();

            fileNameColumn.PackStart(fileNamePixbufRenderer, false);
            fileNameColumn.SetCellDataFunc(fileNamePixbufRenderer, FileIconDataFunc);

            fileNameColumn.PackStart(renderer, true);
            fileNameColumn.SetCellDataFunc(renderer, FileNameDataFunc);
            treeviewSearchResults.AppendColumn(fileNameColumn);


            TreeViewColumn textColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Text"),
                                                                           renderer, ResultTextDataFunc);

            textColumn.Resizable  = true;
            textColumn.Sizing     = TreeViewColumnSizing.Fixed;
            textColumn.FixedWidth = 300;

            pathColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Path"),
                                                            renderer, ResultPathDataFunc);
            pathColumn.SortColumnId = 3;
            pathColumn.Resizable    = true;
            pathColumn.Sizing       = TreeViewColumnSizing.Fixed;
            pathColumn.FixedWidth   = 500;

            store.DefaultSortFunc = DefaultSortFunc;
            store.SetSortFunc(1, CompareProjectFileNames);
            store.SetSortFunc(2, CompareFileNames);
            store.SetSortFunc(3, CompareFilePaths);

            treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;

            buttonStop = new ToolButton(new ImageView(Gui.Stock.Stop, Gtk.IconSize.Menu), null)
            {
                Sensitive = false
            };
            buttonStop.Clicked    += ButtonStopClicked;
            buttonStop.TooltipText = GettextCatalog.GetString("Stop");
            toolbar.Insert(buttonStop, -1);

            var buttonClear = new ToolButton(new ImageView(Gui.Stock.Clear, Gtk.IconSize.Menu), null);

            buttonClear.Clicked    += ButtonClearClicked;
            buttonClear.TooltipText = GettextCatalog.GetString("Clear results");
            toolbar.Insert(buttonClear, -1);

            var buttonOutput = new ToggleToolButton();

            buttonOutput.IconWidget  = new ImageView(Gui.Stock.OutputIcon, Gtk.IconSize.Menu);
            buttonOutput.Clicked    += ButtonOutputClicked;
            buttonOutput.TooltipText = GettextCatalog.GetString("Show output");
            toolbar.Insert(buttonOutput, -1);

            buttonPin             = new ToggleToolButton();
            buttonPin.IconWidget  = new ImageView(Gui.Stock.PinUp, Gtk.IconSize.Menu);
            buttonPin.Clicked    += ButtonPinClicked;
            buttonPin.TooltipText = GettextCatalog.GetString("Pin results pad");
            toolbar.Insert(buttonPin, -1);

            // store.SetSortColumnId (3, SortType.Ascending);
            ShowAll();

            scrolledwindowLogView.Hide();
            treeviewSearchResults.FixedHeightMode = true;

            UpdateStyles();
            IdeApp.Preferences.ColorScheme.Changed += UpdateStyles;
        }
Ejemplo n.º 35
0
        public LogView(string filepath, bool isDirectory, Revision [] history, Repository vc)
            : base(Path.GetFileName(filepath) + " Log")
        {
            this.vc       = vc;
            this.filepath = filepath;
            this.history  = history;

            try {
                this.vinfo = vc.GetVersionInfo(filepath, false);
            }
            catch (Exception ex) {
                MessageService.ShowException(ex, GettextCatalog.GetString("Version control command failed."));
            }

            // Widget setup

            VBox box = new VBox(false, 6);

            widget = box;

            // Create the toolbar
            commandbar = new Toolbar();
            commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
            commandbar.IconSize     = Gtk.IconSize.Menu;
            box.PackStart(commandbar, false, false, 0);

            if (vinfo != null)
            {
                Gtk.ToolButton button = new Gtk.ToolButton(new Gtk.Image("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString("View Changes"));
                button.IsImportant = true;
                if (isDirectory)
                {
                    button.Clicked += new EventHandler(DirDiffButtonClicked);
                    commandbar.Insert(button, -1);
                }
                else
                {
                    button.Clicked += new EventHandler(DiffButtonClicked);
                    commandbar.Insert(button, -1);

                    button             = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Open, Gtk.IconSize.Menu), GettextCatalog.GetString("View File"));
                    button.IsImportant = true;
                    button.Clicked    += new EventHandler(ViewTextButtonClicked);
                    commandbar.Insert(button, -1);
                }
            }

            revertButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert changes from this revision"));
            revertButton.IsImportant = true;
            revertButton.Sensitive   = false;
            revertButton.Clicked    += new EventHandler(RevertRevisionClicked);
            commandbar.Insert(revertButton, -1);

            revertToButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert to this revision"));
            revertToButton.IsImportant = true;
            revertToButton.Sensitive   = false;
            revertToButton.Clicked    += new EventHandler(RevertToRevisionClicked);
            commandbar.Insert(revertToButton, -1);


            // A paned with two trees

            Gtk.VPaned paned = new Gtk.VPaned();
            box.PackStart(paned, true, true, 0);

            // Create the log list

            loglist = new TreeView();
            ScrolledWindow loglistscroll = new ScrolledWindow();

            loglistscroll.ShadowType = Gtk.ShadowType.In;
            loglistscroll.Add(loglist);
            loglistscroll.HscrollbarPolicy = PolicyType.Automatic;
            loglistscroll.VscrollbarPolicy = PolicyType.Automatic;
            paned.Add1(loglistscroll);
            ((Paned.PanedChild)paned [loglistscroll]).Resize = true;

            TreeView       changedPaths       = new TreeView();
            ScrolledWindow changedPathsScroll = new ScrolledWindow();

            changedPathsScroll.ShadowType       = Gtk.ShadowType.In;
            changedPathsScroll.HscrollbarPolicy = PolicyType.Automatic;
            changedPathsScroll.VscrollbarPolicy = PolicyType.Automatic;
            changedPathsScroll.Add(changedPaths);
            paned.Add2(changedPathsScroll);
            ((Paned.PanedChild)paned [changedPathsScroll]).Resize = false;

            widget.ShowAll();

            // Revision list setup

            CellRendererText textRenderer = new CellRendererText();

            textRenderer.Yalign = 0;

            TreeViewColumn colRevNum     = new TreeViewColumn(GettextCatalog.GetString("Revision"), textRenderer, "text", 0);
            TreeViewColumn colRevDate    = new TreeViewColumn(GettextCatalog.GetString("Date"), textRenderer, "text", 1);
            TreeViewColumn colRevAuthor  = new TreeViewColumn(GettextCatalog.GetString("Author"), textRenderer, "text", 2);
            TreeViewColumn colRevMessage = new TreeViewColumn(GettextCatalog.GetString("Message"), textRenderer, "text", 3);

            loglist.AppendColumn(colRevNum);
            loglist.AppendColumn(colRevDate);
            loglist.AppendColumn(colRevAuthor);
            loglist.AppendColumn(colRevMessage);

            ListStore logstore = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string));

            loglist.Model = logstore;

            foreach (Revision d in history)
            {
                logstore.AppendValues(
                    d.ToString(),
                    d.Time.ToString(),
                    d.Author,
                    d.Message == String.Empty ? GettextCatalog.GetString("(No message)") : d.Message);
            }

            // Changed paths list setup

            changedpathstore   = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Gdk.Pixbuf), typeof(string));
            changedPaths.Model = changedpathstore;

            TreeViewColumn   colOperation = new TreeViewColumn();
            CellRendererText crt          = new CellRendererText();
            var crp = new CellRendererPixbuf();

            colOperation.Title = GettextCatalog.GetString("Operation");
            colOperation.PackStart(crp, false);
            colOperation.PackStart(crt, true);
            colOperation.AddAttribute(crp, "pixbuf", 0);
            colOperation.AddAttribute(crt, "text", 1);
            changedPaths.AppendColumn(colOperation);

            TreeViewColumn colChangedPath = new TreeViewColumn();

            crp = new CellRendererPixbuf();
            crt = new CellRendererText();
            colChangedPath.Title = GettextCatalog.GetString("File Path");
            colChangedPath.PackStart(crp, false);
            colChangedPath.PackStart(crt, true);
            colChangedPath.AddAttribute(crp, "pixbuf", 2);
            colChangedPath.AddAttribute(crt, "text", 3);
            changedPaths.AppendColumn(colChangedPath);

            loglist.Selection.Changed += new EventHandler(TreeSelectionChanged);
        }
Ejemplo n.º 36
0
        public PosPaymentsDialog(Window pSourceWindow, DialogFlags pDialogFlags, ArticleBag pArticleBag, bool pEnablePartialPaymentButtons, bool pEnableCurrentAccountButton, bool pSkipPersistFinanceDocument, ProcessFinanceDocumentParameter pProcessFinanceDocumentParameter, string pSelectedPaymentMethodButtonName)
            : base(pSourceWindow, pDialogFlags, false)
        {
            try
            {
                //Init Local Vars
                _sourceWindow = pSourceWindow;
                string windowTitle = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_payments");
                //TODO:THEME
                Size   windowSize            = new Size(598, 620);
                string fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_payments.png");

                //Parameters
                _articleBagFullPayment           = pArticleBag;
                _skipPersistFinanceDocument      = pSkipPersistFinanceDocument;
                _processFinanceDocumentParameter = pProcessFinanceDocumentParameter;
                bool enablePartialPaymentButtons = pEnablePartialPaymentButtons;
                bool enableCurrentAccountButton  = pEnableCurrentAccountButton;
                if (enablePartialPaymentButtons)
                {
                    enablePartialPaymentButtons = (_articleBagFullPayment.TotalQuantity > 1) ? true : false;
                }
                //Files
                //TK016311 Botão Novo Cliente nos pagamentos do TicketPad
                string fileIconNewCustomer    = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\icon_pos_clients.png");
                string fileIconClearCustomer  = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\icon_pos_nav_delete.png");
                string fileIconFullPayment    = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\icon_pos_payment_full.png");
                string fileIconPartialPayment = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\icon_pos_payment_partial.png");
                //Colors
                Color colorPosPaymentsDialogTotalPannelBackground = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosPaymentsDialogTotalPannelBackground"]);
                //Objects
                _intialValueConfigurationCountry = SettingsApp.ConfigurationSystemCountry;

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                //Payment Buttons
                //Get Custom Select Data
                string       executeSql   = @"SELECT Oid, Token, ResourceString FROM fin_configurationpaymentmethod ORDER BY Ord;";
                XPSelectData xPSelectData = FrameworkUtils.GetSelectedDataFromQuery(executeSql);
                //Get Required XpObjects from Selected Data
                fin_configurationpaymentmethod xpoMoney      = (fin_configurationpaymentmethod)xPSelectData.GetXPGuidObjectFromField(typeof(fin_configurationpaymentmethod), "Token", "MONEY");
                fin_configurationpaymentmethod xpoCheck      = (fin_configurationpaymentmethod)xPSelectData.GetXPGuidObjectFromField(typeof(fin_configurationpaymentmethod), "Token", "BANK_CHECK");
                fin_configurationpaymentmethod xpoMB         = (fin_configurationpaymentmethod)xPSelectData.GetXPGuidObjectFromField(typeof(fin_configurationpaymentmethod), "Token", "CASH_MACHINE");
                fin_configurationpaymentmethod xpoCreditCard = (fin_configurationpaymentmethod)xPSelectData.GetXPGuidObjectFromField(typeof(fin_configurationpaymentmethod), "Token", "CREDIT_CARD");
                /* IN009142 - "Visa" option replaced by "Debit Card" */
                fin_configurationpaymentmethod xpoDebitCard      = (fin_configurationpaymentmethod)xPSelectData.GetXPGuidObjectFromField(typeof(fin_configurationpaymentmethod), "Token", "DEBIT_CARD");
                fin_configurationpaymentmethod xpoVisa           = (fin_configurationpaymentmethod)xPSelectData.GetXPGuidObjectFromField(typeof(fin_configurationpaymentmethod), "Token", "VISA");
                fin_configurationpaymentmethod xpoCurrentAccount = (fin_configurationpaymentmethod)xPSelectData.GetXPGuidObjectFromField(typeof(fin_configurationpaymentmethod), "Token", "CURRENT_ACCOUNT");
                fin_configurationpaymentmethod xpoCustomerCard   = (fin_configurationpaymentmethod)xPSelectData.GetXPGuidObjectFromField(typeof(fin_configurationpaymentmethod), "Token", "CUSTOMER_CARD");

                //Instantiate Buttons  //IN009257 Redimensionar botões para a resolução 1024 x 768. Alterei variável de tamanho de icons. era a mesma que documentos
                TouchButtonIconWithText buttonMoney = new TouchButtonIconWithText("touchButtonMoney_Green", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], xpoMoney.ResourceString), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], xpoMoney.ButtonIcon)), _sizeBasePaymentButtonIcon, _sizeBasePaymentButton.Width, _sizeBasePaymentButton.Height)
                {
                    CurrentButtonOid = xpoMoney.Oid, Sensitive = (xpoMoney.Disabled) ? false : true
                };
                TouchButtonIconWithText buttonCheck = new TouchButtonIconWithText("touchButtonCheck_Green", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], xpoCheck.ResourceString), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], xpoCheck.ButtonIcon)), _sizeBasePaymentButtonIcon, _sizeBasePaymentButton.Width, _sizeBasePaymentButton.Height)
                {
                    CurrentButtonOid = xpoCheck.Oid, Sensitive = (xpoCheck.Disabled) ? false : true
                };
                TouchButtonIconWithText buttonMB = new TouchButtonIconWithText("touchButtonMB_Green", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], xpoMB.ResourceString), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], xpoMB.ButtonIcon)), _sizeBasePaymentButtonIcon, _sizeBasePaymentButton.Width, _sizeBasePaymentButton.Height)
                {
                    CurrentButtonOid = xpoMB.Oid, Sensitive = (xpoMB.Disabled) ? false : true
                };
                TouchButtonIconWithText buttonCreditCard = new TouchButtonIconWithText("touchButtonCreditCard_Green", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], xpoCreditCard.ResourceString), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], xpoCreditCard.ButtonIcon)), _sizeBasePaymentButtonIcon, _sizeBasePaymentButton.Width, _sizeBasePaymentButton.Height)
                {
                    CurrentButtonOid = xpoCreditCard.Oid, Sensitive = (xpoCreditCard.Disabled) ? false : true
                };
                /* IN009142 */
                TouchButtonIconWithText buttonDebitCard = new TouchButtonIconWithText("touchButtonDebitCard_Green", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], xpoDebitCard.ResourceString), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], xpoDebitCard.ButtonIcon)), _sizeBasePaymentButtonIcon, _sizeBasePaymentButton.Width, _sizeBasePaymentButton.Height)
                {
                    CurrentButtonOid = xpoDebitCard.Oid, Sensitive = (xpoDebitCard.Disabled) ? false : true
                };
                TouchButtonIconWithText buttonVisa = new TouchButtonIconWithText("touchButtonVisa_Green", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], xpoVisa.ResourceString), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], xpoVisa.ButtonIcon)), _sizeBasePaymentButtonIcon, _sizeBasePaymentButton.Width, _sizeBasePaymentButton.Height)
                {
                    CurrentButtonOid = xpoVisa.Oid, Sensitive = (xpoVisa.Disabled) ? false : true
                };
                TouchButtonIconWithText buttonCurrentAccount = new TouchButtonIconWithText("touchButtonCurrentAccount_Green", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], xpoCurrentAccount.ResourceString), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], xpoCurrentAccount.ButtonIcon)), _sizeBasePaymentButtonIcon, _sizeBaseDialogDefaultButton.Width, _sizeBaseDialogDefaultButton.Height)
                {
                    CurrentButtonOid = xpoCurrentAccount.Oid, Sensitive = (xpoCurrentAccount.Disabled) ? false : true
                };
                TouchButtonIconWithText buttonCustomerCard = new TouchButtonIconWithText("touchButtonCustomerCard_Green", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], xpoCustomerCard.ResourceString), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], xpoCustomerCard.ButtonIcon)), _sizeBasePaymentButtonIcon, _sizeBaseDialogDefaultButton.Width, _sizeBaseDialogDefaultButton.Height)
                {
                    CurrentButtonOid = xpoCustomerCard.Oid, Sensitive = (xpoCustomerCard.Disabled) ? false : true
                };
                //Secondary Buttons
                //Events
                buttonMoney.Clicked      += buttonMoney_Clicked;
                buttonCheck.Clicked      += buttonCheck_Clicked;
                buttonMB.Clicked         += buttonMB_Clicked;
                buttonCreditCard.Clicked += buttonCredit_Clicked;
                /* IN009142 */
                buttonDebitCard.Clicked      += buttonDebitCard_Clicked;
                buttonVisa.Clicked           += buttonVisa_Clicked;
                buttonCurrentAccount.Clicked += buttonCurrentAccount_Clicked;
                buttonCustomerCard.Clicked   += buttonCustomerCard_Clicked;

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Table
                uint  tablePaymentsPadding = 0;
                Table tablePayments        = new Table(2, 3, true)
                {
                    BorderWidth = 2
                };
                //Row 1
                tablePayments.Attach(buttonMoney, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, tablePaymentsPadding, tablePaymentsPadding);
                tablePayments.Attach(buttonMB, 1, 2, 0, 1, AttachOptions.Fill, AttachOptions.Fill, tablePaymentsPadding, tablePaymentsPadding);
                /* IN009142 - adding "Debit Card" option to Payment window */
                tablePayments.Attach(buttonDebitCard, 2, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, tablePaymentsPadding, tablePaymentsPadding);
                /* IN009142 - removed "Visa" payment method */
                //tablePayments.Attach(buttonVisa, 2, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, tablePaymentsPadding, tablePaymentsPadding);
                //Row 2
                tablePayments.Attach(buttonCheck, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, tablePaymentsPadding, tablePaymentsPadding);
                tablePayments.Attach(buttonCreditCard, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, tablePaymentsPadding, tablePaymentsPadding);
                if (enableCurrentAccountButton)
                {
                    tablePayments.Attach(
                        (SettingsApp.PosPaymentsDialogUseCurrentAccount) ? buttonCurrentAccount : buttonCustomerCard
                        , 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, tablePaymentsPadding, tablePaymentsPadding
                        );
                }

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Labels
                Label labelTotal    = new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_total_price_to_pay") + ":");
                Label labelDelivery = new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_total_deliver") + ":");
                Label labelChange   = new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_total_change") + ":");
                _labelTotalValue = new Label(FrameworkUtils.DecimalToStringCurrency(_articleBagFullPayment.TotalFinal))
                {
                    //Total Width
                    WidthRequest = 120
                };
                _labelDeliveryValue = new Label(FrameworkUtils.DecimalToStringCurrency(0));
                _labelChangeValue   = new Label(FrameworkUtils.DecimalToStringCurrency(0));

                //Colors
                labelTotal.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(Color.FromArgb(101, 137, 171)));
                labelDelivery.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(Color.FromArgb(101, 137, 171)));
                labelChange.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(Color.FromArgb(101, 137, 171)));
                _labelTotalValue.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(Color.White));
                _labelDeliveryValue.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(Color.White));
                _labelChangeValue.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(Color.White));

                //Alignments
                labelTotal.SetAlignment(0, 0.5F);
                labelDelivery.SetAlignment(0, 0.5F);
                labelChange.SetAlignment(0, 0.5F);
                _labelTotalValue.SetAlignment(1, 0.5F);
                _labelDeliveryValue.SetAlignment(1, 0.5F);
                _labelChangeValue.SetAlignment(1, 0.5F);

                //labels Font
                Pango.FontDescription fontDescription = Pango.FontDescription.FromString("Bold 10");
                labelTotal.ModifyFont(fontDescription);
                labelDelivery.ModifyFont(fontDescription);
                labelChange.ModifyFont(fontDescription);
                Pango.FontDescription fontDescriptionValue = Pango.FontDescription.FromString("Bold 12");
                _labelTotalValue.ModifyFont(fontDescriptionValue);
                _labelDeliveryValue.ModifyFont(fontDescriptionValue);
                _labelChangeValue.ModifyFont(fontDescriptionValue);

                //Table TotalPannel
                uint  totalPannelPadding = 9;
                Table tableTotalPannel   = new Table(3, 2, false);
                tableTotalPannel.HeightRequest = 132;
                //Row 1
                tableTotalPannel.Attach(labelTotal, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, totalPannelPadding, totalPannelPadding);
                tableTotalPannel.Attach(_labelTotalValue, 1, 2, 0, 1, AttachOptions.Fill, AttachOptions.Fill, totalPannelPadding, totalPannelPadding);
                //Row 2
                tableTotalPannel.Attach(labelDelivery, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, totalPannelPadding, totalPannelPadding);
                tableTotalPannel.Attach(_labelDeliveryValue, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, totalPannelPadding, totalPannelPadding);
                //Row 3
                tableTotalPannel.Attach(labelChange, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, totalPannelPadding, totalPannelPadding);
                tableTotalPannel.Attach(_labelChangeValue, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, totalPannelPadding, totalPannelPadding);

                //TotalPannel
                EventBox eventboxTotalPannel = new EventBox();
                eventboxTotalPannel.BorderWidth = 3;
                eventboxTotalPannel.ModifyBg(StateType.Normal, Utils.ColorToGdkColor(colorPosPaymentsDialogTotalPannelBackground));
                eventboxTotalPannel.Add(tableTotalPannel);

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Customer Name
                CriteriaOperator criteriaOperatorCustomerName = null;
                /* IN009202 */
                _entryBoxSelectCustomerName             = new XPOEntryBoxSelectRecordValidation <erp_customer, TreeViewCustomer>(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_customer"), "Name", "Name", null, criteriaOperatorCustomerName, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericPlus, false);
                _entryBoxSelectCustomerName.ClosePopup += delegate
                {
                    //IN009284 POS - Pagamento conta-corrente - Cliente por defeito
                    if (_processFinanceDocumentParameter != null)
                    {
                        GetCustomerDetails("Oid", _processFinanceDocumentParameter.Customer.ToString());
                        Validate();
                    }
                    //IN009284 ENDS
                    else
                    {
                        GetCustomerDetails("Oid", _entryBoxSelectCustomerName.Value.Oid.ToString());
                        Validate();
                    }
                };
                _entryBoxSelectCustomerName.EntryValidation.Changed += _entryBoxSelectCustomerName_Changed;

                //Customer Discount
                _entryBoxCustomerDiscount = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_discount"), KeyboardMode.Alfa, SettingsApp.RegexPercentage, true);
                _entryBoxCustomerDiscount.EntryValidation.Text           = FrameworkUtils.DecimalToString(0.0m);
                _entryBoxCustomerDiscount.EntryValidation.Sensitive      = false;
                _entryBoxCustomerDiscount.EntryValidation.Changed       += _entryBoxCustomerDiscount_Changed;
                _entryBoxCustomerDiscount.EntryValidation.FocusOutEvent += delegate
                {
                    _entryBoxCustomerDiscount.EntryValidation.Text = FrameworkUtils.StringToDecimalAndToStringAgain(_entryBoxCustomerDiscount.EntryValidation.Text);
                };

                //Address
                _entryBoxCustomerAddress = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_address"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericPlus, false);/* IN009253 */
                _entryBoxCustomerAddress.EntryValidation.Changed += delegate { Validate(); };

                //Locality
                _entryBoxCustomerLocality = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_locality"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericPlus, false);/* IN009253 */
                _entryBoxCustomerLocality.EntryValidation.Changed += delegate { Validate(); };

                //ZipCode
                _entryBoxCustomerZipCode = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_zipcode"), KeyboardMode.Alfa, SettingsApp.ConfigurationSystemCountry.RegExZipCode, false);
                _entryBoxCustomerZipCode.WidthRequest             = 150;
                _entryBoxCustomerZipCode.EntryValidation.Changed += delegate { Validate(); };

                //City
                _entryBoxCustomerCity = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_city"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericPlus, false);/* IN009253 */
                _entryBoxCustomerCity.WidthRequest             = 200;
                _entryBoxCustomerCity.EntryValidation.Changed += delegate { Validate(); };

                //Country
                CriteriaOperator criteriaOperatorCustomerCountry = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1) AND (RegExFiscalNumber IS NOT NULL AND RegExZipCode IS NOT NULL)");
                _entryBoxSelectCustomerCountry = new XPOEntryBoxSelectRecordValidation <cfg_configurationcountry, TreeViewConfigurationCountry>(pSourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_country"), "Designation", "Oid", _intialValueConfigurationCountry, criteriaOperatorCustomerCountry, SettingsApp.RegexGuid, true);
                _entryBoxSelectCustomerCountry.WidthRequest = 235;
                //Extra Protection to prevent Customer without Country
                if (_entryBoxSelectCustomerCountry.Value != null)
                {
                    _entryBoxSelectCustomerCountry.EntryValidation.Validate(_entryBoxSelectCustomerCountry.Value.Oid.ToString());
                }
                _entryBoxSelectCustomerCountry.EntryValidation.IsEditable  = false;
                _entryBoxSelectCustomerCountry.ButtonSelectValue.Sensitive = false;
                _entryBoxSelectCustomerCountry.ClosePopup += delegate
                {
                    _selectedCountry = _entryBoxSelectCustomerCountry.Value;
                    //Require to Update RegEx and Criteria to filter Country Clients Only
                    _entryBoxSelectCustomerFiscalNumber.EntryValidation.Rule = _entryBoxSelectCustomerCountry.Value.RegExFiscalNumber;
                    _entryBoxCustomerZipCode.EntryValidation.Rule            = _entryBoxSelectCustomerCountry.Value.RegExZipCode;
                    //Clear Customer Fields, Except Country
                    ClearCustomer(false);
                    //Apply Criteria Operators
                    ApplyCriteriaToCustomerInputs();
                    //Call Main Validate
                    Validate();
                };

                //FiscalNumber
                CriteriaOperator criteriaOperatorFiscalNumber = null;
                _entryBoxSelectCustomerFiscalNumber = new XPOEntryBoxSelectRecordValidation <erp_customer, TreeViewCustomer>(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_number"), "FiscalNumber", "FiscalNumber", null, criteriaOperatorFiscalNumber, KeyboardMode.AlfaNumeric, _intialValueConfigurationCountry.RegExFiscalNumber, false);
                _entryBoxSelectCustomerFiscalNumber.EntryValidation.Changed += _entryBoxSelectCustomerFiscalNumber_Changed;

                //CardNumber
                CriteriaOperator criteriaOperatorCardNumber = null;//Now Criteria is assigned in ApplyCriteriaToCustomerInputs();
                _entryBoxSelectCustomerCardNumber             = new XPOEntryBoxSelectRecordValidation <erp_customer, TreeViewCustomer>(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_card_number"), "CardNumber", "CardNumber", null, criteriaOperatorCardNumber, KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, false);
                _entryBoxSelectCustomerCardNumber.ClosePopup += delegate
                {
                    if (_entryBoxSelectCustomerCardNumber.EntryValidation.Validated)
                    {
                        GetCustomerDetails("CardNumber", _entryBoxSelectCustomerCardNumber.EntryValidation.Text);
                    }
                    Validate();
                };

                //Notes
                _entryBoxCustomerNotes = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
                _entryBoxCustomerNotes.EntryValidation.Changed += delegate { Validate(); };

                //Fill Dialog Inputs with Defaults FinalConsumerEntity Values
                if (_processFinanceDocumentParameter == null)
                {
                    //If ProcessFinanceDocumentParameter is not null fill Dialog with value from ProcessFinanceDocumentParameter, implemented for SplitPayments
                    GetCustomerDetails("Oid", SettingsApp.XpoOidDocumentFinanceMasterFinalConsumerEntity.ToString());
                }
                //Fill Dialog Inputs with Stored Values, ex when we Work with SplitPayments
                else
                {
                    //Apply Default Customer Entity
                    GetCustomerDetails("Oid", _processFinanceDocumentParameter.Customer.ToString());

                    //Assign Totasl and Discounts Values
                    _totalDelivery  = _processFinanceDocumentParameter.TotalDelivery;
                    _totalChange    = _processFinanceDocumentParameter.TotalChange;
                    _discountGlobal = _processFinanceDocumentParameter.ArticleBag.DiscountGlobal;
                    // Update Visual Components
                    _labelDeliveryValue.Text = FrameworkUtils.DecimalToStringCurrency(_totalDelivery);
                    _labelChangeValue.Text   = FrameworkUtils.DecimalToStringCurrency(_totalChange);
                    // Selects
                    _selectedCustomer = (erp_customer)FrameworkUtils.GetXPGuidObject(typeof(erp_customer), _processFinanceDocumentParameter.Customer);
                    _selectedCountry  = _selectedCustomer.Country;
                    // PaymentMethod
                    _selectedPaymentMethod = (fin_configurationpaymentmethod)FrameworkUtils.GetXPGuidObject(typeof(fin_configurationpaymentmethod), _processFinanceDocumentParameter.PaymentMethod);
                    // Restore Selected Payment Method, require to associate button reference to selectedPaymentMethodButton
                    if (!string.IsNullOrEmpty(pSelectedPaymentMethodButtonName))
                    {
                        switch (pSelectedPaymentMethodButtonName)
                        {
                        case "touchButtonMoney_Green":
                            _selectedPaymentMethodButton = buttonMoney;
                            break;

                        case "touchButtonCheck_Green":
                            _selectedPaymentMethodButton = buttonCheck;
                            break;

                        case "touchButtonMB_Green":
                            _selectedPaymentMethodButton = buttonMB;
                            break;

                        case "touchButtonCreditCard_Green":
                            _selectedPaymentMethodButton = buttonCreditCard;
                            break;

                        /* IN009142 */
                        case "touchButtonDebitCard_Green":
                            _selectedPaymentMethodButton = buttonDebitCard;
                            break;

                        case "touchButtonVisa_Green":
                            _selectedPaymentMethodButton = buttonVisa;
                            break;

                        case "touchButtonCurrentAccount_Green":
                            _selectedPaymentMethodButton = buttonCurrentAccount;
                            break;

                        case "touchButtonCustomerCard_Green":
                            _selectedPaymentMethodButton = buttonCustomerCard;
                            break;
                        }

                        //Assign Payment Method after have Reference
                        AssignPaymentMethod(_selectedPaymentMethodButton);
                    }

                    //UpdateChangeValue, if we add/remove Splits we must recalculate ChangeValue
                    UpdateChangeValue();
                }

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Pack Content

                HBox hboxPaymenstAndTotals = new HBox(false, 0);
                hboxPaymenstAndTotals.PackStart(tablePayments, true, true, 0);
                hboxPaymenstAndTotals.PackStart(eventboxTotalPannel, true, true, 0);

                HBox hboxCustomerNameAndCustomerDiscount = new HBox(true, 0);
                hboxCustomerNameAndCustomerDiscount.PackStart(_entryBoxSelectCustomerName, true, true, 0);
                hboxCustomerNameAndCustomerDiscount.PackStart(_entryBoxCustomerDiscount, true, true, 0);

                HBox hboxFiscalNumberAndCardNumber = new HBox(true, 0);
                hboxFiscalNumberAndCardNumber.PackStart(_entryBoxSelectCustomerFiscalNumber, true, true, 0);
                hboxFiscalNumberAndCardNumber.PackStart(_entryBoxSelectCustomerCardNumber, true, true, 0);

                HBox hboxZipCodeCityAndCountry = new HBox(false, 0);
                hboxZipCodeCityAndCountry.PackStart(_entryBoxCustomerZipCode, false, false, 0);
                hboxZipCodeCityAndCountry.PackStart(_entryBoxCustomerCity, false, false, 0);
                hboxZipCodeCityAndCountry.PackStart(_entryBoxSelectCustomerCountry, true, true, 0);

                VBox vboxContent = new VBox(false, 0);
                vboxContent.PackStart(hboxPaymenstAndTotals, true, true, 0);
                vboxContent.PackStart(hboxFiscalNumberAndCardNumber, true, true, 0);
                vboxContent.PackStart(hboxCustomerNameAndCustomerDiscount, true, true, 0);
                vboxContent.PackStart(_entryBoxCustomerAddress, true, true, 0);
                vboxContent.PackStart(_entryBoxCustomerLocality, true, true, 0);
                vboxContent.PackStart(hboxZipCodeCityAndCountry, true, true, 0);
                vboxContent.PackStart(_entryBoxCustomerNotes, true, true, 0);

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //ActionArea Buttons
                _buttonOk             = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok);
                _buttonCancel         = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel);
                _buttonClearCustomer  = ActionAreaButton.FactoryGetDialogButtonType("touchButtonClearCustomer_DialogActionArea", resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_button_label_payment_dialog_clear_client"), fileIconClearCustomer);
                _buttonNewCustomer    = ActionAreaButton.FactoryGetDialogButtonType("touchButtonClearCustomer_DialogActionArea", resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "dialog_button_label_new_client"), fileIconNewCustomer);
                _buttonFullPayment    = ActionAreaButton.FactoryGetDialogButtonType("touchButtonFullPayment_DialogActionArea", resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_button_label_payment_dialog_full_payment"), fileIconFullPayment);
                _buttonPartialPayment = ActionAreaButton.FactoryGetDialogButtonType("touchButtonPartialPayment_DialogActionArea", resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_button_label_payment_dialog_partial_payment"), fileIconPartialPayment);
                // Enable if has selectedPaymentMethod defined, ex when working with SplitPayments
                _buttonOk.Sensitive          = (_selectedPaymentMethod != null);
                _buttonFullPayment.Sensitive = false;

                //ActionArea
                ActionAreaButtons actionAreaButtons = new ActionAreaButtons();
                actionAreaButtons.Add(new ActionAreaButton(_buttonClearCustomer, _responseTypeClearCustomer));
                actionAreaButtons.Add(new ActionAreaButton(_buttonNewCustomer, _responseTypeClearCustomer));
                if (enablePartialPaymentButtons)
                {
                    actionAreaButtons.Add(new ActionAreaButton(_buttonFullPayment, _responseTypeFullPayment));
                    actionAreaButtons.Add(new ActionAreaButton(_buttonPartialPayment, _responseTypePartialPayment));
                }

                actionAreaButtons.Add(new ActionAreaButton(_buttonOk, ResponseType.Ok));
                actionAreaButtons.Add(new ActionAreaButton(_buttonCancel, ResponseType.Cancel));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Init Object
                this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, windowSize, vboxContent, actionAreaButtons);
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Ejemplo n.º 37
0
        public void Run(object o, EventArgs e)
        {
            Console.WriteLine("EXECUTING ExiflowCreateVersion EXTENSION");

            Window win = new Window("window");

            dialog = new Dialog(dialog_name, win, Gtk.DialogFlags.DestroyWithParent);

            Frame frame_versions = new Frame("new version");
            HBox  hbox_versions  = new HBox();

            frame_versions.Child = hbox_versions;

            // RadioButtons left
            VBox vbox_versions_left = new VBox();

            hbox_versions.PackStart(vbox_versions_left, true, false, 0);
            // EntryBox right
            VBox vbox_versions_right = new VBox();

            hbox_versions.PackStart(vbox_versions_right, true, false, 0);
            vbox_versions_right.PackStart(new_version_entry, true, false, 0);
            vbox_versions_right.PackStart(overwrite_file_ok, true, false, 0);

            Frame frame_resulting_filename = new Frame("resulting filename");
            VBox  vbox_resulting_filename  = new VBox();

            frame_resulting_filename.Child = vbox_resulting_filename;
            vbox_resulting_filename.PackStart(new_filename_label, true, false, 0);
            vbox_resulting_filename.PackStart(overwrite_warning_label, true, false, 0);

            Frame frame_open_with = new Frame("open with");
            VBox  vbox_open_with  = new VBox();

            frame_open_with.Child = vbox_open_with;
            vbox_open_with.PackStart(new_filename_label, true, false, 0);


            new_version_entry.Changed += new EventHandler(on_new_version_entry_changed);
            overwrite_file_ok.Toggled += new EventHandler(on_overwrite_file_ok_toggled);

            gtk_cancel.UseStock = true;
            gtk_cancel.Clicked += CancelClicked;
            gtk_ok.UseStock     = true;
            gtk_ok.Clicked     += OkClicked;

            foreach (Photo p in App.Instance.Organizer.SelectedPhotos())
            {
                this.currentphoto = p;
                //Console.WriteLine ("MimeType: "+ Gnome.Vfs.MimeType.GetMimeTypeForUri (p.DefaultVersionUri.ToString ()));

                //uint default_id = p.DefaultVersionId;
                //Console.WriteLine ("DefaultVersionId: "+default_id);
                //string filename = GetNextIntelligentVersionFileNames (p)[0];

                string [] possiblefilenames = GetNextIntelligentVersionFileNames(p);
                new_version_entry.Text = GetVersionName(possiblefilenames[0].ToString());

                for (int i = 0; i < possiblefilenames.Length; i++)
                {
                    Gtk.RadioButton rb = new Gtk.RadioButton(versionrb, GetVersionName(possiblefilenames[i].ToString()));
                    rb.Clicked += new EventHandler(on_versionrb_changed);
                    vbox_versions_left.PackStart(rb, true, false, 0);
                }

                ComboBox owcb = GetComboBox();
                vbox_open_with.PackStart(owcb, false, true, 0);

                dialog.Modal        = false;
                dialog.TransientFor = null;
            }

            VBox vbox_main = new VBox();

            vbox_main.PackStart(frame_versions);
            vbox_main.PackStart(frame_resulting_filename);
            //vbox_main.PackStart (frame_open_with);

            HButtonBox hbb_ok_cancel = new HButtonBox();

            hbb_ok_cancel.PackStart(gtk_cancel, true, false, 0);
            hbb_ok_cancel.PackStart(gtk_ok, true, false, 0);

            dialog.VBox.PackStart(vbox_main, false, true, 0);
            dialog.ActionArea.PackStart(hbb_ok_cancel, false, true, 0);
            dialog.ShowAll();
        }
Ejemplo n.º 38
0
        public Widget CreateBuildResultsWidget(Orientation orientation)
        {
            EventBox ebox = new EventBox();

            Gtk.Box box;
            if (orientation == Orientation.Horizontal)
            {
                box = new HBox();
            }
            else
            {
                box = new VBox();
            }
            box.Spacing = 3;

            var errorIcon   = ImageService.GetIcon(StockIcons.Error).WithSize(Xwt.IconSize.Small);
            var warningIcon = ImageService.GetIcon(StockIcons.Warning).WithSize(Xwt.IconSize.Small);

            var errorImage   = new Xwt.ImageView(errorIcon);
            var warningImage = new Xwt.ImageView(warningIcon);

            box.PackStart(errorImage.ToGtkWidget(), false, false, 0);
            Label errors = new Gtk.Label();

            box.PackStart(errors, false, false, 0);

            box.PackStart(warningImage.ToGtkWidget(), false, false, 0);
            Label warnings = new Gtk.Label();

            box.PackStart(warnings, false, false, 0);
            box.NoShowAll = true;
            box.Show();

            TaskEventHandler updateHandler = delegate {
                int ec = 0, wc = 0;

                foreach (Task t in TaskService.Errors)
                {
                    if (t.Severity == TaskSeverity.Error)
                    {
                        ec++;
                    }
                    else if (t.Severity == TaskSeverity.Warning)
                    {
                        wc++;
                    }
                }


                using (var font = FontService.SansFont.CopyModified(0.8d)) {
                    errors.Visible = ec > 0;
                    errors.ModifyFont(font);
                    errors.Text        = ec.ToString();
                    errorImage.Visible = ec > 0;

                    warnings.Visible = wc > 0;
                    warnings.ModifyFont(font);
                    warnings.Text        = wc.ToString();
                    warningImage.Visible = wc > 0;
                }

                ebox.Visible = ec > 0 || wc > 0;

                UpdateSeparators();
            };

            updateHandler(null, null);

            TaskService.Errors.TasksAdded   += updateHandler;
            TaskService.Errors.TasksRemoved += updateHandler;

            box.Destroyed += delegate {
                TaskService.Errors.TasksAdded   -= updateHandler;
                TaskService.Errors.TasksRemoved -= updateHandler;
            };

            ebox.VisibleWindow = false;
            ebox.Add(box);
            ebox.ShowAll();
            ebox.ButtonReleaseEvent += delegate {
                var pad = IdeApp.Workbench.GetPad <MonoDevelop.Ide.Gui.Pads.ErrorListPad> ();
                pad.BringToFront();
            };

            errors.Visible       = false;
            errorImage.Visible   = false;
            warnings.Visible     = false;
            warningImage.Visible = false;

            return(ebox);
        }
Ejemplo n.º 39
0
        public void Render_should_traverse_through_child_hierarchy_and_render_all_which_size_is_greater_than_0()
        {
            var panelRenderer     = CreateMockRenderer <Panel>();
            var hboxRenderer      = CreateMockRenderer <HBox>();
            var componentRenderer = CreateMockRenderer <Component>();
            var renderer          = new TestableRenderer();

            renderer.RegisterRenderer(panelRenderer.Object);
            renderer.RegisterRenderer(hboxRenderer.Object);
            renderer.RegisterRenderer(componentRenderer.Object);

            var hbox       = new HBox();
            var vbox       = new VBox();
            var component1 = new Component {
                Width = 1, Height = 1
            };
            var component2 = new Component {
                Width = 1, Height = 1
            };
            var component3 = new Component {
                Width = 1, Height = 1
            };
            var component4 = new Component {
                Width = 1, Height = 1
            };
            var panel1 = new Panel {
                Width = 10, Height = 10, Inner = component1
            };
            var panel2 = new Panel {
                Width = 0, Height = 10, Inner = component2
            };
            var panel3 = new Panel {
                Width = 10, Height = 0, Inner = component3
            };
            var panel4 = new Panel {
                Width = 2, Height = 2, Inner = component4
            };

            hbox.AddComponent(vbox);
            hbox.AddComponent(panel1);

            vbox.AddComponent(panel2);
            vbox.AddComponent(panel3);
            vbox.AddComponent(panel4);

            var form = new Form(hbox);

            form.LayOut(new Size(int.MaxValue, int.MaxValue), TestRendererContext.Instance);
            var g = new object();

            renderer.Render(g, form);

            hboxRenderer.Verify(x => x.Render(g, hbox, It.IsAny <Action <object, IComponent> >()), Times.Once);
            panelRenderer.Verify(x => x.Render(g, panel1, It.IsAny <Action <object, IComponent> >()), Times.Once);
            panelRenderer.Verify(x => x.Render(g, panel2, It.IsAny <Action <object, IComponent> >()), Times.Never);
            panelRenderer.Verify(x => x.Render(g, panel3, It.IsAny <Action <object, IComponent> >()), Times.Never);
            panelRenderer.Verify(x => x.Render(g, panel4, It.IsAny <Action <object, IComponent> >()), Times.Once);

            componentRenderer.Verify(x => x.Render(g, component1, It.IsAny <Action <object, IComponent> >()), Times.Once);
            componentRenderer.Verify(x => x.Render(g, component2, It.IsAny <Action <object, IComponent> >()), Times.Never);
            componentRenderer.Verify(x => x.Render(g, component3, It.IsAny <Action <object, IComponent> >()), Times.Never);
            componentRenderer.Verify(x => x.Render(g, component4, It.IsAny <Action <object, IComponent> >()), Times.Once);
        }
Ejemplo n.º 40
0
        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.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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_financialtemplate"));
                vboxTab1.PackStart(checkButtonFinancialTemplate, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonFinancialTemplate, _dataSourceRow, "FinancialTemplate"));

                //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);
            }
        }
Ejemplo n.º 41
0
        //Initialize UI Keyboard from VirtualKeyboard
        private VBox InitVirtualKeyboard(VirtualKeyBoard pVirtualKeyboard)
        {
            List <VirtualKey> currentKeyboardRow;
            VirtualKey        currentKey;     //Virtual Key
            KeyboardPadKey    keyboardPadKey; //UI GTK Key

            //Init Lists
            List <HBox> hboxKeyBoard = new List <HBox>();
            List <HBox> hboxNumPad   = new List <HBox>();

            //Init VBoxs to strore Rows
            _vboxKeyboardRows = new VBox(true, 0);
            _vboxNumPadRows   = new VBox(true, 0);

            //loop rows
            for (int i = 0; i < pVirtualKeyboard.KeyBoard.Count; i++)
            {
                //Get current VirtualKeyboard Row to Work
                currentKeyboardRow = pVirtualKeyboard.KeyBoard[i];

                //add new Hbox to hboxKeyBoard/hboxNumPad rows List
                hboxKeyBoard.Add(new HBox(false, 0));
                hboxNumPad.Add(new HBox(false, 0));

                //loop columns in a row
                for (int j = 0; j < currentKeyboardRow.Count; j++)
                {
                    //Debug
                    //_log.Debug(string.Format("InitVirtualKeyboard(): tmpKey{0}:{1}:{2}", i, j, currentKey.L1.Glyph));

                    currentKey = currentKeyboardRow[j];

                    //Create UI Key
                    keyboardPadKey          = new KeyboardPadKey(currentKey);
                    keyboardPadKey.Clicked += keyboardPadKey_Clicked;
                    //Assign its UI reference to VirtualKey, usefull to have access to UI in VirtualKeyboard.VirtualKey
                    currentKey.UIKey = keyboardPadKey;

                    //If is a IsNumPad L1 key add to IsNumPad
                    if (currentKey.L1.IsNumPad)
                    {
                        hboxNumPad[i].PackStart(keyboardPadKey, false, false, 0);
                    }
                    //Else Add to KeyBoard
                    else
                    {
                        hboxKeyBoard[i].PackStart(keyboardPadKey, false, false, 0);
                    };
                }
                //In the end add row to Vbox
                _vboxKeyboardRows.PackStart(hboxKeyBoard[i]);
                _vboxNumPadRows.PackStart(hboxNumPad[i]);
            }

            //Pack KeyBoard and NumberPad into hboxResultReyboard
            HBox hboxResultReyboard = new HBox(false, 0);

            hboxResultReyboard.Spacing = _spacing;
            hboxResultReyboard.PackStart(_vboxKeyboardRows, false, false, 0);
            hboxResultReyboard.PackStart(_vboxNumPadRows, false, false, 0);
            //Init _textEntry
            Pango.FontDescription fontDescriptiontextEntry = Pango.FontDescription.FromString(_fontKeyboardPadTextEntry);
            _textEntry = new EntryValidation();
            _textEntry.ModifyFont(fontDescriptiontextEntry);
            //Change Selected Text, when looses entry focus
            _textEntry.ModifyBase(StateType.Active, Utils.ColorToGdkColor(Color.Gray));
            //Final Pack KeyBoard + TextEntry
            VBox vboxResult = new VBox(false, _spacing);

            vboxResult.PackStart(_textEntry);
            vboxResult.PackStart(hboxResultReyboard);

            //Events
            this.KeyReleaseEvent += KeyBoardPad_KeyReleaseEvent;

            //Add Space arround Keyboards
            return(vboxResult);
        }
Ejemplo n.º 42
0
        internal PropertyGrid(EditorManager editorManager)
        {
            this.editorManager = editorManager;

            #region Toolbar

            PropertyGridToolbar tb = new PropertyGridToolbar();
            base.PackStart(tb, false, false, 0);
            toolbar = tb;

            catButton               = new RadioButton((Gtk.RadioButton)null);
            catButton.Name          = "MonoDevelop.PropertyGridToolbar.GtkRadioButton";
            catButton.DrawIndicator = false;
            catButton.Relief        = ReliefStyle.None;
            catButton.Image         = new ImageView(MonoDevelop.Ide.Gui.Stock.GroupByCategory, IconSize.Menu);
            catButton.Image.Show();
            catButton.TooltipText = GettextCatalog.GetString("Sort in categories");
            catButton.Toggled    += new EventHandler(toolbarClick);
            toolbar.Insert(catButton, 0);

            alphButton               = new RadioButton(catButton);
            alphButton.Name          = "MonoDevelop.PropertyGridToolbar.GtkRadioButton";
            alphButton.DrawIndicator = false;
            alphButton.Relief        = ReliefStyle.None;
            alphButton.Image         = new ImageView(MonoDevelop.Ide.Gui.Stock.SortAlphabetically, IconSize.Menu);
            alphButton.Image.Show();
            alphButton.TooltipText = GettextCatalog.GetString("Sort alphabetically");
            alphButton.Clicked    += new EventHandler(toolbarClick);
            toolbar.Insert(alphButton, 1);

            catButton.Active = true;

            #endregion

            vpaned = new VPaned();

            tree          = new PropertyGridTable(editorManager, this);
            tree.Changed += delegate {
                Update();
            };

            CompactScrolledWindow sw = new CompactScrolledWindow();
            sw.AddWithViewport(tree);
            ((Gtk.Viewport)sw.Child).ShadowType = Gtk.ShadowType.None;
            sw.ShadowType       = Gtk.ShadowType.None;
            sw.HscrollbarPolicy = PolicyType.Never;
            sw.VscrollbarPolicy = PolicyType.Automatic;

            VBox tbox = new VBox();
            toolbarSeparator         = new HSeparator();
            toolbarSeparator.Visible = true;
            tbox.PackStart(toolbarSeparator, false, false, 0);
            tbox.PackStart(sw, true, true, 0);
            helpSeparator = new HSeparator();
            tbox.PackStart(helpSeparator, false, false, 0);
            helpSeparator.NoShowAll = true;
            vpaned.Pack1(tbox, true, true);

            AddPropertyTab(new DefaultPropertyTab());
            AddPropertyTab(new EventPropertyTab());

            base.PackEnd(vpaned);
            base.FocusChain = new Gtk.Widget [] { vpaned };

            Populate(saveEditSession: false);
            UpdateTabs();
        }
Ejemplo n.º 43
0
        public PullUpInheritanceWizard(Repository repository, Inheritance inheritance)
        {
            this.repository  = repository;
            this.inheritance = inheritance;

            this.Title         = Mono.Unix.Catalog.GetString("Pull up Inheritance Wizard");
            this.Icon          = Gdk.Pixbuf.LoadFromResource("Allors.R1.Development.GtkSharp.Icons.allors.ico");
            this.DefaultWidth  = 640;
            this.DefaultHeight = 400;

            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 Pull Up Inheritance Wizard</span>", 0.5f));
            headerBox.PackStart(new HtmlLabel("This wizard allows you to pull an inheritance to a super domain.", 0.5f));

            var form = new Form();

            this.VBox.PackStart(form);

            var inheritanceLabel = new HtmlLabel("Inheritance");

            this.inheritanceEntry = new Entry {
                Sensitive = false, Text = this.inheritance.ToString()
            };

            var superDomainLabel = new HtmlLabel("Pull up to super domain");

            this.superDomainComboBox          = new SuperDomainComboBox(repository, inheritance.DomainWhereDeclaredInheritance);
            this.superDomainComboBox.Changed += (sender, args) => this.CreatePullUp();
            this.superDomainErrorMessage      = new ErrorMessage();

            this.dependencyTextView = new DependencyTextView();
            var scrolledDepenceyTextView = new ScrolledWindow {
                this.dependencyTextView
            };

            var buttonCancel = new Button
            {
                CanDefault   = true,
                UseStock     = true,
                UseUnderline = true,
                Label        = "gtk-cancel"
            };

            this.AddActionWidget(buttonCancel, -6);

            var buttonOk = new Button
            {
                CanDefault   = true,
                Name         = "buttonOk",
                UseStock     = true,
                UseUnderline = true,
                Label        = "gtk-ok"
            };

            buttonOk.Clicked += this.OnButtonOkClicked;
            this.ActionArea.PackStart(buttonOk);

            // Layout
            form.Attach(inheritanceLabel, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            form.Attach(this.inheritanceEntry, 0, 1, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            form.Attach(superDomainLabel, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            form.Attach(this.superDomainComboBox, 0, 1, 3, 4, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);
            form.Attach(this.superDomainErrorMessage, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            form.Attach(scrolledDepenceyTextView, 0, 1, 5, 6, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            this.ShowAll();

            this.ResetErrorMessages();
        }
Ejemplo n.º 44
0
        public void It_should_render_text_with_alignments()
        {
            var renderer = new PdfRenderer();

            var labelBox = new HBox {
                Width = SizeUnit.Unlimited
            };

            foreach (var align in new[] { TextAlignment.Left, TextAlignment.Right, TextAlignment.Center, TextAlignment.Justify })
            {
                labelBox.AddComponent(new Panel
                {
                    Width           = 100,
                    Height          = SizeUnit.Unlimited,
                    BackgroundColor = Color.Yellow,
                    Margin          = new Spacer(1),
                    Border          = new Border(1, Color.Black),
                    Padding         = new Spacer(2),
                    Inner           = new Label
                    {
                        Width         = SizeUnit.Unlimited,
                        TextColor     = Color.Red,
                        TextAlignment = align,
                        Font          = new FontInfo(TestFontFamily.Serif, 10, FontInfoStyle.Underline | FontInfoStyle.Italic),
                        Text          = "Hello my friend!\nIt's nice to see you!\n\nWhat is a nice and sunny day, is not it?"
                    }
                });
            }

            var areaBox = new HBox {
                Width = SizeUnit.Unlimited
            };

            foreach (var align in new[] { TextAlignment.Left, TextAlignment.Right, TextAlignment.Center, TextAlignment.Justify })
            {
                var textBox = new TextBox
                {
                    Width         = SizeUnit.Unlimited,
                    TextAlignment = align
                };
                textBox.AddComponent(new Label
                {
                    TextColor = Color.Red,
                    Text      = "Hi Bob!",
                    Font      = new FontInfo(TestFontFamily.Serif, 10, FontInfoStyle.Underline | FontInfoStyle.Italic)
                });

                textBox.AddComponent(new Link
                {
                    TextColor = Color.Black,
                    Text      = "Check out this: ",
                    Font      = new FontInfo(TestFontFamily.Serif, 12, FontInfoStyle.Regular)
                });
                textBox.AddComponent(new Link
                {
                    TextColor = Color.Purple,
                    Text      = "great link!!!",
                    Font      = new FontInfo(TestFontFamily.Serif, 8, FontInfoStyle.Underline),
                    Uri       = "http://google.com"
                });
                areaBox.AddComponent(new Panel
                {
                    Width           = 100,
                    Height          = SizeUnit.Unlimited,
                    BackgroundColor = Color.Green,
                    Margin          = new Spacer(1),
                    Border          = new Border(1, Color.Black),
                    Padding         = new Spacer(2),
                    Inner           = textBox
                });
            }

            var content = new VBox {
                Width = SizeUnit.Unlimited
            };

            content.AddComponent(labelBox);
            content.AddComponent(areaBox);

            var form = new Form(content);

            var doc  = new PdfDocument();
            var page = doc.AddPage();

            page.Width  = 400;
            page.Height = 400;
            renderer.Render(form, page);
            PdfImageComparer.ComparePdfs("text_box_align", doc);
        }
Ejemplo n.º 45
0
        public void configureIdiomsButtons()
        {
            int i = 0;

            MySqlDataReader idioms = Culturize.getCaIdioms();

            if (idioms != null)
            {
                VBox    vbox = null;
                Boolean par  = false;
                while (idioms.Read())
                {
                    i++;

                    if (!par)
                    {
                        vbox             = new VBox();
                        vbox.Spacing     = 6;
                        vbox.Homogeneous = false;
                        vbox.Visible     = true;
                    }

                    Gtk.Button btn = new Gtk.Button();
                    btn.Name         = string.Format("{0}", idioms ["siglas"].ToString());
                    btn.CanFocus     = false;
                    btn.UseUnderline = true;
                    btn.Visible      = true;
                    btn.Image        = new Gtk.Image(string.Format("{0}", cnfg.GetBaseImage(idioms["image_fileName"].ToString())));
                    btn.Clicked     += (object sender, EventArgs e) => {
                        string idiom = ((Gtk.Button)sender).Name;
                        Culturize.changeLenguaje(idiom);
                    };

                    vbox.Add(btn);

                    Gtk.Box.BoxChild boxchild = ((Gtk.Box.BoxChild)(vbox [btn]));
                    boxchild.Position = !par ? 0 : 1;
                    boxchild.Expand   = false;
                    boxchild.Fill     = false;
                    boxchild.PackType = PackType.Start;


                    if (par)
                    {
                        hbox2.Add(vbox);
                        Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(hbox2 [vbox]));
                        w1.Expand = false;
                        w1.Fill   = false;
                    }
                    par = !par;
                }

                if (i % 2 != 0)
                {
                    Gtk.Alignment alignment = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
                    vbox.Add(alignment);
                    Box.BoxChild boxchild = ((global::Gtk.Box.BoxChild)(vbox [alignment]));
                    boxchild.Position = 1;

                    hbox2.Add(vbox);
                    Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(hbox2 [vbox]));
                    w1.Expand = false;
                    w1.Fill   = false;
                }

                if (!idioms.IsClosed)
                {
                    idioms.Close();
                }
            }
        }
Ejemplo n.º 46
0
        public void InitObject(String pName, Color pColor, String pLabelText, String pFont, TableStatus pTableStatus, decimal pTotal, DateTime pDateOpen, DateTime pDateClosed)
        {
            //Init Parameters
            _buttonColor = pColor;
            _tableStatus = pTableStatus;

            //Settings
            _colorPosTablePadTableTableStatusOpenButtonBackground     = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosTablePadTableTableStatusOpenButtonBackground"]);
            _colorPosTablePadTableTableStatusReservedButtonBackground = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosTablePadTableTableStatusReservedButtonBackground"]);

            //Initialize UI Components
            VBox vbox = new VBox(true, 5)
            {
                BorderWidth = 5
            };

            //Button base Label
            _label = new Label(pLabelText);
            SetFont(string.Format("Bold {0}", pFont));
            //Label for Date
            Label labelDateTableOpenOrClosed = new Label(string.Empty);

            Pango.FontDescription fontDescDateTableOpenOrClosed = Pango.FontDescription.FromString("7");
            labelDateTableOpenOrClosed.ModifyFont(fontDescDateTableOpenOrClosed);
            //Label for Total or Status
            _labelTotalOrStatus    = new Label(string.Empty);
            _eventBoxTotalOrStatus = new EventBox();
            _eventBoxTotalOrStatus.Add(_labelTotalOrStatus);
            //_eventBoxTotalOrStatus.CanFocus = false;
            //If click in EventBox call button Click Event
            _eventBoxTotalOrStatus.ButtonPressEvent += delegate { Click(); };

            //Pack VBox
            vbox.PackStart(_label);
            vbox.PackStart(labelDateTableOpenOrClosed);
            vbox.PackStart(_eventBoxTotalOrStatus);
            //Pack Final Widget
            _widget = vbox;

            //_log.Debug(string.Format("pLabelText:[{0}], _tableStatus: [{1}]", pLabelText, _tableStatus));
            switch (_tableStatus)
            {
            case TableStatus.Free:
                SetBackgroundColor(_buttonColor, _eventBoxTotalOrStatus);
                break;

            case TableStatus.Open:
                _labelTotalOrStatus.Text = FrameworkUtils.DecimalToStringCurrency(pTotal);
                if (pDateOpen != null)
                {
                    labelDateTableOpenOrClosed.Text = string.Format(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "pos_button_label_table_open_at"), pDateOpen.ToString(SettingsApp.DateTimeFormatHour));
                }
                SetBackgroundColor(_colorPosTablePadTableTableStatusOpenButtonBackground, _eventBoxTotalOrStatus);
                break;

            case TableStatus.Reserved:
                _labelTotalOrStatus.Text = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_reserved_table");
                SetBackgroundColor(_colorPosTablePadTableTableStatusReservedButtonBackground, _eventBoxTotalOrStatus);
                break;

            default:
                break;
            }
        }
        public ListViewCellBounds()
        {
            MinHeight = 120;
            MinWidth  = 100;

            container = new VBox();
            ListView  = new ListView();

            ListView.GridLinesVisible = GridLines.Both;
            ListStore           = new ListStore(name, icon, text, check, progress);
            ListView.DataSource = ListStore;
            ListView.Columns.Add("Name", icon, name);
            ListView.Columns.Add("Check", new TextCellView()
            {
                TextField = text
            }, new CustomCell()
            {
                ValueField = progress, Size = new Size(20, 20)
            }, new CheckBoxCellView()
            {
                ActiveField = check
            });
            //list.Columns.Add ("Progress", new TextCellView () { TextField = text }, new CustomCell () { ValueField = progress }, new TextCellView () { TextField = text } );
            ListView.Columns.Add("Progress", new CustomCell()
            {
                ValueField = progress
            });

            var png = Image.FromResource(typeof(App), "class.png");

            Random rand = new Random();

            for (int n = 0; n < 100; n++)
            {
                var r = ListStore.AddRow();
                ListStore.SetValue(r, icon, png);
                if (rand.Next(50) > 25)
                {
                    ListStore.SetValue(r, name, "Value \n" + n);
                    ListStore.SetValue(r, check, false);
                }
                else
                {
                    ListStore.SetValue(r, name, "Value " + n);
                    ListStore.SetValue(r, check, true);
                }
                ListStore.SetValue(r, text, "Text " + n);
                ListStore.SetValue(r, progress, new CellData {
                    Value = rand.Next() % 100
                });
            }

            ListView.SelectionChanged += (sender, e) => UpdateTracker(ListView.SelectedRow);
            ListView.MouseMoved       += (sender, e) => UpdateTracker(ListView.GetRowAtPosition(e.X, e.Y));

            drawer = new ListTrackingCanvas(this);

            container.PackStart(ListView, true);
            container.PackStart(drawer);
            AddChild(container);
        }
Ejemplo n.º 48
0
        public SetupWindow() : base("")
        {
            Title          = Catalog.GetString("CmisSync Setup");
            BorderWidth    = 0;
            IconName       = "app-cmissync";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;
            Deletable      = false;

            DeleteEvent += delegate(object sender, DeleteEventArgs args) {
                args.RetVal = true;
            };

            SecondaryTextColor = UIHelpers.GdkColorToHex(Style.Foreground(StateType.Insensitive));

            SecondaryTextColorSelected =
                UIHelpers.GdkColorToHex(
                    MixColors(
                        new TreeView().Style.Foreground(StateType.Selected),
                        new TreeView().Style.Background(StateType.Selected),
                        0.15
                        )
                    );

            SetSizeRequest(680, 400);

            HBox = new HBox(false, 0);

            VBox = new VBox(false, 0);

            Wrapper = new VBox(false, 0)
            {
                BorderWidth = 0
            };

            OptionArea = new VBox(false, 0)
            {
                BorderWidth = 0
            };

            Buttons = CreateButtonBox();


            HBox layout_horizontal = new HBox(false, 0)
            {
                BorderWidth = 0
            };

            layout_horizontal.PackStart(OptionArea, true, true, 0);
            layout_horizontal.PackStart(Buttons, false, false, 0);

            VBox.PackStart(Wrapper, true, true, 0);
            VBox.PackStart(layout_horizontal, false, false, 15);

            EventBox box = new EventBox();

            Gdk.Color bg_color = new Gdk.Color();
            Gdk.Color.Parse("#000", ref bg_color);
            box.ModifyBg(StateType.Normal, bg_color);

            Image side_splash = UIHelpers.GetImage("side-splash.png");

            side_splash.Yalign = 1;

            box.Add(side_splash);

            HBox.PackStart(box, false, false, 0);
            HBox.PackStart(VBox, true, true, 30);

            base.Add(HBox);
        }
Ejemplo n.º 49
0
        /// <summary>
        /// Init components.
        /// </summary>
        void _initializeComponents()
        {
            ContentBox = new VBox();

            // First line
            HBox  FirstLine  = new HBox();
            Label HeaderType = new Label(Director.Properties.Resources.HeaderHeaderType)
            {
                HorizontalPlacement = WidgetPlacement.Center,
                ExpandHorizontal    = true,
                ExpandVertical      = false,
                MarginLeft          = 10
            };
            Label HeaderValue = new Label(Director.Properties.Resources.HeaderHeaderValue)
            {
                ExpandHorizontal    = true,
                ExpandVertical      = false,
                HorizontalPlacement = WidgetPlacement.Center
            };
            Button NewVariable = new Button(Image.FromResource(DirectorImages.ADD_ICON))
            {
                MinWidth     = 30,
                WidthRequest = 30,
                MarginRight  = 30
            };

            FirstLine.PackStart(HeaderType, true, true);
            FirstLine.PackStart(HeaderValue, true, true);
            FirstLine.PackStart(NewVariable, false, false);
            ContentBox.PackStart(FirstLine);

            // New header event
            NewVariable.Clicked += NewVariable_Clicked;

            // Variable content
            VariableContent = new VBox();
            ScrollView VariableContentSC = new ScrollView()
            {
                HorizontalScrollPolicy = ScrollPolicy.Never,
                VerticalScrollPolicy   = ScrollPolicy.Always,
                Content         = VariableContent,
                BackgroundColor = Colors.LightGray
            };

            ContentBox.PackStart(VariableContentSC, true, true);

            // Create temporary data
            int i = 0;

            foreach (KeyValuePair <string, string> kvp in ActiveScenario.customVariables)
            {
                var tmp = new Variable(this, kvp.Key, kvp.Value, (i % 2 == 0) ? Colors.LightGray : Colors.White);
                Variables.Add(tmp);
                VariableContent.PackStart(tmp);
                i++;
            }


            // Content
            Content = ContentBox;
        }
        void Build()
        {
            BorderWidth   = 0;
            WidthRequest  = 901;
            HeightRequest = 632;

            Name           = "wizard_dialog";
            Title          = GettextCatalog.GetString("New Project");
            WindowPosition = WindowPosition.CenterOnParent;
            TransientFor   = IdeApp.Workbench.RootWindow;

            projectConfigurationWidget      = new GtkProjectConfigurationWidget();
            projectConfigurationWidget.Name = "projectConfigurationWidget";

            // Top banner of dialog.
            var topLabelEventBox = new EventBox();

            topLabelEventBox.Name          = "topLabelEventBox";
            topLabelEventBox.HeightRequest = 52;
            topLabelEventBox.ModifyBg(StateType.Normal, bannerBackgroundColor);
            topLabelEventBox.ModifyFg(StateType.Normal, whiteColor);
            topLabelEventBox.BorderWidth = 0;

            var topBannerTopEdgeLineEventBox = new EventBox();

            topBannerTopEdgeLineEventBox.Name          = "topBannerTopEdgeLineEventBox";
            topBannerTopEdgeLineEventBox.HeightRequest = 1;
            topBannerTopEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerTopEdgeLineEventBox.BorderWidth = 0;

            var topBannerBottomEdgeLineEventBox = new EventBox();

            topBannerBottomEdgeLineEventBox.Name          = "topBannerBottomEdgeLineEventBox";
            topBannerBottomEdgeLineEventBox.HeightRequest = 1;
            topBannerBottomEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerBottomEdgeLineEventBox.BorderWidth = 0;

            topBannerLabel      = new Label();
            topBannerLabel.Name = "topBannerLabel";
            Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy();
            font.Size = (int)(font.Size * 1.8);
            topBannerLabel.ModifyFont(font);
            topBannerLabel.ModifyFg(StateType.Normal, whiteColor);
            var topLabelHBox = new HBox();

            topLabelHBox.Name = "topLabelHBox";
            topLabelHBox.PackStart(topBannerLabel, false, false, 20);
            topLabelEventBox.Add(topLabelHBox);

            VBox.PackStart(topBannerTopEdgeLineEventBox, false, false, 0);
            VBox.PackStart(topLabelEventBox, false, false, 0);
            VBox.PackStart(topBannerBottomEdgeLineEventBox, false, false, 0);

            // Main templates section.
            centreVBox      = new VBox();
            centreVBox.Name = "centreVBox";
            VBox.PackStart(centreVBox, true, true, 0);
            templatesHBox      = new HBox();
            templatesHBox.Name = "templatesHBox";
            centreVBox.PackEnd(templatesHBox, true, true, 0);

            // Template categories.
            var templateCategoriesVBox = new VBox();

            templateCategoriesVBox.Name         = "templateCategoriesVBox";
            templateCategoriesVBox.BorderWidth  = 0;
            templateCategoriesVBox.WidthRequest = 220;
            var templateCategoriesScrolledWindow = new ScrolledWindow();

            templateCategoriesScrolledWindow.Name             = "templateCategoriesScrolledWindow";
            templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Template categories tree view.
            templateCategoriesTreeView                = new TreeView();
            templateCategoriesTreeView.Name           = "templateCategoriesTreeView";
            templateCategoriesTreeView.BorderWidth    = 0;
            templateCategoriesTreeView.HeadersVisible = false;
            templateCategoriesTreeView.Model          = templateCategoriesListStore;
            templateCategoriesTreeView.ModifyBase(StateType.Normal, categoriesBackgroundColor);
            templateCategoriesTreeView.AppendColumn(CreateTemplateCategoriesTreeViewColumn());
            templateCategoriesScrolledWindow.Add(templateCategoriesTreeView);
            templateCategoriesVBox.PackStart(templateCategoriesScrolledWindow, true, true, 0);
            templatesHBox.PackStart(templateCategoriesVBox, false, false, 0);

            // Templates.
            var templatesVBox = new VBox();

            templatesVBox.Name         = "templatesVBox";
            templatesVBox.WidthRequest = 400;
            templatesHBox.PackStart(templatesVBox, false, false, 0);
            var templatesScrolledWindow = new ScrolledWindow();

            templatesScrolledWindow.Name             = "templatesScrolledWindow";
            templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Templates tree view.
            templatesTreeView                = new TreeView();
            templatesTreeView.Name           = "templatesTreeView";
            templatesTreeView.HeadersVisible = false;
            templatesTreeView.Model          = templatesListStore;
            templatesTreeView.ModifyBase(StateType.Normal, templateListBackgroundColor);
            templatesTreeView.AppendColumn(CreateTemplateListTreeViewColumn());
            templatesScrolledWindow.Add(templatesTreeView);
            templatesVBox.PackStart(templatesScrolledWindow, true, true, 0);

            // Template
            var templateEventBox = new EventBox();

            templateEventBox.Name = "templateEventBox";
            templateEventBox.ModifyBg(StateType.Normal, templateBackgroundColor);
            templatesHBox.PackStart(templateEventBox, true, true, 0);
            templateVBox             = new VBox();
            templateVBox.Visible     = false;
            templateVBox.BorderWidth = 20;
            templateVBox.Spacing     = 10;
            templateEventBox.Add(templateVBox);

            // Template large image.
            templateImage               = new ImageView();
            templateImage.Name          = "templateImage";
            templateImage.HeightRequest = 140;
            templateImage.WidthRequest  = 240;
            templateVBox.PackStart(templateImage, false, false, 10);

            // Template description.
            templateNameLabel              = new Label();
            templateNameLabel.Name         = "templateNameLabel";
            templateNameLabel.WidthRequest = 240;
            templateNameLabel.Wrap         = true;
            templateNameLabel.Xalign       = 0;
            templateNameLabel.Markup       = MarkupTemplateName("TemplateName");
            templateVBox.PackStart(templateNameLabel, false, false, 0);
            templateDescriptionLabel              = new Label();
            templateDescriptionLabel.Name         = "templateDescriptionLabel";
            templateDescriptionLabel.WidthRequest = 240;
            templateDescriptionLabel.Wrap         = true;
            templateDescriptionLabel.Xalign       = 0;
            templateVBox.PackStart(templateDescriptionLabel, false, false, 0);
            templateVBox.PackStart(new Label(), true, true, 0);

            // Template - button separator.
            var templateSectionSeparatorEventBox = new EventBox();

            templateSectionSeparatorEventBox.Name          = "templateSectionSeparatorEventBox";
            templateSectionSeparatorEventBox.HeightRequest = 1;
            templateSectionSeparatorEventBox.ModifyBg(StateType.Normal, templateSectionSeparatorColor);
            VBox.PackStart(templateSectionSeparatorEventBox, false, false, 0);

            // Buttons at bottom of dialog.
            var bottomHBox = new HBox();

            bottomHBox.Name = "bottomHBox";
            VBox.PackStart(bottomHBox, false, false, 0);

            // Cancel button - bottom left.
            var cancelButtonBox = new HButtonBox();

            cancelButtonBox.Name        = "cancelButtonBox";
            cancelButtonBox.BorderWidth = 16;
            cancelButton          = new Button();
            cancelButton.Name     = "cancelButton";
            cancelButton.Label    = "gtk-cancel";
            cancelButton.UseStock = true;
            cancelButtonBox.PackStart(cancelButton, false, false, 0);
            bottomHBox.PackStart(cancelButtonBox, false, false, 0);

            // Previous button - bottom right.
            var previousNextButtonBox = new HButtonBox();

            previousNextButtonBox.Name        = "previousNextButtonBox";
            previousNextButtonBox.BorderWidth = 16;
            previousNextButtonBox.Spacing     = 9;
            bottomHBox.PackStart(previousNextButtonBox);
            previousNextButtonBox.Layout = ButtonBoxStyle.End;

            previousButton           = new Button();
            previousButton.Name      = "previousButton";
            previousButton.Label     = GettextCatalog.GetString("Previous");
            previousButton.Sensitive = false;
            previousNextButtonBox.PackEnd(previousButton);

            // Next button - bottom right.
            nextButton       = new Button();
            nextButton.Name  = "nextButton";
            nextButton.Label = GettextCatalog.GetString("Next");
            previousNextButtonBox.PackEnd(nextButton);

            // Remove default button action area.
            VBox.Remove(ActionArea);

            if (Child != null)
            {
                Child.ShowAll();
            }

            Show();

            templatesTreeView.HasFocus = true;
            Resizable = false;
        }
Ejemplo n.º 51
0
        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));

                //Token
                Entry       entryToken = new Entry();
                BOWidgetBox boxToken   = new BOWidgetBox(Resx.global_DialogConfigurationPrintersTypetoken, entryToken);
                vboxTab1.PackStart(boxToken, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxToken, _dataSourceRow, "Token", SettingsApp.RegexAlfaNumeric, false));

                //ThermalPrinter
                CheckButton checkButtonThermalPrinter = new CheckButton(Resx.global_printer_thermal_printer);
                vboxTab1.PackStart(checkButtonThermalPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonThermalPrinter, _dataSourceRow, "ThermalPrinter"));

                //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));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryToken.Sensitive = (_dialogMode == DialogMode.Update) ? false : true;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Ejemplo n.º 52
0
        public OptionsDialog(Gtk.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections)
        {
            buttonCancel = new Gtk.Button(Gtk.Stock.Cancel);
            AddActionWidget(this.buttonCancel, ResponseType.Cancel);

            buttonOk = new Gtk.Button(Gtk.Stock.Ok);
            this.ActionArea.PackStart(buttonOk);
            buttonOk.Clicked += OnButtonOkClicked;

            mainHBox = new HBox();
            tree     = new TreeView();
            var sw = new ScrolledWindow();

            sw.Add(tree);
            sw.HscrollbarPolicy = PolicyType.Never;
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.ShadowType       = ShadowType.None;

            var fboxTree = new HeaderBox();

            fboxTree.SetMargins(0, 1, 0, 1);
            fboxTree.SetPadding(0, 0, 0, 0);
            fboxTree.BackgroundColor = new Gdk.Color(255, 255, 255);
            fboxTree.Add(sw);
            mainHBox.PackStart(fboxTree, false, false, 0);

            Realized += delegate {
                fboxTree.BackgroundColor = tree.Style.Base(Gtk.StateType.Normal);
            };

            var vbox = new VBox();

            mainHBox.PackStart(vbox, true, true, 0);
            var headerBox = new HBox(false, 6);

            image = new Xwt.ImageView();
            //	headerBox.PackStart (image, false, false, 0);

            labelTitle        = new Label();
            labelTitle.Xalign = 0;
            textHeader        = new Alignment(0, 0, 1, 1);
            textHeader.Add(labelTitle);
            textHeader.BorderWidth = 12;
            headerBox.PackStart(textHeader, true, true, 0);

            imageHeader = new OptionsDialogHeader();
            imageHeader.Hide();
            headerBox.PackStart(imageHeader.ToGtkWidget());

            var fboxHeader = new HeaderBox();

            fboxHeader.SetMargins(0, 1, 0, 0);
            fboxHeader.Add(headerBox);
//			fbox.GradientBackround = true;
//			fbox.BackgroundColor = new Gdk.Color (255, 255, 255);
            Realized += delegate {
                var c = Style.Background(Gtk.StateType.Normal).ToXwtColor();
                c.Light += 0.09;
                fboxHeader.BackgroundColor = c.ToGdkColor();
            };
            vbox.PackStart(fboxHeader, false, false, 0);

            pageFrame = new HBox();
            var fbox = new HeaderBox();

            fbox.SetMargins(0, 1, 0, 0);
            fbox.ShowTopShadow = true;
            fbox.Add(pageFrame);
            vbox.PackStart(fbox, true, true, 0);

            this.VBox.PackStart(mainHBox, true, true, 0);

            this.removeEmptySections = removeEmptySections;
            extensionContext         = AddinManager.CreateExtensionContext();

            this.mainDataObject = dataObject;
            this.extensionPath  = extensionPath;

            if (parentWindow != null)
            {
                TransientFor = parentWindow;
            }

            ImageService.EnsureStockIconIsLoaded(emptyCategoryIcon);

            store               = new TreeStore(typeof(OptionsDialogSection));
            tree.Model          = store;
            tree.HeadersVisible = false;

            // Column 0 is used to add some padding at the left of the expander
            TreeViewColumn col0 = new TreeViewColumn();

            col0.MinWidth = 6;
            tree.AppendColumn(col0);

            TreeViewColumn col = new TreeViewColumn();
            var            crp = new CellRendererImage();

            col.PackStart(crp, false);
            col.SetCellDataFunc(crp, PixbufCellDataFunc);
            var crt = new CellRendererText();

            col.PackStart(crt, true);
            col.SetCellDataFunc(crt, TextCellDataFunc);
            tree.AppendColumn(col);

            tree.ExpanderColumn = col;

            tree.Selection.Changed += OnSelectionChanged;

            Child.ShowAll();

            InitializeContext(extensionContext);

            FillTree();
            ExpandCategories();
            this.DefaultResponse = Gtk.ResponseType.Ok;

            DefaultWidth  = 960;
            DefaultHeight = 680;
        }
Ejemplo n.º 53
0
        public DocumentFinanceDialogPage4(Window pSourceWindow, String pPageName, String pPageIcon, Widget pWidget, bool pEnabled = true)
            : base(pSourceWindow, pPageName, pPageIcon, pWidget, pEnabled)
        {
            //Init private vars
            _pagePad = (_sourceWindow as PosDocumentFinanceDialog).PagePad;
            _session = (_pagePad as DocumentFinanceDialogPagePad).Session;

            //Initial Values
            _intialValueConfigurationCountry = SettingsApp.ConfigurationSystemCountry;

            //ShipTo Address
            _entryBoxShipToAddressDetail = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_address"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericPlus, true);/* IN009253 */
            _entryBoxShipToAddressDetail.EntryValidation.Changed += delegate { Validate(); };

            //ShipTo Region
            _entryBoxShipToRegion = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_region"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericPlus, false);/* IN009253 */
            _entryBoxShipToRegion.EntryValidation.Changed += delegate { Validate(); };

            //ShipTo PostalCode
            _entryBoxShipToPostalCode = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_zipcode"), KeyboardMode.Alfa, SettingsApp.ConfigurationSystemCountry.RegExZipCode, true);
            _entryBoxShipToPostalCode.EntryValidation.Changed += delegate { Validate(); };

            //ShipTo City
            _entryBoxShipToCity = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_city"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericPlus, true);/* IN009253 */
            _entryBoxShipToCity.EntryValidation.Changed += delegate { Validate(); };

            //ShipTo Country
            CriteriaOperator criteriaOperatorCustomerCountry = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");

            _entryBoxSelectShipToCountry = new XPOEntryBoxSelectRecordValidation <cfg_configurationcountry, TreeViewConfigurationCountry>(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_country"), "Designation", "Oid", _intialValueConfigurationCountry, criteriaOperatorCustomerCountry, SettingsApp.RegexGuid, true);
            _entryBoxSelectShipToCountry.EntryValidation.Validate(_entryBoxSelectShipToCountry.Value.Oid.ToString());
            _entryBoxSelectShipToCountry.EntryValidation.IsEditable = false;
            _entryBoxSelectShipToCountry.EntryValidation.Changed   += delegate { Validate(); };
            _entryBoxSelectShipToCountry.ClosePopup += delegate
            {
                //Require to Update RegExZipCode
                _entryBoxShipToPostalCode.EntryValidation.Rule = _entryBoxSelectShipToCountry.Value.RegExZipCode;
                _entryBoxShipToPostalCode.EntryValidation.Validate();
            };

            //ShipToDeliveryDate
            _entryBoxShipToDeliveryDate = new EntryBoxValidationDatePickerDialog(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ship_to_delivery_date"), _pagePad.DateTimeFormat, _pagePad.InitalDateTime, KeyboardMode.AlfaNumeric, SettingsApp.RegexDateTime, true, _pagePad.DateTimeFormat);
            _entryBoxShipToDeliveryDate.EntryValidation.Sensitive = true;
            //_entryBoxShipToDeliveryDate.EntryValidation.Text = _pagePad.InitalDateTime.ToString(_pagePad.DateTimeFormat);
            _entryBoxShipToDeliveryDate.EntryValidation.Validate();
            //Assign Min Date to Validation
            _entryBoxShipToDeliveryDate.DateTimeMin              = FrameworkUtils.CurrentDateTimeAtomic();
            _entryBoxShipToDeliveryDate.EntryValidation.Changed += _entryBoxShipToDeliveryDate_Changed;
            _entryBoxShipToDeliveryDate.ClosePopup += _entryBoxShipToDeliveryDate_Changed;

            //ShipToDeliveryID
            _entryBoxShipToDeliveryID = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ship_to_delivery_id"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            _entryBoxShipToDeliveryID.EntryValidation.Changed += delegate { Validate(); };

            //ShipToWarehouseID
            _entryBoxShipToWarehouseID = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ship_to_warehouse_id"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            _entryBoxShipToWarehouseID.EntryValidation.MaxLength = 50;
            _entryBoxShipToWarehouseID.EntryValidation.Changed  += delegate { Validate(); };

            //ShipToLocationID
            _entryBoxShipToLocationID = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ship_to_location_id"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            _entryBoxShipToLocationID.EntryValidation.MaxLength = 30;
            _entryBoxShipToLocationID.EntryValidation.Changed  += delegate { Validate(); };

            //HBox ZipCode+City+Country
            HBox hboxZipCodeAndCityAndCountry = new HBox(true, 0);

            hboxZipCodeAndCityAndCountry.PackStart(_entryBoxShipToPostalCode, true, true, 0);
            hboxZipCodeAndCityAndCountry.PackStart(_entryBoxShipToCity, true, true, 0);
            hboxZipCodeAndCityAndCountry.PackStart(_entryBoxSelectShipToCountry, true, true, 0);

            //HBox hboxDeliveryDate+DeliveryID
            HBox hboxDeliveryDateAndDeliveryID = new HBox(true, 0);

            hboxDeliveryDateAndDeliveryID.PackStart(_entryBoxShipToDeliveryDate, true, true, 0);
            hboxDeliveryDateAndDeliveryID.PackStart(_entryBoxShipToDeliveryID, true, true, 0);

            //HBox hboxWarehouseID+LocationID
            HBox hboxhboxWarehouseIDAndLocationID = new HBox(true, 0);

            hboxhboxWarehouseIDAndLocationID.PackStart(_entryBoxShipToWarehouseID, true, true, 0);
            hboxhboxWarehouseIDAndLocationID.PackStart(_entryBoxShipToLocationID, true, true, 0);

            //Pack VBOX
            VBox vbox = new VBox(false, 2);

            vbox.PackStart(_entryBoxShipToAddressDetail, false, false, 0);
            vbox.PackStart(_entryBoxShipToRegion, false, false, 0);
            vbox.PackStart(hboxZipCodeAndCityAndCountry, false, false, 0);
            vbox.PackStart(hboxDeliveryDateAndDeliveryID, false, false, 0);
            vbox.PackStart(hboxhboxWarehouseIDAndLocationID, false, false, 0);
            PackStart(vbox);
        }
Ejemplo n.º 54
0
        public SplashScreenForm(bool showSetting) : base(Gtk.WindowType.Toplevel)
        {
            Console.WriteLine("splash.bild.start-{0}", DateTime.Now);
            waitingSplash = showSetting;

            AppPaintable        = true;
            this.Decorated      = false;
            this.WindowPosition = WindowPosition.Center;
            this.TypeHint       = Gdk.WindowTypeHint.Splashscreen;
            try {
                bitmap = new Gdk.Pixbuf(System.IO.Path.Combine(MainClass.Paths.ResDir, "moscrif.png"));
            } catch (Exception ex) {
                Tool.Logger.Error(ex.Message);
                Tool.Logger.Error("Can't load splash screen pixbuf 'moscrif.png'.");
            }
            progress               = new ProgressBar();
            progress.Fraction      = 0.00;
            progress.HeightRequest = 6;

            vbox             = new VBox();
            vbox.BorderWidth = 12;
            label            = new Gtk.Label();
            label.UseMarkup  = true;
            label.Xalign     = 0;
            //vbox.PackEnd(progress, false, true, 0);

            if (showSetting)
            {
                Table table = new Table(3, 3, false);

                Label lbl1 = new Label("Color Scheme :");
                Label lbl2 = new Label("Keybinding :");

                table.Attach(lbl1, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
                table.Attach(lbl2, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

                cbBackground = new ColorButton();
                table.Attach(cbBackground, 1, 2, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

                cbKeyBinding      = Gtk.ComboBox.NewText();            //new ComboBox();
                cbKeyBinding.Name = "cbKeyBinding";

                if (MainClass.Settings.BackgroundColor == null)
                {
                    MainClass.Settings.BackgroundColor = new Moscrif.IDE.Option.Settings.BackgroundColors(218, 218, 218);

                    /*if(MainClass.Platform.IsMac)
                     *      MainClass.Settings.BackgroundColor = new Moscrif.IDE.Settings.Settings.BackgroundColors(218,218,218);
                     * else
                     *      MainClass.Settings.BackgroundColor = new Moscrif.IDE.Settings.Settings.BackgroundColors(224,41,47);
                     */
                }

                cbKeyBinding.AppendText(WIN);
                cbKeyBinding.AppendText(MACOSX);
                cbKeyBinding.AppendText(JAVA);
                cbKeyBinding.AppendText(VisualC);

                if (MainClass.Platform.IsMac)
                {
                    cbKeyBinding.Active = 1;
                }
                else
                {
                    cbKeyBinding.Active = 0;
                }

                Gdk.Pixbuf default_pixbuf = null;
                string     file           = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-menu.png");
                //if (System.IO.File.Exists(file)) {

                try {
                    default_pixbuf = new Gdk.Pixbuf(file);
                } catch (Exception ex) {
                    Tool.Logger.Error(ex.Message);
                }


                popupColor = new Gtk.Menu();
                CreateMenu();

                Gtk.Button btnClose = new Gtk.Button(new Gtk.Image(default_pixbuf));
                btnClose.TooltipText  = MainClass.Languages.Translate("select_color");
                btnClose.Relief       = Gtk.ReliefStyle.None;
                btnClose.CanFocus     = false;
                btnClose.WidthRequest = btnClose.HeightRequest = 22;

                popupColor.AttachToWidget(btnClose, new Gtk.MenuDetachFunc(DetachWidget));
                btnClose.Clicked += delegate {
                    popupColor.Popup(null, null, new Gtk.MenuPositionFunc(GetPosition), 3, Gtk.Global.CurrentEventTime);
                };
                table.Attach(btnClose, 2, 3, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
                popupColor.ShowAll();
                //}

                cbBackground.Color = new Gdk.Color(MainClass.Settings.BackgroundColor.Red,
                                                   MainClass.Settings.BackgroundColor.Green, MainClass.Settings.BackgroundColor.Blue);


                table.Attach(cbKeyBinding, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

                btnOk              = new Gtk.Button();
                btnOk.Label        = "_Ok";
                btnOk.UseUnderline = true;
                btnOk.Clicked     += OnButtonOkClicked;

                table.Attach(btnOk, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

                vbox.PackEnd(table, false, true, 3);
            }
            vbox.PackEnd(label, false, true, 3);
            this.Add(vbox);

            if (bitmap != null)
            {
                this.Resize(bitmap.Width, bitmap.Height);
            }
            Console.WriteLine("splash.bild.end-{0}", DateTime.Now);
            this.ShowAll();
        }
Ejemplo n.º 55
0
        internal void Init(Gtk.Window parent,
                           DialogType type,
                           ButtonSet buttonSet,
                           string title,
                           string statement,
                           string secondaryStatement,
                           string details)
        {
            this.Title        = title;
            this.HasSeparator = false;
            this.Icon         = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
//		this.BorderWidth = 10;
            this.Resizable = false;
            this.Modal     = true;
            if (parent != null)
            {
                this.TransientFor   = parent;
                this.WindowPosition = WindowPosition.CenterOnParent;
            }
            else
            {
                this.WindowPosition = WindowPosition.Center;
            }

            HBox h = new HBox();

            h.BorderWidth = 10;
            h.Spacing     = 10;

            dialogImage = new Image();
            switch (type)
            {
            case DialogType.Error:
                dialogImage.SetFromStock(Gtk.Stock.DialogError, IconSize.Dialog);
                break;

            case DialogType.Question:
                dialogImage.SetFromStock(Gtk.Stock.DialogQuestion, IconSize.Dialog);
                break;

            case DialogType.Warning:
                dialogImage.SetFromStock(Gtk.Stock.DialogWarning, IconSize.Dialog);
                break;

            default:
            case DialogType.Info:
                dialogImage.SetFromStock(Gtk.Stock.DialogInfo, IconSize.Dialog);
                break;
            }
            dialogImage.SetAlignment(0.5F, 0);
            h.PackStart(dialogImage, false, false, 0);

            VBox v = new VBox();

            v.Spacing = 10;
            Label l = new Label();

            l.LineWrap   = true;
            l.UseMarkup  = true;
            l.Selectable = false;
            l.CanFocus   = false;
            l.Xalign     = 0; l.Yalign = 0;
            l.Markup     = "<span weight=\"bold\" size=\"larger\">" + GLib.Markup.EscapeText(statement) + "</span>";
            v.PackStart(l);

            l            = new Label(secondaryStatement);
            l.LineWrap   = true;
            l.Selectable = false;
            l.CanFocus   = false;
            l.Xalign     = 0; l.Yalign = 0;
            v.PackStart(l, true, true, 8);

            if (details != null)
            {
                detailsExpander = new Expander(Util.GS("_Details"));
                v.PackStart(detailsExpander, false, false, 0);
//			showDetailsButton = new Button(Util.GS("Show _Details"));
//			showDetailsButton.Clicked += new EventHandler(ShowDetailsButtonPressed);

//			HBox detailsButtonBox = new HBox();
//			detailsButtonBox.PackEnd(showDetailsButton, false, false, 0);

//			v.PackStart(detailsButtonBox, false, false, 4);

                TextView textView = new TextView();
                textView.Editable = false;
                textView.WrapMode = WrapMode.Char;
                TextBuffer textBuffer = textView.Buffer;

                textBuffer.Text = details;

                showDetailsScrolledWindow = new ScrolledWindow();
                detailsExpander.Add(showDetailsScrolledWindow);
                showDetailsScrolledWindow.AddWithViewport(textView);

                showDetailsScrolledWindow.Visible = false;

//			v.PackEnd(showDetailsScrolledWindow, false, false, 4);
            }
//		else
//		{
//			showDetailsButton = null;
//			showDetailsScrolledWindow = null;
//		}

            ///
            /// Extra Widget
            ///
            extraWidgetVBox = new VBox(false, 0);
            v.PackStart(extraWidgetVBox, false, false, 0);
            extraWidgetVBox.NoShowAll = true;
            extraWidget = null;

            h.PackEnd(v);
            h.ShowAll();

//		if (details != null)
//			showDetailsScrolledWindow.Visible = false;

            this.VBox.Add(h);

            Widget defaultButton;

            switch (buttonSet)
            {
            default:
            case ButtonSet.Ok:
                defaultButton = this.AddButton(Stock.Ok, ResponseType.Ok);
                break;

            case ButtonSet.OkCancel:
                this.AddButton(Stock.Cancel, ResponseType.Cancel);
                defaultButton = this.AddButton(Stock.Ok, ResponseType.Ok);
                break;

            case ButtonSet.YesNo:
                //		this.AddButton(Stock.No, ResponseType.No);
                //		defaultButton = this.AddButton(Stock.Yes, ResponseType.Yes);
                this.AddButton(Util.GS("_No"), ResponseType.No);
                defaultButton = this.AddButton(Util.GS("_Yes"), ResponseType.Yes);
                break;

            case ButtonSet.AcceptDeny:
                //		this.AddButton(Stock.No, ResponseType.No);
                //		defaultButton = this.AddButton(Stock.Yes, ResponseType.Yes);
                this.AddButton(Util.GS("_Deny"), ResponseType.No);
                defaultButton = this.AddButton(Util.GS("_Accept"), ResponseType.Yes);
                break;
            }

            defaultButton.CanDefault = true;
            defaultButton.GrabFocus();
            defaultButton.GrabDefault();
        }
Ejemplo n.º 56
0
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner) : base(owner)
        {
            Builder builder = MasterView.BuilderFromResource("ApsimNG.Resources.Glade.SeriesView.glade");

            vbox1       = (VBox)builder.GetObject("vbox1");
            table1      = (Table)builder.GetObject("table1");
            label4      = (Label)builder.GetObject("label4");
            label5      = (Label)builder.GetObject("label5");
            _mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            checkpointDropDown    = new DropDownView(this);
            dataSourceDropDown    = new DropDownView(this);
            xDropDown             = new DropDownView(this);
            yDropDown             = new DropDownView(this);
            x2DropDown            = new DropDownView(this);
            y2DropDown            = new DropDownView(this);
            seriesDropDown        = new DropDownView(this);
            lineTypeDropDown      = new DropDownView(this);
            markerTypeDropDown    = new DropDownView(this);
            colourDropDown        = new ColourDropDownView(this);
            lineThicknessDropDown = new DropDownView(this);
            markerSizeDropDown    = new DropDownView(this);

            checkBoxView1             = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2             = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3             = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4             = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5             = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6             = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            table1.Attach(checkpointDropDown.MainWidget, 1, 2, 0, 1, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dataSourceDropDown.MainWidget, 1, 2, 1, 2, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(xDropDown.MainWidget, 1, 2, 2, 3, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(yDropDown.MainWidget, 1, 2, 3, 4, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(y2DropDown.MainWidget, 1, 2, 4, 5, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(x2DropDown.MainWidget, 1, 2, 5, 6, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(seriesDropDown.MainWidget, 1, 2, 6, 7, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(lineTypeDropDown.MainWidget, 1, 2, 7, 8, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(markerTypeDropDown.MainWidget, 1, 2, 8, 9, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(colourDropDown.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);

            Image    helpImage = new Image(null, "ApsimNG.Resources.help.png");
            EventBox ebHelp    = new EventBox();

            ebHelp.Add(helpImage);
            ebHelp.ButtonPressEvent += Help_ButtonPressEvent;
            HBox filterBox = new HBox();

            filterBox.PackStart(editView1.MainWidget, true, true, 0);
            filterBox.PackEnd(ebHelp, false, true, 0);

            //table1.Attach(editView1.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(filterBox, 1, 2, 10, 11, AttachOptions.Fill, 0, 10, 2);

            table1.Attach(checkBoxView1.MainWidget, 2, 3, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView2.MainWidget, 2, 3, 3, 4, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView3.MainWidget, 3, 4, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView4.MainWidget, 3, 4, 3, 4, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(checkBoxView5.MainWidget, 2, 4, 9, 10, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView6.MainWidget, 2, 4, 10, 11, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(lineThicknessDropDown.MainWidget, 3, 4, 7, 8, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(markerSizeDropDown.MainWidget, 3, 4, 8, 9, AttachOptions.Fill, 0, 0, 5);
            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
        void GenerateTabs()
        {
            if (nbDistricts != null)
            {
                nbDistricts.Destroy();
            }
            nbDistricts = new Notebook();

            if (ViewModel.Entity.WageDistrictLevelRates?.LevelRates == null)
            {
                return;
            }

            foreach (var levelRate in ViewModel.Entity.WageDistrictLevelRates.LevelRates)
            {
                yTreeView yTreeRatesInfo = new yTreeView {
                    CanFocus      = true,
                    Name          = nameof(yTreeRatesInfo),
                    ColumnsConfig = FluentColumnsConfig <IWageHierarchyNode> .Create()
                                    .AddColumn("Название ставки")
                                    .HeaderAlignment(0.5f)
                                    .AddTextRenderer(x => x.Name)
                                    .AddColumn("Водитель с\nэкспедитором")
                                    .AddNumericRenderer(r => r.ForDriverWithForwarder)
                                    .Digits(2)
                                    .XAlign(1f)
                                    .Adjustment(new Adjustment(0, 0, 1000000, 1, 100, 0))
                                    .AddTextRenderer(r => r.GetUnitName, false)
                                    .AddColumn("Водитель без\nэкспедитора")
                                    .AddNumericRenderer(r => r.ForDriverWithoutForwarder)
                                    .Digits(2)
                                    .XAlign(1f)
                                    .Adjustment(new Adjustment(0, 0, 1000000, 1, 100, 0))
                                    .AddTextRenderer(r => r.GetUnitName, false)
                                    .AddColumn("Экспедитор")
                                    .AddNumericRenderer(r => r.ForForwarder)
                                    .Digits(2)
                                    .XAlign(1f)
                                    .Adjustment(new Adjustment(0, 0, 1000000, 1, 100, 0))
                                    .AddTextRenderer(r => r.GetUnitName, false)
                                    .AddColumn("")
                                    .Finish()
                };
                yTreeRatesInfo.YTreeModel = new RecursiveTreeConfig <IWageHierarchyNode>
                                                (x => x.Parent, x => x.Children)
                                            .CreateModel(levelRate.ObservableWageRates);
                yTreeRatesInfo.ExpandAll();
                VBox vbx = new VBox {
                    yTreeRatesInfo
                };
                Box.BoxChild viewBox = (Box.BoxChild)vbx[yTreeRatesInfo];
                viewBox.Fill   = true;
                viewBox.Expand = true;
                var scrolledWindow = new ScrolledWindow {
                    vbx
                };

                Label tabLabel = new Label {
                    UseMarkup = true,
                    Markup    = $"{levelRate.CarTypeOfUse.GetEnumTitle()} {levelRate.WageDistrict.Name}"
                };

                nbDistricts.AppendPage(scrolledWindow, tabLabel);
            }
            hbxNotebooksWithDistricts.Add(nbDistricts);
            hbxNotebooksWithDistricts.ShowAll();
        }
Ejemplo n.º 58
0
        public LogView(VersionControlDocumentInfo info) : base("Log")
        {
            this.info     = info;
            this.vc       = info.Item.Repository;
            this.filepath = info.Item.Path;

            info.Updated += delegate {
                history = this.info.History;
                vinfo   = this.info.VersionInfo;
                ShowHistory();
            };

            // Widget setup
            VBox box = new VBox(false, 6);

            widget = box;

            // Create the toolbar
            commandbar = new Toolbar();
            commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
            commandbar.IconSize     = Gtk.IconSize.Menu;
            box.PackStart(commandbar, false, false, 0);

            if (vinfo != null)
            {
                Gtk.ToolButton button = new Gtk.ToolButton(new Gtk.Image("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString("View Changes"));
                button.IsImportant = true;
                button.Clicked    += new EventHandler(DiffButtonClicked);
                commandbar.Insert(button, -1);

                button             = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Open, Gtk.IconSize.Menu), GettextCatalog.GetString("View File"));
                button.IsImportant = true;
                button.Clicked    += new EventHandler(ViewTextButtonClicked);
                commandbar.Insert(button, -1);
            }

            revertButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert changes from this revision"));
            revertButton.IsImportant = true;
            revertButton.Sensitive   = false;
            revertButton.Clicked    += new EventHandler(RevertRevisionClicked);
            commandbar.Insert(revertButton, -1);

            revertToButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert to this revision"));
            revertToButton.IsImportant = true;
            revertToButton.Sensitive   = false;
            revertToButton.Clicked    += new EventHandler(RevertToRevisionClicked);
            commandbar.Insert(revertToButton, -1);


            // A paned with two trees

            Gtk.VPaned paned = new Gtk.VPaned();
            box.PackStart(paned, true, true, 0);

            // Create the log list

            loglist = new TreeView();
            ScrolledWindow loglistscroll = new ScrolledWindow();

            loglistscroll.ShadowType = Gtk.ShadowType.In;
            loglistscroll.Add(loglist);
            loglistscroll.HscrollbarPolicy = PolicyType.Automatic;
            loglistscroll.VscrollbarPolicy = PolicyType.Automatic;
            paned.Add1(loglistscroll);
            ((Paned.PanedChild)paned [loglistscroll]).Resize = true;

            TreeView       changedPaths       = new TreeView();
            ScrolledWindow changedPathsScroll = new ScrolledWindow();

            changedPathsScroll.ShadowType       = Gtk.ShadowType.In;
            changedPathsScroll.HscrollbarPolicy = PolicyType.Automatic;
            changedPathsScroll.VscrollbarPolicy = PolicyType.Automatic;
            changedPathsScroll.Add(changedPaths);
            paned.Add2(changedPathsScroll);
            ((Paned.PanedChild)paned [changedPathsScroll]).Resize = false;

            widget.ShowAll();

            // Revision list setup

            CellRendererText textRenderer = new CellRendererText();

            textRenderer.Yalign = 0;

            TreeViewColumn colRevNum     = new TreeViewColumn(GettextCatalog.GetString("Revision"), textRenderer, "text", 0);
            TreeViewColumn colRevDate    = new TreeViewColumn(GettextCatalog.GetString("Date"), textRenderer, "text", 1);
            TreeViewColumn colRevAuthor  = new TreeViewColumn(GettextCatalog.GetString("Author"), textRenderer, "text", 2);
            TreeViewColumn colRevMessage = new TreeViewColumn(GettextCatalog.GetString("Message"), textRenderer, "text", 3);

            loglist.AppendColumn(colRevNum);
            loglist.AppendColumn(colRevDate);
            loglist.AppendColumn(colRevAuthor);
            loglist.AppendColumn(colRevMessage);

            logstore      = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string));
            loglist.Model = logstore;

            // Changed paths list setup

            changedpathstore   = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Gdk.Pixbuf), typeof(string));
            changedPaths.Model = changedpathstore;

            TreeViewColumn   colOperation = new TreeViewColumn();
            CellRendererText crt          = new CellRendererText();
            var crp = new CellRendererPixbuf();

            colOperation.Title = GettextCatalog.GetString("Operation");
            colOperation.PackStart(crp, false);
            colOperation.PackStart(crt, true);
            colOperation.AddAttribute(crp, "pixbuf", 0);
            colOperation.AddAttribute(crt, "text", 1);
            changedPaths.AppendColumn(colOperation);

            TreeViewColumn colChangedPath = new TreeViewColumn();

            crp = new CellRendererPixbuf();
            crt = new CellRendererText();
            colChangedPath.Title = GettextCatalog.GetString("File Path");
            colChangedPath.PackStart(crp, false);
            colChangedPath.PackStart(crt, true);
            colChangedPath.AddAttribute(crp, "pixbuf", 2);
            colChangedPath.AddAttribute(crt, "text", 3);
            changedPaths.AppendColumn(colChangedPath);

            loglist.Selection.Changed += new EventHandler(TreeSelectionChanged);
        }
Ejemplo n.º 59
0
        public MainToolbar()
        {
            IdeApp.Workspace.ActiveConfigurationChanged += (sender, e) => UpdateCombos();
            IdeApp.Workspace.ConfigurationsChanged      += (sender, e) => UpdateCombos();

            IdeApp.Workspace.SolutionLoaded   += (sender, e) => UpdateCombos();
            IdeApp.Workspace.SolutionUnloaded += (sender, e) => UpdateCombos();

            IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleCurrentSelectedSolutionChanged;


            WidgetFlags |= Gtk.WidgetFlags.AppPaintable;

            AddWidget(button);
            AddSpace(8);

            configurationCombo       = new Gtk.ComboBox();
            configurationCombo.Model = configurationStore;
            var ctx = new Gtk.CellRendererText();

            configurationCombo.PackStart(ctx, true);
            configurationCombo.AddAttribute(ctx, "text", 0);

            configurationCombosBox = new HBox(false, 8);

            var configurationComboVBox = new VBox();

            configurationComboVBox.PackStart(configurationCombo, true, false, 0);
            configurationCombosBox.PackStart(configurationComboVBox, false, false, 0);

            runtimeCombo       = new Gtk.ComboBox();
            runtimeCombo.Model = runtimeStore;
            runtimeCombo.PackStart(ctx, true);
            runtimeCombo.AddAttribute(ctx, "text", 0);

            var runtimeComboVBox = new VBox();

            runtimeComboVBox.PackStart(runtimeCombo, true, false, 0);
            configurationCombosBox.PackStart(runtimeComboVBox, false, false, 0);
            AddWidget(configurationCombosBox);

            buttonBarBox             = new Alignment(0.5f, 0.5f, 0, 0);
            buttonBarBox.LeftPadding = 7;
            buttonBarBox.Add(buttonBar);
            buttonBarBox.NoShowAll = true;
            AddWidget(buttonBarBox);
            AddSpace(24);

            statusArea = new StatusArea();
            statusArea.ShowMessage(BrandingService.ApplicationName);

            var statusAreaAlign = new Alignment(0, 0, 1, 1);

            statusAreaAlign.Add(statusArea);
            contentBox.PackStart(statusAreaAlign, true, true, 0);
            AddSpace(24);

            statusAreaAlign.SizeAllocated += (object o, SizeAllocatedArgs args) => {
                Gtk.Widget toplevel = this.Toplevel;
                if (toplevel == null)
                {
                    return;
                }

                int  windowWidth   = toplevel.Allocation.Width;
                int  center        = windowWidth / 2;
                int  left          = Math.Max(center - 300, args.Allocation.Left);
                int  right         = Math.Min(left + 600, args.Allocation.Right);
                uint left_padding  = (uint)(left - args.Allocation.Left);
                uint right_padding = (uint)(args.Allocation.Right - right);

                if (left_padding != statusAreaAlign.LeftPadding || right_padding != statusAreaAlign.RightPadding)
                {
                    statusAreaAlign.SetPadding(0, 0, (uint)left_padding, (uint)right_padding);
                }
            };

            matchEntry = new SearchEntry();

            var searchFiles = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Files"));

            searchFiles.Activated += delegate {
                SetSearchCategory("files");
            };
            var searchTypes = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Types"));

            searchTypes.Activated += delegate {
                SetSearchCategory("type");
            };
            var searchMembers = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Members"));

            searchMembers.Activated += delegate {
                SetSearchCategory("member");
            };

            matchEntry.ForceFilterButtonVisible = true;
            matchEntry.Entry.FocusOutEvent     += delegate {
                matchEntry.Entry.Text = "";
            };
            var cmd = IdeApp.CommandService.GetCommand(Commands.NavigateTo);

            cmd.KeyBindingChanged += delegate {
                UpdateSearchEntryLabel();
            };
            UpdateSearchEntryLabel();

            matchEntry.Ready       = true;
            matchEntry.Visible     = true;
            matchEntry.IsCheckMenu = true;
            matchEntry.Entry.ModifyBase(StateType.Normal, Style.White);
            matchEntry.WidthRequest   = 240;
            matchEntry.RoundedShape   = true;
            matchEntry.Entry.Changed += HandleSearchEntryChanged;
            matchEntry.Activated     += (sender, e) => {
                var pattern = SearchPopupSearchPattern.ParsePattern(matchEntry.Entry.Text);
                if (pattern.Pattern == null && pattern.LineNumber > 0)
                {
                    popup.Destroy();
                    var doc = IdeApp.Workbench.ActiveDocument;
                    if (doc != null && doc != null)
                    {
                        doc.Select();
                        doc.Editor.Caret.Location = new Mono.TextEditor.DocumentLocation(pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1);
                        doc.Editor.CenterToCaret();
                        doc.Editor.Parent.StartCaretPulseAnimation();
                    }
                    return;
                }
                if (popup != null)
                {
                    popup.OpenFile();
                }
            };
            matchEntry.Entry.KeyPressEvent += (o, args) => {
                if (args.Event.Key == Gdk.Key.Escape)
                {
                    var doc = IdeApp.Workbench.ActiveDocument;
                    if (doc != null)
                    {
                        if (popup != null)
                        {
                            popup.Destroy();
                        }
                        doc.Select();
                    }
                    return;
                }
                if (popup != null)
                {
                    args.RetVal = popup.ProcessKey(args.Event.Key, args.Event.State);
                }
            };
            IdeApp.Workbench.RootWindow.WidgetEvent += delegate(object o, WidgetEventArgs args) {
                if (args.Event is Gdk.EventConfigure)
                {
                    PositionPopup();
                }
            };

            BuildToolbar();
            IdeApp.CommandService.RegisterCommandBar(buttonBar);

            AddinManager.ExtensionChanged += delegate(object sender, ExtensionEventArgs args) {
                if (args.PathChanged(ToolbarExtensionPath))
                {
                    BuildToolbar();
                }
            };

            contentBox.PackStart(matchEntry, false, false, 0);

            var align = new Gtk.Alignment(0, 0, 1f, 1f);

            align.Show();
            align.TopPadding    = 5;
            align.LeftPadding   = 9;
            align.RightPadding  = 18;
            align.BottomPadding = 10;
            align.Add(contentBox);

            Add(align);
            UpdateCombos();

            button.Clicked += HandleStartButtonClicked;
            IdeApp.CommandService.RegisterCommandBar(this);

            IdeApp.CommandService.ActiveWidgetChanged += (sender, e) => {
                lastCommandTarget = e.OldActiveWidget;
            };

            this.ShowAll();
            this.statusArea.statusIconBox.HideAll();
        }
Ejemplo n.º 60
0
        private void InitUI()
        {
            try
            {
                //Get XpoObject Reference from DataSourceRow
                fin_configurationvatrate _configurationVatRate = (DataSourceRow as fin_configurationvatrate);

                //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.RegexAlfaNumericExtended, true));

                //Value
                Entry       entryValue = new Entry();
                BOWidgetBox boxValue   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_vat_rate_value"), entryValue);
                vboxTab1.PackStart(boxValue, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", SettingsApp.RegexDecimalGreaterThanZero, true));

                //TaxType
                Entry       entryTaxType = new Entry();
                BOWidgetBox boxTaxType   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_vat_rate_tax_type"), entryTaxType);
                vboxTab1.PackStart(boxTaxType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxType, _dataSourceRow, "TaxType", SettingsApp.RegexAlfa, true));

                //TaxCode
                Entry       entryTaxCode = new Entry();
                BOWidgetBox boxTaxCode   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_vat_rate_tax_code"), entryTaxCode);
                vboxTab1.PackStart(boxTaxCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxCode, _dataSourceRow, "TaxCode", SettingsApp.RegexAlfa, true));

                //TaxCountryRegion
                Entry       entryTaxCountryRegion = new Entry();
                BOWidgetBox boxTaxCountryRegion   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_vat_rate_tax_country_region"), entryTaxCountryRegion);
                vboxTab1.PackStart(boxTaxCountryRegion, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxCountryRegion, _dataSourceRow, "TaxCountryRegion", SettingsApp.RegexAlfaNumericExtended, true));

                //TaxDescription
                Entry       entryTaxDescription = new Entry();
                BOWidgetBox boxTaxDescription   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_description"), entryTaxDescription);
                vboxTab1.PackStart(boxTaxDescription, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxDescription, _dataSourceRow, "TaxDescription", SettingsApp.RegexAlfaNumericExtended, true));

                //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")));

                //Disable Components
                bool enableComponents = !(
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateNormalPT ||
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateIntermediatePT ||
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateReducedPT ||
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateNormalPTMA ||
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateIntermediatePTMA ||
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateReducedPTMA ||
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateNormalPTAC ||
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateIntermediatePTAC ||
                    _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateReducedPTAC
                    );
                entryDesignation.Sensitive      = enableComponents;
                entryTaxType.Sensitive          = enableComponents;
                entryTaxCode.Sensitive          = enableComponents;
                entryTaxCountryRegion.Sensitive = enableComponents;
                checkButtonDisabled.Sensitive   = enableComponents;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }