Esempio n. 1
0
        public MainForm()
        {
            InitializeComponent();
            string dbPath = RegistrySettings.GetLatestOpenedDatabase();

            currentSortType = RegistrySettings.GetSortType();
            UpdateSortTypeButtons();

            currentRateType = RegistrySettings.GetGameType();
            UpdateRateTypeButtons();

            showInactivePlayers = RegistrySettings.GetShowInactivePlayersOption();
            UpdateShowInactivePlayersMenuItem();

            playersListRight.Dock = DockStyle.Fill;
            playersListRight.OnItemDoubleClick += new PlayersList.MouseDoubleClickEvent(this.OnPlayerDoubleClick);
            playersListRight.OnItemMouseRightClick += new PlayersList.MouseRightClickEvent(this.OnPlayerMouseRightClick);
            playersListRight.OnColumnHeaderClick += new PlayersList.ColumnHeadertClickEvent(this.OnSortTypeChange);

            playersListLeft.Dock  = DockStyle.Fill;
            playersListLeft.OnItemDoubleClick += new PlayersList.MouseDoubleClickEvent(this.OnPlayerDoubleClick);
            playersListLeft.OnItemMouseRightClick += new PlayersList.MouseRightClickEvent(this.OnPlayerMouseRightClick);
            playersListLeft.OnColumnHeaderClick += new PlayersList.ColumnHeadertClickEvent(this.OnSortTypeChange);

            this.splitContainer.Panel1.Controls.Add(playersListLeft);
            this.splitContainer.Panel2.Controls.Add(playersListRight);

            printPageSettings = RegistrySettings.GetPageSettings();

            if(dbPath != null && dbPath.Length != 0)
            {
                InitListView(dbPath);
            }
        }
Esempio n. 2
0
        public static PrintPageSettings GetPageSettings()
        {
            PrintPageSettings ps = new PrintPageSettings();
            ps.Font = GetFont();
            ps.HeaderFont = GetHeaderFont();
            int [] margins = GetPageMargins();
            ps.TopMargin = margins[0];
            ps.BottomMargin = margins[1];
            ps.LeftMargin = margins[2];
            ps.RightMargin = margins[3];
            ps.HeaderMargin = margins[4];
            ps.NameBoxWidth = margins[5];

            return ps;
        }
Esempio n. 3
0
        public PrintPageSetupDialog(PrintPageSettings ps, List<Player> pl)
        {
            InitializeComponent();

            players = pl;

            pageSettings = ps;

            SetFontText(pageSettings.Font);
            SetHeaderFontText(pageSettings.HeaderFont);
            numericTopMargin.Value = ps.TopMargin;
            numericBottomMargin.Value = ps.BottomMargin;
            numericLeftMargin.Value = ps.LeftMargin;
            numericRightMargin.Value = ps.RightMargin;
            numericHeaderMargin.Value = ps.HeaderMargin;
            numericNameBox.Value = ps.NameBoxWidth;
        }
Esempio n. 4
0
        public ListPrinter(PrintPageSettings ps, PrintPreviewControl pc = null)
        {
            pageSettings = ps;
            printFont = ps.Font;
            headerFont = ps.HeaderFont;
            nameBoxWidth = ps.NameBoxWidth;
            Margins margins = new Margins
            {
                Left = ps.LeftMargin,
                Right = ps.RightMargin,
                Top = ps.TopMargin,
                Bottom = ps.BottomMargin
            };

            doc.DefaultPageSettings.Margins = margins;
            doc.PrintPage += new PrintPageEventHandler(doc_PrintPage);

            previewControl = pc;
        }
Esempio n. 5
0
 public static void SetPageSettings(PrintPageSettings ps)
 {
     SetFont(ps.Font);
     SetHeaderFont(ps.HeaderFont);
     SetMargins(new int[]
                 {
                     ps.TopMargin,
                     ps.BottomMargin,
                     ps.LeftMargin,
                     ps.RightMargin,
                     ps.HeaderMargin,
                     ps.NameBoxWidth
                 }
               );
 }