I'm complete new to the Winforms. I use Progress/OpenEdge 11.6.
I build the "getting started" Example and tried to customize it.
My questions:
Is it possible to disable the context menu (Close, close all ...) for the last shown Tab, because I want one Tab always stay open?
Is it possible to float out a complete document container with all document windows in it?
When I autohide as Document, is it possible to put the information to the bottom of the form?
When I set the CloseAction to "Hide" is there a build in function to manage then hidden Documents?
Thank yout for answers
Jürgen
12 Answers, 1 is accepted
Thank you for writing.
1. The following article shows how you can customize the context menu: Using the ContextMenuService.
2. You can do this with the following code:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
radDock1.DockWindows.DocumentWindows[0].DockState = Telerik.WinControls.UI.Docking.DockState.Floating;
for
(
int
i = 1; i < radDock1.DockWindows.DocumentWindows.Length; i++)
{
radDock1.DockWindow(radDock1.DockWindows.DocumentWindows[i], radDock1.DockWindows.DocumentWindows[0], Telerik.WinControls.UI.Docking.DockPosition.Fill);
}
}
3. You need to set the AutoHidePosition of the specific window. An example is available here: Building an advanced layout at runtime.
4. I am not sure what you want to achieve here. Could you please elaborate?
I hope this helps. I am looking forward to your reply.
Regards,
Dimitar
Telerik
Thank you for your answers.
1. This is exactly what I want, but it seems that I cannot use "GetService" with the Progress-ABL
2. Same thing here, or I'm simply not able to translate the C# Code to Progress ABL correctly
3. Works fine
4. Ther is the build-in function CTRL-TAB to see all active Documents. Is there a similar function for hidden Documents?
I will redesign my UI with other Elements, because I have not the knowledge (and the time) to make things working with Progress ABL
Regards,
Jürgen
Thank you for writing back.
1. In this case, you need to use reflection to get the service in ABL. Here is the code (in order this to work you need Open Edge 11.6.2):
define variable fi AS System.Reflection.FieldInfo.
define variable flags As System.Reflection.BindingFlags.
flags = System.Reflection.BindingFlags:NonPublic OR System.Reflection.BindingFlags:Instance.
fi = this-object:radDock1:GetType():GetField("sevices", flags).
define variable services as class "Dictionary<
Integer
,RadDockService>".
define variable so as System.Object.
so = fi:GetValue(this-object:radDock1).
services = cast(so,"System.Collections.Generic.Dictionary<
Integer
,Telerik.WinControls.UI.Docking.RadDockService>").
define variable serviceC as ContextMenuService.
define variable i as integer.
define variable j as integer.
define variable s as RadDockService.
do i = 1 to services:count:
j = i - 1.
s = services:item[i].
serviceC = cast(s,ContextMenuService) no-error.
if valid-object(serviceC) then
do:
serviceC:ContextMenuDisplaying:Subscribe(menuService_ContextMenuDisplaying).
end.
end.
2. The following snippet shows how this can be achieved in ABL:
documentWindow1:DockState = DockState:Floating.
iLength = radDock1:DockWindows:DocumentWindows:Length - 1.
DO iLoop = 0 TO iLength:
radDock1:DockWindow(radDock1:DockWindows:Item[iLoop], radDock1:DockWindows:Item[0], DockPosition:Fill).
END.
4. We do not have build in function for the hidden (closed) documents. You have to manually handle this.
Please let me know if there is something else I can help you with.
Dimitar
Telerik
Hello,
Thank you for your help. I got everything work. Especially your code in Progress-ABL was very helpfull for me to understand (at least a little bit) what I'm typing here.
If I have more questions, I will post them here, thank you for your offer helping me.
Regards,
Jürgen
I am glad I could be of help. Let us know if you have any other questions.
Regards,
Dimitar
Telerik
Hello,
The customizing of the RadDock Context menu worked with the trial Winforms 2015.2.... . For a real project I purchased now a lizensed Version 2016.02.608.40 and installed it. Everything seems to be working, but when I implement the code for the customizing I get back an unknown Value on the line
fi = this-object:radDock1:GetType():GetField("sevices", flags).
which throws an error.
can you give me a tip, what is missing.
I'm still working with Progress Developer Studio 11.6.2.
Regards,
Jürgen
Thank you for writing back.
There is a typo in my code snippet, you should change the string in the method parameters to "services".
Please let me know if there is something else I can help you with.
Dimitar
Telerik
Thank you very, very much!!
I was sitting this morning 2 hours in front of that code, and I did not see the missing "r"!
Now it works.
Your support is really first class.
Regards
Jürgen
It took me a while to notice this as well. Nevertheless, I am glad that this is working fine now. Do not hesitate to contact us if you have other questions.
Regards,
Dimitar
Telerik
Hello, this code was exactly what I've been looking for but for me it errors on any line that doesn't have the full name entered:
method private void StopDragDrop( ):
define variable fi as System.Reflection.FieldInfo.
fi = this-object:radDock1:GetType():GetField("services",System.Reflection.BindingFlags:NonPublic or System.Reflection.BindingFlags:Instance).
define variable services as class "System.Collections.Generic.Dictionary<Integer,Telerik.WinControls.UI.Docking.RadDockService>".
define variable so as System.Object.
so = fi:GetValue(this-object:radDock1).
services = cast(so,"System.Collections.Generic.Dictionary<Integer,Telerik.WinControls.UI.Docking.RadDockService>").
define variable service as Telerik.WinControls.UI.Docking.DragDropService.
define variable i as integer.
define variable j as integer.
define variable s as Telerik.WinControls.UI.Docking.RadDockService.
do i = 1 to services:count:
j = i - 1.
s = services:item[i].
service = cast(s,Telerik.WinControls.UI.Docking.DragDropService) no-error.
if valid-object(service) then
service:Starting:Subscribe(serviceStarting).
end.
return.
end method.
Now it errors on:
if valid-object(service) then
With error: no accessible overload of serviceStarting in class MainClient has the signature required for the starting event (14584).
I am using Openedge 11.6.0.
Any help would be great!!
Thanks
Mark
Thank you for writing.
You can include the following using statements so you do not need the full names:
USING System.Collections.Generic.*.
USING Telerik.WinControls.UI.Docking.*.
Then you should add the event handler:
METHOD PRIVATE VOID serviceStarting( INPUT sender AS System.
Object
, INPUT e AS StateServiceStartingEventArgs ):
RETURN.
END METHOD.
I hope this will be useful.
Regards,
Dimitar
Telerik by Progress