예제 #1
0
        /**
         *  Add in all needed components to our welcome window
         * */
        private void buildWindow()
        {
            //prevent resize on home screen
            this.Resizable = false;

            //create label and import button - put label in event box to allow setting of background
            EventBox labelContainer = new EventBox ();

            Label welcomeLabel = new Label (Constants.Constants.homeWindowWelcomeText);

            //set the style of the label
            Style labelStyle = welcomeLabel.Style.Copy();
            labelStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
            labelStyle.FontDescription.Size = Constants.Constants.WELCOME_MESSAGE_FONT_SIZE;
            welcomeLabel.Style = labelStyle.Copy();

            labelContainer.Add (welcomeLabel);
            labelContainer.WidthRequest = 100;

            importDataButton = new Button (Constants.Constants.homeWindowImportButtonText);
            importDataButton.Clicked += new EventHandler(OpenFileTree);

            //set the style of the button
            Style buttonStyle = importDataButton.Style.Copy ();
            buttonStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
            buttonStyle.FontDescription.Size = Constants.Constants.WELCOME_BUTTON_FONT_SIZE;
            importDataButton.Style = buttonStyle.Copy();

            welcomeLabel.SetSizeRequest (100, 100);
            importDataButton.SetSizeRequest (100, 100);

            //create container for import button
            HBox masterContainer = new HBox ();
            VBox homeWindowContainer = new VBox (false, 100);

            homeWindowContainer.PackStart (labelContainer, false, false, 50);
            homeWindowContainer.PackStart (importDataButton, false, false, 50);

            masterContainer.PackStart (homeWindowContainer, true, true, 100);

            //set size of containers
            masterContainer.SetSizeRequest (1000, 1000);
            this.SetSizeRequest (1000, 500);
            this.Add (masterContainer);
        }
예제 #2
0
        private void Build()
        {
            box = new HBox(false, 0);
            box.SetSizeRequest(40, 40);
            box.BorderWidth = 2;

            button          = new Button();
            button.Clicked += CyclePoint;

            lblpoints = new Label();
            Pango.FontDescription desc = Pango.FontDescription.FromString("Bebas Neue 14");
            lblpoints.ModifyFont(desc);
            lblpoints.Text = points[10];


            button.Add(lblpoints);
            button.ShowAll();

            box.Add(this.button);
            box.ShowAll();

            // This damn this call is anoyingly needed otherwise it shant build
            this.Add(box);
        }
예제 #3
0
    protected void Populate()
    {
        this.SetDefaultSize(1024,768);
        Window pingpong = new Window(Gtk.WindowType.Toplevel);
        pingpong.SetDefaultSize(500,50);
        pingpong.SetPosition(Gtk.WindowPosition.CenterOnParent);
        pingpong.Title = "Loading...";
        _pulseBar = new ProgressBar();
        pingpong.Add(_pulseBar);
        pingpong.ShowAll();
        pingpong.Show();

        while (_currentStrs == null)
        {
            Application.Invoke( delegate {
                _pulseBar.Pulse();
            });

            Thread.Sleep(100);
        }

        Application.Invoke( delegate {
            pingpong.Destroy();

            this.Remove(_vbox);
            _vbox = new VBox(false, 10);

            MenuBar bar = new MenuBar ();

            Menu fileMenu = new Menu ();
            MenuItem fileMenuItem = new MenuItem ("File");
            fileMenuItem.Submenu = fileMenu;

            MenuItem exit = new MenuItem ("Exit");
            exit.Activated += delegate(object sender, EventArgs e) {
                Application.Quit ();
            };

            MenuItem openFile = new MenuItem ("Open file...");

            openFile.Activated += OpenFile;

            fileMenu.Append (openFile);
            fileMenu.Append (exit);

            bar.Append (fileMenuItem);

            _vbox.PackStart(bar, false, false, 0);

            _regxTitle = ComboBox.NewText();
            _regxTitle.Changed += HandleChanged;

            foreach (KeyValuePair<string, string> pair in _regexes)
                _regxTitle.AppendText(pair.Key);

            _regx = new Entry();
            _regx.IsEditable = false;
            _regx.CanFocus = false;

            HBox comboRegexBox = new HBox(true, 10);
            comboRegexBox.SetSizeRequest(768, 50);

            comboRegexBox.PackStart(_regxTitle, false,false, 0);
            comboRegexBox.PackStart(_regx, true, true, 0);

            Button search = new Button("Search!");
            search.Clicked += HandleClicked;
            comboRegexBox.PackStart(search, false, false, 20);

            _vbox.PackStart(comboRegexBox, true, true, 10);
            ScrolledWindow sw = new ScrolledWindow();
            _tv = new TreeView();
            sw.Add(_tv);

            CellRendererText tsText  = new CellRendererText();
            TreeViewColumn match = new TreeViewColumn();
            match.Title = "Match";
            match.PackStart(tsText, true);
            match.AddAttribute(tsText, "text", 0);

            _tv.AppendColumn(match);

            TreeStore store = new TreeStore(typeof(string));

            foreach (string str in _currentStrs)
                store.AppendValues(str);

            _tv.Model = store;
            sw.SetSizeRequest(768,600);
            _vbox.PackStart(sw, false, false, 0);
            this.Add(_vbox);
            this.ShowAll();
        });
    }
예제 #4
0
    private void buildWindow()
    {
        //prevent resize on screen
        this.Resizable = false;

        //initialize the colors
        MakeColors ();

        //initialize styles
        makeLabelStyle ();

        masterContainer = new VBox ();
        masterContainer.SetSizeRequest (Constants.Constants.APPLICATION_WIDTH, Constants.Constants.APPLICATION_HEIGHT);

        buildMenu ();

        //add in the header
        mainContainer = new HBox ();
        mainContainer.SetSizeRequest (Constants.Constants.APPLICATION_WIDTH, Constants.Constants.APPLICATION_HEIGHT - 400);
        addHeader ();

        //add in the main data and side bar
        sidePanel = new VBox ();

        //add main and side panel to frame
        addMainPanel ();
        addSidePanel ();

        //create link panel
        addLinkPanel ();

        mainContainer.PackStart (graphFrame, false, false, 42);
        mainContainer.PackStart (midPanel, false, false, 42);
        mainContainer.PackStart (sidePanel, false, false, 42);

        masterContainer.PackStart (mainContainer, false, false, 50);
        this.Add (masterContainer);
    }
예제 #5
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();
    }