Esempio n. 1
0
        // TODO: pass in a label which it will update with the name from the combobox?
        public ComboBoxFromConstants(bool showHelp = true, bool vertical = false, bool showSpin = true)
        {
            this.Name = "LynnaLab.ComboBoxFromConstants";

            Gtk.Box box2 = new Gtk.HBox();
            box2.Spacing = 6;

            // Container child LynnaLab.ComboBoxFromConstants.Gtk.Container+ContainerChild
            if (vertical)
            {
                this.box1 = new Gtk.VBox();
            }
            else
            {
                this.box1 = new Gtk.HBox();
            }
            // Container child box1.Gtk.Box+BoxChild
            this.spinButton                          = new LynnaLab.SpinButtonHexadecimal();
            this.spinButton.CanFocus                 = true;
            this.spinButton.Name                     = "spinButton";
            this.spinButton.Adjustment.Upper         = 255D;
            this.spinButton.Adjustment.PageIncrement = 16D;
            this.spinButton.Adjustment.StepIncrement = 1D;
            this.spinButton.ClimbRate                = 1D;
            this.spinButton.Digits                   = 2;
            this.spinButton.Numeric                  = true;
            if (showSpin)
            {
                box2.Add(spinButton);
                box2.SetChildPacking(spinButton, expand: false, fill: false, padding: 0, pack_type: Gtk.PackType.Start);
                box1.Add(box2);
            }

            // Container child box1.Gtk.Box+BoxChild
            this.combobox1      = new Gtk.ComboBoxText();
            this.combobox1.Name = "combobox1";
            this.box1.Add(this.combobox1);
            box1.SetChildPacking(this.combobox1, false, false, 0, Gtk.PackType.Start);

            this.spinButton.ValueChanged += new System.EventHandler(this.OnSpinButtonValueChanged);
            this.combobox1.Changed       += new System.EventHandler(this.OnCombobox1Changed);

            if (showHelp)
            {
                // When clicking the "help" button, create a popup with documentation for
                // possible values. (It checks for a "@values" field in the documentation.)
                Gtk.Button helpButton = new Gtk.Button("?");
                helpButton.CanFocus = false;
                helpButton.Clicked += delegate(object sender, EventArgs e) {
                    if (DefaultDocumentation == null)
                    {
                        return;
                    }

                    DocumentationDialog d = new DocumentationDialog(DefaultDocumentation);
                    d.Run();
                    d.Dispose();
                };

                box2.PackStart(helpButton, false, false, 0);
            }

            Gtk.Frame frame = new Gtk.Frame();
            frame.Add(box1);
            this.Add(frame);
        }
Esempio n. 2
0
            private void Reparent (Widget widget, HBox box, int index)
            {
                if (widget.Parent == box) {
                    return;
                }

                if (widget.Parent == null) {
                    box.PackStart (widget, false, false, 0);
                } else {
                    widget.Reparent (box);
                    box.SetChildPacking (widget, false, false, 0, PackType.Start);
                }

                box.ReorderChild (widget, index);
                widget.Show ();
            }
Esempio n. 3
0
 Gtk.Label addtabwithicon(string filename,string label,Gtk.Widget contents)
 {
     Gtk.Image image=new Gtk.Image(MainClass.GetResource(""+filename));
     image.SetSizeRequest(16,16);
     Gtk.Label lable=new Gtk.Label(label);
     Gtk.HBox box=new Gtk.HBox();
     box.PackStart(image);
     box.PackStart(lable);
     box.SetChildPacking(image,false,false,0,PackType.Start);
     box.ShowAll();
     notebook1.InsertPage(contents,box,-1);
     notebook1.ShowAll();
     return lable;
 }
    void makeimwindow(string name,ChatConsole cs,bool group,UUID target)
    {
        Gtk.Image image=new Gtk.Image(MainClass.GetResource("closebox.png"));
        image.HeightRequest=16;
        image.WidthRequest=16;

        Gtk.Image icon;

        if(group)
            icon=new Gtk.Image(MainClass.GetResource("icon_group.png"));
        else
            icon=new Gtk.Image(MainClass.GetResource("icn_voice-groupfocus.png"));

        image.SetSizeRequest(16,16);
        Gtk.Label lable=new Gtk.Label(name);
        Gtk.Button button=new Gtk.Button(image);
        button.SetSizeRequest(16,16);
        Gtk.HBox box=new Gtk.HBox();
        box.PackStart(icon);
        box.PackStart(lable);
        box.PackStart(button);
        box.SetChildPacking(image,false,false,0,PackType.Start);

        box.ShowAll();
        notebook.InsertPage(cs,box,-1);
        notebook.ShowAll();
        cs.tabLabel=lable;
        AsyncNameUpdate ud;

        if(target!=UUID.Zero)
        {
            if(group)
                ud=new AsyncNameUpdate(target,true);
            else
                ud=new AsyncNameUpdate(target,false);

            ud.onNameCallBack += delegate(string namex,object [] values){cs.tabLabel.Text=namex;};
            ud.go();
        }

        button.Clicked += new EventHandler(cs.clickclosed);
        this.notebook.SwitchPage += new SwitchPageHandler(cs.onSwitchPage);
    }
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        trayIcon = new StatusIcon(MainClass.GetResource("omvviewer-light.xpm"));
        trayIcon.Visible=true;
        trayIcon.Tooltip="Disconnected";
        trayIcon.Activate+= delegate{
            Visible=!Visible;
            this.Deiconify();
        };
        trayIcon.Activate += delegate { trayIcon.Blinking = false; this.UrgencyHint = false; };

        trayIcon.PopupMenu += delegate {
            Gtk.Menu menu = new Gtk.Menu();
                Gtk.ImageMenuItem menu_hide = new ImageMenuItem("Minimse");
              Gtk.ImageMenuItem menu_restore = new ImageMenuItem("Restore");
            AccelGroup ag=new AccelGroup();
              Gtk.ImageMenuItem menu_quit = new ImageMenuItem("gtk-quit",ag);

              menu_quit.ButtonPressEvent += new ButtonPressEventHandler(menu_quit_fn);
              menu_restore.ButtonPressEvent  += new ButtonPressEventHandler(menu_restore_fn);
              menu_hide.ButtonPressEvent  += new ButtonPressEventHandler(menu_hide_fn);
              if(MainClass.win.Visible)
                  menu.Append(menu_hide);
              else
                menu.Append(menu_restore);
              menu.Append(menu_quit);
              menu.ShowAll();
              menu.Popup();
        };

        this.Icon=MainClass.GetResource("omvviewer-light.xpm");
        status_location=new Gtk.Label("Location: Unknown (0,0,0)");

        appearancesetting.Set();

        status_balance=new Gtk.HBox();
        status_balance_lable=new Gtk.Label("?");
        Gtk.Image balicon=new Gtk.Image();
        balicon.Pixbuf = MainClass.GetResource("status_money.png");
        status_balance.PackStart(balicon);
        status_balance.PackStart(status_balance_lable);
        status_balance.SetChildPacking(balicon,false,false,0,PackType.Start);
        status_balance.SetChildPacking(status_balance_lable,false,false,0,PackType.Start);

        status_parcel=new Gtk.Label("Parcel: Unknown");

        this.statusbar1.PackStart(status_location);
        this.statusbar1.PackStart(status_parcel);
        this.statusbar1.PackStart(status_balance);

        this.Title="omvviewer light v0.48.1";

           chat=new ChatLayout();
           chat_tab_lable=this.addtabwithicon("icn_voice-pvtfocus.png","Chat",chat);
           chat.passontablable(chat_tab_lable);
           this.notebook.SwitchPage += new SwitchPageHandler(chat.onSwitchPage);

            this.LocationAction.Active = MainClass.appsettings.tab_location;

            this.SearchAction.Active = MainClass.appsettings.tab_search;

            this.GroupsAction.Active = MainClass.appsettings.tab_groups;

            this.InventoryAction.Active = MainClass.appsettings.tab_inv;

            this.ObjectsAction.Active = MainClass.appsettings.tab_objects;

            this.ParcelAction.Active = MainClass.appsettings.tab_parcel;

        this.statusbar1.ShowAll();

        MainClass.onRegister += new MainClass.register(MainClass_onRegister);
        MainClass.onDeregister += new MainClass.deregister(MainClass_onDeregister);
        if(MainClass.client != null ) { MainClass_onRegister(); }

        //this.menubar1.get

        this.AvaiableAction.Activate();
        this.StandingAction.Activate();

        this.AvaiableAction.Sensitive=false;
        this.AwayAction.Sensitive=false;
        this.BusyAction.Sensitive=false;
        this.StandingAction.Sensitive=false;
        this.CrouchAction.Sensitive=false;
        this.FlyAction.Sensitive=false;
        this.GroundSitAction.Sensitive=false;
        this.SittingAction.Sensitive=false;

        this.WindowStateEvent += delegate { if (this.Visible) { trayIcon.Blinking = false; this.UrgencyHint = false; };};

        this.DeleteEvent += new DeleteEventHandler(MainWindow_DeleteEvent);

        GLib.Timeout.Add(1000,OnUpdateStatus);

        tooltips1 = new Tooltips();
        this.statusbar1.Push(1, "Logged out");
    }
    void doicons(Parcel parcel)
    {
        if(status_icons!=null)
            status_icons.Destroy();

        status_icons=new Gtk.HBox();
        this.statusbar1.PackStart(status_icons);
        if((parcel.Flags & OpenMetaverse.ParcelFlags.AllowFly) != OpenMetaverse.ParcelFlags.AllowFly )
        {
            Gtk.Image myimage=new Gtk.Image(MainClass.GetResource("status_no_fly.png"));
            status_icons.PackStart(myimage);
            status_icons.SetChildPacking(myimage,false,false,0,PackType.Start);
        }
        if((parcel.Flags & OpenMetaverse.ParcelFlags.RestrictPushObject)==OpenMetaverse.ParcelFlags.RestrictPushObject)
        {
            Gtk.Image myimage=new Gtk.Image(MainClass.GetResource("status_no_push.png"));
            status_icons.PackStart(myimage);
            status_icons.SetChildPacking(myimage,false,false,0,PackType.Start);

        }

        if((parcel.Flags & OpenMetaverse.ParcelFlags.AllowOtherScripts)!=OpenMetaverse.ParcelFlags.AllowOtherScripts)
        {
            Gtk.Image myimage=new Gtk.Image(MainClass.GetResource("status_no_scripts.png"));
            status_icons.PackStart(myimage);
            status_icons.SetChildPacking(myimage,false,false,0,PackType.Start);

        }

        if((parcel.Flags & OpenMetaverse.ParcelFlags.CreateObjects)!=OpenMetaverse.ParcelFlags.CreateObjects)
        {
            Gtk.Image myimage=new Gtk.Image(MainClass.GetResource("status_no_build.png"));
            status_icons.PackStart(myimage);
            status_icons.SetChildPacking(myimage,false,false,0,PackType.Start);

        }

        status_icons.ShowAll();
    }