buf *getblk(int blknum){
  while(&h_head[blknum % 4] != NULL){
    buf *buffer = Search(blknum);
    if(buffer != NULL){
      assert(buffer != NULL);
      if(IsStatus(buffer, STAT_LOCKED)){
	//sleep();
	printf("SCENARIO 5\n");
	printf("Process goes to sleep\n");
	AddStatus(buffer, STAT_WAITED);
	return NULL;
	continue;
      }
      //scenario 1
      printf("SCENARIO 1\n");
      MakeStatus(buffer, (STAT_LOCKED | STAT_VALID));
      RemFromFreeList(buffer);
      return buffer;	
    }
    else{
      //if(IsInFreeList(buffer)){
      if(IsEmptyFree()){
	//scenario 4
	//sleep();
	printf("SCENARIO 4\n");
	printf("Process goes to sleep\n");
	return buffer;
	//continue;
      }
      //RemFromFreeList(buffer);
      //RemoveFromFree()
      buf *ref = ref_free_head();
      if(CheckStatus(ref, STAT_DWR)){
	//scenario 3
	printf("SCENARIO 3\n");	//asynchronous write buffer to disk;
	buf *prev = ref -> free_bp;
	buf *next = ref -> free_fp;
	prev -> free_fp = next;
	next -> free_bp = prev;
	MakeStatus(ref, STAT_LOCKED | STAT_VALID | STAT_KRDWR | STAT_OLD);
	continue;
      }
      //scenario 2
      printf("SCENARIO 2\n");
      buf *additionalbuf = remove_free_head();
      RemStatus(additionalbuf, STAT_VALID);
      additionalbuf -> blkno = blknum;
      AddToHash(additionalbuf);
      printf("Kernel HDD access occuring\n");
      AddStatus(additionalbuf, STAT_KRDWR);
      printf("Kernel HDD access finished\n");
      RemStatus(additionalbuf, STAT_KRDWR);
      AddStatus(additionalbuf, STAT_VALID);
      return additionalbuf;
    }
  }
  printf("BUFFER NOT FOUND\n");
  return NULL;
}
Exemple #2
0
void Patcher_HandleReceipt_NextPatchFile()
{
	char* MessageContent = strstr( g_HTTPResultBuffer.GetData(), CRLF CRLF );
	if( !MessageContent )
	{
		// If we were updating, we're not anymore
		g_Patcher_IsUpdating = false;

		AddStatus( "Error receiving patch file.", g_StatusWarningColor );
		++g_NumWarnings;
		return;
	}

	MessageContent += 4;

	uint Offset = ( uint )( MessageContent - g_HTTPResultBuffer.GetData() );
	uint ContentSize = g_HTTPSocket->AsyncGetBytesReceived() - Offset;

	// Compute the checksum for the payload and compare with the data in the manifest file
	uint32 ContentChecksum = Checksum::Adler32( ( uint8* )MessageContent, ContentSize );
	SimpleString ContentLengthString = SimpleString::PrintF( "%d", ContentSize );
	SimpleString ContentChecksumString = SimpleString::PrintF( "0x%08X", ContentChecksum );

	SManifestFile& ManifestFile = g_FilesInManifest[ g_NextPatchFileIndex ];
	SimpleString PatchFile = ManifestFile.m_Filename;

	if( ContentLengthString == ManifestFile.m_Length && ContentChecksumString == ManifestFile.m_Checksum )
	{
		ManifestFile.m_Validated = true;

		FileStream TempFile( GetTempFileForPatchFile( PatchFile ).CStr(), FileStream::EFM_Write );
		TempFile.Write( ContentSize, MessageContent );

		AddStatus( SimpleString::PrintF( "%s received.", PatchFile.CStr() ), g_StatusColor );
	}
	else
	{
		AddStatus( SimpleString::PrintF( "Checksum failure for %s.", PatchFile.CStr() ), g_StatusWarningColor );
		++g_NumWarnings;
	}

	g_NextPatchFileIndex++;

	// If there are remaining files, get them.
	if( g_NextPatchFileIndex < g_FilesInManifest.Size() )
	{
		Patcher_GetNextPatchFile();
	}
	else
	{
		FinishPatching();
	}
}
Exemple #3
0
void CIrcWnd::NoticeMessage( CString source, CString message )
{
	bool flag = false;
	Channel* curr_channel = m_channelselect.FindChannelByName( source );
	if( curr_channel )
	{
		AddInfoMessage( source, _T("-%s- %s"), source, message);
		flag = true;
	}
	POSITION pos1, pos2;
	for (pos1 = m_channelselect.channelPtrList.GetHeadPosition();( pos2 = pos1 ) != NULL;)
	{
		m_channelselect.channelPtrList.GetNext(pos1);
		curr_channel = (Channel*)(m_channelselect.channelPtrList).GetAt(pos2);
		Nick* curr_nick = m_nicklist.FindNickByName(curr_channel->name, source );
		if( curr_nick)
		{
			AddInfoMessage( curr_channel->name, _T("-%s- %s"), source, message);
			flag = true;			
		}
	}
	if( flag == false )
	{
		if( m_channelselect.m_pCurrentChannel->type == 4 )
			AddInfoMessage( m_channelselect.m_pCurrentChannel->name, _T("-%s- %s"), source, message);
		else
			AddStatus( _T("-%s- %s"), source, message );
	}
}
Exemple #4
0
/*--------------------------------------------------------------------------*/
PegChart::PegChart(const PegRect& rect, LONG lMinX, LONG lMaxX, LONG lMinY, 
                   LONG lMaxY, WORD wXScale, WORD wYScale) : 
    PegThing(rect),
    mlMinX(lMinX),
    mlMaxX(lMaxX),
    mlMinY(lMinY),
    mlMaxY(lMaxY),
    mwMajorXScale(wXScale),
	mwMinorXScale(0),
    mwMajorYScale(wYScale),
	mwMinorYScale(0),
    mwMajorTicSize(12),
	mwMinorTicSize(8),
    mwXLabelScale(wXScale),
    mwYLabelScale(wYScale),
	mwXLabelHeight(0),
	mwYLabelWidth(0),
	mpFont(&MenuFont)
{
    InitClient();
    mChartRegion = mClient;

    muColors[PCI_NORMAL] = BLACK;
   #if(PEG_NUM_COLORS >= 4)
    muColors[PCI_NTEXT] = DARKGRAY;
   #else
    muColors[PCI_NTEXT] = WHITE;
   #endif
    muColors[PCI_STEXT] = WHITE;

	AddStatus(PSF_VIEWPORT);
}
void AddToHash(buf *elem){
  int key = elem -> blkno;
  int hkey = key % 4;
  AddStatus(elem, STAT_LOCKED);
  //insert_hash_head(h_head[hkey].hash_bp, elem);
  insert_list(&h_head[hkey], elem, HASHTAIL);
}
Exemple #6
0
bool SRCCOL::Init(PGLOBAL g)
  {
  if (PRXCOL::Init(g))
    return true;

  AddStatus(BUF_READ);     // All is done here
  return false;
  } // end of SRCCOL constructor
Exemple #7
0
void CIrcWnd::AddStatusF(CString sLine, ...)
{
	va_list argptr;
	va_start(argptr, sLine);
	CString sTemp;
	sTemp.FormatV(sLine, argptr);
	va_end(argptr);
	AddStatus(sTemp);
}
Exemple #8
0
XCLCOL::XCLCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i)
			: PRXCOL(cdp, tdbp, cprec, i, "XCL")
  {
  // Set additional XXL access method information for column.
  Cbuf = NULL;                // Will be allocated later
	Cp = NULL;						      // Pointer to current position in Cbuf
	Sep = ((PTDBXCL)tdbp)->Sep;
	AddStatus(BUF_READ);	      // Only evaluated from TDBXCL::ReadDB
  } // end of XCLCOL constructor
Exemple #9
0
void CopyTempPathFiles()
{
	AddStatus( "Applying patches...", g_StatusColor );

	for( uint PatchFileIndex = 0; PatchFileIndex < g_FilesInManifest.Size(); ++PatchFileIndex )
	{
		SManifestFile& ManifestFile = g_FilesInManifest[ PatchFileIndex ];

		if( ManifestFile.m_Validated )
		{
			// Create the folder if it doesn't exist yet.
			FileUtil::RecursiveMakePath( ManifestFile.m_Filename.CStr() );

			SimpleString PatchFile = ManifestFile.m_Filename;
			SimpleString TempFile = GetTempFileForPatchFile( PatchFile );

			// Handle the special case of updating our own executable
			bool IsSelf = false;
			STATICHASH( ContentSyncer );
			STATICHASH( Self );
			STATICHASH( TempSelf );
			if( PatchFile == ConfigManager::GetString( sSelf, "", sContentSyncer ) )
			{
				PatchFile = ConfigManager::GetString( sTempSelf, "", sContentSyncer );
				IsSelf = true;
			}

			if( FileUtil::Copy( TempFile.CStr(), PatchFile.CStr(), false ) )
			{
				FileUtil::RemoveFile( TempFile.CStr() );

				if( IsSelf )
				{
					g_ShouldRestart = true;
				}
			}
			else
			{
				AddStatus( SimpleString::PrintF( "Failed to copy %s.", PatchFile.CStr() ).CStr(), g_StatusWarningColor );
				++g_NumWarnings;
			}
		}
	}
}
Exemple #10
0
/*--------------------------------------------------------------------------*/
void PegButton::Enable()
{
    mwStyle |= AF_ENABLED;
    AddStatus(PSF_SELECTABLE|PSF_TAB_STOP);

    if (StatusIs(PSF_VISIBLE))
    {
        Invalidate(mReal);
    }
}
Exemple #11
0
/*--------------------------------------------------------------------------*/
PegButton::PegButton(WORD wId, WORD wStyle) : PegThing(wId, wStyle)
{
    muColors[PCI_NORMAL] = PCLR_BUTTON_FACE;
    muColors[PCI_NTEXT] = PCLR_NORMAL_TEXT;
    muColors[PCI_SELECTED] = PCLR_BUTTON_FACE;
    muColors[PCI_STEXT] = PCLR_NORMAL_TEXT;

    Type(TYPE_BUTTON);
    AddStatus(PSF_MOVEABLE|PSF_SIZEABLE);
    SetSignals(SIGMASK(PSF_CLICKED));

    if (wStyle & AF_ENABLED)
    {
        AddStatus(PSF_SELECTABLE|PSF_TAB_STOP);
    }
    else
    {
        RemoveStatus(PSF_SELECTABLE|PSF_TAB_STOP);
    }
}
Exemple #12
0
/*--------------------------------------------------------------------------*/
PegMenuButton::PegMenuButton(PegMenuDescription *pDesc) :
    PegThing(pDesc->wId, pDesc->wStyle),
    PegTextThing(pDesc->wStyle, PEG_MENU_FONT)
{
    mReal.Set(0, 0, 100, 18);
    mClient.Set(0, 0, 100, 18);
    Type(TYPE_MENU_BUTTON);
    muColors[PCI_NORMAL] = PCLR_BUTTON_FACE;

    DataSet(pDesc->pText);
    mpOwner = NULL;

    if (pDesc->pSubMenu)
    {
        mpSubMenu = new PegMenu(pDesc->pSubMenu);
    }
    else
    {
        mpSubMenu = NULL;

        if (pDesc->wStyle & BF_DOTABLE)
        {
            SetSignals(SIGMASK(PSF_DOT_ON));
        }
        else
        {
            if (pDesc->wStyle & BF_CHECKABLE)
            {
                SetSignals(SIGMASK(PSF_CHECK_ON)|SIGMASK(PSF_CHECK_OFF));
            }
            else
            {
                if (pDesc->wStyle & AF_ENABLED)
                {
                    SetSignals(SIGMASK(PSF_CLICKED));
                }
                else
                {
                    RemoveStatus(PSF_SELECTABLE);
                }
            }
        }
    }
    AddStatus(PSF_SIZEABLE | PSF_NONCLIENT);
    RemoveStatus(PSF_ACCEPTS_FOCUS);

    muColors[PCI_NORMAL] = PCLR_BUTTON_FACE;
    muColors[PCI_SELECTED] = PCLR_ACTIVE_TITLE;
    muColors[PCI_NTEXT] = PCLR_NORMAL_TEXT;
    muColors[PCI_STEXT] = PCLR_HIGH_TEXT;

    mbPointerOver = FALSE;
    mbSubVisible = FALSE;
}
Exemple #13
0
/*--------------------------------------------------------------------------*/
PegGroup::PegGroup(PegRect &Rect, const PEGCHAR *Text, WORD wFlags) :
    PegThing(Rect, 0, wFlags),
    PegTextThing(Text, wFlags & TT_COPY, PEG_GROUP_FONT)
{
    Type(TYPE_GROUP);
    AddStatus(PSF_TAB_STOP);
    mClient = mReal;
    mClient -= 2;
    mClient.wTop += TextHeight(lsTEST, mpFont) / 2;
    muColors[PCI_NTEXT] = PCLR_NORMAL_TEXT;
}
Exemple #14
0
void TryLaunchApp()
{
	if( LaunchApp() )
	{
		g_ShouldExit = true;
	}
	else
	{
		AddStatus( SimpleString::PrintF( "Failed to launch %s", g_CommandLine->m_App.CStr() ), g_StatusWarningColor );
		++g_NumWarnings;
	}
}
Exemple #15
0
void CIrcWnd::SetConnectStatus(bool bFlag)
{
	if (bFlag)
	{
		GetDlgItem(IDC_BN_IRCCONNECT)->SetWindowText(GetResString(IDS_IRC_DISCONNECT));
		AddStatus(GetResString(IDS_CONNECTED));
		m_bConnected = true;
	}
	else
	{
		GetDlgItem(IDC_BN_IRCCONNECT)->SetWindowText(GetResString(IDS_IRC_CONNECT));
		AddStatus(GetResString(IDS_DISCONNECTED));
		m_bConnected = false;
		m_bLoggedIn = false;
		while (m_wndChanSel.m_lstChannels.GetCount() > 2)
		{
			Channel* pToDel = m_wndChanSel.m_lstChannels.GetTail();
			m_wndChanSel.RemoveChannel(pToDel->m_sName);
		}
	}
}
Exemple #16
0
/*--------------------------------------------------------------------------*/
PegStatusBar::PegStatusBar() : PegThing()
{
    mpFont = PegTextThing::GetDefaultFont(PEG_PROMPT_FONT);

    mReal.Set(0, 0, 100, mpFont->uHeight + 6);
    mClient.Set(0, 0, 100, mpFont->uHeight + 6);
    Type(TYPE_STATUS_BAR);
    muColors[PCI_NORMAL] = PCLR_BUTTON_FACE;
    AddStatus(PSF_SIZEABLE|PSF_NONCLIENT);
    mpLastPrompt = NULL;
    mbShowPointer = FALSE;
}
Exemple #17
0
/*--------------------------------------------------------------------------*/
void PegButton::Style(WORD wStyle)
{
    PegThing::Style(wStyle);
    if (wStyle & AF_ENABLED)
    {
        AddStatus(PSF_SELECTABLE|PSF_TAB_STOP);
    }
    else
    {
        RemoveStatus(PSF_SELECTABLE|PSF_TAB_STOP);
    }
}
Exemple #18
0
void CIrcWnd::SetConnectStatus( bool flag )
{
	if(flag)
	{
		GetDlgItem(IDC_BN_IRCCONNECT)->SetWindowText(GetResString(IDS_IRC_DISCONNECT));
		AddStatus( GetResString(IDS_CONNECTED));
		m_bConnected = true;
	}
	else
	{
		GetDlgItem(IDC_BN_IRCCONNECT)->SetWindowText(GetResString(IDS_IRC_CONNECT));
		AddStatus( GetResString(IDS_DISCONNECTED));
		m_bConnected = false;
		m_bLoggedIn = false;
		while( m_channelselect.channelPtrList.GetCount() > 2 )
		{
			Channel* todel = (Channel*)(m_channelselect.channelPtrList).GetTail();
			m_channelselect.RemoveChannel( todel->name );
		}
	}
}
Exemple #19
0
bool Launch( SimpleString& CommandLine )
{
	if( g_NumWarnings > 0 )
	{
		AddStatus( SimpleString::PrintF( "\nContentSyncer finished with %d warnings.\n\nPress Enter to continue.", g_NumWarnings ), g_StatusColor );

		// Mini loop in here, ugh!
		for(;;)
		{
			g_Keyboard->Tick( 0.0f );

			if( GetForegroundWindow() == GetConsoleWindow() )
			{
				if( g_Keyboard->OnRise( Keyboard::EB_Enter ) )
				{
					break;
				}
			}

			TickRender();
			SwitchToThread();
		}
	}

	STARTUPINFO StartupInfo;
	PROCESS_INFORMATION ProcessInfo;

	ZeroMemory( &StartupInfo, sizeof( StartupInfo ) );
	StartupInfo.cb = sizeof( StartupInfo );

	ZeroMemory( &ProcessInfo, sizeof( ProcessInfo ) );

	// See Process Creation Flags
	DWORD Flags =
		CREATE_DEFAULT_ERROR_MODE |		// Don't inherit error mode
		CREATE_NEW_CONSOLE;				// Create new console (DETACHED_PROCESS also means this console isn't inherited; but a new console must be created with AllocConsole)

	BOOL Result = CreateProcess(
		NULL,						// Application name (optional--use the first argument from command line if NULL)
		CommandLine.MutableCStr(),	// Command line (optional, includes application name)
		NULL,						// Process attributes (optional pointer to a SECURITY_ATTRIBUTES)
		NULL,						// Thread attributes (optional pointer to a SECURITY_ATTRIBUTES)
		FALSE,						// Inherit handles
		Flags,						// Creation flags (see Process Creation Flags)
		NULL,						// Environment block (optional void*)
		NULL,						// Current directory (optional string)
		&StartupInfo,				// Startup info
		&ProcessInfo				// Process info
		);

	return Result == TRUE;
}
Exemple #20
0
/*--------------------------------------------------------------------------*/
void PegMenuButton::SetEnabled(BOOL State)
{
    if (State)
    {
        mwStyle |= AF_ENABLED;
        AddStatus(PSF_SELECTABLE);
    }
    else
    {
        mwStyle &= ~AF_ENABLED;
        RemoveStatus(PSF_SELECTABLE);
    }
}
Exemple #21
0
/*--------------------------------------------------------------------------*/
PegWindow::PegWindow(const PegRect &Rect, WORD wStyle) :
    PegThing(Rect, 0, wStyle),
    mpIconMap(NULL),
    mpVScroll(NULL),
    mpHScroll(NULL),
    mbModal(FALSE),
    mbMaximized(FALSE),
    mbMoveFrame(FALSE),
    muScrollMode(0),
    muMoveMode(0),
    mbShowPointer(PPT_NORMAL)
{
    Type(TYPE_WINDOW);
    muColors[PCI_NORMAL] = PCLR_CLIENT;
    AddStatus(PSF_VIEWPORT|PSF_TAB_STOP);

    if (wStyle & FF_THICK)
    {
        AddStatus(PSF_SIZEABLE|PSF_MOVEABLE);
    }
    InitClient();
}
Exemple #22
0
void FinishPatching()
{
	CopyTempPathFiles();

	// Successfully updated!
	g_Patcher_IsUpdating = false;

	Reinit();

	AddStatus( "Update successful!", g_StatusColor );

	g_ShouldLaunchApp = true;
}
Exemple #23
0
void Patcher_ReportFailure()
{
	if( g_Patcher_GettingVersionNumber )
	{
		AddStatus( "Could not connect to update server.", g_StatusColor );
	}
	else if( g_Patcher_GettingManifestFile )
	{
		AddStatus( "Error receiving manifest file.", g_StatusWarningColor );
		++g_NumWarnings;
	}
	else if( g_Patcher_GettingNextPatchFile )
	{
		AddStatus( SimpleString::PrintF( "Error receiving %s.", g_FilesInManifest[ g_NextPatchFileIndex ] ), g_StatusWarningColor );
		++g_NumWarnings;
	}
	else
	{
		AddStatus( "Unknown error connecting to update server.", g_StatusWarningColor );
		++g_NumWarnings;
	}
}
Exemple #24
0
void Patcher_HandleReceipt_ManifestFile()
{
	g_FilesInManifest.Clear();
	g_NextPatchFileIndex = 0;

	char* MessageContent = strstr( g_HTTPResultBuffer.GetData(), CRLF CRLF );
	if( !MessageContent )
	{
		AddStatus( "Error receiving manifest file.", g_StatusWarningColor );
		++g_NumWarnings;
		return;
	}

	MessageContent += 4;

	uint Offset = ( uint )( MessageContent - g_HTTPResultBuffer.GetData() );
	uint ContentSize = g_HTTPSocket->AsyncGetBytesReceived() - Offset;

	Array<SimpleString>	Lines;
	SplitIntoLines( MessageContent, ContentSize, Lines );

	for( uint LinesIndex = 0; LinesIndex + 2 < Lines.Size(); LinesIndex += 3 )
	{
		SManifestFile ManifestFile;
		ManifestFile.m_Filename = Lines[ LinesIndex ];
		ManifestFile.m_Length = Lines[ LinesIndex + 1 ];
		ManifestFile.m_Checksum = Lines[ LinesIndex + 2 ];
		ManifestFile.m_Validated = false;

		g_FilesInManifest.PushBack( ManifestFile );
	}

	AddStatus( "Manifest file received.", g_StatusColor );

	if( g_NextPatchFileIndex < g_FilesInManifest.Size() )
	{
		Patcher_GetNextPatchFile();
	}
}
Exemple #25
0
bool FNCCOL::InitColumn(PGLOBAL g)
{
  // Must have its own value block
  if (InitValue(g))
    return TRUE;

  // Make a value from the column name
  Hval = AllocateValue(g, Name, TYPE_STRING);
  Hval->SetPrec(1);         // Case insensitive

  Xcolp = ((PTDBPIVOT)To_Tdb)->Xcolp;
  AddStatus(BUF_READ);      // All is done here
  return FALSE;
} // end of InitColumn
Exemple #26
0
void Patcher_HandleReceipt_VersionNumber()
{
	char* MessageContent = strstr( g_HTTPResultBuffer.GetData(), CRLF CRLF );
	if( !MessageContent )
	{
		AddStatus( "Error receiving version number.", g_StatusWarningColor );
		++g_NumWarnings;
		return;
	}

	MessageContent += 4;	// Skip the CRLF CRLF

	// If there's additional content, only get the first line
	char* LineBreak = strstr( MessageContent, LF );
	if( LineBreak )
	{
		*LineBreak = '\0';
	}

	SimpleString LatestVersion = MessageContent;

	STATICHASH( Version );
	STATICHASH( ContentSyncer );
	SimpleString LocalVersion = ConfigManager::GetString( sVersion, "", sContentSyncer );

	if( LocalVersion == LatestVersion )
	{
		AddStatus( "Game is up to date.", g_StatusColor );
		g_ShouldLaunchApp = true;
	}
	else
	{
		AddStatus( "New updates are available.", g_StatusColor );
		BeginUpdating();
	}
}
Exemple #27
0
/*--------------------------------------------------------------------------*/
PictureMenu::PictureMenu(SIGNED iLeft, SIGNED iTop) : 
    PegWindow(FF_NONE)
{
    PegRect ChildRect;

	mReal.Set(iLeft, iTop, iLeft + 49, iTop + 299);
    InitClient();
    AddStatus(PSF_MOVEABLE|PSF_SIZEABLE);

    ChildRect.Set(iLeft + 0, iTop + 250, iLeft + 49, iTop + 299);
    m_pPictureMenuButtonColorTemp = new TVBitmapButton(ChildRect, &gbcolortempBitmap, ID_PictureMenu_Button_ColorTemp);
    Add(m_pPictureMenuButtonColorTemp);

    ChildRect.Set(iLeft + 0, iTop + 200, iLeft + 49, iTop + 249);
    m_pPictureMenuButtonColor = new TVBitmapButton(ChildRect, &gbreducenoiseBitmap, ID_PictureMenu_Button_Color);
    Add(m_pPictureMenuButtonColor);

    ChildRect.Set(iLeft + 0, iTop + 150, iLeft + 49, iTop + 199);
    m_pPictureMenuButtonSharp = new TVBitmapButton(ChildRect, &gbsharpnessBitmap, ID_PictureMenu_Button_Sharp);
    Add(m_pPictureMenuButtonSharp);

    ChildRect.Set(iLeft + 0, iTop + 100, iLeft + 49, iTop + 149);
    m_pPictureMenuButtonTint = new TVBitmapButton(ChildRect, &gbcolorBitmap, ID_PictureMenu_Button_Tint);
    Add(m_pPictureMenuButtonTint);

    ChildRect.Set(iLeft + 0, iTop + 50, iLeft + 49, iTop + 99);
    m_pPictureMenuButtonContrast = new TVBitmapButton(ChildRect, &gbcontrastBitmap, ID_PictureMenu_Button_Contrast);
    Add(m_pPictureMenuButtonContrast);

    ChildRect.Set(iLeft + 0, iTop + 0, iLeft + 49, iTop + 49);
    m_pPictuerMenuButtonBright = new TVBitmapButton(ChildRect, &gbbrightnessBitmap, ID_PictureMenu_Button_Brightness);
    Add(m_pPictuerMenuButtonBright);

    /* WB End Construction */
	m_pPictureMenuButtonColorTemp->SetTipString(LS(SID_PictureMenu_Prompt_ColorTemp));
	m_pPictureMenuButtonColor->SetTipString(LS(SID_PictureMenu_Prompt_Color));
    m_pPictureMenuButtonSharp->SetTipString(LS(SID_PictureMenu_Prompt_Sharpness)); 
	m_pPictureMenuButtonTint->SetTipString(LS(SID_PictureMenu_Prompt_Tint));
	m_pPictureMenuButtonContrast->SetTipString(LS(SID_PictureMenu_Prompt_Contrast));
	m_pPictuerMenuButtonBright->SetTipString(LS(SID_PictureMenu_Prompt_Brightness));
	m_pToolTip = NULL;
	m_nCurrentSubWndID = ID_PictureMenu_Button_Brightness;
	Id(PICTURE_MENU_ID);

}
Exemple #28
0
/*--------------------------------------------------------------------------*/
MainMenu::MainMenu(SIGNED iLeft, SIGNED iTop) : 
    PegWindow(FF_NONE)
{
    PegRect ChildRect;

	mReal.Set(iLeft, iTop, iLeft + 49, iTop + 249);
    InitClient();
    AddStatus(PSF_MOVEABLE|PSF_SIZEABLE);

    ChildRect.Set(iLeft + 0, iTop + 200, iLeft + 49, iTop + 249);
	m_pMainMenuButton_SupFunction = new TVBitmapButton(ChildRect, &gbsuperfunctionBitmap, ID_MainMenu_Button_SupFunction);
    Add(m_pMainMenuButton_SupFunction);

	ChildRect.Set(iLeft + 0, iTop + 150, iLeft + 49, iTop + 199);
	m_pMainMenuButtonSupSetting = new TVBitmapButton(ChildRect, &gbsupersettingBitmap, ID_MainMenu_Button_SupSetting);
    Add(m_pMainMenuButtonSupSetting);

    ChildRect.Set(iLeft + 0, iTop + 100, iLeft + 49, iTop + 149);
	m_pMainMenuButtonSound = new TVBitmapButton(ChildRect, &gbsoundBitmap, ID_MainMenu_Button_Sound);
    Add(m_pMainMenuButtonSound);

    ChildRect.Set(iLeft + 0, iTop + 50, iLeft + 49, iTop + 99);
    m_pMainMenuButtonPicture = new TVBitmapButton(ChildRect, &gbpictureBitmap, ID_MainMenu_Buttion_Picture);
    Add(m_pMainMenuButtonPicture);

    ChildRect.Set(iLeft + 0, iTop + 0, iLeft + 49, iTop + 49);
	m_pMainMenuButtonFactorySetting = new TVBitmapButton(ChildRect, &gbfactoryBitmap, ID_MainMenu_Button_FactorySetting);
    Add(m_pMainMenuButtonFactorySetting);

    /* WB End Construction */
	m_pMainMenuButtonFactorySetting->SetTipString(LS(SID_MainMenu_Prompt_Factory));
	m_pMainMenuButton_SupFunction->SetTipString(LS(SID_MainMenu_Prompt_SuperFunction));
	m_pMainMenuButtonSupSetting->SetTipString(LS(SID_MainMenu_Prompt_SuperSetting));

	m_pMainMenuButtonSound->SetTipString(LS(SID_MainMenu_Prompt_Sound));
	m_pMainMenuButtonPicture->SetTipString(LS(SID_MainMenu_Prompt_Picture));

	m_pToolTip = NULL;
	m_pTVHelpWnd = NULL;
	m_nCurrentSubWndID = ID_MainMenu_Button_FactorySetting;


	Id(MAIN_MENU_ID);
}
Exemple #29
0
bool COLBLK::Eval(PGLOBAL g)
  {
#ifdef DEBTRACE
 htrc("Col Eval: %s status=%.4X\n", Name, Status);
#endif

  if (!GetStatus(BUF_READ)) {
//  if (To_Tdb->IsNull())
//    Value->Reset();
    if (To_Kcol)
      To_Kcol->FillValue(Value);
    else
      ReadColumn(g);

    AddStatus(BUF_READ);
    } // endif

  return false;
  } // end of Eval
Exemple #30
0
PegMenuBar::PegMenuBar(PegMenuDescription *pDesc) : PegThing()
{
    PegFont *pFont = DEF_MENU_FONT;
    mReal.Set(0, 0, 100, pFont->uHeight + 6);
    mClient.Set(0, 0, 100, pFont->uHeight + 6);
    Type(TYPE_MENU_BAR);
    muColors[PCI_NORMAL] = PCLR_BUTTON_FACE;
    AddStatus(PSF_SIZEABLE | PSF_MOVEABLE | PSF_NONCLIENT);

    if (pDesc)
    {
        while (pDesc->wId || pDesc->wStyle)
        {
            Add(new PegMenuButton(pDesc));
            pDesc++;
        }
    }
    mbFlyoverMode = 0;
}