Beispiel #1
0
/*!***************************************************************************
 @Function			CreateDefaultWindow
 @Input				fPosX					Position X for the new window
 @Input				fPosY					Position Y for the new window
 @Input				nXSize_LettersPerLine
 @Input				sTitle					Title of the window
 @Input				sBody					Body text of the window
 @Return			Window handle
 @Description		Creates a default window.
					If Title is NULL the main body will have just one line
					(for InfoWin).
*****************************************************************************/
unsigned int CPVRTPrint3D::CreateDefaultWindow(float fPosX, float fPosY, int nXSize_LettersPerLine, const char * const sTitle, const char * const sBody)
{
#if !defined (DISABLE_PRINT3D)

	unsigned int dwActualWin;
	unsigned int dwFlags = ePVRTPrint3D_ADJUST_SIZE_ALWAYS;
	unsigned int dwBodyTextColor, dwBodyBackgroundColor;

	// If no text is specified, return an error
	if(!sBody && !sTitle) return 0xFFFFFFFF;

	// If no title is specified, body text colours are different
	if(!sTitle)
	{
		dwBodyTextColor			= PVRTRGBA(0xFF, 0xFF, 0x30, 0xFF);
		dwBodyBackgroundColor	= PVRTRGBA(0x20, 0x20, 0xB0, 0xE0);
	}
	else
	{
		dwBodyTextColor			= PVRTRGBA(0xFF, 0xFF, 0xFF, 0xFF);
		dwBodyBackgroundColor	= PVRTRGBA(0x20, 0x30, 0xFF, 0xE0);
	}

	// Set window flags depending on title and body text were specified
	if(!sBody)		dwFlags |= ePVRTPrint3D_DEACTIVATE_WIN;
	if(!sTitle)		dwFlags |= ePVRTPrint3D_DEACTIVATE_TITLE;

	// Create window
	dwActualWin = InitWindow(nXSize_LettersPerLine, (sTitle==NULL) ? 1:50);

	// Set window properties
	SetWindow(dwActualWin, dwBodyBackgroundColor, dwBodyTextColor, 0.5f, fPosX, fPosY, 20.0f, 20.0f);

	// Set title
	if (sTitle)
		SetTitle(dwActualWin, PVRTRGBA(0x20, 0x20, 0xB0, 0xE0), 0.6f, PVRTRGBA(0xFF, 0xFF, 0x30, 0xFF), sTitle, PVRTRGBA(0xFF, 0xFF, 0x30, 0xFF), (char*)"");

	// Set window text
	if (sBody)
		SetText(dwActualWin, sBody);

	// Set window flags
	SetWindowFlags(dwActualWin, dwFlags);

	m_pWin[dwActualWin].bNeedUpdated = true;

	// Return window handle
	return dwActualWin;

#else
	return 0;
#endif
}
logical TWindow :: DoCreated ( )
{
  DAlign      *align;
  logical term = NO;
BEGINSEQ
  SetWindowFlags(YES);
  
  if ( TField::DoCreated() )                         ERROR
  if ( !complexWidget )                              ERROR
  
  complexWidget->UpdateScrollBars(Style()->HasHscrol(),Style()->HasVscrol());

  align = elementStyle->Align();
//  if ( align->get_arrange() == AT_Grid )
//    complexWidget->CreateLayout(DSize(0,0),align->get_margin());

RECOVER
  term = YES;
ENDSEQ
  return(term);
}
     OFrame :: OFrame (ODataWidget *pODataWidget, ODataWidget *oODataWidget, ODS *pODS )
                     : QFrame (pODataWidget ? pODataWidget->WidgetQ() : NULL),
OEHControlValue (pODataWidget,oODataWidget,pODS)
{
  SetWindowFlags(YES,NO,YES,NO,NO,NO,NO,NO,NO);
}