Dragging app by title bar makes menu dissappear


#1

My main app consists of a resizableWindow which sets a documentWindow as its content component. The documentWindow class has a menubar set to it. In order to have this menubar appear I had to take out the Resize() and Paint() methods from my documentWindow derived class. (why do I get the feeling that this is part of the problem…). Anyway this all works fine apart from the following anomalies:

  1. Trying to move my main window by dragging the title bar results in the menubar and title bar disappearing. In order for them to show up again I need to resize the window by dragging one of its corners.

  2. My documentWindow derived class has a popup menu if I right-click anywhere on the application background. Same thing happens if I try to access that, i.e., the titlebar and menubar disappear.

I realise that it must have something to do with my taking out the resize and paint methods but leaving them in prevents my menubar from being drawn. Can anyone shed any light on the situation?


#2

You probably shouldn’t derive from documentwindow, but if you do, and if you override any methods like resized(), make sure you call the parent class’s implementation of them in your own, because important stuff happens in there.


#3

If I shouldn’t derive from documentWindow what do you suggest I derive from? I only want a simple application with a menubar, perhaps I’m going over board?


#4

I have it working now. I changed things around and now I derive my main application window from a documentWindow and then set my main component to a component derived class which inherits from menuBarModel. I don’t know why I was trying it the other way.