From ca17d3dd82f4e76e7a4b6a540b0d2dfcb94ae4bb Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 11 Jan 2012 20:49:46 +0000 Subject: [PATCH] Couple of minor compilation fixes. --- .../juce_gui_basics/menus/juce_PopupMenu.cpp | 7 +-- .../juce_gui_basics/menus/juce_PopupMenu.h | 5 +- .../documents/juce_FileBasedDocument.h | 2 + .../native/juce_win32_OpenGLComponent.cpp | 48 ++++++------------- 4 files changed, 23 insertions(+), 39 deletions(-) diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index 6ac41f9c44..5f2e735a55 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -124,9 +124,7 @@ public: : itemInfo (itemInfo_), isHighlighted (false) { - if (itemInfo.customComp != nullptr) - addAndMakeVisible (itemInfo.customComp); - + addAndMakeVisible (itemInfo.customComp); parent->addAndMakeVisible (this); int itemW = 80; @@ -139,8 +137,7 @@ public: ~ItemComponent() { - if (itemInfo.customComp != nullptr) - removeChildComponent (itemInfo.customComp); + removeChildComponent (itemInfo.customComp); } void getIdealSize (int& idealWidth, int& idealHeight, const int standardItemHeight) diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.h b/modules/juce_gui_basics/menus/juce_PopupMenu.h index f448913a64..c40597866c 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.h +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.h @@ -77,6 +77,9 @@ */ class JUCE_API PopupMenu { +private: + class Window; + public: //============================================================================== /** Creates an empty popup menu. */ @@ -232,6 +235,7 @@ public: private: friend class PopupMenu; + friend class PopupMenu::Window; Rectangle targetArea; Component* targetComponent; int visibleItemID, minWidth, maxColumns, standardHeight; @@ -474,7 +478,6 @@ private: //============================================================================== class Item; class ItemComponent; - class Window; friend class MenuItemIterator; friend class ItemComponent; diff --git a/modules/juce_gui_extra/documents/juce_FileBasedDocument.h b/modules/juce_gui_extra/documents/juce_FileBasedDocument.h index 9712f87e46..1aa92b4582 100644 --- a/modules/juce_gui_extra/documents/juce_FileBasedDocument.h +++ b/modules/juce_gui_extra/documents/juce_FileBasedDocument.h @@ -275,6 +275,7 @@ protected: */ virtual void setLastDocumentOpened (const File& file) = 0; + #if JUCE_MODAL_LOOPS_PERMITTED /** This is called by saveAsInteractive() to allow you to optionally customise the filename that the user is presented with in the save dialog. The defaultFile parameter is an initial suggestion based on what the class knows @@ -282,6 +283,7 @@ protected: extension, etc, or just return something completely different. */ virtual File getSuggestedSaveAsFile (const File& defaultFile); + #endif private: //============================================================================== diff --git a/modules/juce_opengl/native/juce_win32_OpenGLComponent.cpp b/modules/juce_opengl/native/juce_win32_OpenGLComponent.cpp index de01ad5da1..1b4bf57cf8 100644 --- a/modules/juce_opengl/native/juce_win32_OpenGLComponent.cpp +++ b/modules/juce_opengl/native/juce_win32_OpenGLComponent.cpp @@ -113,41 +113,23 @@ public: int atts[64]; int n = 0; - atts[n++] = WGL_DRAW_TO_WINDOW_ARB; - atts[n++] = GL_TRUE; - atts[n++] = WGL_SUPPORT_OPENGL_ARB; - atts[n++] = GL_TRUE; - atts[n++] = WGL_ACCELERATION_ARB; - atts[n++] = WGL_FULL_ACCELERATION_ARB; - atts[n++] = WGL_DOUBLE_BUFFER_ARB; - atts[n++] = GL_TRUE; - atts[n++] = WGL_PIXEL_TYPE_ARB; - atts[n++] = WGL_TYPE_RGBA_ARB; + atts[n++] = WGL_DRAW_TO_WINDOW_ARB; atts[n++] = GL_TRUE; + atts[n++] = WGL_SUPPORT_OPENGL_ARB; atts[n++] = GL_TRUE; + atts[n++] = WGL_DOUBLE_BUFFER_ARB; atts[n++] = GL_TRUE; + atts[n++] = WGL_PIXEL_TYPE_ARB; atts[n++] = WGL_TYPE_RGBA_ARB; - atts[n++] = WGL_COLOR_BITS_ARB; - atts[n++] = pfd.cColorBits; - atts[n++] = WGL_RED_BITS_ARB; - atts[n++] = pixelFormat.redBits; - atts[n++] = WGL_GREEN_BITS_ARB; - atts[n++] = pixelFormat.greenBits; - atts[n++] = WGL_BLUE_BITS_ARB; - atts[n++] = pixelFormat.blueBits; - atts[n++] = WGL_ALPHA_BITS_ARB; - atts[n++] = pixelFormat.alphaBits; - atts[n++] = WGL_DEPTH_BITS_ARB; - atts[n++] = pixelFormat.depthBufferBits; + atts[n++] = WGL_COLOR_BITS_ARB; atts[n++] = pfd.cColorBits; + atts[n++] = WGL_RED_BITS_ARB; atts[n++] = pixelFormat.redBits; + atts[n++] = WGL_GREEN_BITS_ARB; atts[n++] = pixelFormat.greenBits; + atts[n++] = WGL_BLUE_BITS_ARB; atts[n++] = pixelFormat.blueBits; + atts[n++] = WGL_ALPHA_BITS_ARB; atts[n++] = pixelFormat.alphaBits; + atts[n++] = WGL_DEPTH_BITS_ARB; atts[n++] = pixelFormat.depthBufferBits; - atts[n++] = WGL_STENCIL_BITS_ARB; - atts[n++] = pixelFormat.stencilBufferBits; - - atts[n++] = WGL_ACCUM_RED_BITS_ARB; - atts[n++] = pixelFormat.accumulationBufferRedBits; - atts[n++] = WGL_ACCUM_GREEN_BITS_ARB; - atts[n++] = pixelFormat.accumulationBufferGreenBits; - atts[n++] = WGL_ACCUM_BLUE_BITS_ARB; - atts[n++] = pixelFormat.accumulationBufferBlueBits; - atts[n++] = WGL_ACCUM_ALPHA_BITS_ARB; - atts[n++] = pixelFormat.accumulationBufferAlphaBits; + atts[n++] = WGL_STENCIL_BITS_ARB; atts[n++] = pixelFormat.stencilBufferBits; + atts[n++] = WGL_ACCUM_RED_BITS_ARB; atts[n++] = pixelFormat.accumulationBufferRedBits; + atts[n++] = WGL_ACCUM_GREEN_BITS_ARB; atts[n++] = pixelFormat.accumulationBufferGreenBits; + atts[n++] = WGL_ACCUM_BLUE_BITS_ARB; atts[n++] = pixelFormat.accumulationBufferBlueBits; + atts[n++] = WGL_ACCUM_ALPHA_BITS_ARB; atts[n++] = pixelFormat.accumulationBufferAlphaBits; if (pixelFormat.multisamplingLevel > 0 && OpenGLHelpers::isExtensionSupported ("GL_ARB_multisample"))