Board index » cppbuilder » Menu Merging Bug on BCB5

Menu Merging Bug on BCB5

All,

There is a problem when merging menus in BCB5 which was addressed by
Damon Chandler (TeamB).  Damon shows
code on how to work around the problem by not using using menu merging.
His email was published on April 9, 2000.  This appears to be a problem
that a number of users have documented, John McDermott, Clayton Arends,
etc.

Does anyone know if Borland has acknowledged this (I can't find it in
the bug list) and if so what are the plans and time frame to fix it.
This seems to me to a significant problem and diminishes some of the
advantages of a RAD systems.

I have started to implement Damon's code but have found that changing
existing code and if you have a mildly sophisticated menus is turning
out to be a significant effort.

I would love to not change my code and just use what Borland advertises
as having.  By the way my code worked just find with BCB3!

Thanks
Tom

 

Re:Menu Merging Bug on BCB5


Hi Tom --

Quote
> There is a problem when merging menus in BCB5...
[snip]
> Does anyone know if Borland has acknowledged this (I can't find
> it in the bug list) and if so what are the plans and time frame
> to fix it.  This seems to me to a significant problem and
> diminishes some of the advantages of a RAD systems.

Personally, I have no idea, but I'll ask.

Quote
> I have started to implement Damon's code but have found that changing
> existing code and if you have a mildly sophisticated menus is turning
> out to be a significant effort.

IIRC, a few users were reporting problems with my code as well.  What
specific problem are you having? -- I'll try to find a workaround.

Best of luck,

--
Damon Chandler (TeamB - C++Builder)
- http://homepages.go.com/~damonchandler/vcl_faq.zip
- http://bcbcaq.freeservers.com

Re:Menu Merging Bug on BCB5


Hi Tom!

I've similar problem since I upgraded from BCB3 to BCB5. My windows controls
are disappearing completly (they're just flickering on holding down Ctrl+TAB
in the app). I've  submitted this as a bug to Borland on July, 26. It seems
that VCL under Win98 is drawing the menubar in maximized state and
overwrites it immediately with the menubar in miminzed state (then it
contains no controls). In addition the WindowMenu contains no MDIChilds. Do
you have similar experiences?

Are you relating to the piece of code of a procedure named "FixMDI" which
minimizes and maxmizes the active MDI-Child twice? (I think it's from
Chandler, released somewhen in March) With that particular procedure I'd
some problems, too, like buttons appearing from the application lying under
my app (strange behaviour) or a MDIChild activated that wasn't in front
before. I've managed to come around those problems but I can't automate it
(e.g. as a reaction to a windows message). Do you know a better way to work
around this bug?

But I truly agree with you: when does a fix come out for this bug?

Alex McKenzie.

Re:Menu Merging Bug on BCB5


Quote
> In addition the WindowMenu contains no MDIChilds. Do you have similar experiences?

I do have (see my news question below).
It seems, that WindowMenu only works with Childs, that are created before Application->Run().

Ekki

Re:Menu Merging Bug on BCB5


Alex,

Sorry about taking so long to respond.  The best way to see the problem that I'm
seeing is to run the edit example project that comes with BCB5.  The example is
stored in the "examples" directory:

               ...\CBuilder5\Examples\Doc\TextEdit\textedit.bpr

1. Compile the example as is.
2. Seclect File menu and then select New.
3. Do this twice.
4. Maximize one of the child forms.
5. Select the Window menu, then select the child form that is not active.
6. Then try to select one of the maximize, minimize or close buttons on the
upper right corner.

You will not be able to select any of these since they are not working.   You
can make these work by elimating the menu merging mechanism and then use the
code from Damon Chandler.  I've used Damon's code and it appears to work.

 However, in my case I use a number of dialogs components such as Find, Replace,
Print etc. which is complicating changing/modifying my code.  Since all the code
is now in the parent level and the parent doen't know which child is active you
have to use dynamic casting such as below.  Since I have never understood when
and where to use dynamic casting I am not compfortable using it.  It was a hell
of a lot simpler with menu merging!

      TEditForm * textview;
      textview = dynamic_cast<TEditForm *>(Screen->ActiveForm);
      if(textview != 0) textview->Find(Sender);

Good luck
Tom

Quote
Alex McKenzie wrote:
> Hi Tom!

> I've similar problem since I upgraded from BCB3 to BCB5. My windows controls
> are disappearing completly (they're just flickering on holding down Ctrl+TAB
> in the app). I've  submitted this as a bug to Borland on July, 26. It seems
> that VCL under Win98 is drawing the menubar in maximized state and
> overwrites it immediately with the menubar in miminzed state (then it
> contains no controls). In addition the WindowMenu contains no MDIChilds. Do
> you have similar experiences?

> Are you relating to the piece of code of a procedure named "FixMDI" which
> minimizes and maxmizes the active MDI-Child twice? (I think it's from
> Chandler, released somewhen in March) With that particular procedure I'd
> some problems, too, like buttons appearing from the application lying under
> my app (strange behaviour) or a MDIChild activated that wasn't in front
> before. I've managed to come around those problems but I can't automate it
> (e.g. as a reaction to a windows message). Do you know a better way to work
> around this bug?

> But I truly agree with you: when does a fix come out for this bug?

> Alex McKenzie.

Re:Menu Merging Bug on BCB5


Hi Ekki!

Quote
> It seems, that WindowMenu only works with Childs, that are created before

Application->Run().

Tom Renaud gave me a hint on an example delivered with BCB5:
...\CBuilder5\Examples\Doc\TextEdit\textedit.bpr
This example shows some strange behaviour, too. See my other posting today
in the newsgroup.

Alex McKenzie.

Re:Menu Merging Bug on BCB5


Hi Tom!

Quote
>                ...\CBuilder5\Examples\Doc\TextEdit\textedit.bpr

Thanks for that example! I needed to see some code from Borland to proof my
observations... I tried what you suggested and the following happened:

Quote
> 1. Compile the example as is.
> 2. Seclect File menu and then select New.
> 3. Do this twice.
> 4. Maximize one of the child forms.

When starting while IDE was running windows kicked me at this time to a BSOD
telling me VWIN32 hanged up. After pressing enter the text editor and BCB5
were gone... May there be a problem with some windows dlls?
Starting it stand-alone succeded but showed some interesting behaviour:
1. First MDIChild is being maximized
2. MenuBar is cleared
3. MenuBar is drawn in "maximized-child-state" (showing
Icon-Menus-Windowcontrols)
Everything OK ==> Menus are merged correctly, WindowMenu shows the correct
entries and the window controls are working

Quote
> 5. Select the Window menu, then select the child form that is not active.
> 6. Then try to select one of the maximize, minimize or close buttons on
the
> upper right corner.

4. Switch to another MDIChild
5. The MenuBar will not be redrawn! But it switches back to
"normal-child-state" (showing just the menu) without drawing it.
6. Move the mouse over the menubar.
7. The activated menu is drawn (flat-style like Office97) in
"normal-child-state" over the not cleared MenuBar still showing the
"maximized-child-state". ==> You get a mess in the MenuBar. The
Windowcontrols you can see are without any function because they're drawn
before but there are no controls connected to them anymore.

Quote
> You will not be able to select any of these since they are not working.
You
> can make these work by elimating the menu merging mechanism and then use
the
> code from Damon Chandler.  I've used Damon's code and it appears to work.

>  However, in my case I use a number of dialogs components such as Find,
Replace,
> Print etc. which is complicating changing/modifying my code.  Since all
the code
> is now in the parent level and the parent doen't know which child is
active you
> have to use dynamic casting such as below.  Since I have never understood
when
> and where to use dynamic casting I am not compfortable using it.  It was a
hell
> of a lot simpler with menu merging!

Very Right! Why do I have to reprogram something that used to work before
upgrading? I need to use menu merging since I use a complex set of MDIChilds
(about 6 different ones) with each a unique menu which has to be merged into
the mainmenu. Reprogramming that code (with code for enabling/disabling some
menuitems!) isn't an alternative for me, because adding one more Childform
leads to reprogram at least 2 other forms...

My only hope is that anyone at Borland is reading this and is going to write
a patch! I'm this close to go back to BCB3. There everything worked
properly!

BTW, has anyone experienced similar problems with Delphi 5? Or is this just
BCB5-related?

Alex McKenzie.

Other Threads