Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - CommandBars hides OpenEdge menubar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommandBars hides OpenEdge menubar

 Post Reply Post Reply
Author
Message
oli.dune View Drop Down
Groupie
Groupie


Joined: 18 June 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote oli.dune Quote  Post ReplyReply Direct Link To This Post Topic: CommandBars hides OpenEdge menubar
    Posted: 16 November 2010 at 11:01am
Hi there,

Consider an OpenEdge window with a menubar.
If I add a CommandBars control, and perform the AttachToWindow() method, the OpenEdge window's menubar disappears (although its handle is still valid and shortcuts are still available).

DEF VAR i_WinHWND AS INT NO-UNDO.
RUN GetParent( {&WINDOW-NAME}:HWND, OUTPUT i_WinHWND ).
chCtrlFrame:CommandBars:AttachToWindow( i_WinHWND ).

Any help would be highly appreciated.
Thanks in advance
Product: Xtreme SuitePro (ActiveX) version 16.4.0

Platform: Windows 10 (64bit)

Language: OpenEdge 11.7.4
Back to Top
oli.dune View Drop Down
Groupie
Groupie


Joined: 18 June 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote oli.dune Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2010 at 9:57am
I've surrounded the CommandBars:AttachToWindow() function with the Windows API functions GetMenu() and SetMenu():

  DEF VAR i_WinHWND AS INT  NO-UNDO.
  DEF VAR i_MenuHWND AS INT  NO-UNDO.
  DEF VAR i AS INT NO-UNDO.

  RUN GetParent( {&WINDOW-NAME}:HWND, OUTPUT i_WinHWND ).

  RUN GetMenu( INPUT i_WinHWND, OUTPUT i_MenuHWND ).
  /* Here, we have a valid menu handle in i_MenuHWND */

  chCtrl_SkinCommandBars:CommandBars:AttachToWindow( i_WinHWND ).

  RUN GetMenu( INPUT i_WinHWND, OUTPUT i ).
  /* Here, it seems there's no menu assigned to the window anymore (i = 0) */

  RUN SetMenu( INPUT i_WinHWND, INPUT i_MenuHWND, OUTPUT i ).
  /* i > 0 (it seems that the function succeeded) */

  RUN GetMenu( INPUT i_WinHWND, OUTPUT i ).
  /* Helas, it seems the menu were not assigned to the window (i = 0) */
 

So, can anyone from CJ tell me if the AttachToWindow() method is altering the Window definition to disallow menubar?

Thx
Product: Xtreme SuitePro (ActiveX) version 16.4.0

Platform: Windows 10 (64bit)

Language: OpenEdge 11.7.4
Back to Top
oli.dune View Drop Down
Groupie
Groupie


Joined: 18 June 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote oli.dune Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2010 at 4:44am
I've submitted an issue to the CJ Support Team (#:25683) on Monday, but I didn't receive anything else than a receipt so far.
OK, the support period of our license is over, but I would have expected some feedback regarding something that looks like a bug an "undocumented feature" Wink

Please, Oleg? Aaron?
Product: Xtreme SuitePro (ActiveX) version 16.4.0

Platform: Windows 10 (64bit)

Language: OpenEdge 11.7.4
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2010 at 6:46am
Hi,
 
Since your "fellow OpenEdge users" don't want to help, I will give it a try....
 
First of all I would like to know what you want. You mentioned, you want to "attach" a commandbars control to another "window"
 
The commandbars control is a Toolbar or what?
 
YES: The AttachToWindow method (with VB) works OK. If you use this method, you are able to "move" a toolbar to another "window" but it will be docked at position you defined (see bold part below)
 
With Me.CommandBars
        .AttachToWindow picBoxReport.hwnd
        With .Add("Tools", xtpBarRight)
        .....
        .....
End With
 
So this toolbar will be docked at right side of the picturebox BUT if you have some resizing function that will resize control in same picturebox as you attached the toolbar to, the toolbar won't be visible (it will stay behind the control you resized) In this case we need to resize the control inside picturebox a bit and normally you could do this by using ResizeClient event:
 
Private Sub CommandBars_ResizeClient(ByVal Left As Long, ByVal Top As Long, ByVal Right As Long, ByVal Bottom As Long)
        Me.wndReportControl.Move Left, Top, Right - Left, Bottom - Top 'This is a ReportControl that resides in another picturebox as the commandbars control (toolbar)
End Sub
 
With above code I was able to show the toolbar as should.  
 
 
NO:
Define Commandbar control
 
 
Hope this helps a bit, if not just reply again and I will see what I can do Wink
 
 
 
 
   
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
oli.dune View Drop Down
Groupie
Groupie


Joined: 18 June 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote oli.dune Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2010 at 9:10am
Thanks for your answer Aaron.

In fact, the goal of all this is to make windows' control buttons (min/max/close) available when a skin is currently selected.
I've simply read and applied the suggestion described in this post: http://forum.codejock.com/forum_posts.asp?TID=15393&title=openedge-minimize-restore-close-buttons-disabled

So to answer your question: No, I do not use the CommandBars control to set up a nice menu/toolbar. I just want to keep using those we have yet defined (in OpenEdge).

If I invoke the AttachToWin() method, and reference the window, its menu-bar disappear.
If I invoke the method on something else (frame, or whatever) or if I simply do not invoke the method, then the min/max/close control buttons remain disabled.

Product: Xtreme SuitePro (ActiveX) version 16.4.0

Platform: Windows 10 (64bit)

Language: OpenEdge 11.7.4
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2010 at 12:32pm
Hi,
 
Ok, I understand what you mean. My best guess is that CJ Commandbars "tries" to include the Main menu but it fails somewhere... Look in the update event and add code so you can see if the commandbar items are created.
 
Note:
With VB, when dropping a CommandBar control on a form and a skin is applied, the main menu just looks like a "real" menu created with commandbars. The standard VB menu has been "integrated" and I'm able to use the Execute / Update event just as with ordinary created commandbar items (just mainitems aren't skinned)
 
Too bad, the member who had same problem, didn't respond anymore otherwise you would know what to do. Try to get in touch with the member (personal message or maybe email)
 
btw did you try with CommandBarsFrame? Some people use this to get it working within Access database... Never had to use it so I don't know if it works...
 
 
 
Good luck Wink
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
oli.dune View Drop Down
Groupie
Groupie


Joined: 18 June 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote oli.dune Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2010 at 3:22am
Believe me or not, Aaron, the solution is as simple as a call to the DeleteAll() method, just after the :AttachToWindow().

I've seen that the :ActiveMenuBar wasn't null, and after several (unsuccessful) attempts to re-assign it to the OpenEdge window's one, I've tried the DeleteAll() eraser...

Hope this might help our fellows

Once again, thank you.

Product: Xtreme SuitePro (ActiveX) version 16.4.0

Platform: Windows 10 (64bit)

Language: OpenEdge 11.7.4
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2010 at 3:57am
Hi,
 
You could submit post in https://forum.codejock.com/forum_topics.asp?FID=158&title=articles-and-tutorials Maybe you will find other helpfull solutions (or your fellow OpenEdge users) which will be helpfull without having to worry like you already did Wink
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
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 December 2010 at 9:41am
Codejock Menu Bar will replace standard menu bar - same as in VB.  DeleteAll will remove the Codejock MenuBar so you can see your own OpenEdge menu.  CommandBars.ActiveMenuBar.Visible = False will not work because when you call it your menubar has already been removed.  So you need to first DeleteAll and only after call AttachTOWindow.  I noticed you call DeleteAll After AttachTOWindow, we never tried OpenEdge so can't be sure how it works, but we recommend it is called before AttachTOWindow.
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.