Exemplo n.º 1
0
        protected virtual void OnDoubleClick(object o, Gtk.ItemActivatedArgs args)
        {
            TreeIter iter;

            if (imagesView.SelectedItems[0] != null)
            {
                m_model.GetIter(out iter, imagesView.SelectedItems[0]);
                string      file = (string)m_model.GetValue(iter, 2);
                ImageDialog dlg  = new ImageDialog(file);
                dlg.Run();
            }
        }
Exemplo n.º 2
0
        void HandleIconview1ItemActivated(object o, Gtk.ItemActivatedArgs args)
        {
            TreeIter iter;

            store.GetIter(out iter, args.Path);
            string label = store.GetValue(iter, 2) as string;

            if (String.IsNullOrEmpty(label))
            {
                return;
            }
            if (ItemActivated != null)
            {
                ItemActivated(label);
            }
        }
Exemplo n.º 3
0
		protected virtual void OnRowActivated (object o, ItemActivatedArgs args)
		{
			if ( RowActivated != null )
			{
				RowActivated(this, new System.EventArgs() );
			}
		}
Exemplo n.º 4
0
 protected void OnIconviewFilesItemActivated(object o, ItemActivatedArgs args)
 {
     buttonOpen.Click ();
 }
Exemplo n.º 5
0
    //==================ZEDGRAPH=================
    void OnIvFtpBrowserItemActivated_ZedGraph(object o, ItemActivatedArgs args)
    {
        string selected_file = get_BrowserItem_Value (ivFtpBrowser);
        StreamReader file_reader = c_current_ftp_session.CFTP_GetFile (selected_file);

        Viewport _port = new Viewport (new Adjustment(1000, 500, 1000, 5, 0, 500),
            new Adjustment (500, 500, 500, 0, 0, 500));
        _port.WidthRequest = 2000;
        _port.ResizeMode = ResizeMode.Parent;

        ZedGraphControl g_graph = new ZedGraphControl ();

        c_current_logfile = new CLogFile
                            (
                                file_reader,
                                c_current_ftp_session.CFTP_LogFileDate,
                                c_current_device.DeviceFileDescription
                               );

        c_current_graph = new CGraph (c_current_logfile.LogFileEntries);
        //c_current_graph.YAxisCodeIndex = c_current_logfile.CLogFile_Get_Y_Axis_Code_Index (c_current_device);
        c_current_graph.Title = selected_file;
        c_current_graph.YAxisCode = "CURTEMP";
        c_current_graph.YAxisLabel = "Current Temperature";
        c_current_graph.XAxisLabel = "Time Stamp";
        c_current_graph.CGRAPH_X_AxisData = c_current_logfile.LogFileTime;
        c_current_graph.CGRAPH_Y_AxisData = c_current_logfile.LogFileTemps;

        //Plot Graph
        c_current_graph.ploy_zedgraph (out g_graph);
        System.Drawing.Bitmap bmp_graph =
            new System.Drawing.Bitmap (g_graph.Width, g_graph.Height);

        g_graph.DrawToBitmap(bmp_graph,
            new System.Drawing.Rectangle(0, 0, g_graph.Width, g_graph.Height));

        bmp_graph.Save ("graph.bmp");

        img_graph.ModifyBg (StateType.Normal, CUtil.get_light_grey ());
        img_graph.ModifyBase (StateType.Normal, CUtil.get_light_grey ());
        img_graph.File = "graph.bmp";
        img_graph.QueueDraw ();
        img_graph.ShowAll ();

        /**
         * Fill Alarms Table
         */

        FillAlarmsTable (c_current_logfile.LogFileAlarms);

        file_reader.Close ();
        file_reader.Dispose ();

        nbFrames.CurrentPage = (int)nb_Notebook_Pages.GRAPH;
    }
Exemplo n.º 6
0
    //========NPLOT===========
    void OnIvFtpBrowserItemActivated_NPlot(object o, ItemActivatedArgs args)
    {
        //TODO: Implement OnIvFtpBrowserItemActivated

        /* Get and parse file.
         * Populate appropriate classes.
         * --> LogFileEntries.
         * --> Graph Class
         * Plot graph and alarms.
         */

        NPlot.Gtk.PlotSurface2D graph = null;

        string selected_file = get_BrowserItem_Value (ivFtpBrowser);
        StreamReader file_reader = c_current_ftp_session.CFTP_GetFile (selected_file);

        Viewport _port = new Viewport (new Adjustment(1000, 500, 1000, 5, 0, 500),
            new Adjustment (500, 500, 500, 0, 0, 500));
        _port.WidthRequest = 2000;
        _port.ResizeMode = ResizeMode.Parent;

        c_current_logfile = new CLogFile
            (
                file_reader,
                c_current_ftp_session.CFTP_LogFileDate,
                c_current_device.DeviceFileDescription
            );

        c_current_graph = new CGraph (c_current_logfile.LogFileEntries);
        //c_current_graph.YAxisCodeIndex = c_current_logfile.CLogFile_Get_Y_Axis_Code_Index (c_current_device);
        c_current_graph.Title = selected_file;
        c_current_graph.YAxisCode = "CURTEMP";
        c_current_graph.YAxisLabel = "Current Temperature";
        c_current_graph.XAxisLabel = "Time Stamp";
        c_current_graph.CGRAPH_X_AxisData = c_current_logfile.LogFileTime;
        c_current_graph.CGRAPH_Y_AxisData = c_current_logfile.LogFileTemps;

        /**
         * Plot Graph
         */

        swGraph.Remove ((Widget)swGraph.Child);

        graph = new PlotSurface2D();
        graph.WidthRequest = 2000;
        graph.Allocation  = (new Gdk.Rectangle (0, 0, 2000, 500));

        c_current_graph.plot_nplot (out graph);

        swGraph.ReallocateRedraws = true;

        //swGraph.AddWithViewport (graph);
        _port.Add (graph);
        swGraph.ResizeMode = ResizeMode.Queue;
        swGraph.Add (_port);
        graph.QueueResize ();
        swGraph.QueueDraw ();
        swGraph.ShowAll ();

        /**
         * Fill Alarms Table
         */

        FillAlarmsTable (c_current_logfile.LogFileAlarms);

        file_reader.Close ();
        file_reader.Dispose ();

        nbFrames.CurrentPage = (int)nb_Notebook_Pages.GRAPH;
    }
Exemplo n.º 7
0
                private void OnItemActivated (object sender, ItemActivatedArgs args)
                {
                        TreeIter iter;
                        store.GetIter (out iter, args.Path);

                        try {
                                string host = (string) store.GetValue (iter, COL_HOST);
                                int port = (int) store.GetValue (iter, COL_PORT);

                                Console.WriteLine ("Host activated: {0}", 
                                                   String.Format ("{0}:{1}", host.Trim (), port));
                                
                                // The user has double clicked on the icon, so they probably expect
                                // the same behavior as selecting this icon and clicking "Add".
                                Respond (ResponseType.Ok);
                        } catch (Exception e) {
                                Console.Error.WriteLine ("Exception: {0}", e.Message);
                        }
                }
Exemplo n.º 8
0
 public void OnStandardIconActivated(object o, ItemActivatedArgs e)
 {
     TreeIter iter;
     if (standardList.GetIter(out iter, e.Path))
     {
         EventHandler OnClick = (EventHandler)standardList.GetValue(iter, 3);
         if (OnClick != null)
             OnClick(this, e);
     }
 }
Exemplo n.º 9
0
 // Other
 void OnItemActivated(object sender, ItemActivatedArgs e)
 {
     OnPlayClicked(sender, e);
 }
		/// <summary>
		/// Maneja el evento de activación (doble click) de un icono.
		/// </summary>
		private void OnFilesIconViewItemActivated(object o, ItemActivatedArgs a)
		{
			FilesIconViewItemActivated();
		}
Exemplo n.º 11
0
		void OnItemActivated (object sender, ItemActivatedArgs a)
		{
			TreeIter iter;
			store.GetIter (out iter, a.Path);
			string path = (string) store.GetValue (iter, COL_PATH);
			bool isDir = (bool) store.GetValue (iter, COL_IS_DIRECTORY);

			if (!isDir)
				return;

			// Replace parent with path and re-fill the model
			parent = new DirectoryInfo (path);
			FillStore ();

			// Sensitize the up button
			upButton.Sensitive = true;
		}
Exemplo n.º 12
0
        void HandleItemActivated(object o, ItemActivatedArgs args)
        {
            TreeIter iter;
            ProjectDescription pdesc;

            if (swallowSignals)
                return;

            if (ProjectSelected != null) {
                iconview.Model.GetIter (out iter, args.Path);
                pdesc = iconview.Model.GetValue (iter, COL_PROJECT_DESCRIPTION) as ProjectDescription;
                if (pdesc != null) {
                    ProjectSelected (pdesc);
                }
            }
        }
Exemplo n.º 13
0
 private void avatarIconView_ItemActivated(object o, ItemActivatedArgs args)
 {
     okButton_clicked (null, null);
 }
Exemplo n.º 14
0
        void OnItemActivated(object sender, ItemActivatedArgs a)
        {
            TreeIter iter;
            store.GetIter (out iter, a.Path);
            string path = (string) store.GetValue (iter, COL_PATH);
            bool isDir = (bool) store.GetValue (iter, COL_IS_DIRECTORY);

            if (!isDir){
                OpenFile(path);
                return;
            }

            DirectoryInfo di = new DirectoryInfo (path);
            try {
                di.GetDirectories ();
            }catch {
                return;
            }

            parent = di;
            FillStore (true);

            if(parent.Parent==null){
                upButton.Sensitive = false;
            } else {
                upButton.Sensitive = true;
            }
        }
Exemplo n.º 15
0
 //Doubleclick
 private void OnItemActivated(object sender, ItemActivatedArgs a)
 {
     OnInstallButtonClicked(sender, a);
 }
Exemplo n.º 16
0
    private void OnTagClicked(object o, ItemActivatedArgs args)
    {
        TreePath childpath = _filter.ConvertPathToChildPath(args.Path);
          string tag = (string) _tags[childpath.Indices[0]];
          ArrayList tagschosen;

          if (checkbutton1.Active || !checkbutton1.Sensitive) {
            Photo p = ((DeskFlickrUI.SelectedPhoto) _selectedphotos[_curphotoindex]).photo;
            p.AddTag(tag);
            tagschosen = p.Tags;
          } else {
            foreach (DeskFlickrUI.SelectedPhoto sel in _selectedphotos) {
              Photo p = sel.photo;
              p.AddTag(tag);
            }
            tagschosen = ((DeskFlickrUI.SelectedPhoto) _selectedphotos[0]).photo.Tags;
            foreach (DeskFlickrUI.SelectedPhoto sel in _selectedphotos) {
              Photo p = sel.photo;
              tagschosen = Utils.GetIntersection(tagschosen, p.Tags);
            }
          }
          ActivateRevertButton();
          _ignorechangedevent = true;
          textview3.Buffer.Text = Utils.GetDelimitedString(tagschosen, " ");
          _ignorechangedevent = false;
    }
Exemplo n.º 17
0
    protected void OnIvDeviceBrowserItemActivated(object o, ItemActivatedArgs args)
    {
        //TODO: Implement device browser item activated for Ftp.

        /**
         * - Get item activated from browser model
         * - Get item activated from sqlite
         * - Get Server for selected Device
         * - Get File list
         * - Build file list model for ftp browser.
         */

        // Get device details from model and sqlite.
        TreePath[] path = ivDeviceBrowser.SelectedItems;
        TreeIter iter;
        string _device_key = null;
        ArrayList ftp_file_list = new ArrayList();

            ivDeviceBrowser.Model.GetIter (out iter, path [0]);
            _device_key = (string)ivDeviceBrowser.Model.GetValue (iter, 0);

            c_current_device = csql.CSQL_GetDevice (_device_key);
            c_current_server = csql.CSQL_GetServer (c_current_device.DeviceServer);
            c_current_ftp_session = new CFTP (c_current_server, c_current_device);

        if (c_current_server.ServerProtocol == "file://") {

            string __dir_to_list = c_current_device.DeviceServerSubDir;

            foreach (string s_file in Directory.EnumerateFiles (__dir_to_list)) {

                string c_file = s_file;

                if (c_current_platform == PlatformID.Win32NT)
                    c_file = s_file.Substring (2);

                string[] file_name = c_file.Split (System.IO.Path.DirectorySeparatorChar);
                ftp_file_list.Add (file_name[(file_name.Length - 1)]);

            }

        } else {

            try {

                ftp_file_list = c_current_ftp_session.CFTP_GetFileList ();

            } catch (WebException e) {

                if (e.Status == WebExceptionStatus.ProtocolError) {

                    string msg = "Please check you Server and Device directory settings.";

                    new Gtk.MessageDialog (null, Gtk.DialogFlags.Modal, Gtk.MessageType.Error,
                        Gtk.ButtonsType.Ok, e.Message + "\n" + msg, 0).Run ();

                } else {

                    Console.WriteLine (e.Status + "\n" + e.Message + "\n" + e.Source);
                }

                return;
            }
        }

        if (ftp_file_list != null) {
            populate_FtpFileBrowser (ftp_file_list);
        }
    }
Exemplo n.º 18
0
 private void lbDefaultNames_Click(object sender, ItemActivatedArgs e)
 {
     if (SupplementAdded != null && e.Path.Indices[0] > 0)
     {
         TreeIter iter;
         if (defNameList.GetIter(out iter, e.Path))
         {
             TStringArgs args = new TStringArgs();
             args.name = (string)defNameList.GetValue(iter, 0);
             SupplementAdded.Invoke(sender, args);
         }
     }
     lbDefaultNames.Visible = false;
 }
Exemplo n.º 19
0
 protected void OnIvServerBrowserItemActivated(object o, ItemActivatedArgs args)
 {
     //TODO: What do we do for server activation ?
 }
Exemplo n.º 20
0
        void HandleItemActivated(object o, ItemActivatedArgs args)
        {
            TreeIter iter;
            ProjectLongoMatch project;

            if (swallowSignals)
                return;

            if (ProjectSelected != null) {
                iconview.Model.GetIter (out iter, args.Path);
                project = iconview.Model.GetValue (iter, COL_PROJECT) as ProjectLongoMatch;
                if (project != null) {
                    ProjectSelected (project);
                }
            }
        }
Exemplo n.º 21
0
        protected void iconview_ItemActivated(object o, ItemActivatedArgs args)
        {
            iconStore.GetIter(out fullSizeIter, args.Path);
            String fileName = (String)iconStore.GetValue(fullSizeIter, 0);
            int imageNum = (int)iconStore.GetValue(fullSizeIter, 5);
            iconwindow.Hide();
            threadwindow.Hide();
            imageviewbtn.Hide();
            textviewbtn.Hide();
            imageSortAscending.Hide();
            imageSortDescending.Hide();
            imageLoadingProgress.Hide ();
            downbtn.Hide();
            upbtn.Hide();
            prevbtn.Show ();
            nextbtn.Show ();
            imagewindow.Show();
            closebtn.Show();
            rotatebtn.Show();
            savebtn.Show();
            sepFullsize.Show();

            imagewindow.GrabFocus();
            showFullsizeImage(fileName, ref this.fullSizeImage, imageNum);
        }