Progress 11.3 We have Progress GUI application that we have not had the time or resources to rewrite using .Net Forms. We have used .Net forms for new features but keep wanting to use some .Net controls in some of our exiting ABL windows. I know this is unsupported but decided to give it a try. Using a form with FormBorderStyle set to none, and the WinApi calls setParent and MoveWindow, I've been able to get this basically working in a small test environment. The one remaining known problem is that when I focus on the .Net form that's embedded in the ABL window, the ABL window appears inactive. This may not be a fatal flaw but it is distracting. I have two questions. 1) Is there a way I can get the ABL Window to retain its active appearance even when focus is now on the embedded .Net form? 2) Has anyone else done this and what other pitfalls am I likely to encounter? IOW, am I wasting my time for some as yet undiscovered reason? Thanks
As is usual for me, 10 minutes after I posted this I came up with a, seemingly working, solution for question #1. Sometimes I just have to write something up before the lights go on. I just embedded a .Net user control instead of a form. I'd still like to know if anyone else has pursued this and their experience. Thanks, Tom
Flag this post as spam/abuse.
Hi Mike,
Maybe I'm confused (probably?) but isn't Winkit and the Progress window container used in order to put ABL widgets and frames into a .Net form?
I'm planning on the opposite. .Net components in a ABL window. There is no .net form.
Thanks,
Tom
Well every ABL window deserves a facelift by embedding it.
First you embed the ABL Window in the WindowContainer and put that Window Container on the Form. Then you overlay the Window Container (alas the ABL Window) with other .NET Controls. Show me the user who can tell the difference...
Hello Mike,
How to embed an ABL Window in the WindowContainer and put it an a Form.
From the PSDOE you can create a form and drop a WindowContainer on it.
Can you embed the ABL window after you put the WindowContainer on the form too.?
Regards,
Peter
The GUI for .NET docs are explaining how to add a window to MDIChildForm into a MDI container.
And to embed the window into a Window container and set the parent to the form.
In the example they use CREATE WINDOW hWin.
And add this hWin.
It does not explain how I get my SmartWindow sales/wo_order.w into this.
Do I have to start it persistent set to get the window handle and forward that into the Window Container?
Or is there an other way to set a window handle to sales/wo_order.w
Kind regards,
Peter Wokke
The GUI for .NET docs are explaining how to add a window to MDIChildForm into a MDI container.
And to embed the window into a Window container and set the parent to the form.
In the example they use CREATE WINDOW hWin.
And add this hWin.
It does not explain how I get my SmartWindow sales/wo_order.w into this.
Do I have to start it persistent set to get the window handle and forward that into the Window Container?
Or is there an other way to set a window handle to sales/wo_order.w
Kind regards,
Peter Wokke
Flag this post as spam/abuse.
Hi Mike,
Only challenge: You need to do this before the ABL Window realized.
This means you have to delay the initializeObject?
I have no clue how to adjust the src/adm2/custom/containrcustom.i to realize this.
Hope you can help me on this.
Regards,
Peter
You don’t need to delay initalizeObject.
When you put the code in containrCustom.i (in the main block of the include) – you are typically executing the code prior to initializeObject.
Hi Mike ,
In the main of containrCustom.i you should set the following code:
/* create handle to get the Container handle first */
DEFINE VARIABLE hWindow AS HANDLE NO-UNDO.
{get ContainerHandle hWindow}.
/* Create the form. */
MainForm = NEW Progress.Windows.Form( ).
MainForm:Text = "Embedded Window Sample".
MainForm:Menu = MainMenu.
MainForm:ClientSize = NEW Size(hWindow:WIDTH-PIXELS, hWindow:HEIGHT-PIXELS).
MainForm:FormClosed:Subscribe( "Window_FormClosed" ).
MainForm:Show( ).
/* Create the WindowContainer, embedding the window into it. */
WinContainer = NEW Progress.Windows.WindowContainer( ).
WinContainer:Size = NEW Size( hWindow:WIDTH-PIXELS, hWindow:HEIGHT-PIXELS ).
WinContainer:EmbeddedWindow = hWindow.
WinContainer:Parent = MainForm.
WinContainer:Show( ).
Application:Run(MainForm).
/* Delete the embedded window after the main form closes. */
PROCEDURE Window_FormClosed:
DEFINE INPUT PARAMETER sender AS System.Object.
DEFINE INPUT PARAMETER e AS System.EventArgs.
DELETE WIDGET hWindow.
END PROCEDURE.
Question where do I set the required using settings?
In the definition settings of the this Includefile?
USING System.Windows.Forms.* FROM ASSEMBLY.
USING System.Drawing.* FROM ASSEMBLY.
USING Progress.Windows.* FROM ASSEMBLY.
USING Progress.Util.* FROM ASSEMBLY.
Regards,
Peter
“Question where do I set the required using settings?
In the definition settings of the this Includefile?”
The AppBuilder features a new section in the Procedure Settings dialog for that purpose.
Hi Mike,
I found the Declarative statements section.
If I set the using statements in this section of the Include file Progress will put it on the proper place when compiling.
Even if the include is set at an other location in the structured procedure.
Thank you kindly
Peter.
Hi Mike and Tom,
I am running to another question.
Container is also creating visual objects like frames and browsers.
The embedding should only be done on containers of type WINDOW.
The embedding should be done conditional if I am correct?
if hContainerHandle:type = "WINDOW":U then do:
end.
Are there other container type that could be embedded too?
Regards,
Peter
“Are there other container type that could be embedded too?”
Hi Mike,
You refer to implement it within a pre-compile block like this.
&IF "{&ADM-CONTAINER}":U NE "":U &THEN
&IF "{&ADM-CONTAINER}":U = "WINDOW":U &THEN
/* implement the embeding over here */
&ENDIF
&ENDIF
Thanks Peter
Mike,
For embed SmartFrames, SmartViewers or SmartBrowsers you have to deal with the reposition en resize object procedures to get the .Net form at the proper location and size within the window where they are placed. That is what you main that needs to be customized.
Regards,
Peter
After embedding one of our GUI windows in a window container I lost, as expected, the menu bar and menu items. I'm wondering if anyone has a utility to convert an ABL menu into the .Net equivalent? It's a rather large menu and any head start on converting would make life much easier. Thanks, Tom
there was something on the old communities site - I know, because I
wrote it ;) It took an menu bar handle and created a .net menu from
it.
I'll see if I can find it.
Julian
On 12 September 2014 11:37, tbergman
wrote:
> RE: Embedding .Net form in Progress window
> Reply by tbergman
> After embedding one of our GUI windows in a window container I lost, as
> expected, the menu bar and menu items. I'm wondering if anyone has a utility
> to convert an ABL menu into the .Net equivalent? It's a rather large menu
> and any head start on converting would make life much easier. Thanks, Tom
> Stop receiving emails on this subject.
>
> Flag this post as spam/abuse.
--
Julian Lyndon-Smith
IT Director,
dot.r
http://www.dotr.com
Hi Julian,
If you can find this it will be greatly appreciated.
Thanks,
Tom
Fairly sure this is the thread?
community.progress.com/.../1603.aspx
(Well, it's *a* thread in which Julian creates .Net Ultra menus from and existing window.)
There's also this community.progress.com/.../1194.adding-an-abl-wrapper-to-a-net-control.aspx where I demo creating a Ultra menu from code/dynamically. Assuming you know how to read a ABL menu, it shouldn't be too hard to convert. There's a FetchData() method in the MyToolbarsManager which populates a set of temp-tables, which you should be able to populate.
-- peter
Mike,
For embed SmartFrames, SmartViewers or SmartBrowsers you have to deal with the reposition en resize object procedures to get the .Net form at the proper location and size within the window where they are placed. That is what you main that needs to be customized.
Regards,
Peter
Flag this post as spam/abuse.
I have another question on embedding windows. I am using an mdicontainer as the main window and embed .net forms into the mdicontainer. I noticed that the close button (X) is at the far right. Is there a way the have this button next to the name of the form.
Regards
Thomas
In regards to my previous question, I have figured out that it is a property of the ultra tabbed mdi manager that I am using. there is a property called ultraTabbedMdiManager.TabGroupSettings.CloseButtonLocation that can be set to 'Tab'. However it doesn't seem to get the close button inside the tab. Any idea what else needs to be set.
Regards
Thomas