picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.62k stars 329 forks source link

Eto Viewer does not display window menu and titlebar #1407

Open Shadowblitz16 opened 5 years ago

Shadowblitz16 commented 5 years ago

Expected Behavior

The eto viewer should show the menu bar and the window frame

Actual Behavior

The eto viewer just shows what's in the panel or in this case the items property

Steps to Reproduce the Problem

  1. Create new eto app
  2. Click on the project without .Desktop at the end
  3. Click on the MainForm.eto.cs

Code that Demonstrates the Problem

using System;
using Eto.Forms;
using Eto.Drawing;

namespace EtoApp
{
    partial class MainForm : Form
    {
        void InitializeComponent()
        {
            Title = "My Eto Form";
            ClientSize = new Size(400, 350);
            Padding = 10;

            Content = new StackLayout
            {
                Items =
                {
                    "Hello World!",
                    // add more controls here
                }
            };

            // create a few commands that can be used for the menu and toolbar
            var clickMe = new Command { MenuText = "Click Me!", ToolBarText = "Click Me!" };
            clickMe.Executed += (sender, e) => MessageBox.Show(this, "I was clicked!");

            var quitCommand = new Command { MenuText = "Quit", Shortcut = Application.Instance.CommonModifier | Keys.Q };
            quitCommand.Executed += (sender, e) => Application.Instance.Quit();

            var aboutCommand = new Command { MenuText = "About..." };
            aboutCommand.Executed += (sender, e) => new AboutDialog().ShowDialog(this);

            // create menu
            Menu = new MenuBar
            {
                Items =
                {
                    // File submenu
                    new ButtonMenuItem { Text = "&File", Items = { clickMe } },
                    // new ButtonMenuItem { Text = "&Edit", Items = { /* commands/items */ } },
                    // new ButtonMenuItem { Text = "&View", Items = { /* commands/items */ } },
                },
                ApplicationItems =
                {
                    // application (OS X) or file menu (others)
                    new ButtonMenuItem { Text = "&Preferences..." },
                },
                QuitItem = quitCommand,
                AboutItem = aboutCommand
            };

            // create toolbar           
            ToolBar = new ToolBar { Items = { clickMe } };
        }
    }
}

Picture that Demonstrates the Problem

image

Specifications

cwensley commented 5 years ago

Hey @Shadowblitz16,

This feature is not yet implemented, thanks for reporting the issue. If it did actually show the window decoration it would probably not be able to be natively drawn as what you are seeing is not actually a window. It could possibly be approximated and/or add a generic border and menu so you can at least tell that it is a window.

BTW, thanks for all the reported issues, it is much appreciated.

Shadowblitz16 commented 5 years ago

I know it just would be nice to see it :D