Esempio n. 1
0
        private void AddDocContents()
        {
            _tasksQueueManager = new TasksQueueManager();

            var theme = new VS2012LightTheme();

            this.dockPanel.Theme         = theme;
            this.dockPanel.DocumentStyle = DocumentStyle.DockingSdi;

            _queueUserControl = new QueueUserControl(_tasksQueueManager.TasksQueue);
            _queueUserControl.Show(this.dockPanel, DockState.DockRight);

            _logUserControl = new LogUserControl();
            _logUserControl.Show(this.dockPanel, DockState.DockBottom);

            _filtersUserControl = new FiltersUserControl();
            _filtersUserControl.Show(this.dockPanel, DockState.DockLeft);
            _filtersUserControl.OnFilterChanged += FiltersUserControlOnOnFilterChanged;

            _mainUserControl       = new MainUserControl();
            _mainUserControl.Tasks = _tasksQueueManager.TasksQueue;
            _mainUserControl.Show(this.dockPanel, DockState.Document);
            _mainUserControl.OnSynchRebinded += _mainUserControl_OnSynchRebinded;
        }
Esempio n. 2
0
        private void InitializeInterfaceComonents()
        {
            #region Menu Items

            MenuItemUserControl CreateMenuItem(ContentItemEnum itemButtonEnum, Image menuItemImage, string itemButtonText)
            {
                return(new MenuItemUserControl(itemButtonEnum, OnMenuItemButton_Click, menuItemImage, itemButtonText)
                {
                    Size = new Size(280, 50)
                });
            }

            //Image image = global::FinAndTime.Views.Properties.Resources.summary_icon;
            menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.Summary, Properties.Resources.summary_icon, "Dashboard"));
            menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.Passbook, Properties.Resources.Passbook_icon, "Passbook"));
            menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.TransactionParty, Properties.Resources.Transaction_party_icon, "Transaction Party"));
            menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.Transaction, Properties.Resources.Transaction_icon, "Transactions"));
            menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.Task, Properties.Resources.Tasks_icon, "Tasks"));

            #endregion

            #region Content section

            _summaryUserControl = new DashboardUserControl()
            {
                Dock    = DockStyle.Fill,
                Visible = true,
                Padding = new Padding(0),
                Margin  = new Padding(0)
            };

            _passbookUserControl = new PassbookUserControl()
            {
                Dock    = DockStyle.Fill,
                Visible = true,
                Padding = new Padding(0),
                Margin  = new Padding(0)
            };

            _transactionPartyUserControl = new TransactionPartyUserControl()
            {
                Dock    = DockStyle.Fill,
                Visible = true,
                Padding = new Padding(0),
                Margin  = new Padding(0)
            };

            _transactionUserControl = new TransactionUserControl(OnMenuItemButton_Click)
            {
                Dock    = DockStyle.Fill,
                Visible = true,
                Padding = new Padding(0),
                Margin  = new Padding(0)
            };

            _taskUserControl = new TaskUserControl()
            {
                Dock    = DockStyle.Fill,
                Visible = true,
                Padding = new Padding(0),
                Margin  = new Padding(0)
            };

            _logUserControl = new LogUserControl()
            {
                Dock    = DockStyle.Fill,
                Visible = true,
                Padding = new Padding(0),
                Margin  = new Padding(0)
            };

            _selectedContentItemEnum = ContentItemEnum.Summary;
            mainContentPanel.Controls.Add(_summaryUserControl);
            #endregion
        }
Esempio n. 3
0
        public GameForm()
        {
            this.Name = MyName;

            InitializeComponent();

            tblGameScreen      = new TableLayoutPanel();
            tblGameScreen.Size = new Size();

            var singleMsgConsole = new SingleMessageLogUserControl();
            var backpackControl  = new BackpackUserControl(tblGameScreen);
            var spellbookControl = new SpellbookUserControl(tblGameScreen);
            var mapViewControl   = new MapUserControl(this,
                                                      backpackControl,
                                                      spellbookControl,
                                                      singleMsgConsole);
            var characterSheet = new CharacterSheetUserControl();
            var logConsole     = new LogUserControl();

            var merchantControl = new MerchantUserControl(tblGameScreen);

            tblGameScreen.Dock = DockStyle.Fill;

            tblGameScreen.RowStyles.Clear();
            tblGameScreen.RowStyles.Add(new RowStyle(SizeType.Percent, 0.75F));
            tblGameScreen.RowStyles.Add(new RowStyle(SizeType.Absolute, 30.0f));
            tblGameScreen.RowStyles.Add(new RowStyle(SizeType.Percent, 0.25F));
            tblGameScreen.BackColor   = Color.Beige;
            tblGameScreen.MinimumSize = new Size();

            var tblMapAndSheet = new TableLayoutPanel();

            tblMapAndSheet.Size = new Size();
            tblMapAndSheet.ColumnStyles.Clear();
            tblMapAndSheet.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.40F));
            tblMapAndSheet.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.60F));
            tblMapAndSheet.BackColor   = Color.Beige;
            tblMapAndSheet.Margin      = new Padding(0);
            tblMapAndSheet.MinimumSize = new Size();

            tblMapAndSheet.Controls.Add(mapViewControl, 0, 0);
            mapViewControl.Dock = DockStyle.Fill;
            tblMapAndSheet.Controls.Add(characterSheet, 1, 0);
            characterSheet.Dock = DockStyle.Fill;
            //var cellPos = tblMapAndSheet.GetCellPosition(mapViewControl);
            //int width = tblMapAndSheet.GetColumnWidths()[cellPos.Column];
            //mapViewControl.Size = new Size(20, 20);

            tblGameScreen.Controls.Add(tblMapAndSheet, 0, 0);
            tblMapAndSheet.Dock = DockStyle.Fill;

            tblGameScreen.Controls.Add(singleMsgConsole, 0, 1);
            singleMsgConsole.Dock = DockStyle.Fill;

            tblGameScreen.Controls.Add(logConsole, 0, 2);
            logConsole.Dock = DockStyle.Fill;

            backpackControl.Hide();
            spellbookControl.Hide();
            merchantControl.Hide();

            this.Controls.Add(tblGameScreen);
            this.Controls.Add(backpackControl);
            this.Controls.Add(spellbookControl);
            this.Controls.Add(merchantControl);

            this.Text = GameName;

            mainMenuViewer = new MenuUserControl();
            this.Controls.Add(mainMenuViewer);

            this.Size = InitSize;

            Game.Current.Init(pgController: mapViewControl,
                              aiController: mapViewControl,
                              merchantController: merchantControl,
                              mapViewer: mapViewControl,
                              singleMsgListener: singleMsgConsole,
                              animationViewer: mapViewControl,
                              pgViewers: new List <IPgViewer>()
            {
                mapViewControl
            },
                              atomListeners: new List <IAtomListener> {
                logConsole
            },
                              sheetViews: new List <ISheetViewer> {
                characterSheet
            },
                              backpackViewers: new List <IBackpackViewer> {
                backpackControl
            },
                              spellbookViewers: new List <ISpellbookViewer> {
                spellbookControl
            },
                              secondarySpellsViewers: new List <IAtomListener> {
                singleMsgConsole
            },
                              merchantViewers: new List <IMerchantViewer> {
                merchantControl
            },
                              mainMenuViewer: mainMenuViewer,
                              mainMenuController: mainMenuViewer);
        }