コード例 #1
0
        public void RecreateList(wx.WindowStyles flags, bool withText)
        {
            /* HMaH: This here replaces statement "delete m_listCtrl" in the original.
             * You have to call this in C# because deletion will be deferred by garbage
             * collection and the old control will still be active after recreation.
             * You should not dispose the old control because there might be some open
             * events generated by this control.
             */
            if (m_listCtrl != null)
            {
                m_listCtrl.Destroy();
            }

            m_listCtrl = new MyListCtrl(m_panel, (int)Cmd.LIST_CTRL,
                                        wxDefaultPosition, wxDefaultSize,
                                        flags |
                                        wx.WindowStyles.BORDER_SUNKEN | wx.WindowStyles.LC_EDIT_LABELS);

            switch (flags & wx.WindowStyles.LC_MASK_TYPE)
            {
            case wx.WindowStyles.LC_LIST:
                InitWithListItems();
                break;

            case wx.WindowStyles.LC_ICON:
                InitWithIconItems(withText);
                break;

            case wx.WindowStyles.LC_SMALL_ICON:
                InitWithIconItems(withText, true);
                break;

            case wx.WindowStyles.LC_REPORT:
                if ((flags & wx.WindowStyles.LC_VIRTUAL) > 0)
                {
                    InitWithVirtualItems();
                }
                else
                {
                    InitWithReportItems();
                }
                break;

            default:
                Console.WriteLine("unknown listctrl mode");
                break;
            }

            DoSize();

            m_logWindow.Clear();
        }
コード例 #2
0
        //---------------------------------------------------------------------

        public void RecreateList(wx.WindowStyles flags)
        {
            RecreateList(flags, true);
        }