Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - MDI Window list
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDI Window list

 Post Reply Post Reply
Author
Message
rplp4 View Drop Down
Groupie
Groupie


Joined: 18 May 2008
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote rplp4 Quote  Post ReplyReply Direct Link To This Post Topic: MDI Window list
    Posted: 19 June 2009 at 1:19pm
Can anyone tell me where and how the open documents is added to the window list?
 
I am tring to make a MDI text editor.     I can not see how the window list is being updated.
 
I am using VB.net 2008
Product: Xtreme SuitePro (ActiveX) version 12.0.0
Platform: Vista (64bit) - SP 2
Language: Visual Basic 6.0
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 21 June 2009 at 12:36pm
You simply add a command with ID XTP_ID_WINDOWLIST and the commandbars will keeps all open windows in the list for you.
Back to Top
rplp4 View Drop Down
Groupie
Groupie


Joined: 18 May 2008
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote rplp4 Quote  Post ReplyReply Direct Link To This Post Posted: 21 June 2009 at 1:51pm
This I have done, but it is only tracking the last opened window.   I am using vb.net 2008 on a 64bit system if this matters.
 
ControlPopup.CommandBar.Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, CInt(XtremeCommandBars.XTPCommandBarsSpecialCommands.XTP_ID_WINDOWLIST), "Item 1", False, False)
Product: Xtreme SuitePro (ActiveX) version 12.0.0
Platform: Vista (64bit) - SP 2
Language: Visual Basic 6.0
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2014 at 10:17am
Hi...

Yeah I know this is 2014 and this post was originally posted in 2009, however this issue is still very well much alive!

So, I have decided to share my workaround to resolve this if anyone else stumbles upon this and has the same issue!!

This replaces the WINDOWLIST method supplied by Codejock as it would not corerctly show all forms.

PS. This solution is C#.Net, but it should be quite easy to convert over to VB.Net.

Note: The .IsNull() & .Includes() are my own extension methods. Simply convert this to:

e.commandBar.Parent != null

if (e.commandBar.Controls.Id != 1000 && e.commandBar.Controls.Id != 1001 && e.commandBar.Controls.Id != 1002)

The above id's are described below, I simply didn't wish to delete them when building the Window List.


private void CommandBars_Execute(object sender, AxXtremeCommandBars._DCommandBarsEvents_ExecuteEvent e)
{
    switch (e.control.Id)
    {
        ... // All your commandbar execution code goes above here

        default:
            // Activate the selected Window List Form.
            for (int i = 0; i < Workspace.ItemCount; i++)
            {
                if (Workspace.Item(i).Caption == e.control.Caption)
                {
                    Workspace.Item(i).Selected = true;
                    break;
                }
            }
            break;
    }
}

private void CommandBars_InitCommandsPopup(object sender, AxXtremeCommandBars._DCommandBarsEvents_InitCommandsPopupEvent e)
{
    // Build the Window List of Open Mdi Child Forms
    if (!e.commandBar.Parent.IsNull())
    {
        if (e.commandBar.Parent.Caption == "Window")
        {
            // Delete all menu's apart from Cascade, Arrange Horizontally & Arrange Vertically
            for (int i = e.commandBar.Controls.Count; i >= 1; i--)
            {
                if (!e.commandBar.Controls.Id.Includes(1000, 1001, 1002))
                    e.commandBar.Controls.Delete();
            }

            // Get the Active Mdi Child Form
            Form frmActiveForm = this.ActiveMdiChild;

            // Build the Open Window List
            int x = 1;
            foreach (Form frm in this.MdiChildren)
            {
                CommandBarControl ctrl = e.commandBar.Controls.Add(XTPControlType.xtpControlButton, x, frm.Text.Trim());
                ctrl.BeginGroup = (x == 1 ? true : false);
                ctrl.Checked = (frmActiveForm.Text == ctrl.Caption ? true : false);
                x++;
            }
        }
    }
}

Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.