Ejemplo n.º 1
0
zOPER_EXPORT zSHORT OPERATION
zwTZCMRPTD_RefreshSelComponents( zVIEW vSubtask )
{
   zVIEW    vTZCMLPLO;
   zVIEW    vTZCMRPTO;
   zVIEW    vCompList;
   zVIEW    vTZCMRPTO_New;
   zCHAR    szName[ 33 ];
   zCHAR    szERR_Msg[ 254 ];

   SetNameForView( vSubtask,"TZCM_ChkInWindow", vSubtask, zLEVEL_TASK );
   GetViewByName( &vTZCMRPTO, "TZCMRPTO", vSubtask, zLEVEL_TASK );

   if ( SetCursorFirstSelectedEntity( vTZCMRPTO, "ReportLine",
                                      "" ) < zCURSOR_SET )
   {
      zstrcpy( szERR_Msg, "No Component selected to Refresh." );
      MessageSend( vSubtask, "CM00241", "Configuration Management",
                   szERR_Msg, zMSGQ_OBJECT_CONSTRAINT_WARNING, zBEEP );
      return( 0 );
   }

   if ( zwTZCMLPLD_OptionRefreshFromRepo( vSubtask, &vTZCMLPLO,
                                          szName, zRefreshUserDefined ) < 0 )
   {
      return( -1 );
   }

   GetViewByName( &vTZCMRPTO_New, "TZCMRPTO_New", vSubtask, zLEVEL_TASK );

   // if component refreshed?
   if ( CompareAttributeToInteger( vTZCMRPTO_New, "CPLR",
                                   "ComponentRefreshed", 1 ) == 0 )
   {
      zstrcpy( szERR_Msg, "Project '" );
      GetStringFromAttribute( &szERR_Msg[ zstrlen( szERR_Msg ) ], vTZCMLPLO,
                              "LPLR", "Name" );
      zstrcat( szERR_Msg, "' has been successfully refreshed \nfrom CPLR '" );
      zstrcat( szERR_Msg, szName );
      zstrcat( szERR_Msg, "'." );
      MessageSend( vSubtask, "CM00279", "Configuration Management",
                   szERR_Msg,
                   zMSGQ_OBJECT_CONSTRAINT_INFORMATION, zBEEP );
   }

   if ( GetViewByName( &vTZCMRPTO, "TZCMRPTO", vSubtask, zLEVEL_TASK ) > 0 )
      DropObjectInstance( vTZCMRPTO );

   // Build new Refresh List
   if ( zwTZCMLPLD_RefreshUserDefined( vSubtask ) < 1 )
      return( -1 );

   RefreshWindow( vSubtask );

   if ( GetViewByName( &vCompList, "CompList", vSubtask, zLEVEL_TASK ) >= 0 )
      RefreshWindow( vCompList );

   return( 0 );
} // zwTZCMRPTD_RefreshSelComponents
Ejemplo n.º 2
0
// This function draws a circular arc, centered at (x,y) with the given radius.
// The arc travels from angle stangle to angle endangle.  The angles are given
// in degrees in standard mathematical notation, with 0 degrees along the
// vector (1,0) and travelling counterclockwise.
// POSTCONDITION: The arccoords variable (arcinfo) for the current window
//                is set with data resulting from this call.
//                The current position is not modified.
//
void arc( int x, int y, int stangle, int endangle, int radius )
{
    HDC hDC;
    WindowData* pWndData = BGI__GetWindowDataPtr( );
    // Convert coordinates to those expected by GDI Arc
    int left, top, right, bottom;
    int xstart, ystart, xend, yend;

    // Convert center coordinates to box coordinates
    CenterToBox( x, y, radius, radius, &left, &top, &right, &bottom );
    // Convert given arc specifications to pixel start and end points.
    ArcEndPoints( x, y, radius, radius, stangle, endangle, &xstart, &ystart, &xend, &yend );

    // Draw to the current active page
    hDC = BGI__GetWinbgiDC( );
    Arc( hDC, left, top, right, bottom, xstart, ystart, xend, yend );
    BGI__ReleaseWinbgiDC( );
    
    // The update rectangle does not contain the right or bottom edge.  Thus
    // add 1 so the entire region is included.
    RECT rect = { left, top, right+1, bottom+1 };
    RefreshWindow( &rect );

    // Set the arccoords structure to relevant data.
    pWndData->arcInfo.x = x;
    pWndData->arcInfo.y = y;
    pWndData->arcInfo.xstart = xstart;
    pWndData->arcInfo.ystart = ystart;
    pWndData->arcInfo.xend = xend;
    pWndData->arcInfo.yend = yend;
}
Ejemplo n.º 3
0
// This function draws a 2D bar.
//
void bar( int left, int top, int right, int bottom )
{
    HDC hDC;
    WindowData* pWndData = BGI__GetWindowDataPtr( );
    HBRUSH hBrush;
    int color;

    hDC = BGI__GetWinbgiDC( );
    // Is it okay to use the currently selected brush to paint with?
    hBrush = (HBRUSH)GetCurrentObject( hDC, OBJ_BRUSH );
    // Set the text color for the fill pattern
    // Convert from BGI color to RGB color
    color = converttorgb( pWndData->fillInfo.color );
    SetTextColor( hDC, color );
    RECT r = {left, top, right, bottom};
    FillRect( hDC, &r, hBrush );
    // Reset the text color to the drawing color
    color = converttorgb( pWndData->drawColor );
    SetTextColor( hDC, color );
    BGI__ReleaseWinbgiDC( );
    
    // The update rectangle does not contain the right or bottom edge.  Thus
    // add 1 so the entire region is included.
    RECT rect = { left, top, right+1, bottom+1 };
    RefreshWindow( &rect );
}
Ejemplo n.º 4
0
BOOL TextView::BackDelete()
{
	ULONG selstart = min(m_nSelectionStart, m_nSelectionEnd);
	ULONG selend   = max(m_nSelectionStart, m_nSelectionEnd);

	// if there's a selection then delete it
	if(selstart != selend)
	{
		m_pTextDoc->erase_text(selstart, selend-selstart);
		m_nCursorOffset = selstart;
		m_pTextDoc->m_seq.breakopt();
	}
	// otherwise do a back-delete
	else if(m_nCursorOffset > 0)
	{
		//m_nCursorOffset--;
		ULONG oldpos = m_nCursorOffset;
		MoveCharPrev();
		//m_pTextDoc->erase_text(m_nCursorOffset, 1);
		m_pTextDoc->erase_text(m_nCursorOffset, oldpos - m_nCursorOffset);
	}

	m_nSelectionStart = m_nCursorOffset;
	m_nSelectionEnd   = m_nCursorOffset;

	ResetLineCache();
	RefreshWindow();
	Smeg(FALSE);

	return TRUE;
}
Ejemplo n.º 5
0
void Manager::RefreshAll(void)
{
	if (!m_windows.empty())
	{
		RefreshWindow(m_windows.front());
	}
}
Ejemplo n.º 6
0
// This function draws a rectangle border in the current line style, thickness, and color
//
void rectangle( int left, int top, int right, int bottom )
{
    HDC hDC;
    WindowData* pWndData = BGI__GetWindowDataPtr( );

    POINT endpoints[5];         // Endpoints of the line
    endpoints[0].x = left;      // Upper left
    endpoints[0].y = top;
    endpoints[1].x = right;     // Upper right
    endpoints[1].y = top;
    endpoints[2].x = right;     // Lower right
    endpoints[2].y = bottom;
    endpoints[3].x = left;      // Lower left
    endpoints[3].y = bottom;
    endpoints[4].x = left;      // Upper left to complete rectangle
    endpoints[4].y = top;

    hDC = BGI__GetWinbgiDC( );
    Polyline( hDC, endpoints, 5 );
    BGI__ReleaseWinbgiDC( );

    // The update rectangle does not contain the right or bottom edge.  Thus
    // add 1 so the entire region is included.
    RECT rect = { left, top, right+1, bottom+1 };
    RefreshWindow( &rect );
}
Ejemplo n.º 7
0
// This function draws an elliptical pie slice centered at (x,y) with major
// and minor radii given by xradius and yradius.  It is filled with the
// current fill pattern and color and outlined with the current line color.
// The pie slice travels from angle stangle to angle endangle.  The angles are
// given in degrees in standard mathematical notation, with 0 degrees along
// the vector (1,0) and travelling counterclockwise.
// 
void sector( int x, int y, int stangle, int endangle, int xradius, int yradius )
{
    HDC hDC;
    WindowData* pWndData = BGI__GetWindowDataPtr( );
    // Convert coordinates to those expected by GDI Pie
    int left, top, right, bottom;
    int xstart, ystart, xend, yend;
    int color;


    // Convert center coordinates to box coordinates
    CenterToBox( x, y, xradius, yradius, &left, &top, &right, &bottom );
    // Convert given arc specifications to pixel start and end points.
    ArcEndPoints( x, y, xradius, yradius, stangle, endangle, &xstart, &ystart, &xend, &yend );

    // Set the text color for the fill pattern
    // Convert from BGI color to RGB color
    color = converttorgb( pWndData->fillInfo.color );
    hDC = BGI__GetWinbgiDC( );
    SetTextColor( hDC, color );
    Pie( hDC, left, top, right, bottom, xstart, ystart, xend, yend );
    // Reset the text color to the drawing color
    color = converttorgb( pWndData->drawColor );
    SetTextColor( hDC, color );
    BGI__ReleaseWinbgiDC( );

    // The update rectangle does not contain the right or bottom edge.  Thus
    // add 1 so the entire region is included.
    RECT rect = { left, top, right+1, bottom+1 };
    RefreshWindow( &rect );
}
Ejemplo n.º 8
0
// This function draws and ellipse centered at (x,y) with major and minor axes
// xradius and yradius.  It fills the ellipse with the current fill color and
// fill pattern.
//
void fillellipse( int x, int y, int xradius, int yradius )
{
    HDC hDC;
    WindowData* pWndData = BGI__GetWindowDataPtr( );
    // Convert coordinates to those expected by GDI Ellipse
    int left, top, right, bottom;
    int color;

    // Convert center coordinates to box coordinates
    CenterToBox( x, y, xradius, yradius, &left, &top, &right, &bottom );

    // Set the text color for the fill pattern
    // Convert from BGI color to RGB color
    hDC = BGI__GetWinbgiDC( );
    color = converttorgb( pWndData->fillInfo.color );
    SetTextColor( hDC, color );
    Ellipse( hDC, left, top, right, bottom );
    // Reset the text color to the drawing color
    color = converttorgb( pWndData->drawColor );
    SetTextColor( hDC, color );
    BGI__ReleaseWinbgiDC( );

    // The update rectangle does not contain the right or bottom edge.  Thus
    // add 1 so the entire region is included.
    RECT rect = { left, top, right+1, bottom+1 };
    RefreshWindow( &rect );
}
Ejemplo n.º 9
0
void CUWPsWindow::CreateSubWindows(HWND hWnd)
{
	cuwpTree.CreateThis(hWnd, 5, 5, 175, 100, false, CuwpTree);
	checkUsed.CreateThis(hWnd, 185, 5, 100, 20, false, "Is Used", CheckUsed);
	checkUsed.DisableThis();

	healthPercent.CreateThis(hWnd, 190, 40, 65, 20, "Life (%): ", 0);
	manaPercent.CreateThis(hWnd, 190, 65, 65, 20, "Mana (%): ", 0);
	shieldPercent.CreateThis(hWnd, 190, 90, 65, 20, "Shield (%): ", 0);
	resourceAmount.CreateThis(hWnd, 190, 115, 65, 20, "Resources: ", 0);
	hangerAmount.CreateThis(hWnd, 190, 140, 65, 20, "Hanger: ", 0);

	editHitpointPercent.CreateThis(hWnd, 260, 38, 80, 20, false, EditHitpoints);
	editManaPercent.CreateThis(hWnd, 260, 63, 80, 20, false, EditMana);
	editShieldPercent.CreateThis(hWnd, 260, 88, 80, 20, false, EditShields);
	editResources.CreateThis(hWnd, 260, 113, 80, 20, false, EditResources);
	editHanger.CreateThis(hWnd, 260, 138, 80, 20, false, EditHanger);

	checkInvincible.CreateThis(hWnd, 190, 170, 100, 20, false, "Invincible", CheckInvincible);
	checkBurrowed.CreateThis(hWnd, 190, 190, 100, 20, false, "Burrowed", CheckBurrowed);
	checkLifted.CreateThis(hWnd, 190, 210, 100, 20, false, "Lifted", CheckLifted);
	checkHallucinated.CreateThis(hWnd, 190, 230, 100, 20, false, "Hallucinated", CheckHallucinated);
	checkCloaked.CreateThis(hWnd, 190, 250, 100, 20, false, "Cloaked", CheckCloaked);

	DisableEditing();
	RefreshWindow(true);
}
Ejemplo n.º 10
0
BOOKNODE * HexView::AddBookmark(BOOKMARK * bookm)
{
	BOOKNODE * bnew = new BOOKNODE();//bookm);
	BOOKNODE * bptr;

	// find the best place to insert into
	for(bptr = m_BookHead->next; bptr != m_BookTail; bptr = bptr->next)
	{
		if(bookm->offset < bptr->bookmark.offset)
		{
			break;
		}
	}

	bnew->prev		 = bptr->prev;
	bnew->next		 = bptr;

	bptr->prev->next = bnew;
	bptr->prev		 = bnew;


	bnew->bookmark = *bookm;
	bnew->bookmark.pszText  = bookm->pszText ? _tcsdup(bookm->pszText) : 0;//TEXT("");
	bnew->bookmark.pszTitle = bookm->pszTitle ? _tcsdup(bookm->pszTitle) : 0;//TEXT("");
	

	RefreshWindow();


	return (BOOKNODE *)bnew;
}
Ejemplo n.º 11
0
void CCompressionOptionsPage::OnGetTime() 
{
	if (!Enc_Info.b_selectrange)
	{
		UpdateData(TRUE);
		
		Enc_Info.b_gettimefromvob = m_bGetTime;
		if (m_bGetTime)
		{
			m_lFrames = Enc_Info.l_frames;
			m_lSeconds = (long) (m_lFrames / Enc_Info.f_framerate);
		}
		
		m_hour = m_lSeconds / 3600;
		m_min = (-m_hour * 3600 + m_lSeconds) / 60;
		m_sec = (-m_hour * 3600 - m_min * 60 + m_lSeconds);
		
		RefreshWindow();
		
		if (Enc_Info.b_enter_filesize == 1)
		{
			Calc();
		}
		else
		{
			CalcFileSize();
		}
	}
}
Ejemplo n.º 12
0
void CMainDlg::OnMouseHookMouseMove(UINT nFlags, CPoint point)
{
	// TODO : figure out while cursor is not changing 
	// Change cursor
	::SetCursor(m_hSelectCursor);

	// Check selecting flag
	if(m_bSelecting)
	{
		// Get window under mouse
		HWND hFound = ::WindowFromPoint(point);
		if(m_hHilightWnd != hFound)
		{
			HWND hOld = m_hHilightWnd;
			m_hHilightWnd = hFound;

			// Undraw old
			if((hOld) && (::IsWindow(hOld)))
				RefreshWindow(hOld);

			// Draw new
			HighlightWindow(m_hHilightWnd);
		}
	}

	// Check drawing flag
	if(m_bDrawing)
	{
		// Draw 
		DrawFocusRect(point);

		// Save current point
		m_ptLast = point;
	}
}
Ejemplo n.º 13
0
// This function clears the current viewport (with the background color) and
// moves the current point to (0,0 (relative to the viewport)
//
void clearviewport( )
{
    HDC hDC;
    WindowData* pWndData = BGI__GetWindowDataPtr( );
    int color;
    RECT rect;
    HBRUSH hBrush;
    
    // Convert from BGI color to RGB color
    color = converttorgb( pWndData->bgColor );

    rect.left = 0;
    rect.top = 0;
    rect.right = pWndData->viewportInfo.right - pWndData->viewportInfo.left;
    rect.bottom = pWndData->viewportInfo.bottom - pWndData->viewportInfo.top;

    // Fill hDC with background color
    hDC = BGI__GetWinbgiDC( );
    hBrush = CreateSolidBrush( color );
    FillRect( hDC, &rect, hBrush );
    DeleteObject( hBrush );
    BGI__ReleaseWinbgiDC( );
    moveto( 0, 0 );

    RefreshWindow( NULL );
}
Ejemplo n.º 14
0
zOPER_EXPORT zSHORT OPERATION
zwTZCMRPTD_RefreshAllComponents( zVIEW vSubtask )
{
   zVIEW    vTZCMLPLO;
   zVIEW    vTZCMRPTO;
   zVIEW    vCompList;
   zCHAR    szName[ 33 ];
   zCHAR    szERR_Msg[ 254 ];

   if ( GetViewByName( &vTZCMRPTO, "TZCMRPTO", vSubtask, zLEVEL_TASK ) > 0 )
      DropObjectInstance( vTZCMRPTO );

   if ( zwTZCMLPLD_OptionRefreshFromRepo( vSubtask, &vTZCMLPLO,
                                          szName, zRefreshLPLR ) < 0 )
   {
      return( -1 );
   }

   zstrcpy( szERR_Msg, "Project '" );
   GetStringFromAttribute( &szERR_Msg[ zstrlen( szERR_Msg ) ], vTZCMLPLO,
                           "LPLR", "Name" );
   zstrcat( szERR_Msg, "' has been successfully refreshed." );
   MessageSend( vSubtask, "CM00279", "Configuration Management",
                szERR_Msg,
                zMSGQ_OBJECT_CONSTRAINT_INFORMATION, zBEEP );

   if ( GetViewByName( &vCompList, "CompList", vSubtask, zLEVEL_TASK ) >= 0 )
      RefreshWindow( vCompList );

   return( 0 );
} // zwTZCMRPTD_RefreshAllComponents
Ejemplo n.º 15
0
LRESULT TrigPlayersWindow::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch ( msg )
	{
		case WM_SHOWWINDOW:
			if ( wParam == FALSE )
				OnLeave();
			else if ( wParam == TRUE )
				RefreshWindow(trigIndex);
			return ClassWindow::WndProc(hWnd, msg, wParam, lParam);
			break;

		case WM_LBUTTONDOWN:
			SetFocus(getHandle());
			return ClassWindow::WndProc(hWnd, msg, wParam, lParam);
			break;

		case WM_CLOSE:
			OnLeave();
			return ClassWindow::WndProc(hWnd, msg, wParam, lParam);
			break;

		default:
			return ClassWindow::WndProc(hWnd, msg, wParam, lParam);
	}
	return 0;
}
Ejemplo n.º 16
0
//
//	WM_LBUTTONDOWN
//
//	Set the item position from the specified client coordinates
//
LRESULT GridView::OnLButtonDown(int x, int y)
{
	ULONG lineNo, colIdx, portion;

	GVRow *rowptr;
	RECT rect;

//	RelayEvent(m_hWndTooltip, WM_LBUTTONDOWN, x, y);
	
	if((rowptr = MouseToItem(x, y, &lineNo, &colIdx, &portion, &rect)) == 0)
		return 0;

	if(m_hwndEdit)
		ExitEditMode(FALSE);

	if((portion & GHT_TREEBUTTON) && rowptr)
	{
		ToggleRow(rowptr, lineNo);

		NotifyParent(GVN_ITEMEXPANDED, rowptr);
	}
	else
	{
		// have we clicked again in the already selected item?
		if(m_nCurrentColumn == colIdx && m_nCurrentLine == lineNo)
		{
			if(portion & GHT_TEXT)
			{
				EnterEditMode();
				return 0;
			}
		}
		else
		{
			if(m_nCurrentColumn != colIdx)
			{
				RefreshWindow();
				m_nCurrentColumn = colIdx;
			}
			
			if(m_nCurrentLine != lineNo)
			{
				RedrawLine(m_nCurrentLine);
				RedrawLine(lineNo);
				m_nCurrentLine   = lineNo;
			}

			NotifyParent(GVN_SELCHANGED, rowptr);

			// make an exception - always edit if the combo is clicked on!
			if(portion & GHT_COMBO)
				EnterEditMode();
		}
	
		m_fMouseDown = TRUE;
		SetCapture(m_hWnd);
	}
	return 0;
}
Ejemplo n.º 17
0
Archivo: Tools.cpp Proyecto: glfpes/VLP
 void Tools::PrintMessage(std::string WindowName, std::string Message)
 {
   if (Messages.find(WindowName) == Messages.end()) {
     Messages[WindowName] = std::vector<std::string>();
   }
   Messages[WindowName].push_back(Message);
   RefreshWindow(WindowName);
 }
Ejemplo n.º 18
0
/////////////////////////////////////////////////////////////////////////////
//
//    OPERATION: zwTZERRORD_RefreshErrorList
//
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT /*DIALOG */  OPERATION
zwTZERRORD_RefreshErrorList( zVIEW vSubtask )
{
   zwTZERRORD_SetCountError( vSubtask );
   RefreshWindow( vSubtask );
   return( 0 );

} // zwTZERRORD_RefreshErrorList
Ejemplo n.º 19
0
int ReloadIcons(WPARAM wParam, LPARAM lParam) {
	hIconResponding = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ping_responding");
	hIconNotResponding = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ping_not_responding");
	hIconTesting = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ping_testing");
	hIconDisabled = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ping_disabled");

	RefreshWindow(0, 0);
	return 0;
}
Ejemplo n.º 20
0
bool TrigModifyWindow::CreateThis(HWND hParent, u32 trigIndex)
{
    if ( getHandle() == NULL &&
         ClassDialog::CreateModelessDialog(MAKEINTRESOURCE(IDD_TRIGMODIFY), hParent) )
    {
        ShowNormal();
        ChangeTab(currTab);
        RefreshWindow(trigIndex);
        return true;
    }
    else if ( getHandle() != NULL )
    {
        Show();
        ChangeTab(currTab);
        RefreshWindow(trigIndex);
    }
    return false;
}
Ejemplo n.º 21
0
ULONG TextViewBase::SelectAll()
{	m_nSelectionStart = 0;
	m_nSelectionEnd   = m_pTextDoc->charCount();
	//m_nCursorOffset   = m_nSelectionEnd;

	//Smeg(TRUE);
	RefreshWindow();
	return 0;
}
Ejemplo n.º 22
0
int ReloadIcons(WPARAM, LPARAM)
{
	hIconResponding = IcoLib_GetIcon("ping_responding");
	hIconNotResponding = IcoLib_GetIcon("ping_not_responding");
	hIconTesting = IcoLib_GetIcon("ping_testing");
	hIconDisabled = IcoLib_GetIcon("ping_disabled");

	RefreshWindow(0, 0);
	return 0;
}
Ejemplo n.º 23
0
void TrigGeneralWindow::SetPausedTrigger(bool paused)
{
    Trigger* trigger;
    if ( CM->getTrigger(trigger, trigIndex) )
    {
        trigger->setFlagPaused(paused);
        CM->notifyChange(false);
        RefreshWindow(trigIndex);
    }
}
Ejemplo n.º 24
0
void TrigGeneralWindow::SetIgnoreDefeatDraw(bool ignoreDefeatDraw)
{
    Trigger* trigger;
    if ( CM->getTrigger(trigger, trigIndex) )
    {
        trigger->setIgnoreDefeatDraw(ignoreDefeatDraw);
        CM->notifyChange(false);
        RefreshWindow(trigIndex);
    }
}
Ejemplo n.º 25
0
void TrigGeneralWindow::SetIgnoreMiscActionsOnce(bool ignoreMiscActionsOnce)
{
    Trigger* trigger;
    if ( CM->getTrigger(trigger, trigIndex) )
    {
        trigger->setIgnoreMiscActionsOnce(ignoreMiscActionsOnce);
        CM->notifyChange(false);
        RefreshWindow(trigIndex);
    }
}
Ejemplo n.º 26
0
void TrigGeneralWindow::SetPreserveTrigger(bool preserve)
{
    Trigger* trigger;
    if ( CM->getTrigger(trigger, trigIndex) )
    {
        trigger->setPreserveTriggerFlagged(preserve);
        CM->notifyChange(false);
        RefreshWindow(trigIndex);
    }
}
Ejemplo n.º 27
0
void TrigGeneralWindow::SetDisabledTrigger(bool disabled)
{
    Trigger* trigger;
    if ( CM->getTrigger(trigger, trigIndex) )
    {
        trigger->setDisabled(disabled);
        CM->notifyChange(false);
        RefreshWindow(trigIndex);
    }
}
Ejemplo n.º 28
0
void TrigPlayersWindow::CheckBoxUpdated(u16 checkId)
{
	Trigger* trig;
	if ( chkd.maps.curr->getTrigger(trig, trigIndex) )
	{
		if ( checkId >= CHECK_PLAYER1 && checkId <= CHECK_PLAYER8 )
		{
			u8 player = u8(checkId-CHECK_PLAYER1);
			if ( checkMainPlayers[player].isChecked() )
				trig->players[player+Player1] = 1;
			else
				trig->players[player+Player1] = 0;
		}
		else if ( checkId >= CHECK_FORCE1 && checkId <= CHECK_FORCE4 )
		{
			u8 force = u8(checkId-CHECK_FORCE1);
			if ( checkForces[force].isChecked() )
				trig->players[force+Force1] = 1;
			else
				trig->players[force+Force1] = 0;
		}
		else if ( checkId == CHECK_ALL_PLAYERS )
		{
			if ( checkAllPlayers.isChecked() )
				trig->players[AllPlayers] = 1;
			else
				trig->players[AllPlayers] = 0;
		}
		else if ( checkId >= CHECK_PLAYER9 && checkId <= CHECK_NEUTRALPLAYERS )
		{
			u8 lowerNonExecutingPlayersId = u8(checkId-CHECK_PLAYER9);
			if ( checkNonExecutingPlayers[lowerNonExecutingPlayersId].isChecked() )
				trig->players[checkId-CHECK_PLAYER1] = 1;
			else
				trig->players[checkId-CHECK_PLAYER1] = 0;
		}
		else if ( checkId >= CHECK_UNUSED1 && checkId <= CHECK_ID27 )
		{
			u8 upperNonExecutingPlayersId = u8(checkId-CHECK_UNUSED1+9);
			if ( checkNonExecutingPlayers[upperNonExecutingPlayersId].isChecked() )
				trig->players[checkId-CHECK_PLAYER1] = 1;
			else
				trig->players[checkId-CHECK_PLAYER1] = 0;
		}
		else if ( checkId == CHECK_ALLOWRAWEDIT )
		{
			if ( checkAllowRawEdit.isChecked() )
				editRawPlayers.EnableThis();
			else
				editRawPlayers.DisableThis();
		}
		
	}
	RefreshWindow(trigIndex);
}
Ejemplo n.º 29
0
// This function draws a bar with a 3D outline.  The angle of the bar background is
// 30 degrees.
void bar3d( int left, int top, int right, int bottom, int depth, int topflag )
{
    HDC hDC;
    WindowData* pWndData = BGI__GetWindowDataPtr( );
    int color;
    int dy;     // Distance to draw 3D bar up to
    POINT p[4]; // An array to hold vertices for the outline

    hDC = BGI__GetWinbgiDC( );
    // Set the text color for the fill pattern
    // Convert from BGI color to RGB color
    color = converttorgb( pWndData->fillInfo.color );
    SetTextColor( hDC, color );
    Rectangle( hDC, left, top, right, bottom );
    // Reset the text color to the drawing color
    color = converttorgb( pWndData->drawColor );
    SetTextColor( hDC, color );

    // Draw the surrounding part.
    // The depth is specified to be the x-distance from the front line to the
    // back line, not the actual diagonal line length
    dy = (int)(depth * tan( 30.0 * M_PI / 180.0 ));
    
    p[0].x = right;
    p[0].y = bottom;            // Bottom right of box
    p[1].x = right + depth;
    p[1].y = bottom - dy;       // Bottom right of outline
    p[2].x = right + depth;
    p[2].y = top - dy;          // Upper right of outline
    p[3].x = right;
    p[3].y = top;               // Upper right of box

    // A depth of zero is a way to draw a 2D bar with an outline.  No need to
    // draw the 3D outline in this case.
    if ( depth != 0 )
        Polyline( hDC, p, 4 );

    // If the user specifies the top to be drawn
    if ( topflag != 0 )
    {
        p[0].x = right + depth;
        p[0].y = top - dy;          // Upper right of outline
        p[1].x = left + depth;
        p[1].y = top - dy;          // Upper left of outline
        p[2].x = left;
        p[2].y = top;               // Upper left of box
        Polyline( hDC, p, 3 );
    }
    BGI__ReleaseWinbgiDC( );
    
    // The update rectangle does not contain the right or bottom edge.  Thus
    // add 1 so the entire region is included.
    RECT rect = { left, top-dy, right+depth+1, bottom+1 };
    RefreshWindow( &rect );
}
Ejemplo n.º 30
0
BOOL TextView::ForwardDelete()
{
	ULONG selstart = min(m_nSelectionStart, m_nSelectionEnd);
	ULONG selend   = max(m_nSelectionStart, m_nSelectionEnd);

	if(selstart != selend)
	{
		m_pTextDoc->erase_text(selstart, selend-selstart);
		m_nCursorOffset = selstart;

		m_pTextDoc->m_seq.breakopt();
	}
	else
	{
		BYTE tmp[2];
		//USPCACHE		* uspCache;
		//CSCRIPT_LOGATTR * logAttr;
		//ULONG			  lineOffset;
		//ULONG			  index;

		m_pTextDoc->m_seq.render(m_nCursorOffset, tmp, 2);

		/*GetLogAttr(m_nCurrentLine, &uspCache, &logAttr, &lineOffset);
	
		index = m_nCursorOffset - lineOffset;

		do
		{
			m_pTextDoc->seq.erase(m_nCursorOffset, 1);
			index++;
		}
		while(!logAttr[index].fCharStop);*/

		ULONG oldpos = m_nCursorOffset;
		MoveCharNext();

		m_pTextDoc->erase_text(oldpos, m_nCursorOffset - oldpos);
		m_nCursorOffset = oldpos;
		

		//if(tmp[0] == '\r')
		//	m_pTextDoc->erase_text(m_nCursorOffset, 2);
		//else
		//	m_pTextDoc->erase_text(m_nCursorOffset, 1);
	}

	m_nSelectionStart = m_nCursorOffset;
	m_nSelectionEnd   = m_nCursorOffset;

	ResetLineCache();
	RefreshWindow();
	Smeg(FALSE);

	return TRUE;
}