Beispiel #1
0
        protected void OnNvOutKeyPressEvent(object o, KeyPressEventArgs args)
        {
            Gtk.NodeView selection = (Gtk.NodeView)o;
            MyTreeNode   node      = (MyTreeNode)selection.NodeSelection.SelectedNode;

            if ((args.Event.Key == Gdk.Key.Delete) || (args.Event.Key == Gdk.Key.s) || (args.Event.Key == Gdk.Key.d))               // Efface
            {
                String        msgTxt  = "Comfirmer l'effacage de\n" + node.CNom;
                MessageDialog msgConf = new MessageDialog(this, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, msgTxt);
                ResponseType  rtD     = (Gtk.ResponseType)msgConf.Run();
                msgConf.Destroy();
                if (rtD == ResponseType.Yes)                   //efface
                {
                    String sTrash = Environment.GetEnvironmentVariable("HOME") + "/PNMail/Trash/" + node.CNom;
                    String sProc  = Environment.GetEnvironmentVariable("HOME") + "/PNMail/OutBox/" + node.CNom;
                    try {
                        File.Copy(sProc, sTrash);                           // Move marche pas ????
                        File.Delete(sProc);
                    } catch (IOException e) {
                        Console.WriteLine("PB: {0}", e.Message);
                    }

                    nvOut.NodeStore = StoreOut;
                    nvOut.ShowAll();
                }
            }
            else                 // Raffraichit
            {
                nvIn.NodeStore  = StoreIn;
                nvOut.NodeStore = StoreOut;
                nvIn.ShowAll();
                nvOut.ShowAll();
            }
        }
		/// <summary>
		/// <c>SegmentedNode</c>'s constructor
		/// </summary>
		/// <param name="bitmap">
		/// A <see cref="MathTextBitmap"/>
		/// </param>
		/// <param name="view">
		/// The parent node's <c>NodeView</c>.
		/// </param>
		public SegmentedNode(MathTextBitmap bitmap, NodeView view)
		{
		
			this.view = view;
			
			this.bitmap =bitmap;
			
			this.position = String.Format("({0}, {1})",
			                              bitmap.Position.X, bitmap.Position.Y);
		}
 internal ProjectView()
 {
     componentNodeStore = new NodeStore (typeof (GenericNode));
     componentNodeView = new NodeView (componentNodeStore);
     componentNodeView.AppendColumn ("Project Tree", new CellRendererText (),"text", 0);
     componentScrolledWindow = new ScrolledWindow ();
     componentScrolledWindow.Add (componentNodeView);
     componentNodeView.NodeSelection.Mode = SelectionMode.Single;
     componentNodeView.NodeSelection.Changed += new EventHandler (OnSelectionChanged);
 }
Beispiel #4
0
    public NodeView GetNodeView()
    {
        NodeView nv = new NodeView (this);
        nv.HeadersVisible = false;
        nv.AppendColumn ("Size",        new CellRendererText (), new NodeCellDataFunc (GetNumBytes));
        nv.AppendColumn ("Num objects", new CellRendererText (), new NodeCellDataFunc (GetNumObjects));
        nv.AppendColumn ("Percent",     new CellRendererText (), new NodeCellDataFunc (GetPercent));

        nv.AppendColumn ("Source",      new CellRendererText (), "text", 0);

        return nv;
    }
		public SyntacticalCoverNode(SyntacticalMatcher matcher, NodeView container)
		{
			this.container = container;
			this.matcherLabel = matcher.Label;
			this.matcher = matcher;
			
			this.matcherType = matcher.Type;
			
			matchedTokens ="";
			
			
			this.ChildAdded += new TreeNodeAddedHandler(OnChildAdded);
		}
Beispiel #6
0
 public MainWindow()
     : base(Gtk.WindowType.Toplevel)
 {
     Build ();
     Devices = new NodeStore (typeof(DeviceTreeNode));
     DeviceView = new NodeView (Devices);
     scrolledwindow1.Add (DeviceView);
     DeviceView.AppendColumn ("Name", new CellRendererText (), "text", 0);
     DeviceView.AppendColumn ("IP", new CellRendererText (), "text", 1);
     DeviceView.ShowAll ();
     DeviceView.NodeSelection.Changed += OnDeviceSelectionChanged;
     SelectedDeviceTreeNode = new DeviceTreeNode ("", "");
 }
Beispiel #7
0
 public MainWindow(ContactService contactService)
     : base(Gtk.WindowType.Toplevel)
 {
     this.contactService = contactService;
     this.contactTable = CreateTable();
     this.SetSizeRequest(400, 300);
     var vbox = new VBox();
     vbox.PackStart(this.contactTable, true, true, 0);
     vbox.PackStart(createActionButtonsContainer(), false, false, 5);
     this.Add(vbox);
     this.ShowAll();
     this.Name = "MainWindow";
     this.DeleteEvent += new global::Gtk.DeleteEventHandler(this.HandleWindowDeleted);
 }
Beispiel #8
0
		public MainView()
		{
			MainWindow = new Window("Сервер приложений ГЛОБАЛ");
			statusView = new StatusView();

			MainWindow.DeleteEvent += Window_Delete;
			gkNode = new NodeView();
			gkNode.AppendColumn("Время", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			gkNode.AppendColumn("Адрес", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 1);
			gkNode.AppendColumn("Название", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 2);
			gkNode.AppendColumn("Прогресс", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 3);
			logNode = new NodeView();
			logNode.AppendColumn("Название", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			logNode.AppendColumn("Время", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 1);
			logNode.NodeStore = new NodeStore(typeof(LogTreeNode));
			connectionNode = new NodeView();
			connectionNode.AppendColumn("Тип", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			connectionNode.AppendColumn("Адрес", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 1);
			connectionNode.AppendColumn("Пользователь", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 2);
			connectionNode.ButtonPressEvent += new ButtonPressEventHandler(OnItemButtonPressed);
			pollingNode = new NodeView();
			pollingNode.AppendColumn("Клиент", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			pollingNode.AppendColumn("Идентификатор", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 1);
			pollingNode.AppendColumn("Первый поллинг", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 2);
			pollingNode.AppendColumn("Последний поллинг", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 3);
			pollingNode.AppendColumn("Индекс", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 4);
			pollingNode.NodeStore = new NodeStore(typeof(PollingTreeNode));
			operationNode = new NodeView();
			operationNode.AppendColumn("Название", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			operationNode.NodeStore = new NodeStore(typeof(OperationTreeNode));
			Notebook notepadControl = new Notebook();
			notepadControl.AppendPage(connectionNode, new Label("Соединения"));
			notepadControl.AppendPage(logNode, new Label("Лог"));
			notepadControl.AppendPage(statusView.Create(), new Label("Статус"));
			notepadControl.AppendPage(gkNode, new Label("ГК"));
			notepadControl.AppendPage(pollingNode, new Label("Поллинг"));
			notepadControl.AppendPage(operationNode, new Label("Операции"));
			notepadControl.AppendPage(new LicenseView().Create(), new Label("Лицензирование"));
			MainWindow.Add(notepadControl);
			MainWindow.SetDefaultSize(700, 500);
			MainWindow.ShowAll();
			GKLifecycleManager.GKLifecycleChangedEvent += On_GKLifecycleChangedEvent;
			LicenseManager.LicenseChanged += On_LicenseChanged;

			GKLifecycles = new List<KeyValuePair<GKLifecycleInfo, DateTime>>();
			Clients = new List<ClientCredentials>();
			ClientPolls = new List<ClientPoll>();
			ServerTasks = new List<ServerTask>();
			Current = this;
		}
		/// <summary>
		/// El constructor de <code>FormulaNode</code>
		/// </summary>
		/// <param name="name">
		/// El texto que aparecera en el nodo.
		/// </param>
		/// <param name="bitmap">
		/// El objeto <code>MathTextBitmap</code> asociado al nodo.
		/// </param>
		/// <param name="view">
		/// El árbol al que añadimos el nodo.
		/// </param>		
		public SegmentedNode(string name, MathTextBitmap bitmap, NodeView view)
		    : base()
		{
			this.name=name;
			this.label="";
			this.bitmap=bitmap;
			
			position = String.Format("({0}, {1})",
			                         bitmap.Position.X,
			                         bitmap.Position.Y);
			
			this.view = view;
			
			this.symbols = new List<MathSymbol>();
		}
Beispiel #10
0
		public NodeViewDemo () : base ("NodeView demo")
		{
			DeleteEvent += new DeleteEventHandler (DeleteCB);
			DefaultSize = new Gdk.Size (640,480);

			ScrolledWindow sw = new ScrolledWindow ();
			Add (sw);

			NodeView view = new NodeView (Store);
			view.HeadersVisible = true;
			view.AppendColumn ("Name", new CellRendererText (), "text", 0);
			view.AppendColumn ("Type", new CellRendererText (), new NodeCellDataFunc (DataCallback));

			sw.Add (view);
			
			dialog.Destroy ();
			dialog = null;
		}
Beispiel #11
0
        private void LoadLastCampaigns()
        {
            lblState.Text = "Loading...";

            Thread oThread = new Thread(new ThreadStart(delegate() {
                try{
                    nodeviewTable.Hide();

                    int[] ids = api.GetCampaigns();

                    Gtk.NodeStore store = new Gtk.NodeStore(typeof(CampaignTreeNode));
                    foreach (int i in ids)
                    {
                        store.AddNode(new CampaignTreeNode(i, getStatName(i)));
                    }

                    Gtk.NodeView view = new Gtk.NodeView(store);

                    nodeviewTable.NodeStore = view.NodeStore;

                    nodeviewTable.AppendColumn("Id", new Gtk.CellRendererText(), "text", 0);
                    nodeviewTable.AppendColumn("Name", new Gtk.CellRendererText(), "text", 1);

                    lblTableTitle.Text = "Last Campaigns";
                    nodeviewTable.NodeSelection.Changed += new System.EventHandler(OnNodeviewTableChange);

                    nodeviewTable.Show();
                }catch (Exception ex) {
                    MessageDialog msg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, ex.Message);
                    msg.Title         = "Error";

                    ResponseType response = (ResponseType)msg.Run();
                    if (response == ResponseType.Close || response == ResponseType.DeleteEvent)
                    {
                        msg.Destroy();
                    }
                }
                lblState.Text = "Ready";
            }));

            oThread.Start();
        }
Beispiel #12
0
//		readonly Label errorLabel = new Label ("Errors") {
//			Justify = Justification.Left,
//		};

		public MainPadControl ()
		{
			Env.LinkedMonitoredCode += Env_LinkedMonitoredCode;

			runButton.Clicked += RunButton_Clicked;
			refreshButton.Clicked += RefreshButton_Clicked;
			stopButton.Clicked += StopButton_Clicked;
			clearButton.Clicked += ClearButton_Clicked;

			dependenciesView = new NodeView (dependenciesStore);
			dependenciesView.AppendColumn ("Dependency", new CellRendererText (), "text", 0);
			dependenciesView.AppendColumn ("Status", new CellRendererText (), "text", 1);

			toolbar.PackStart (runButton, false, false, 4);
			toolbar.PackStart (refreshButton, false, false, 4);
			toolbar.PackStart (stopButton, false, false, 4);
			toolbar.PackEnd (clearButton, false, false, 4);
			PackStart (toolbar, false, false, 0);
//			PackStart (errorLabel, false, false, 8);
			PackEnd (dependenciesView, true, true, 0);
		}
Beispiel #13
0
 void RemoveFolder(NodeView View, NodeStore Store)
 {
     foreach(var node in View.NodeSelection.SelectedNodes)
         Store.RemoveNode(node);
 }
		/// <summary>
		/// Sets the intial tokens to be processed.
		/// </summary>
		/// <param name="initialTokens">
		/// The inital tokens.
		/// </param>
		public void SetInitialData(List<Token> initialTokens, NodeView view)
		{
			tokens = initialTokens;
			this.view = view;
		}
		/// <summary>
		/// Initializes the child widgets of the widget.
		/// </summary>
		private void InitializeWidgets()
		{
			syntacticalCoverModel = 
				new NodeStore(typeof(SyntacticalCoverNode));
			
			syntacticalCoverTree = new NodeView(syntacticalCoverModel);
			syntacticalCoverTree.RulesHint = true;
			
			syntacticalCoverTree.AppendColumn("Elemento de análisis",
			                                  new CellRendererText(),
			                                  "markup" ,0);
			
			syntacticalCoverTree.RowActivated+= 
				new RowActivatedHandler(OnSyntacticalCoverTreeRowActivated);
			
			syntacticalCoverTree.Selection.Changed +=
				new EventHandler(OnSyntacticalCoverTreeSelectionChanged);
			
			//syntacticalCoverTree.ShowExpanders = false;
			
			syntacticalTreePlaceholder.Add(syntacticalCoverTree);
			
			
			remainingItemsStore = new ListStore(typeof(Gdk.Pixbuf),
			                                    typeof(string),
			                                    typeof(Token));
			remainingItemsIconView.Model = remainingItemsStore;
			
			remainingItemsIconView.PixbufColumn =0;
			remainingItemsIconView.TextColumn = 1;
			
			originalImageArea = new  ImageArea();
			originalImageArea.ImageMode = ImageAreaMode.Zoom;
			
			synImageOriginalPlaceholder.Add(originalImageArea);
			
			originalImageArea.ShowAll();
		}
Beispiel #16
0
    public NodeView GetNodeView()
    {
        r = new ColorCellRenderer ();
        NodeView nv = new NodeView (this);
        nv.SetSizeRequest (250, 700);
        nv.HeadersVisible = false;
        nv.AppendColumn ("Color",r, new NodeCellDataFunc (GetColorData));
        nv.AppendColumn ("Type",  new CellRendererText (),  "text", 1);

        return nv;
    }
Beispiel #17
0
        public MainView(Personne man)
            : base(Gtk.WindowType.Toplevel)
        {
            employe.id = man.id;
            employe.prenom = man.prenom;
            employe.nom = man.nom;
            employe.login = man.login;
            employe.password = man.password;
            employe.idPoste = man.idPoste;

            this.Build ();
            // affiche le nom et prénom de la personne connecté dans la Status bar
            labelSessionPersonne.Text = man.prenom + " " + man.nom;
            labelDateDuJour.Text = DateTime.Now.ToString ("dd/MM/yyyy");

            List<Operation> operations = ConnectionBdd.getOperationsFromIdPoste (man.idPoste);
            foreach (Operation operation in operations) {
                action = new Gtk.Button ();
                actions.Add (action);
                Label labelOperation = new Label ();
                NodeView nodeViewOperation = new NodeView ();
                VBox vbox54 = new VBox ();
                HBox hbox54 = new HBox ();
                Fixed boucheTrou = new Fixed ();

                nodeViewOperation.AppendColumn ("Date et Heure", new Gtk.CellRendererText (), "text", 0);
                nodeViewOperation.AppendColumn ("Numero Traçabilité", new Gtk.CellRendererText (), "text", 1);
                nodeViewOperation.AppendColumn ("Prenom", new Gtk.CellRendererText (), "text", 2);
                nodeViewOperation.AppendColumn ("Nom", new Gtk.CellRendererText (), "text", 3);
                nodeViewOperation.AppendColumn ("Dernière Operation", new Gtk.CellRendererText (), "text", 4);
                nodeViewOperation.AppendColumn ("Numero Fiche", new Gtk.CellRendererText (), "text", 5);
                nodeViewOperation.AppendColumn ("Numero Operation", new Gtk.CellRendererText (), "text", 6);

                nodeViewOperation.NodeStore = ConnectionBdd.getFicheNodeStoreFromIdOperation (operation.id);

                labelOperation.Name = operation.libelleOperation;
                labelOperation.LabelProp = operation.libelleOperation.ToUpper ();
                notebookOperation.Add (vbox54);
                notebookOperation.SetTabLabel (vbox54, labelOperation);
                action.Label = operation.libelleAction;
                action.Name = operation.id.ToString ();
                action.Sensitive = false;

                if (operation.ordre == 1) {
                    vbox54.Add (hbox54);
                    hbox54.Add (action);
                    Box.BoxChild v1 = (Box.BoxChild)vbox54 [hbox54];
                    v1.Fill = false;
                    Box.BoxChild h1 = (Box.BoxChild)hbox54 [action];
                    h1.Fill = false;
                    action.WidthRequest = 200;
                    action.HeightRequest = 80;

                } else {
                    vbox54.Add (nodeViewOperation);
                    vbox54.Add (hbox54);
                    hbox54.Add (boucheTrou);
                    hbox54.Add (action);
                    Box.BoxChild v2 = (Box.BoxChild)vbox54 [hbox54];
                    v2.Expand = false;
                    v2.Padding = 5;
                    Box.BoxChild h1 = (Box.BoxChild)hbox54 [boucheTrou];
                    h1.Position = 0;
                    Box.BoxChild h2 = (Box.BoxChild)hbox54 [action];
                    h2.Position = 1;
                    h2.Expand = false;

                }

                action.Clicked += delegate (object sender, EventArgs e) {
                    Button btn = (Gtk.Button)sender;
                    FicheView ficheView = new FicheView (ConnectionBdd.getOperation (btn.Name));
                    ficheView.ShowAll ();
                    ficheView.init ();
                };

                nodeViewOperation.NodeSelection.Changed += nodeSelectedChange;

            }
        }
Beispiel #18
0
		public MainPadControl ()
		{
			mainScheduler = TaskScheduler.Current;

			hostEntry.Entry.Text = ContinuousEnv.Shared.IP;
			PopulateHostEntry ();

			Env.LinkedMonitoredCode += Env_LinkedMonitoredCode;
			Env.Failure += Env_Alerted;
			Env.Success += Env_Success;
			Env.Discovery.DevicesChanged += Discovery_DevicesChanged;

			runButton.Clicked += RunButton_Clicked;
			refreshButton.Clicked += RefreshButton_Clicked;
			stopButton.Clicked += StopButton_Clicked;
			clearButton.Clicked += ClearButton_Clicked;
			hostEntry.Changed += HostEntry_Changed;
			//portEntry.Changed += PortEntry_Changed;

			dependenciesView = new NodeView (dependenciesStore);
			dependenciesView.AppendColumn ("Dependency", new CellRendererText (), "text", 0);
			dependenciesView.AppendColumn ("Status", new CellRendererText (), "text", 1);

			toolbar0.PackStart (runButton, false, false, 4);
			toolbar0.PackStart (refreshButton, false, false, 4);
			toolbar0.PackStart (stopButton, false, false, 4);
			toolbar0.PackEnd (clearButton, false, false, 4);
			toolbar1.PackStart (hostLabel, false, false, 4);
			toolbar1.PackStart (hostEntry, false, false, 4);
			toolbar2.AddWithViewport (alertLabel);
			//toolbar1.PackStart (portLabel, false, false, 4);
			//toolbar1.PackStart (portEntry, false, false, 4);
			toolbar.PackStart (toolbar0, false, false, 0);
			toolbar.PackStart (toolbar1, false, false, 0);
			toolbar.PackStart (toolbar2, false, false, 0);
			PackStart (toolbar, false, false, 0);
			PackEnd (dependenciesView, true, true, 0);
		}
Beispiel #19
0
    public MsdnView()
        : base("Msdn View")
    {
        DefaultSize = new Gdk.Size (1024,1024);

        HPaned hb = new HPaned ();

        Store = new NodeStore (typeof (TreeNode));
        WebControl wc = new WebControl ();
        ScrolledWindow sw = new ScrolledWindow ();
        NodeView view = new NodeView (Store);
        view.HeadersVisible = false;
        view.AppendColumn ("Name", new CellRendererText (), "text", 0);
        sw.WidthRequest = 300;
        InitTree ();
        Add (hb);
        hb.Add (sw);
        hb.Add (wc);
        sw.Add (view);

        // Events
        DeleteEvent += delegate {
            Application.Quit ();
        };

        view.NodeSelection.Changed += delegate {
            TreeNode n = (TreeNode) view.NodeSelection.SelectedNode;
            if (n == null)
                return;

            //
            // Fool msdn's code that tries to detect if it
            // is in a frame
            //
            string html = @"
        <frameset>
          <frame src='" + n.Href + @"?frame=true' />
        </frameset>";

            wc.OpenStream (MsdnClient.BaseUrl, "text/html");
            wc.AppendData (html);
            wc.CloseStream ();

        };
        view.RowExpanded += delegate (object o, RowExpandedArgs args) {
            TreeNode n = (TreeNode) Store.GetNode (args.Path);
            n.PopulateChildrenAsync ();
        };
    }
Beispiel #20
0
 private NodeView CreateTable()
 {
     NodeView contactTable = new NodeView(CreateContactNodeStore());
     contactTable.AppendColumn("Name", new CellRendererText(), "text", ContactTreeNode.NAME_COLUMN_INDEX);
     contactTable.AppendColumn("Phone", new CellRendererText(), "text", ContactTreeNode.PHONE_COLUMN_INDEX);
     contactTable.AppendColumn("Email", new CellRendererText(), "text", ContactTreeNode.EMAIL_COLUMN_INDEX);
     contactTable.RowActivated += delegate (object o, RowActivatedArgs args) {
         this.ShowEditContactDialog();
     };
     return contactTable;
 }
		public SequenceNode(TokenSequence sequence, NodeView widget)
		{
			this.sequence = sequence;			
			this.sequence.Changed += new EventHandler(OnSequenceChanged);	
			this.widget = widget;
		}
Beispiel #22
0
        private void NodeViewPopulate(NodeView nodeView, List<String[]> alValuesList )
        {
            RemoveAllFromPagesNodeView();

            int i = 0;
            foreach (String[] oaValue in alValuesList)
            {
                nodeView.NodeStore.AddNode(new PageNodeCell(i++, oaValue[0], oaValue[1]));
            }
        }
Beispiel #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DynamicCodeTests.UI.ProjectPreferencesDialog"/> class.
        /// </summary>
        public ProjectDialog(Window parent, Project project)
        {
            Project = project;

            XML gxml = new XML("CodeWindow.glade", "ProjectDialog", null);
            gxml.Autoconnect(this);
            GtkDialog = nbPreferences.Toplevel as Dialog;
            //			GtkDialog.Reparent(parent as Widget);
            GtkDialog.Modal = GtkDialog.DestroyWithParent = true;

            storeReferencePaths = new NodeStore(typeof(Project.ReferencePathTreeNode));
            nvReferencePaths = new NodeView(storeReferencePaths);
            swReferencePaths.Add(nvReferencePaths);
            nvReferencePaths.AppendColumn("Reference Path", new CellRendererText(), "text", 0);

            Update();
        }
Beispiel #24
0
    public MainWindow()
        : base(WindowType.Toplevel)
    {
        VBox mainVBox = new VBox(false, 0);
        HBox nodeViewHBox = new HBox(true, 0);
        HBox crudButtonsHBox = new HBox(true, 0);
        HBox transactionContolButtonsHBox = new HBox(true, 0);

        Button refreshButton = new Button("Refresh");
        Button createButton = new Button("Create");
        Button deleteButton = new Button("Delete");
        Button commitButton = new Button("Commit");
        Button rollbackButton = new Button("Rollback");

        refreshButton.Clicked += RefreshButtonClicked;
        createButton.Clicked += CreateButtonClicked;
        deleteButton.Clicked += DeleteButtonClicked;
        commitButton.Clicked += CommitButtonClicked;
        rollbackButton.Clicked += RollbackButtonClicked;

        HSeparator separator = new HSeparator();

        view = new NodeView(Store);

        CellRendererText titleRenderer = new CellRendererText();
        CellRendererText contentRenderer = new CellRendererText();

        titleRenderer.Editable = true;
        contentRenderer.Editable = true;
        titleRenderer.Edited += NoteTitleEdited;
        contentRenderer.Edited += NoteContentEdited;

        view.AppendColumn("Title", titleRenderer, "text", 0);
        view.AppendColumn("Content", contentRenderer, "text", 1);

        ScrolledWindow scrolledWindow = new ScrolledWindow();
        scrolledWindow.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
        scrolledWindow.AddWithViewport(view);

        try {
            //Если сервер и клиент запускаются из ИДЕ (по порядку, но практически одновременно),
            //сервер не успевает создать сокет, поэтому надо немного подождать
            System.Threading.Thread.Sleep(1000);
            RemotingConfiguration.Configure("remoteNotes.exe.config", false);

            clientActivated = new NotesClientActivated();
            singleton = new NotesSingleton();
            singlecall = new NotesTransactionSinglecall();
        } catch (System.Net.WebException) {
            Logger.Write("Unable to connect");
            return;
        }

        foreach (Note note in singleton.GetPesistentData()) {
            store.AddNode(new NoteTreeNode(note));
        }

        nodeViewHBox.PackStart(scrolledWindow, false, true, 0);
        nodeViewHBox.SetSizeRequest(200, 200);

        crudButtonsHBox.PackStart(refreshButton, false, true, 0);
        crudButtonsHBox.PackStart(createButton, false, true, 0);
        crudButtonsHBox.PackStart(deleteButton, false, true, 0);

        transactionContolButtonsHBox.PackStart(commitButton, false, true, 0);
        transactionContolButtonsHBox.PackStart(rollbackButton, false, true, 0);

        mainVBox.PackStart(nodeViewHBox, true, false, 0);
        mainVBox.PackStart(crudButtonsHBox, true, false, 0);
        mainVBox.PackStart(separator, true, false, 2);
        mainVBox.PackStart(transactionContolButtonsHBox, true, false, 0);

        Add(mainVBox);

        mainVBox.ShowAll();

        Build();
    }
		protected void InitializeWidgets()
		{
			store = new NodeStore(typeof(SegmentedNode));
			
			// Creamos el NodeView, podría hacerse en el fichero de Glade,
			// aunque alguna razón habría por la que se hizo así.
			treeview=new NodeView(store);
			treeview.RulesHint = true;
			
			treeview.ShowExpanders = true;
			treeview.AppendColumn ("Imagen", 
			                       new CellRendererText (), 
			                       "text", 0);
			
			CellRendererText cellRenderer = new CellRendererText();
			cellRenderer.Xalign = 0.5f;
			treeview.AppendColumn ("Etiqueta", cellRenderer, "text", 1);
			treeview.AppendColumn ("Posición", 
			                       new CellRendererText (), 
			                       "text", 2);
			
			scrolledtree.Add(treeview);
			
			foreach (TreeViewColumn col in treeview) 
			{
				col.Sizing = TreeViewColumnSizing.Autosize;
			}
			
			
			
			// Asignamos el evento para cuando se produzca la selección de un
			// nodo en el árbol.
			treeview.NodeSelection.Changed += OnTreeviewSelectionChanged;
						
			treeview.ButtonPressEvent += 
				new ButtonPressEventHandler(OnTreeviewButtonPress);
			
			imageAreaOriginal = new ImageArea();
			imageAreaOriginal.ImageMode = ImageAreaMode.Zoom;
				
			frameOriginal.Add(imageAreaOriginal);
			
			
			imageAreaNode=new ImageArea();
			imageAreaNode.ImageMode=ImageAreaMode.Zoom;			
			frameNodeActual.Add(imageAreaNode);
			
			learnImageItem.Image = ImageResources.LoadImage("database16");
		}
		/// <summary>
		/// Initialize the widget's children widgets.
		/// </summary>
		private void InitializeWidgets()
		{
			this.Add(tokenizingStageWidgetBase);
			
			sequencesModel = new NodeStore(typeof(SequenceNode));
			
			sequencesNV = new NodeView(sequencesModel);
			
			sequencesNV.ShowExpanders = true;
			sequencesNV.RulesHint = true;
			sequencesNVPlaceholder.Add(sequencesNV);
			
			sequencesNV.AppendColumn("Secuencia", 
			                         new CellRendererText(), 
			                         "text",0);
			
			sequencesNV.AppendColumn("Símbolos", 
			                         new CellRendererText(), 
			                         "text",1);
			
			sequencesNV.AppendColumn("Ítem",
			                         new CellRendererText(),
			                         "text",2);
			
			// We tell the treeview's columns to resize automatically.
			foreach (TreeViewColumn column in sequencesNV.Columns) 
			{
				column.Sizing = TreeViewColumnSizing.Autosize;								
			}
			
			// We handle the pressing of the mouse buttons, so we can show
			// the contextual menu.
		
			sequencesNV.Events = Gdk.EventMask.ButtonPressMask;
			sequencesNV.ButtonPressEvent+= 
				new ButtonPressEventHandler(OnSequencesNVButtonPress);
									
			symbolsModel = new ListStore(typeof(Gdk.Pixbuf),
			                             typeof(string),
			                             typeof(Token));
			
			symbolsIV.Model = symbolsModel;
			
			symbolsIV.TextColumn = 1;
			symbolsIV.PixbufColumn =0;
			
			baselineImageArea = new ImageArea();
			baselineImageArea.ImageMode = ImageAreaMode.Zoom;
			currentImageFrm.Add(baselineImageArea);
			
			sequenceMatchingImageArea = new ImageArea();
			sequenceMatchingImageArea.ImageMode = ImageAreaMode.Zoom;
			sequenceImageFrm.Add(sequenceMatchingImageArea);
			
			tokenizingRulesTV.AppendColumn("Item generado", 
			                               new CellRendererText(), 
			                               "text", 0);
			tokenizingRulesTV.AppendColumn("Expresión", 
			                               new CellRendererText(), 
			                               "text", 1);
			
			tokenizingRulesTV.Columns[0].Sizing = TreeViewColumnSizing.Autosize;
			tokenizingRulesTV.Columns[1].Sizing = TreeViewColumnSizing.Autosize;
			
			
				
			
			tokenizingButtonsNB.Page = 0;
			tokenizingStepsNB.Page = 0;
			
			tokenizingStageWidgetBase.ShowAll();
		}
Beispiel #27
0
 public static void CreateNodeViewColumns(NodeView view)
 {
     view.AppendColumn("Poz.", new CellRendererText(), "text", 0);
     CellRendererToggle toggle_visible = new CellRendererToggle();
     toggle_visible.Activatable = true;
     toggle_visible.Toggled += delegate(object o, ToggledArgs args) {
         TreePath path = new TreePath(args.Path);
         ConfigurableColumn cc = ((ConfigurableColumn)view.NodeStore.GetNode(path));
         cc.Conf_Visible = !cc.Conf_Visible;
     };
     view.AppendColumn("Viditelný", toggle_visible, "active", 2);
     view.AppendColumn("Nadpis", new CellRendererText(), "text", 1);
     CellRendererSpin col_width = new CellRendererSpin();
     col_width.Editable = false;
     col_width.Digits = 0;
     col_width.ClimbRate = 2;
     col_width.Edited += HandleCol_widthEdited;
     view.AppendColumn("Šířka", col_width, "adjustment", 3, "text", 4);
 }
        private void InitLinksNodeView(Gtk.ListStore store, NodeView nodeView)
        {
            nodeView.Model = store;
            nodeView.AppendColumn("Icon", new Gtk.CellRendererPixbuf (), "pixbuf", 0);
            
            CellRendererText websiteLinkRenderer = new CellRendererText();
            websiteLinkRenderer.WrapMode = Pango.WrapMode.Word;
            TreeViewColumn websiteColumn = nodeView.AppendColumn("Website Link", websiteLinkRenderer);
            websiteColumn.SetCellDataFunc(websiteLinkRenderer, new TreeCellDataFunc(RenderWebsiteLink));

            nodeView.RowActivated += OpenWebsiteLink;
        }
		/// <summary>
		/// Inicializa los controles del panel del asistente.
		/// </summary>
		/// <param name="imagesStore">
		/// El almacén de imagenes creado en el paso anterior, para que las
		/// imagenes sean seleccionables en la vista de previsualización.
		/// </param>
		private void InitializeWidgets(ListStore imagesStore)
		{
			NodeStore store = new NodeStore(typeof(BitmapProcessNode));
			processesView =  new NodeView(store);			
			
			processesView.ShowExpanders = false;
			
			processesView.RulesHint = true;
			
			processesView.NodeSelection.Changed += OnProcessesSelectionChanged;
			
			processesView.AppendColumn("Algoritmo", 
			                           new CellRendererText(),
			                           "text",0);
			
			processesView.AppendColumn("Parámetros",
			                           new CellRendererText(),
			                           "text",1);		
			
			bitmapsProcessSW.Add(processesView);
			
			originIA = new ImageArea();
			processedIA = new ImageArea();

			originIA.ImageMode = ImageAreaMode.Zoom;
			processedIA.ImageMode = ImageAreaMode.Zoom;
					
			originFrame.Add(originIA);
			processedFrame.Add(processedIA);
			
			imagesTV.Model = imagesStore;
			
			imagesTV.AppendColumn("Imagen",new CellRendererText(),"text",1);
			
			imagesTV.Selection.Changed += OnImagesTVSelectionChanged;
		
			LoadDefaults();
			
		}
Beispiel #30
0
        public override void OnCreate()
        {
            this.ServerUrl = MainApp.ServerUrl;
            this.UserLogin = MainApp.UserLogin;

            this.Window.Title = "LPS Sklad: " + Connection.GetUserName() + " (" + this.UserLogin + ")@" + this.ServerUrl;

            this.Window.DeleteEvent += delegate {
                this.OnClose();
                Application.Quit();
            };

            nbData.SwitchPage += HandleNbDataSwitchPage;

            InitModules(false);

            viewColumns = new NodeView();
            viewColumns.Show();
            viewColumns.SearchColumn = 1;
            viewColumns.EnableSearch = true;
            ConfigurableColumn.CreateNodeViewColumns(viewColumns);
            scrollwindowColumns.Add(viewColumns);

            RestoreTabs();
        }
Beispiel #31
0
        public Toolbox(ServiceContainer parentServices)
        {
            this.parentServices = parentServices;

            //we need this service, so create it if not present
            toolboxService = parentServices.GetService (typeof (IToolboxService)) as ToolboxService;
            if (toolboxService == null) {
                toolboxService = new ToolboxService ();
                parentServices.AddService (typeof (IToolboxService), toolboxService);
            }

            #region Toolbar
            toolbar = new Toolbar ();
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.IconSize = IconSize.SmallToolbar;
            base.PackStart (toolbar, false, false, 0);

            filterToggleButton = new ToggleToolButton ();
            filterToggleButton.IconWidget = new Image (Stock.MissingImage, IconSize.SmallToolbar);
            filterToggleButton.Toggled += new EventHandler (toggleFiltering);
            toolbar.Insert (filterToggleButton, 0);

            catToggleButton = new ToggleToolButton ();
            catToggleButton.IconWidget = new Image (Stock.MissingImage, IconSize.SmallToolbar);
            catToggleButton.Toggled += new EventHandler (toggleCategorisation);
            toolbar.Insert (catToggleButton, 1);

            SeparatorToolItem sep = new SeparatorToolItem();
            toolbar.Insert (sep, 2);

            filterEntry = new Entry();
            filterEntry.WidthRequest = 150;
            filterEntry.Changed += new EventHandler (filterTextChanged);

            #endregion

            scrolledWindow = new ScrolledWindow ();
            base.PackEnd (scrolledWindow, true, true, 0);

            //Initialise model

            store = new ToolboxStore ();

            //initialise view
            nodeView = new NodeView (store);
            nodeView.Selection.Mode = SelectionMode.Single;
            nodeView.HeadersVisible = false;

            //cell renderers
            CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf ();
            CellRendererText textRenderer = new CellRendererText ();
            textRenderer.Ellipsize = Pango.EllipsizeMode.End;

            //Main column with text, icons
            TreeViewColumn col = new TreeViewColumn ();

            col.PackStart (pixbufRenderer, false);
            col.SetAttributes (pixbufRenderer,
                                  "pixbuf", ToolboxStore.Columns.Icon,
                                  "visible", ToolboxStore.Columns.IconVisible,
                                  "cell-background-gdk", ToolboxStore.Columns.BackgroundColour);

            col.PackEnd (textRenderer, true);
            col.SetAttributes (textRenderer,
                                  "text", ToolboxStore.Columns.Label,
                                  "weight", ToolboxStore.Columns.FontWeight,
                                  "cell-background-gdk", ToolboxStore.Columns.BackgroundColour);

            nodeView.AppendColumn (col);

            //Initialise self
            scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
            scrolledWindow.HscrollbarPolicy = PolicyType.Never;
            scrolledWindow.WidthRequest = 150;
            scrolledWindow.AddWithViewport (nodeView);

            //selection events
            nodeView.NodeSelection.Changed += OnSelectionChanged;
            nodeView.RowActivated  += OnRowActivated;

            //update view when toolbox service updated
            toolboxService.ToolboxChanged += new EventHandler (tbsChanged);
            Refresh ();

            //track expanded state of nodes
            nodeView.RowCollapsed += new RowCollapsedHandler (whenRowCollapsed);
            nodeView.RowExpanded += new RowExpandedHandler (whenRowExpanded);

            //set initial state
            filterToggleButton.Active = false;
            catToggleButton.Active = true;
        }
Beispiel #32
0
    private void NodeViewPopulate(NodeView nodeView, List<String> list )
    {
        foreach(TreeViewColumn col in nodeView.Columns)
            nodeView.RemoveColumn(col);

        nodeView.NodeStore = new Gtk.NodeStore( typeof(MyTreeNode) ); ;
        nodeView.AppendColumn ("Имя формы", new Gtk.CellRendererText (), "text", 0);

        foreach (String str in list)
        {
            MyTreeNode node = new MyTreeNode(str);
            nodeView.NodeStore.AddNode(node);
        }

        //filter = new TreeModelFilter (nodeView.Model, null);
        //filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
        //nodeview1.Model = filter;
    }