コード例 #1
0
        public NavigateBarCollapsibleScreen(NavigateBar tNavigateBar)
        {
            navigateBar = tNavigateBar;

            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);

            // Get positon on desktop screen
            Point p = new Point(navigateBar.Location.X + Width, navigateBar.Location.Y);
            this.DesktopLocation = this.PointToScreen(p);

            // Caption info
            caption = new NavigateBarCaption(navigateBar);
            caption.Height = 20;
            caption.CollapseButton.Visible = false;

            //

            Controls.Add(caption);
            Controls.Add(panelControl);

            //
        }
コード例 #2
0
        public NavigateBarRemoteControl(NavigateBar tNavigatebar)
        {
            InitializeComponent();

            navigateBar = tNavigatebar;

            // Combo Theme

            cboTheme.Items.Add("System Colors");
            cboTheme.Items.Add("Office 2003 Style Blue");
            cboTheme.Items.Add("Office 2003 Style Silver");
            cboTheme.Items.Add("Office 2003 Style Olive");
            cboTheme.Items.Add("Office 2007 Style Blue");
            cboTheme.Items.Add("Office 2007 Style Black");
            cboTheme.Items.Add("Office 2007 Style Silver");

            // Combo Select Button

            foreach (NavigateBarButton nvb in navigateBar.NavigateBarButtons)
                cboSelect.Items.Add(nvb.ToString());

            // Property Grid
            colorTable = navigateBar.NavigateBarColorTable;
            pgColorTable.SelectedObject = colorTable;
        }
コード例 #3
0
        public NavigateBarOptions(NavigateBar tNavigateBar)
        {
            navigateBar = tNavigateBar;

            InitializeComponent();
            InitNavigateBarOptions();
        }
コード例 #4
0
        public NhapThongTinBenhNhan(NavigateBar tNavigatebar)
        {
            InitializeComponent();

            navigateBar = tNavigatebar;

            // Property Grid
            colorTable = navigateBar.NavigateBarColorTable;
        }
コード例 #5
0
        public NavigateBarSplitter(NavigateBar tNavigateBar)
        {
            navigateBar = tNavigateBar;
            this.Height = 6;
            this.Width = 120;
            this.Cursor = Cursors.SizeNS;

            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
        }
コード例 #6
0
        public NavigateBarCollapseButton(NavigateBar tNavigateBar)
        {
            this.Size = new Size(14, 14);
            this.BackColor = Color.Transparent;
            this.Cursor = Cursors.Hand;

            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            navigateBar = tNavigateBar;
        }
コード例 #7
0
        public NavigateBarCollapsibleText(NavigateBar tNavigateBar)
        {
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);

            navigateBar = tNavigateBar;

            this.Cursor = Cursors.Hand;
            this.TabStop = true;

            captionBand = new NavigateBarCaption(navigateBar);
            captionBand.CollapseMode = false;
            captionBand.Cursor = Cursors.Default;
            captionBand.CollapseButton.ToolTipText = Properties.Resources.TEXT_COLLAPSE_BUTTON_EXPAND;

            this.Controls.Add(captionBand);
        }
コード例 #8
0
        public NavigateBarCaption(NavigateBar tNavigateBar)
        {
            navigateBar = tNavigateBar;
            // Control
            this.Height = 24;
            this.Dock = DockStyle.Top;

            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);

            // Collapse Button
            collapseButton = new NavigateBarCollapseButton(navigateBar);
            this.CollapseMode = true;
            SetNewPositionForCollapseButton();
            collapseButton.Top = (this.Height - collapseButton.Size.Height) / 2;
            collapseButton.MouseClick += new MouseEventHandler(CollapseButton_MouseClick);

            //
            this.Controls.Add(collapseButton);
        }
コード例 #9
0
 public NavigateBarButtonCollection(NavigateBar tNavigateBar)
 {
     this.NavigationPane = tNavigateBar;
 }
コード例 #10
0
 public NavigateBarSettings(NavigateBar tNavigateBar)
 {
     navigateBar = tNavigateBar;
 }
コード例 #11
0
        public void InitNavigateBar()
        {
            // For automatically save (Save %APPDATA%<exe filename> folder )
            //outlookNavigatePane = new NavigateBar();
            //outlookNavigatePane.SaveAndRestoreSettings = true;

            // For custom save
            outlookNavigatePane = new NavigateBar(Environment.CurrentDirectory + @"\NavigateBarSettings.xml");
            outlookNavigatePane.Dock = DockStyle.Left;
            outlookNavigatePane.IsShowCollapsibleScreen = true;
            outlookNavigatePane.CollapsedScreenWidth = 150; // For all buttons // Optional
            outlookNavigatePane.CollapsibleWidth = 32;
            outlookNavigatePane.OnNavigateBarDisplayedButtonCountChanged += new NavigateBar.OnNavigateBarDisplayedButtonCountChangedEventHandler(NavigationPane_OnNavigateBarDisplayedButtonCountChanged);
            outlookNavigatePane.OnNavigateBarButtonSelected += new NavigateBar.OnNavigateBarButtonEventHandler(outlookNavigatePane_OnNavigateBarButtonSelected);
            outlookNavigatePane.OnNavigateBarButtonSelecting += new NavigateBar.OnNavigateBarButtonSelectingEventHandler(outlookNavigatePane_OnNavigateBarButtonSelecting);

            outlookNavigatePane.OnNavigateBarColorChanged += new EventHandler(outlookNavigatePane_OnNavigateBarColorChanged);
            outlookNavigatePane.HandleCreated += new EventHandler(outlookNavigatePane_HandleCreated);
            outlookNavigatePane.RightToLeftChanged += new EventHandler(outlookNavigatePane_RightToLeftChanged);
            outlookNavigatePane.Width = 150;

            #region Optional features
            //outlookNavigatePane.RelatedControl = new MailTree(); // If Button.RelatedControl is empty then display this control
            //outlookNavigatePane.NavigateBarDisplayedButtonCount = 5; // Max display 5 button in panel
            //outlookNavigatePane.AlwaysUseSystemColors = true;
            #endregion

            #region NavigateBar Buttons

            nvbMail = new NavigateBarButton();
            nvbMail.RelatedControl = new MailTree();
            nvbMail.Caption = "Mail";
            nvbMail.CaptionDescription = "Mail Folders";
            nvbMail.Image = Properties.Resources.Mail24;
            nvbMail.Enabled = true;
            nvbMail.Key = "MAIL";
            nvbMail.IsShowCaptionImage = false;
            nvbMail.OnNavigateBarButtonSelected += new NavigateBarButton.OnNavigateBarButtonSelectedEventHandler(nvbMail_OnNavigateBarButtonSelected);

            Calendar clndr = new Calendar();
            clndr.BackColor = Color.Red;
            nvbCalendar = new NavigateBarButton(clndr);
            nvbCalendar.Caption = "Calendar";
            nvbCalendar.IsShowCaption = true;
            nvbCalendar.IsShowCaptionDescription = false;
            nvbCalendar.Image = Properties.Resources.Calendar24;
            //nvbCalendar.Font = new Font("Tahoma", 12, FontStyle.Italic | FontStyle.Bold);
            nvbCalendar.ForeColor = Color.Red; // move on ColorTable
            nvbCalendar.Key = "CALENDAR";
            nvbCalendar.IsShowCaptionImage = false;
            nvbCalendar.CollapsedScreenWidth = 195;
            nvbCalendar.IsShowCollapseScreenCaption = false; // Hide collapse screen caption band

            DataGridView dgv = new DataGridView();

            nvbContacts = new NavigateBarButton();
            nvbContacts.Caption = "Contacts";
            nvbContacts.CaptionDescription = "My Friends";
            nvbContacts.Image = Properties.Resources.Contacts24;
            nvbContacts.RelatedControl = dgv;
            nvbContacts.IsShowCaption = false;
            nvbContacts.IsShowCaptionDescription = true;
            nvbContacts.Key = "CONTACTS";
            nvbContacts.IsAlwaysDisplayed = true; // Always show in panel
            nvbContacts.CollapsedScreenWidth = 240; // For Contacts button

            nvbTasks = new NavigateBarButton(new RichTextBox());
            nvbTasks.Caption = "Tasks";
            nvbTasks.CaptionDescription = "My Tasks";
            nvbTasks.Image = Properties.Resources.Tasks24;
            nvbTasks.MouseOverImage = Properties.Resources.Contacts24;
            nvbTasks.SelectedImage = Properties.Resources.Mail24;
            nvbTasks.ToolTipText = "ToolTipText for tasks";
            //nvbTasks.Enabled = false;
            nvbTasks.IsShowCaption = false;
            nvbTasks.IsShowCaptionDescription = false;
            nvbTasks.Key = "TASKS";

            nvbNotes = new NavigateBarButton("Notes", Properties.Resources.Notes24);
            nvbNotes.Key = "NOTES";

            nvbFolderList = new NavigateBarButton("Folder List", Properties.Resources.FolderList24);
            nvbFolderList.Key = "FOLDERLIST";

            nvbShortCuts = new NavigateBarButton("Shortcuts", Properties.Resources.Shortcut24);
            nvbShortCuts.Key = "SHORTCUT";

            nvbDiary = new NavigateBarButton("Diary", Properties.Resources.Diary24);
            nvbDiary.Key = "DIARY";

            outlookNavigatePane.NavigateBarButtons.AddRange(new NavigateBarButton[] { nvbMail, nvbCalendar, nvbContacts });
            outlookNavigatePane.NavigateBarButtons.Add(nvbTasks);
            outlookNavigatePane.NavigateBarButtons.Add(nvbNotes);
            outlookNavigatePane.NavigateBarButtons.Add(nvbFolderList);
            outlookNavigatePane.NavigateBarButtons.Add(nvbShortCuts);
            outlookNavigatePane.NavigateBarButtons.Add(nvbDiary);
            #endregion

            #region Strips

            // ToolStrip
            toolStrip = new ToolStrip();
            toolStrip.RenderMode = ToolStripRenderMode.ManagerRenderMode;

            tbtnMDIChildForm = new ToolStripButton();
            tbtnMDIChildForm.Text = "MDI Child";
            tbtnMDIChildForm.Click += new EventHandler(tbtnMDIChildForm_Click);

            tbtnAbout = new ToolStripButton();
            tbtnAbout.Text = "About";
            tbtnAbout.Click += delegate(object sender, EventArgs e)
                {

                    Type typ = typeof(TestMainForm);

                    object[] r = typ.Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
                    AssemblyCopyrightAttribute ct = (AssemblyCopyrightAttribute)r[0];

                    object[] d = typ.Assembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
                    AssemblyDescriptionAttribute dt = (AssemblyDescriptionAttribute)d[0];

                    object[] v = typ.Assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false);
                    AssemblyFileVersionAttribute vt = (AssemblyFileVersionAttribute)v[0];

                    MessageBox.Show(ct.Copyright + "\n\n" + dt.Description + "\n\n" + "Version : " + vt.Version);

                };

            tbtnExit = new ToolStripButton();
            tbtnExit.Text = "Exit";
            tbtnExit.Click += delegate(object sender, EventArgs e)
            {
                this.Close();
            };

            toolStrip.Items.Add(tbtnMDIChildForm);
            toolStrip.Items.Add(new ToolStripSeparator());
            toolStrip.Items.Add(tbtnAbout);
            toolStrip.Items.Add(tbtnExit);

            // MenuStrip

            menuStrip = new MenuStrip();
            menuStrip.RenderMode = ToolStripRenderMode.ManagerRenderMode;
            menuStrip.Dock = DockStyle.Top;
            MainMenuStrip = menuStrip;

            // StatusStrip

            statusStrip = new StatusStrip();
            statusStrip.RenderMode = ToolStripRenderMode.ManagerRenderMode;

            #endregion

            // Splitter

            splitterNavigateMenu = new MTSplitter();
            splitterNavigateMenu.Size = new Size(7, 100);
            splitterNavigateMenu.SplitterPointCount = 10;
            splitterNavigateMenu.SplitterPaintAngle = 360F;

            splitterNavigateMenu.Dock = DockStyle.Left;

            // Navigatebar Remote Control

            nbRemoteControl = new NhapThongTinBenhNhan(outlookNavigatePane);
            nbRemoteControl.Dock = DockStyle.Fill;

            containerControlProp = new ContainerControl();
            containerControlProp.Width = nbRemoteControl.Width;

            containerControlProp.Controls.Add(nbRemoteControl);
            containerControlProp.Dock = DockStyle.Right;

            Controls.AddRange(new Control[] { splitterNavigateMenu, outlookNavigatePane, containerControlProp, toolStrip, statusStrip, menuStrip });
        }