Exemplo n.º 1
0
//---------------------------------------------------------------------------
void __fastcall TTScope::SBUpWClick(TObject *Sender)
{
	int x = (m_CursorX - m_XOFF) * PaintBox->Width / m_XW;
	if( m_XW < 512 ){
		m_XW += 32;
		AdjXoff(x);
		PaintBoxPaint(NULL);
	}
	else if( m_XW <= (pScope->m_ScopeSize - 512) ){
		m_XW += 512;
		AdjXoff(x);
		PaintBoxPaint(NULL);
	}
	UpdateBtn();
}
Exemplo n.º 2
0
//---------------------------------------------------------------------------
void __fastcall TTScope::SBDownWClick(TObject *Sender)
{
	int x = (m_CursorX - m_XOFF) * PaintBox->Width / m_XW;
	if( m_XW >= 1024 ){
		m_XW -= 512;
		AdjXoff(x);
		PaintBoxPaint(NULL);
	}
	else if( m_XW >= 64 ){
		m_XW -= 32;
		AdjXoff(x);
		PaintBoxPaint(NULL);
	}
	UpdateBtn();
}
Exemplo n.º 3
0
//---------------------------------------------------------------------------
void __fastcall TForm1::FormActivate(TObject *Sender)
{
        Obraz=new Graphics::TBitmap();
        Obraz->Width=PaintBox->Width;
        Obraz->Height=PaintBox->Height;
        updateedits(Sender);
        PaintBoxPaint(Sender);
        maycount = true;
}
Exemplo n.º 4
0
//---------------------------------------------------------------------------
void __fastcall TTScope::TimerTimer(TObject *Sender)
{
	if( pDem == NULL ) return;

	if( pScope->GetFlag() ){
		PaintBoxPaint(NULL);
		if( SBTrig->Down ){
			SBTrig->Down = FALSE;
		}
	}
}
Exemplo n.º 5
0
//---------------------------------------------------------------------------
void __fastcall TForm1::PaintBoxMouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
        if(Przesuwany==true)
        {
                L[Nr].x=X-dx;
                L[Nr].y=Y-dy;
                PaintBoxPaint(Sender);
        }
        if(kreowany==true)
        {
                L[Nr].vx=(X-dx)*4.;
                L[Nr].vy=(Y-dy)*4.;
                PaintBoxPaint(Sender);
        }
        char buffer[64];
        snprintf(buffer, sizeof(buffer), "X = %g", rx(X));
        Label3->Caption = buffer;
        snprintf(buffer, sizeof(buffer), "Y = %g", ry(Y));
        Label4->Caption = buffer;
}
Exemplo n.º 6
0
//---------------------------------------------------------------------------
void __fastcall TTScope::SBUpDownClick(TObject *Sender)
{
	int x;
	double d, peak;
	peak = 0;
	double *dp = &pScope[1].pScopeData[m_XOFF];
	for( x = m_XOFF; x < (m_XOFF + m_XW); x++, dp++ ){
		d = fabs(*dp);
		if( peak < d ) peak = d;
	}
	if( peak ){
		m_Gain = 16384.0 * 0.8 / peak;
	}
	PaintBoxPaint(NULL);
}
Exemplo n.º 7
0
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer2Timer(TObject *Sender)
{
        PaintBoxPaint(Sender);
}
Exemplo n.º 8
0
//---------------------------------------------------------------------------
void __fastcall TForm1::CSpinIloscChange(TObject *Sender)
{
        Ilosc = CSpinIlosc->Value;
        updateedits(Sender);
        PaintBoxPaint(Sender);
}
Exemplo n.º 9
0
//---------------------------------------------------------------------------
void __fastcall TForm1::CSpinNrChange(TObject *Sender)
{
        Nr = CSpinNr->Value;
        updateedits(Sender);
        PaintBoxPaint(Sender);
}
Exemplo n.º 10
0
//---------------------------------------------------------------------------
void __fastcall TForm1::FormResize(TObject *Sender)
{
  Obraz->Width=PaintBox->Width;
  Obraz->Height=PaintBox->Height;
  PaintBoxPaint(Sender);        
}
Exemplo n.º 11
0
void __fastcall TFormMain::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
{
  TRect R = RectNormalize(&Selection);
  unsigned tx = MAX(ListView->ItemIndex,0);

  //ShowMessage(Key);
  switch (Key)
  {
    case 221: {APPLY(cell->bot += 64) Key = 1; break;}
    case 219: {APPLY(cell->bot -= 64) Key = 1; break;}
    //case  36: {APPLY(cell->mid += 64) Key = 1; break;}
    //case  35: {APPLY(cell->mid -= 64) Key = 1; break;}
    case 'P': {APPLY(cell->top += 64) Key = 1; break;}
    case 'O': {APPLY(cell->top -= 64) Key = 1; break;}
    case 'L': {APPLY(cell->swi ^= CELL_SWI_LIGHT) Key = 1; break;}

    case  45: {if(tc)tx=(tx-1)%YETI_TEXTURE_MAX;APPLY(cell->btx=tx);Key=1;break;}
    case  46: {if(tc)tx=(tx+1)%YETI_TEXTURE_MAX;APPLY(cell->btx=tx);Key=1;break;}
    case  36: {if(tc)tx=(tx-1)%YETI_TEXTURE_MAX;APPLY(cell->wtx=tx);Key=1;break;}
    case  35: {if(tc)tx=(tx+1)%YETI_TEXTURE_MAX;APPLY(cell->wtx=tx);Key=1;break;}
    case  33: {if(tc)tx=(tx-1)%YETI_TEXTURE_MAX;APPLY(cell->ttx=tx);Key=1;break;}
    case  34: {if(tc)tx=(tx+1)%YETI_TEXTURE_MAX;APPLY(cell->ttx=tx);Key=1;break;}

    case 'F': {APPLY(cell_block(cell, true )); Key = 1; break;}
    case 'G': {APPLY(cell_block(cell, false)); Key = 1; break;}
    case 'E':
    {
      String Value = yeti->cells[R.top][R.left].ent;
      if (InputQuery("", "Enter Entity ID (0..255):", Value))
      {
        int ent = Value.ToIntDef(0);
        APPLY(cell->ent = ent);
        Key = 1;
      }
      break;
    }
    case  VK_LEFT     : {yeti->keyboard.left  = true; Key = 0; break;}
    case  VK_UP       : {yeti->keyboard.up    = true; Key = 0; break;}
    case  VK_RIGHT    : {yeti->keyboard.right = true; Key = 0; break;}
    case  VK_DOWN     : {yeti->keyboard.down  = true; Key = 0; break;}
    case  VK_CONTROL  : {yeti->keyboard.a     = true; Key = 0; break;}
    case  ' '         : {yeti->keyboard.b     = true; Key = 0; break;}
    case  'A'         : {yeti->keyboard.l     = true; Key = 0; break;}
    case  'Z'         : {yeti->keyboard.r     = true; Key = 0; break;}

    default:
    {
      //ShowMessage(Key);
    }
  }
  
  if (Key == 1)
  {
    Key = 0;
    yeti_default_lighting(yeti);
    PaintBoxPaint(PaintBox);
    FormPreview->TimerTimer(FormPreview->Timer);
    Modified = true;
    ListView->ItemIndex = tx;
    ListView->Selected->MakeVisible(False);
    tc = true;
  }
}
Exemplo n.º 12
0
//---------------------------------------------------------------------------
void __fastcall TTScope::DownBtnClick(TObject *Sender)
{
	m_Gain /= 1.2;
	PaintBoxPaint(NULL);
}