Exemplo n.º 1
0
        /// <summary>
        /// Public constructor
        /// </summary>
        public LayoutsPanel()
        {
            InitializeComponent();

            // Set the ListView to double-buffer
            m_list.SetDoubleBuffered(true);

            // Toolbar icons
            var image_size = SystemInformation.SmallIconSize.Width;

            m_button_new.Image        = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.New.ico", image_size);
            m_button_copy.Image       = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Copy.ico", image_size);
            m_button_delete.Image     = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Delete.ico", image_size);
            m_button_properties.Image = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Props.ico", image_size);
            m_button_help.Image       = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Help.ico", image_size);

            // ListView image
            var image      = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Panel.ico", image_size);
            var image_list = new ImageList {
                ImageSize = new Size(image_size, image_size)
            };

            image_list.Images.Add(image);
            m_list.SmallImageList = image_list;

            // ListView item sorter
            m_item_sorter             = new ListViewItemSorter();
            m_list.ListViewItemSorter = m_item_sorter;

            // Regular and bold ListView font
            m_font_regular = new Font(m_list.Font, FontStyle.Regular);
            m_font_bold    = new Font(m_list.Font, FontStyle.Bold);

            // Sneaky way to add a cue banner to the text box
            SendMessage(m_text.Handle, EM_SETCUEBANNER, 1, "Search");

            // Fill the ListView
            FillListView();

            // Enable the toolbar buttons
            SetButtonsEnabled(0);

            // Hook some Rhino events
            HookRhinoEvents();
        }
Exemplo n.º 2
0
        public LayoutsPanel()
        {
            InitializeComponent();

            var icon_size = SystemInformation.SmallIconSize.Width;

            m_btn_new.Image    = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.New.ico", 24);
            m_btn_copy.Image   = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Copy.ico", 24);
            m_btn_delete.Image = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Delete.ico", 24);
            m_btn_props.Image  = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Props.ico", 24);
            m_btn_up.Image     = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Up.ico", 24);
            m_btn_down.Image   = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Down.ico", 24);

            RhinoDoc.EndOpenDocument += OnEndOpenDocument;
            RhinoView.Create         += OnCreateViewEventHandler;
            RhinoView.Rename         += OnRenameViewEventHandler;
            RhinoView.SetActive      += OnSetActiveViewEventHandler;
            RhinoView.Destroy        += OnDestroyViewEventHandler;

            m_tt_new.SetToolTip(m_btn_new, "New");
            m_tt_copy.SetToolTip(m_btn_copy, "Copy");
            m_tt_delete.SetToolTip(m_btn_delete, "Delete");
            m_tt_props.SetToolTip(m_btn_props, "Properties");
            m_tt_up.SetToolTip(m_btn_up, "Move Up");
            m_tt_down.SetToolTip(m_btn_down, "Move Down");

            var image     = DrawingUtilities.LoadBitmapWithScaleDown("RealDrawings.Resources.Panel.ico", 16);
            var imageList = new ImageList();

            imageList.Images.Add("main", image);
            m_list.SmallImageList = imageList;

            lvwColumnSorter           = new ListViewColumnSorter();
            m_list.ListViewItemSorter = lvwColumnSorter;

            FillList();
        }