mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for some audio plugin window focus issues. Changed the Jucer to use a CodeEditorComponent for its preview panel.
This commit is contained in:
parent
69321e8b33
commit
e53a0efb56
3 changed files with 22 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -13,6 +13,8 @@
|
|||
*.idb
|
||||
*.manifest
|
||||
*.manifest.res
|
||||
*.o
|
||||
*.d
|
||||
extras/juce demo/build/macosx/build
|
||||
extras/juce demo/build/win32_vc8/Debug
|
||||
extras/juce demo/build/win32_vc8/Release
|
||||
|
|
|
|||
|
|
@ -302,10 +302,7 @@ public:
|
|||
: document (document_),
|
||||
isHeader (showHeaderFileFirst)
|
||||
{
|
||||
addAndMakeVisible (editor = new TextEditor());
|
||||
editor->setMultiLine (true, false);
|
||||
editor->setReadOnly (true);
|
||||
editor->setFont (Font (Font::getDefaultMonospacedFontName(), 13.0f, Font::plain));
|
||||
addAndMakeVisible (editor = new CodeEditorComponent (codeDocument, &tokeniser));
|
||||
|
||||
addAndMakeVisible (switchButton = new TextButton (String::empty));
|
||||
switchButton->addButtonListener (this);
|
||||
|
|
@ -322,7 +319,7 @@ public:
|
|||
void showFile (const bool isHeader_)
|
||||
{
|
||||
isHeader = isHeader_;
|
||||
editor->setText (isHeader ? h : cpp, false);
|
||||
editor->loadContent (isHeader ? h : cpp);
|
||||
switchButton->setButtonText (isHeader ? T("Show .cpp") : T("Show .h"));
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +348,9 @@ private:
|
|||
JucerDocument& document;
|
||||
String h, cpp;
|
||||
bool isHeader;
|
||||
TextEditor* editor;
|
||||
CodeDocument codeDocument;
|
||||
CPlusPlusCodeTokeniser tokeniser;
|
||||
CodeEditorComponent* editor;
|
||||
TextButton* switchButton;
|
||||
|
||||
static bool showHeaderFileFirst;
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ END_JUCE_NAMESPACE
|
|||
- (void) scrollWheel: (NSEvent*) ev;
|
||||
- (BOOL) acceptsFirstMouse: (NSEvent*) ev;
|
||||
- (void) frameChanged: (NSNotification*) n;
|
||||
- (void) viewDidMoveToWindow;
|
||||
|
||||
- (void) keyDown: (NSEvent*) ev;
|
||||
- (void) keyUp: (NSEvent*) ev;
|
||||
|
|
@ -186,6 +187,8 @@ public:
|
|||
virtual bool windowShouldClose();
|
||||
|
||||
virtual void redirectMovedOrResized();
|
||||
virtual void viewMovedToWindow();
|
||||
|
||||
virtual NSRect constrainRect (NSRect r);
|
||||
|
||||
static void showArrowCursorIfNeeded();
|
||||
|
|
@ -368,6 +371,12 @@ END_JUCE_NAMESPACE
|
|||
owner->redirectMovedOrResized();
|
||||
}
|
||||
|
||||
- (void) viewDidMoveToWindow
|
||||
{
|
||||
if (owner != 0)
|
||||
owner->viewMovedToWindow();
|
||||
}
|
||||
|
||||
- (void) asyncRepaint: (id) rect
|
||||
{
|
||||
NSRect* r = (NSRect*) [((NSData*) rect) bytes];
|
||||
|
|
@ -1498,6 +1507,12 @@ void NSViewComponentPeer::redirectMovedOrResized()
|
|||
handleMovedOrResized();
|
||||
}
|
||||
|
||||
void NSViewComponentPeer::viewMovedToWindow()
|
||||
{
|
||||
if (isSharedWindow)
|
||||
window = [view window];
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool allowMenusAndBars)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue