void MainContentComponent::resized() { Component* comps[] = { mainFrame, spliteBar, settingsPanel }; layoutManager.layOutComponents (comps, 3, 0, 0, getWidth(), getHeight(),false,true); //if(mainFrame) mainFrame->setBounds(getLocalBounds()); updateLayoutMode(); }
void buttonClicked (Button* b) override { if (b == &showInTabsButton) updateLayoutMode(); else if (b == &addNoteButton) addNote (String ("Note ") + String (multiDocumentPanel.getNumDocuments() + 1), "Hello World!"); }
//============================================================================== MainContentComponent::MainContentComponent() { setSize (500, 400); spliteBar = new StretchableLayoutResizerBar(&layoutManager, 1, true); spliteBar->setSize(8,100); addAndMakeVisible(spliteBar); settingsPanel = new ComponentSettings(); addAndMakeVisible(settingsPanel); mainFrame = new MDIFrame(); addAndMakeVisible(mainFrame); mainFrame->setBackgroundColour (Colours::transparentBlack); mainFrame->addDocument(new DocumentView(settingsPanel->getPropertyPanel()), Colours::white, true); mainFrame->setBounds(getLocalBounds()); //rightFrame = new MDIFrame(); //addAndMakeVisible(rightFrame); //rightFrame->setBackgroundColour (Colours::transparentBlack); // rightFrame->addDocument(new PropertyPage(), Colours::whitesmoke, true); layoutManager.setItemLayout (0, -0.2, -0.85,-0.85); layoutManager.setItemLayout (1, 8, 8, 8); layoutManager.setItemLayout (2,-0.1, -0.8,-0.13); updateLayoutMode(); }
MDIDemo() { setOpaque (true); showInTabsButton.setButtonText ("Show with tabs"); showInTabsButton.setToggleState (false, dontSendNotification); showInTabsButton.addListener (this); addAndMakeVisible (showInTabsButton); addNoteButton.setButtonText ("Create a new note"); addNoteButton.addListener (this); addAndMakeVisible (addNoteButton); addAndMakeVisible (multiDocumentPanel); multiDocumentPanel.setBackgroundColour (Colours::transparentBlack); updateLayoutMode(); addNote ("Notes Demo", "You can drag-and-drop text files onto this page to open them as notes.."); addExistingNotes(); }