Example #1
0
        private void parseData(string message)
        {
            Utilities.Log(message);

            string[] arr = message.Split(' '.ToString().ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            Constants.MessageTypes type = Constants.TypeFromStrings[arr[2]];
            int tempid = -1;

            if (int.TryParse(arr[1], out tempid))
            {
                if (tempid == id)
                {
                    if (type == Constants.MessageTypes.id)
                    {
                        id            = int.Parse(arr[3]);
                        Console.Title = "Client " + id;
                        this.Title    = "Client " + id;
                    }
                }
            }
            else
            {
                if (type == Constants.MessageTypes.move)
                {
                    en.center.X = int.Parse(arr[3]);
                    en.center.Y = int.Parse(arr[4]);
                }
            }
        }
Example #2
0
 //special caller to show stiffness formula or others
 public DialogMessage(Constants.MessageTypes type, string message, string objectToShow)
 {
     initialize("", type, message);
     if (objectToShow == "hbox_stiffness_formula")
     {
         hbox_stiffness_formula.Show();
     }
 }
Example #3
0
 public Message(int i, Constants.MessageTypes m, params string[] msg)
 {
     id   = i;
     type = m;
     body = "";
     foreach (string s in msg)
     {
         body += " " + s;
     }
 }
 //special caller to show stiffness formula or others
 public DialogMessage(Constants.MessageTypes type, string message, string objectToShow)
 {
     initialize("", type, message, false);
     if (objectToShow == "hbox_stiffness_formula")
     {
         hbox_stiffness_formula.Show();
     }
     else if (objectToShow == "button_go_r_mac")
     {
         button_go_link = "http://cran.cnr.berkeley.edu/bin/macosx/R-latest.pkg";
         button_go.Show();
     }
 }
Example #5
0
    private void initialize(string title, Constants.MessageTypes type, string message)
    {
        LogB.Information("Dialog message: " + message);

        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "dialog_message.glade", "dialog_message", "chronojump");
        gladeXML.Autoconnect(this);

        //put an icon to window
        UtilGtk.IconWindow(dialog_message);

        //with this, user doesn't see a moving/changing creation window
        //if uncommented, then does weird bug in windows not showing dialog as its correct size until window is moves
        //dialog_message.Hide();

        if (title != "")
        {
            dialog_message.Title = title;
        }

        label_message.Text      = message;
        label_message.UseMarkup = true;

        switch (type)
        {
        case Constants.MessageTypes.WARNING:
            image_warning.Show();
            image_info.Hide();
            image_help.Hide();
            break;

        case Constants.MessageTypes.INFO:
            image_warning.Hide();
            image_info.Show();
            image_help.Hide();
            break;

        case Constants.MessageTypes.HELP:
            image_warning.Hide();
            image_info.Hide();
            image_help.Show();
            break;
        }

        label_message.Show();
        dialog_message.Show();
    }
Example #6
0
        static void parseData(ref NetworkStream n, string msg)
        {
            Console.WriteLine(msg);

            string[] arr = msg.Split(' ');
            Constants.MessageTypes type = Constants.TypeFromStrings[arr[2]];

            if (type == Constants.MessageTypes.getid)
            {
                send("id " + arr[1] + " giveid " + users.Count.ToString());
            }
            else if (type == Constants.MessageTypes.move)

            {
                send("id host move " + arr[3] + " " + arr[4], int.Parse(arr[1]));
            }
        }
Example #7
0
 public DialogMessage(Constants.MessageTypes type, string message)
 {
     initialize("", type, message);
 }
Example #8
0
 public DialogMessage(string title, Constants.MessageTypes type, string message)
 {
     initialize(title, type, message);
 }
    private void initialize(string title, Constants.MessageTypes type, string message, bool showScroledWinBar)
    {
        LogB.Information("Dialog message: " + message);

        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "dialog_message.glade", "dialog_message", "chronojump");
        gladeXML.Autoconnect(this);

        button_go.Visible = false;
        button_go_link    = "";

        Visible = true;

        //put an icon to window
        UtilGtk.IconWindow(dialog_message);

        //with this, user doesn't see a moving/changing creation window
        //if uncommented, then does weird bug in windows not showing dialog as its correct size until window is moves
        //dialog_message.Hide();

        if (title != "")
        {
            dialog_message.Title = title;
        }

        label_message.Text      = message;
        label_message.UseMarkup = true;

        image_warning.Hide();
        image_info.Hide();
        image_help.Hide();
        image_inspect.Hide();

        switch (type)
        {
        case Constants.MessageTypes.WARNING:
            image_warning.Show();
            break;

        case Constants.MessageTypes.INFO:
            image_info.Show();
            break;

        case Constants.MessageTypes.HELP:
            image_help.Show();
            break;

        case Constants.MessageTypes.INSPECT:
            Pixbuf pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_test_inspect.png");
            image_inspect.Pixbuf = pixbuf;
            image_inspect.Show();
            break;
        }

        if (showScroledWinBar)
        {
            dialog_message.HeightRequest = 450;
            scrolledwindow.SetPolicy(PolicyType.Never, PolicyType.Automatic);
        }
        else
        {
            scrolledwindow.SetPolicy(PolicyType.Never, PolicyType.Never);
        }

        label_message.Show();
        dialog_message.Show();
    }
Example #10
0
 public DialogMessage(string title, Constants.MessageTypes type, string message, bool showScrolledWinBar)
 {
     initialize(title, type, message, showScrolledWinBar);
 }