예제 #1
0
        public KoolkLVItem createItem(Bitmap image, string name, bool viewName)
        {
            // This item is obfuscated and can not be translated.
            KoolkLVItem item = new KoolkLVItem {
                Dock = DockStyle.Bottom
            };

            if (image.Width > 100 || image.Height > 100)
            {
                image = (Bitmap)KoolkLVItem.ResizeImage(image, 100, 100);
            }
            item.Image    = image;
            item.viewName = viewName;
            item.Width    = image.Width + 8;
            if (viewName)
            {
                item.Height = image.Height + 20;
            }
            else
            {
                item.Height = image.Height + 8;
            }
            item.Name    = name;
            item.Field02 = false;
            base.Controls.Add(item);
            return(item);
        }
예제 #2
0
        public TileSetBrowser(ListBox target)
        {
            InitializeComponent();
            targetListBox             = target;
            styleManager.ManagerStyle = UserSettings.applicationStyle;
            List <string> sortedTileSets = new List <string>();

            foreach (DictionaryEntry tS in Program.InfoManager.TileSets)
            {
                sortedTileSets.Add((string)tS.Key);
            }
            sortedTileSets.Sort();
            foreach (string tS in sortedTileSets)
            {
                WzImage tSImage = Program.InfoManager.TileSets[tS];
                if (!tSImage.Parsed)
                {
                    tSImage.ParseImage();
                }
                IWzImageProperty enh0 = tSImage["enH0"];
                if (enh0 == null)
                {
                    continue;
                }
                WzCanvasProperty image = (WzCanvasProperty)enh0["0"];
                if (image == null)
                {
                    continue;
                }
                //image.PngProperty.GetPNG(true);
                KoolkLVItem item = koolkLVContainer.createItem(image.PngProperty.GetPNG(true), tS, true);
                item.MouseDown        += new MouseEventHandler(item_Click);
                item.MouseDoubleClick += new MouseEventHandler(item_DoubleClick);
            }
        }
예제 #3
0
 void item_Click(object sender, MouseEventArgs e)
 {
     if (selectedItem != null)
         selectedItem.Selected = false;
     selectedItem = (KoolkLVItem)sender;
     selectedItem.Selected = true;
 }
예제 #4
0
 void item_Click(object sender, MouseEventArgs e)
 {
     if (selectedItem != null)
     {
         selectedItem.Selected = false;
     }
     selectedItem          = (KoolkLVItem)sender;
     selectedItem.Selected = true;
 }
예제 #5
0
 public KoolkLVItem createItem(Bitmap image, string name, bool viewName)
 {
     // This item is obfuscated and can not be translated.
     KoolkLVItem item = new KoolkLVItem {
         Dock = DockStyle.Bottom
     };
     if (image.Width > 100 || image.Height > 100) 
         image = (Bitmap)KoolkLVItem.ResizeImage(image, 100, 100);
     item.Image = image;
     item.viewName = viewName;
     item.Width = image.Width + 8;
     if (viewName)
         item.Height = image.Height + 20;
     else
         item.Height = image.Height + 8;
     item.Name = name;
     item.Field02 = false;
     base.Controls.Add(item);
     return item;
 }