New Posts New Posts RSS Feed: [SOLVED] Display a CAB UI modally
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

[SOLVED] Display a CAB UI modally

 Post Reply Post Reply
Author
mykel View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Sep-2007
Location: Philippines
Posts: 30
Post Options Post Options   Quote mykel Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Display a CAB UI modally
    Posted: 02-Oct-2007 at 7:59pm

thanks for this, bill.

Just got some problems, but i was able to find a solution for it. THanks!

Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 10:33am
I'd try this:
 
1.  Create a new CabWindowWorkspaceSmartPartInfo.
 
2. Set Modal = true
 
3.  Show the view in the window workspace., passing the smart part info as the second parameter.
 
Is this what you tried?
 
I believe that Ward designed the WindowWorkspace to support both modal and non-modal windows, as well as a number of other parameters.
 
If it doesn't work, post a snippet of your code and we'll look at it.
 
Bill J.
 
Back to Top
mykel View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Sep-2007
Location: Philippines
Posts: 30
Post Options Post Options   Quote mykel Quote  Post ReplyReply Direct Link To This Post Posted: 02-Oct-2007 at 12:16am
Yup i also have seen that as an alternative but I was not able to make it work. can you teach me how? :D
 
I considered modifying the WindowWorkspace because all our dialog windows should be viewed as a modal dialog, wherein the user should not be able to click behind.


Edited by mykel - 02-Oct-2007 at 12:16am
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 01-Oct-2007 at 4:45pm
I'm curious why you needed to modify the WindowWorkspace class. 
 
Did you try setting the Modal flag in the CabWindowSmartPartInfo supplied to the WindowWorkspace before showing your view?
 
Bill
Back to Top
mykel View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Sep-2007
Location: Philippines
Posts: 30
Post Options Post Options   Quote mykel Quote  Post ReplyReply Direct Link To This Post Posted: 30-Sep-2007 at 11:42pm
I already made it work at last. I need to modify the methods in the WindowWorkspace class in the library in order to view it as a modal dialog. thanks!
Back to Top
mykel View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Sep-2007
Location: Philippines
Posts: 30
Post Options Post Options   Quote mykel Quote  Post ReplyReply Direct Link To This Post Posted: 30-Sep-2007 at 6:58pm
yup. Actually I have already implemented that. But either those two, I can still click and type behind the dialog window, even if the said window is always on top of the shell.
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2007 at 10:37am
Sure.
 
Out of the box, the Cabana Foundation module (in FoundationModule.cs)
creates two instances of WindowWorkspace:
 

/// <summary>Window workspace to be used for Editor windows under the aegis of the shell's form.</summary>

/// <remarks>

/// Added by IdeaBlade

/// </remarks>

private void AddWindowWorkspace() {

// Add window workspace to be used for modal windows

WindowWorkspace wsp = new WindowWorkspace(ShellForm);

RootWorkItem.Workspaces.Add(wsp, WorkspaceNames.ModalWindows);

// Use the following if editor forms may hide behind the shell.

WindowWorkspace editorWorkspace = new WindowWorkspace();

// Use the following if editor forms should always be on top of the shell.

// WindowWorkspace editorWorkspace = new WindowWorkspace(ShellForm);

RootWorkItem.Workspaces.Add(editorWorkspace, WorkspaceNames.EditorWorkspace);

}

Simply set one of these as the workspace for your view before showing it.

Bill J.
Back to Top
mykel View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Sep-2007
Location: Philippines
Posts: 30
Post Options Post Options   Quote mykel Quote  Post ReplyReply Direct Link To This Post Posted: 27-Sep-2007 at 6:10pm
Yep, it does but you are still allowed to click and modify the parent shell form, even if i set the page as always on the top of the parent form. I am looking for a way that the CAB page will behave like the ordinary dialog window that the code ShowDialog() does in a form. Is it possible to implement it using Cabana or CAB workspaces?
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 27-Sep-2007 at 1:58pm
Look at the SharedEditor module of the Cabana application.  I think it does what you want to do.
 
Bill J.
Back to Top
mykel View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Sep-2007
Location: Philippines
Posts: 30
Post Options Post Options   Quote mykel Quote  Post ReplyReply Direct Link To This Post Posted: 27-Sep-2007 at 12:47am
Hello again,
 
I already implemented the way that the CAB UI page will be displayed with the use of the WindowWorkspace using the ff code:

WindowWorkspace wsp = new WindowWorkspace(ShellForm);

What happens is the CAB UI form displayed always on the top of the ShellForm, but can still manage to click and modify fields in the ShellForm.

Does this really the meaning of a "Modal" Window in CAB application? :) To what I expect is my CAB UI page should be displayed as dialog window and not be able to click behind it on other forms or on the main shell form. Help! hehe
 
Thanks a lot!
 
 
Back to Top
mykel View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Sep-2007
Location: Philippines
Posts: 30
Post Options Post Options   Quote mykel Quote  Post ReplyReply Direct Link To This Post Posted: 26-Sep-2007 at 11:16pm
Hello,
 
Do you know how to display a CAB UI page (which is normally displayed in the content workspace) modally with its Shell as its parent?
 
Thanks!
 
 


Edited by mykel - 01-Oct-2007 at 12:31am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down