v1.24

Discussion and support for general JUCE issues

Postby hayashi » Fri Jan 27, 2006 4:22 am

Hi Jules,

Did you changed the behavior of Component::addToDesktop()?

I'm using it in my code since I want to use native window title bar. Following is the part of my code that works correctly in JUCE 1.23. But in JUCE 1.24, they are shown as a two different window. I'm passing an ResizableWindow for the child component of my native window.

Code: Select all
//------------------------------------------------------------------------------
//   KfcWindowAttrToMacWindowAttr
//   Last modified 2005/12/02
//------------------------------------------------------------------------------
static WindowAttributes KfcWindowAttrToMacWindowAttr(unsigned int iAttr)
{
   WindowAttributes iMacAttr = kWindowStandardHandlerAttribute;

   //iMacAttr |= kWindowMetalAttribute;   //   Metal!

   if (iAttr & kKfcWindowAttrCloseBox)         iMacAttr |= kWindowCloseBoxAttribute;
   if (iAttr & kKfcWindowAttrHorizontalZoom)   iMacAttr |= kWindowHorizontalZoomAttribute;
   if (iAttr & kKfcWindowAttrVerticalZoom)      iMacAttr |= kWindowVerticalZoomAttribute;
   if (iAttr & kKfcWindowAttrCollapseBox)      iMacAttr |= kWindowCollapseBoxAttribute;
   if (iAttr & kKfcWindowAttrResizable)      iMacAttr |= kWindowResizableAttribute;
   if (iAttr & kKfcWindowAttrSideTitlebar)      iMacAttr |= kWindowSideTitlebarAttribute;
   if (iAttr & kKfcWindowAttrNoUpdates)      iMacAttr |= kWindowNoUpdatesAttribute;
   if (iAttr & kKfcWindowAttrNoActivates)      iMacAttr |= kWindowNoActivatesAttribute;
   if (iAttr & kKfcWindowAttrOpaqueForEvents)   iMacAttr |= kWindowOpaqueForEventsAttribute;
   if (iAttr & kKfcWindowAttrNoShadow)         iMacAttr |= kWindowNoShadowAttribute;
   if (iAttr & kKfcWindowAttrHideOnSuspend)   iMacAttr |= kWindowHideOnSuspendAttribute;
   if (iAttr & kKfcWindowAttrStandardHandler)   iMacAttr |= kWindowStandardHandlerAttribute;
   if (iAttr & kKfcWindowAttrHideOnFullScreen)   iMacAttr |= kWindowHideOnFullScreenAttribute;
   if (iAttr & kKfcWindowAttrInWindowMenu)      iMacAttr |= kWindowInWindowMenuAttribute;
   if (iAttr & kKfcWindowAttrLiveResize)      iMacAttr |= kWindowLiveResizeAttribute;

   return iMacAttr;
}

bool CKfcNativeWindow::Create(const String& sName, int iX, int iY, int iWidth, int iHeight, int iAttr, CKfcMenuBar* pMenuBar, CKfcNativeWindow* pParent)
{
   bool bRet = false;

   OSStatus         iErr;
   Rect            mMacRect;
   WindowAttributes   iMacAttr;
   WindowRef         pMacWindow;
   int               iMacMBarHeight = ::GetMBarHeight();
   int               iMacWindowTitleHeight = 22;   //   wow, don't specify it...

   mMacRect.left   = iX;
   mMacRect.top   = iMacMBarHeight + iMacWindowTitleHeight + iY;
   mMacRect.right   = iX + iWidth;
   mMacRect.bottom   = iY + iHeight;

   iMacAttr = KfcWindowAttrToMacWindowAttr(iAttr);

   iErr = ::CreateNewWindow(kDocumentWindowClass, iMacAttr, &mMacRect, &pMacWindow);
   
   if ((pMacWindow) && (iErr == noErr)) {

      SetNativeHandle(pMacWindow);
      InstallEventHandler(this, pMacWindow);
      GetChildComponent()->addToDesktop(0, pMacWindow);
      GetChildComponent()->setBounds(iX, iY, iWidth, iHeight);

      CFStringRef pCFStrCaption = PlatformUtilities::juceStringToCFString(sName);
      if (pCFStrCaption) {
         ::SetWindowTitleWithCFString(pMacWindow, pCFStrCaption);
         ::CFRelease(pCFStrCaption);
         bRet = true;
      }
   }

   return bRet;
}
hayashi
JUCE UberWeenie
 
Posts: 120
Joined: Sat Nov 19, 2005 8:15 pm
Location: Japan

Postby OvermindDL1 » Fri Jan 27, 2006 5:36 am

DocumentWindow is like ResizableWindow and such in that you add a component for it to display, but it itself you really don't alter sans handling close events and such. What buttons are you needing to add?
Image
OvermindDL1
JUCE UberWeenie
 
Posts: 328
Joined: Fri Jun 03, 2005 11:58 am

Postby jules » Fri Jan 27, 2006 10:22 am

Chance wrote:Hi Jules,
Is there a reason that void buttonClicked (Button* button) is defined as private in DocumentWindow class?

I am using DialogWindow and need to add some buttons so have overridden this function and call DialogWindow::buttonClicked(button) in it;

It was possible with 1.21 but not with 1.24.
Of course having source code I can solve my problem but just needed to be sure.

By the way,
What you have is fantastic; I hope one day it can be fully accelerated on all platforms.


hmm - sorry, I didn't mean to make it private. I should really have used another class to handle the events so that DocumentWindow didn't have to be a ButtonListener at all... but you really oughtn't to be using the DocumentWindow as a ButtonListener either - that sort of thing belongs in your content component class!
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby jtxx000 » Sat Jan 28, 2006 6:48 pm

I'm getting 16 "conversion from 'const double' to 'float', possible loss of data" warnings in VC++.NET 2003... not a problem just thought you might want to know as I've never had any warnings compiling previous JUCE versions.
jtxx000
JUCE UberWeenie
 
Posts: 177
Joined: Tue Sep 07, 2004 12:41 am

Postby jules » Sat Jan 28, 2006 6:51 pm

Really? I turned a lot more warnings on for this build, though don't get any warnings in vcexpress. If you post a copy of the list I'll tidy it up for next time.
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby valley » Sat Jan 28, 2006 9:07 pm

I can confirm this. Building JUCE on three different installs of VSE all throw up a bunch of data loss warnings.
valley
JUCE UberWeenie
 
Posts: 679
Joined: Sat Sep 04, 2004 4:32 am
Location: Chicago

Postby jules » Sun Jan 29, 2006 2:47 pm

valley wrote:I can confirm this. Building JUCE on three different installs of VSE all throw up a bunch of data loss warnings.


On VCExpress? ..then why don't I get any warnings? Not fair! I've got my warning level turned up to full..
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby jtxx000 » Sun Jan 29, 2006 3:44 pm

Code: Select all
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(725) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
        \juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(1516) : see reference to function template instantiation 'void juce::transformedImageRender<juce::PixelARGB,juce::PixelARGB>(juce::Image &,const juce::Image &,const int,const int,const int,const int,const int,const int,const int,const int,float,float,const double,const double,const double,const double,const uint8,const juce::Graphics::ResamplingQuality,DestPixelType *,SrcPixelType *)' being compiled
        with
        [
            DestPixelType=juce::PixelARGB,
            SrcPixelType=juce::PixelARGB
        ]
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(726) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(793) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(794) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(725) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
        \juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(1524) : see reference to function template instantiation 'void juce::transformedImageRender<juce::PixelARGB,juce::PixelRGB>(juce::Image &,const juce::Image &,const int,const int,const int,const int,const int,const int,const int,const int,float,float,const double,const double,const double,const double,const uint8,const juce::Graphics::ResamplingQuality,DestPixelType *,SrcPixelType *)' being compiled
        with
        [
            DestPixelType=juce::PixelARGB,
            SrcPixelType=juce::PixelRGB
        ]
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(726) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(793) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(794) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(725) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
        \juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(1539) : see reference to function template instantiation 'void juce::transformedImageRender<juce::PixelRGB,juce::PixelARGB>(juce::Image &,const juce::Image &,const int,const int,const int,const int,const int,const int,const int,const int,float,float,const double,const double,const double,const double,const uint8,const juce::Graphics::ResamplingQuality,DestPixelType *,SrcPixelType *)' being compiled
        with
        [
            DestPixelType=juce::PixelRGB,
            SrcPixelType=juce::PixelARGB
        ]
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(726) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(793) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(794) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(725) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
        \juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(1547) : see reference to function template instantiation 'void juce::transformedImageRender<juce::PixelRGB,juce::PixelRGB>(juce::Image &,const juce::Image &,const int,const int,const int,const int,const int,const int,const int,const int,float,float,const double,const double,const double,const double,const uint8,const juce::Graphics::ResamplingQuality,DestPixelType *,SrcPixelType *)' being compiled
        with
        [
            DestPixelType=juce::PixelRGB,
            SrcPixelType=juce::PixelRGB
        ]
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(726) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(793) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
\juce\src\juce_appframework\gui\graphics\contexts\juce_LowLevelGraphicsSoftwareRenderer.cpp(794) : warning C4244: '+=' : conversion from 'const double' to 'float', possible loss of data
jtxx000
JUCE UberWeenie
 
Posts: 177
Joined: Tue Sep 07, 2004 12:41 am

Postby valley » Sun Jan 29, 2006 5:12 pm

jules wrote:
valley wrote:I can confirm this. Building JUCE on three different installs of VSE all throw up a bunch of data loss warnings.


On VCExpress? ..then why don't I get any warnings?


No idea. My installs[1] are pretty much vanilla, 'cos I don't yet know enough about VC to do much monkeying with config.


FWIW I have warnings set to W3 and 64 portability warnings on (at least on the machine I'm looking at currently).

[1] home laptop and desktop - both previously had betas installed. Work PC - fully virgin install.
valley
JUCE UberWeenie
 
Posts: 679
Joined: Sat Sep 04, 2004 4:32 am
Location: Chicago

Postby Rock Hardbuns » Sun Jan 29, 2006 5:24 pm

64 portability warnings


Well, there's your problem.
Rock Hardbuns
JUCE UberWeenie
 
Posts: 332
Joined: Tue Nov 22, 2005 1:10 am
Location: Global scope

Postby jules » Sun Jan 29, 2006 5:53 pm

aha! Looks like one of my standard C header files was disabling these warnings.. I've added some push/pops around the bit where I include them, and that gets me lots of lovely warnings. Seems to be the std header files that come with the platform SDK that are the culprits.
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

DocumentWindow

Postby gedumer » Sun Jan 29, 2006 6:59 pm

I love the new DocumentWindow with the Min, Max, and Close buttons in the JuceDemo. I notice, however, that the Min and Max buttons are slightly misaligned with the Close button... ie. the space between them and the Close button, as opposed to each other, is somewhat different. Nitpicking, I know, but it is what it is... right? Also when you switch to original look and feel, they seem even more misaligned, and their "button" appearance seems in conflict with the simple "X" of the Close button in that case. Perhaps a stylized "+" and "-" would be better in the original view?
gedumer
JUCE Weenie
 
Posts: 10
Joined: Tue Jan 10, 2006 10:14 pm

Postby jules » Sun Jan 29, 2006 7:57 pm

I kind of like the different separations.. I know on the mac the buttons are equidistant, but on windows the close button's a little further away. I'm open to suggestions though - anyone else got an opinion?

And I have to admit I didn't spend long on the old look and feel. I'll tart it up a bit when I get a moment.
User avatar
jules
Fearless Leader
 
Posts: 17218
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby Rock Hardbuns » Sun Jan 29, 2006 8:08 pm

The spacing looks a little ambiguous, like it might be a mistake. If you move the max/ min buttons a tad closer together, or the close button another pixel away from the others, it might look clearer.

Personally though, I'm more interested in getting consistent looks for the controls. It looks a bit wonky with the sliders being old-shiny and a button next to it being new shiny. But I expect that's comming sooner or later.
Rock Hardbuns
JUCE UberWeenie
 
Posts: 332
Joined: Tue Nov 22, 2005 1:10 am
Location: Global scope

Postby jtxx000 » Sun Jan 29, 2006 8:56 pm

I like how it's set up on suse linux where there's a significant gap between the close button and the min/max buttons... no chance of accidentally closing a window you meant to maximize, but it wouldn't blend in very well with a windows environment (or mac for that matter).
Image
jtxx000
JUCE UberWeenie
 
Posts: 177
Joined: Tue Sep 07, 2004 12:41 am

PreviousNext

Return to General JUCE discussion

Who is online

Users browsing this forum: Google Feedfetcher and 3 guests