Example #1
0
        private ChatsPage()
        {
            base.FocusGrabbed += base_FocusGrabbed;

            closePixbuf = new Gdk.Pixbuf(null, "FileFind.Meshwork.GtkClient.smallclose.png");

            tabLabelPages = new Dictionary <Widget, ChatSubpageBase>();

            notebook                = new Notebook();
            notebook.TabPos         = PositionType.Bottom;
            notebook.SwitchPage    += notebook_SwitchPage;
            notebook.PageReordered += notebook_PageReordered;

            ScrolledWindow swindow = new ScrolledWindow();

            swindow.HscrollbarPolicy = PolicyType.Automatic;
            swindow.VscrollbarPolicy = PolicyType.Automatic;
            chatList = new TreeView();
            swindow.Add(chatList);

            chatTreeStore  = new NetworkGroupedTreeStore <ChatRoom>(chatList);
            chatList.Model = chatTreeStore;

            TreeViewColumn column;

            column        = chatList.AppendColumn("Room Name", new CellRendererText(), new TreeCellDataFunc(NameDataFunc));
            column.Expand = true;
            column.Sizing = TreeViewColumnSizing.Autosize;

            var pixbufCell = new CellRendererPixbuf();

            column.PackStart(pixbufCell, false);
            column.SetCellDataFunc(pixbufCell, new TreeCellDataFunc(RoomSecureDataFunc));

            column        = chatList.AppendColumn("Users", new CellRendererText(), new TreeCellDataFunc(RoomUsersDataFunc));
            column.Sizing = TreeViewColumnSizing.Autosize;

            chatList.RowActivated     += chatList_RowActivated;
            chatList.ButtonPressEvent += chatList_ButtonPressEvent;

            EventBox box = new EventBox();

            box.Add(new Label("Chatroom List"));
            box.ButtonPressEvent += HandleTabButtonPressEvent;
            box.ShowAll();
            notebook.AppendPage(swindow, box);

            this.PackStart(notebook, true, true, 0);
            notebook.ShowAll();

            foreach (Network network in Core.Networks)
            {
                Core_NetworkAdded(network);
            }

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                    );
        }
Example #2
0
        private MemosPage()
        {
            ScrolledWindow swindow = new ScrolledWindow();

            memoList = new TreeView();
            swindow.Add(memoList);

            memoTreeStore  = new NetworkGroupedTreeStore <Memo>(memoList);
            memoList.Model = memoTreeStore;

            TreeViewColumn column;

            column = memoList.AppendColumn("Subject",
                                           new CellRendererText(),
                                           new TreeCellDataFunc(MemoSubjectDataFunc));
            column.Expand    = true;
            column.Resizable = true;

            column = memoList.AppendColumn(String.Empty,
                                           new CellRendererPixbuf(),
                                           new TreeCellDataFunc(MemoAttachmentFunc));
            column.Widget = new Gtk.Image(new Gdk.Pixbuf(null, "FileFind.Meshwork.GtkClient.attachment-col-small.png"));
            column.Widget.Show();

            column = memoList.AppendColumn("Posted By",
                                           new CellRendererText(),
                                           new TreeCellDataFunc(MemoByDataFunc));

            column.Resizable = true;

            column = memoList.AppendColumn("Date",
                                           new CellRendererText(),
                                           new TreeCellDataFunc(MemoDateDataFunc));

            column.Resizable = true;

            memoList.RowActivated     += memoList_RowActivated;
            memoList.ButtonPressEvent += memoList_ButtonPressEvent;

            this.PackStart(swindow, true, true, 0);
            swindow.ShowAll();

            foreach (Network network in Core.Networks)
            {
                Core_NetworkAdded(network);
            }

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                    );
        }