Esempio n. 1
0
        public override void Update()
        {
            isHovered    = false;
            isPopupShown = false;

            if (binding == null)
            {
                return;
            }

            string dd = null;

            float buttonSizeX = Manager.NativeManager.GetTextLineHeightWithSpacing() * 2;

            if (Manager.NativeManager.Button(Resources.GetString("Load") + id1, buttonSizeX))
            {
                btn_load_Click();
            }

            Popup();

            if (dd == null)
            {
                dd = DragAndDrops.UpdateImageDst();
            }

            isHovered = isHovered || Manager.NativeManager.IsItemHovered();

            Manager.NativeManager.SameLine();

            Manager.NativeManager.Text(filePath);

            if (Manager.NativeManager.IsItemHovered())
            {
                Manager.NativeManager.SetTooltip(filePath);
            }

            if (dd == null)
            {
                dd = DragAndDrops.UpdateImageDst();
            }

            isHovered = isHovered || Manager.NativeManager.IsItemHovered();

            if (thumbnail != null)
            {
                if (Manager.NativeManager.Button(Resources.GetString("Delete") + id2, buttonSizeX))
                {
                    btn_delete_Click();
                }

                Popup();

                if (dd == null)
                {
                    dd = DragAndDrops.UpdateImageDst();
                }

                isHovered = isHovered || Manager.NativeManager.IsItemHovered();

                Manager.NativeManager.SameLine();

                Manager.NativeManager.Text(infoText);

                Popup();

                if (dd == null)
                {
                    dd = DragAndDrops.UpdateImageDst();
                }

                isHovered = isHovered || Manager.NativeManager.IsItemHovered();

                if (thumbnail != null)
                {
                    var   image      = thumbnail.Image;
                    float imageSizeX = image.GetWidth();
                    float imageSizeY = image.GetHeight();
                    if (imageSizeX < imageSizeY)
                    {
                        Manager.NativeManager.Image(image, 128 * imageSizeX / imageSizeY, 128);
                    }
                    else if (imageSizeX > imageSizeY)
                    {
                        Manager.NativeManager.Image(image, 128, 128 * imageSizeY / imageSizeX);
                    }
                    else
                    {
                        Manager.NativeManager.Image(image, 128, 128);
                    }

                    Popup();
                }

                if (dd == null)
                {
                    dd = DragAndDrops.UpdateImageDst();
                }

                isHovered = isHovered || Manager.NativeManager.IsItemHovered();
            }

            if (dd != null)
            {
                Dropped(dd);
            }
        }
Esempio n. 2
0
        public override void Update()
        {
            isHovered = false;

            if (binding == null)
            {
                return;
            }

            string dd = null;

            if (Manager.NativeManager.Button("読込"))
            {
                btn_load_Click();
            }

            if (dd == null)
            {
                dd = DragAndDrops.UpdateImageDst();
            }

            isHovered = isHovered || Manager.NativeManager.IsItemHovered();

            Manager.NativeManager.SameLine();

            Manager.NativeManager.Text(filePath);

            if (dd == null)
            {
                dd = DragAndDrops.UpdateImageDst();
            }

            isHovered = isHovered || Manager.NativeManager.IsItemHovered();

            if (Manager.NativeManager.Button("解除"))
            {
                btn_delete_Click();
            }

            if (dd == null)
            {
                dd = DragAndDrops.UpdateImageDst();
            }

            isHovered = isHovered || Manager.NativeManager.IsItemHovered();

            Manager.NativeManager.SameLine();

            Manager.NativeManager.Text(infoText);

            if (dd == null)
            {
                dd = DragAndDrops.UpdateImageDst();
            }

            isHovered = isHovered || Manager.NativeManager.IsItemHovered();

            if (image != null)
            {
                Manager.NativeManager.Image(image, 128, 128);

                if (dd == null)
                {
                    dd = DragAndDrops.UpdateImageDst();
                }

                isHovered = isHovered || Manager.NativeManager.IsItemHovered();
            }

            if (dd != null)
            {
                Dropped(dd);
            }
        }