void AlertWindow::lookAndFeelChanged() { const int newFlags = getLookAndFeel().getAlertBoxWindowFlags(); setUsingNativeTitleBar ((newFlags & ComponentPeer::windowHasTitleBar) != 0); setDropShadowEnabled (isOpaque() && (newFlags & ComponentPeer::windowHasDropShadow) != 0); }
MainWindow::MainWindow(const String &name, const Colour &backgroundColour, const int requiredButtons, const bool addToDesktop) : DocumentWindow(name, backgroundColour, requiredButtons, addToDesktop), _pContentWindow(nullptr), _tooltipWindow(this) { setDropShadowEnabled(false); //setTitleBarHeight(24); setTitleBarTextCentred(false); Image *l_pAppIcon = ImageCache::getFromMemory(SAKURA_ICON_PNG, SAKURA_ICON_PNG_SIZE); setIcon(l_pAppIcon); setContentComponent(_pContentWindow = new SakuraMatrix(this), true, true); }
FindAndReplaceWindow(FindAndReplaceDialog* comp) : DocumentWindow(T("Find & Replace"), Colour(0xffe5e5e5), DocumentWindow::closeButton, true) { comp->setVisible(true); centreWithSize(comp->getWidth(),comp->getHeight()); setContentComponent(comp); setResizable(false, false); setUsingNativeTitleBar(true); setDropShadowEnabled(true); setVisible(true); }
//============================================================================== TopLevelWindow::TopLevelWindow (const String& name, const bool addToDesktop_) : Component (name), useDropShadow (true), useNativeTitleBar (false), windowIsActive_ (false) { setOpaque (true); if (addToDesktop_) Component::addToDesktop (TopLevelWindow::getDesktopWindowStyleFlags()); else setDropShadowEnabled (true); setWantsKeyboardFocus (true); setBroughtToFrontOnMouseClick (true); windowIsActive_ = TopLevelWindowManager::getInstance()->addWindow (this); }
void ResizableWindow::addToDesktop() { Component::addToDesktop (ResizableWindow::getDesktopWindowStyleFlags()); setDropShadowEnabled (isDropShadowEnabled()); // force an update to clear away any fake shadows if necessary. }
void TopLevelWindow::parentHierarchyChanged() { setDropShadowEnabled (useDropShadow); }
TextEditorWindow::TextEditorWindow (File file, String text, int synt, String title) : DocumentWindow (String::empty, Colours::white, DocumentWindow::allButtons, true) { isfms = false; Preferences* prefs=Preferences::getInstance(); setMenuBar(this); int size=0; if (file.existsAsFile()) { String ext=file.getFileExtension(); String lsp=T(".lisp.lsp.scm.cm.clm.cmn.ins"); String sal=T(".sal"); String sal2=T(".sal2"); String fms=T(".fms"); if (synt==TextIDs::Empty) if (sal.contains(ext)) synt=TextIDs::Sal; else if (sal2.contains(ext)) synt=TextIDs::Sal2; else if (lsp.contains(ext)) synt=TextIDs::Lisp; else if (fms.contains(ext)) { isfms = true; synt=TextIDs::Fomus; } else synt=TextIDs::Text; size=(int)file.getSize(); text=file.loadFileAsString(); } else { file=File::nonexistent; size=text.length(); } if (synt==TextIDs::Empty) synt=prefs->getIntProp(T("EditorSyntax"), TextIDs::Lisp); TextBuffer* buf=new TextBuffer(synt); setTextBuffer(buf); setApplicationCommandManagerToWatch(buf->manager); setResizable(true, true); // set buffer to standard 74 column width. + 10 adds space for // scrollers to avoid linewrap when scoller appears :/ centreWithSize(buf->getFont().getStringWidth(T("M"))*74+10, 400); setUsingNativeTitleBar(true); setDropShadowEnabled(true); setWantsKeyboardFocus(false); // Buffer has it. buf->setFile(file); buf->setText(text); if (title.isEmpty()) buf->updateWindowTitle(); else setName(title); // flag may have been set by loading editor. buf->clearFlag(EditFlags::NeedsSave); // arrrrg give up on large buffers since text coloring in juce editors is so slow if (size>20000) { Console::getInstance()->printWarning(T("Cowardly refusing to colorize large buffer for ") + getName().quoted() + T(".\n")); buf->setFlag(EditFlags::HiliteOff); } setVisible(true); buf->colorizeAll(); }