[CLOSED] How to minimize window when clicked window's minimize button?

  1. #1

    [CLOSED] How to minimize window when clicked window's minimize button?

    Hi,

    I have a desktop,When I want to minimize the opened window.It doesn't send the window to taskbar.Attached capture will summarize the issue.How can I handle it.

    Screencast link : http://screencast.com/t/Y09aMuEqJtz
    Last edited by Daniil; Dec 11, 2015 at 11:54 AM. Reason: [CLOSED]
  2. #2
    Hi @metci,

    Most like you are creating a regular <ext:Window> instance. If so, then yes - it is not going to be a Desktop window of full value.

    There is the "Create Window" shortcut in this example.
    https://examples2.ext.net/#/Desktop/...ction/Overview

    That shortcut calls:
    [DirectMethod(ShowMask = true)]
    public void CreateWindow()
    {
        Desktop.GetInstance().CreateWindow(new Window 
        { 
            Title = "New window",
            Width = 300,
            Height = 300,
            CloseAction = CloseAction.Destroy,
            Html="The window is created"
        });
    }
    That is a correct way to create a truly Desktop window which supports minimizing as well.
  3. #3
    Hi @Daniil,

    Thanks for your reply, but I don't create window by <ext:Window,I create my windows at code behind.Following blocks will helps you to understand .

    ThÅŸs is my parent menu list
    foreach (ConcreteMenuAuthorization menuAuthorization in parentMenuList)
                    {
                        SetMenuVisibility(menuAuthorization, menuAuthorizationList);
                        if (menuAuthorization.Menu.IsActive && menuAuthorization.IsUserClick image for larger version. 
    
    Name:	2015-12-03_1416.png 
    Views:	83 
    Size:	21.0 KB 
    ID:	24342Authorized)
                        {
                            Ext.Net.MenuPanel menuPanel = new Ext.Net.MenuPanel();
                            menuPanel.ID = menuAuthorization.Menu.MenuCode;
                            menuPanel.Title = menuAuthorization.Menu.MenuName;
                            menuPanel.Collapsible = true;
                            menuPanel.SaveSelection = false;
    
                            AddChildMenus(menuPanel, menuAuthorization, menuAuthorizationList);
    
                            pnlMenu.Items.Add(menuPanel);
                        }
                    }
    The parent menus has its childs.AddChildMenus method loads child menus

    private void AddChildMenus(MenuPanel menuPanel, ConcreteMenuAuthorization parentMenuAuthorization, ConcreteMenuAuthorization[] menuAuthorizationList)
        {
            ConcreteMenuAuthorization[] childMenuList = (from _menuAuthorization in menuAuthorizationList
                                                         where _menuAuthorization.Menu.ParentMenuOid == parentMenuAuthorization.Menu.Oid
                                                         select _menuAuthorization).ToArray();
    
            foreach (ConcreteMenuAuthorization menuAuthorization in childMenuList)
            {
                if (menuAuthorization.Menu.IsActive && menuAuthorization.IsUserAuthorized)
                {
                    Ext.Net.MenuItem menuItem = new Ext.Net.MenuItem();
                    menuItem.Text = menuAuthorization.Menu.MenuName;
                    menuItem.ID = menuAuthorization.Menu.MenuCode;
                    menuPanel.Menu.Items.Add(menuItem);
    
                    Window win = new Window();
                    win.ClientIDMode = System.Web.UI.ClientIDMode.Static;
                    win.IDMode = IDMode.Static;
                    win.ID = "window" + menuAuthorization.Menu.MenuCode;
                    win.Width = Unit.Pixel(1350);
                    win.Height = Unit.Pixel(690);
                    win.AutoScroll = true;
                    win.AutoRender = false;
                    win.Loader = new ComponentLoader();
                    win.Loader.Url = menuAuthorization.Menu.MenuPage;
                    win.Loader.Mode = Ext.Net.LoadMode.Frame;
                    win.CloseAction = CloseAction.Hide;
                    win.Maximizable = true;
                    win.Hide();
                    win.Title = menuAuthorization.Menu.MenuName;
                    win.Icon = Icon.Application;
    
                    AnchorLayoutConfig cfg = new AnchorLayoutConfig();
                    this.Desktop1.Controls.Add(win);
                    menuItem.Listeners.Click.Handler = "App.direct.ShowWindow(\"" + win.ID + "\");";
    
                    AddChildMenus(menuPanel, menuAuthorization, menuAuthorizationList);
                }
            }
        }
    I am adding Windows created by using "this.Desktop1.Controls.Add(win);" as you see.What is my wrong?

    How to convert my code to yours in order to see my windows on taskbar when they is minimized.

    I am attaching my resulting menu.
  4. #4
    Please demonstrate the App.direct.ShowWindow DirectMethod's code. First of all, please clarify if a server request is required. If it is not, I would recommend to try this:
    menuItem.Listeners.Click.Handler = "App.Desktop1.getDesktop().showWindow('" + win.ID + "');";
    Though, I cannot guarantee this working, because adding Windows into a Desktop's Controls is something that is not quite supported.

    Ideally, Windows should be added as DesktopModules.

Similar Threads

  1. [CLOSED] Window cannot minimize
    By registrator in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 08, 2015, 6:01 AM
  2. [CLOSED] Minimize window created in another desktop window
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 03, 2011, 1:46 PM
  3. How to minimize window?
    By dbassett74 in forum 1.x Help
    Replies: 1
    Last Post: May 31, 2009, 11:31 PM
  4. Window is not minimize
    By Mohammad Yakub in forum 1.x Help
    Replies: 3
    Last Post: Feb 10, 2009, 5:41 AM
  5. Replies: 3
    Last Post: Feb 03, 2009, 5:57 PM

Tags for this Thread

Posting Permissions