Example #1
0
/*-----------------------------------------------------------------*/
void __fastcall TFixeinzugForm::pbFixeinzugMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y)
{
    int i = X / dx;
    int j = maxy-1 - (Y / dy);

    dbw3_assert(i>=0);
    dbw3_assert(j>=0);

    if (i>=maxx || j>=maxy) return;

    short old = einzug[scrollx+i];
    if (old==j+1) einzug[scrollx+i] = 0;
    else einzug[scrollx+i] = short(j+1);
    changed = true;
    CalcRange();
    if (old!=0) {
        pbFixeinzug->Canvas->Pen->Color = clBtnFace;
        pbFixeinzug->Canvas->Brush->Color = clBtnFace;
        pbFixeinzug->Canvas->Rectangle (i*dx+2, (maxy-old)*dy+2, (i+1)*dx-1, (maxy-old+1)*dy-1);
    }
    DrawData (pbFixeinzug, i);
    DeleteCursor();
    cx = i;
    cy = j;
    DeleteRange();
    CalcRange();
    DrawRange();
    DrawCursor();
}
Example #2
0
/*-----------------------------------------------------------------*/
void __fastcall TDBWFRM::RangePatternsClick(TObject *Sender)
{
    dbw3_assert(cursorhandler);
    cursorhandler->DisableCursor();
    try {
        dbw3_assert(bereichundo);
        TBlockmusterForm* pFrm = new TBlockmusterForm(this, *bereichundo, &bereichmuster, currentbm, cursorhandler, SUBST_RANGE, false);
        if (pFrm->ShowModal()==mrOk) {
            int x = pFrm->mx+1;
            int y = pFrm->my+1;

            // Auf Schlagpatrone umschalten
            ViewSchlagpatrone->Checked = true;
            trittfolge.einzeltritt = false;

            BereicheFillPattern (x, y);

            CalcRange();
            CalcRapport();
            RecalcAll();

            Invalidate();
            dbw3_assert (undo!=0);
            undo->Snapshot();
        }
        delete pFrm;
    } catch (...) {
    }
    SetModified();
    cursorhandler->EnableCursor();
}
/*-----------------------------------------------------------------*/
void __fastcall TDBWFRM::DoSetAufknuepfung (int _i, int _j, bool _set, int _range)
{
    int i, j, k, l;
    if (ViewSchlagpatrone->Checked) {
        MessageBeep (MB_OK);
        return;
    }

    // Punkt toggeln und neuzeichnen
    if (!_set) ToggleAufknuepfung (scroll_x2+_i, scroll_y1+_j);
    else aufknuepfung.feld.Set (scroll_x2+_i, scroll_y1+_j, char(_range));
    RedrawAufknuepfung (scroll_x2+_i, scroll_y1+_j);

    // Muss überhaupt neuberechnet werden?!
    if (einzughandler->IsEmptySchaft (scroll_y1+_j) || IsEmptyTritt (scroll_x2+_i)) {
        SetModified();
        return;
    }

    // Zeilen und Spalten löschen
    for (i=0; i<Data->MAXX1; i++)
        if (einzug.feld.Get (i)==scroll_y1+_j+1)
            for (j=0; j<Data->MAXY2; j++) {
                char s = gewebe.feld.Get (i, j);
                if (s>0) {
                    gewebe.feld.Set (i, j, 0);
                    RedrawGewebe (i, j);
                }
            }
    for (j=0; j<Data->MAXY2; j++)
        if (trittfolge.feld.Get (scroll_x2+_i, j)>0)
            for (i=0; i<Data->MAXX1; i++) {
                char s = gewebe.feld.Get (i, j);
                if (s>0) {
                    gewebe.feld.Set (i, j, 0);
                    RedrawGewebe (i, j);
                }
            }

    // Neuberechnen und -zeichnen
    for (i=0; i<Data->MAXX2; i++)
        for (l=0; l<Data->MAXY1; l++) {
            char s = aufknuepfung.feld.Get (i, l);
            if (s>0) {
                for (j=0; j<Data->MAXY2; j++)
                    if (trittfolge.feld.Get (i, j)>0)
                        for (k=0; k<Data->MAXX1; k++)
                            if (einzug.feld.Get(k)==l+1)
                                if (gewebe.feld.Get(k, j)<=0) {
                                    gewebe.feld.Set (k, j, s);
                                    RedrawGewebe (k, j);
                                }
            }
        }

    CalcRange();
    UpdateRapport();

    SetModified();
}
Example #4
0
void CProgressST::SetRange(int nLower, int nUpper)
{
	m_nLower = nLower;
	m_nUpper = nUpper;
	CalcRange();

	CProgressCtrl::SetRange(nLower, nUpper);
} // End of SetRange
Example #5
0
/*-----------------------------------------------------------------*/
void __fastcall TFixeinzugForm::DeleteClick(TObject *Sender)
{
    DeleteRange();
    firstfree = 0;
    memset (einzug, 0, sizeof(short)*Data->MAXX1);
    size = 0;
    CalcRange();
    Invalidate();
}
Example #6
0
/*-----------------------------------------------------------------*/
void __fastcall TFixeinzugForm::GrabClick(TObject *Sender)
{
    frm->UpdateEinzugFixiert();
    memset (einzug, 0, sizeof(short)*Data->MAXX1);
    size = frm->fixsize;
    for (int i=0; i<=size; i++)
        einzug[i] = frm->fixeinzug[i];
    firstfree = frm->firstfree;
    changed = true;
    CalcRange();
    Invalidate();
}
Example #7
0
CProgressST::CProgressST()
{
	// Default range of the control
	m_nLower = 0;
	m_nUpper = 100;
	CalcRange();

	// Default position
	m_nPos = 0;

	// Default step
	m_nStep = 10;
} // End of CProgressST
Example #8
0
CProgressCtrlST::CProgressCtrlST()
{
	// Default range of the control
	m_nLower = 0;
	m_nUpper = 100;
	CalcRange();

	// Default position
	m_nPos = 0;

	// Default step
	m_nStep = 10;

	FreeResources(FALSE);
}
Example #9
0
/*-----------------------------------------------------------------*/
__fastcall TFixeinzugForm::TFixeinzugForm(TComponent* Owner, TDBWFRM* _frm, CrCursorHandler* _ch)
: TForm(Owner), frm(_frm)
{
    LoadLanguage();

    dbw3_assert(frm!=NULL);

    Width = frm->Width;
    Left = frm->Left;

    Top = frm->gewebe.pos.y0+30;

    cursorhandler = _ch;
    if (cursorhandler) cursordirection = cursorhandler->GetCursorDirection();

    // Daten kopieren
    try {
        einzug = new short[Data->MAXX1];
        memset (einzug, 0, sizeof(short)*Data->MAXX1);
        size = frm->fixsize;
        for (int i=0; i<=size; i++)
            einzug[i] = frm->fixeinzug[i];
        firstfree = frm->firstfree;
        changed = false;
    } catch (...) {
        dbw3_assert(false);
    }

    cx = cy = 0;
    scrollx = 0;
    scrolly = 0;

    RecalcDimensions();
    CalcRange();
    Invalidate();
}
Example #10
0
/*-----------------------------------------------------------------*/
void __fastcall TFixeinzugForm::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
{
    switch (Key) {
        case VK_SPACE: {
            DeleteCursor();
            DeleteRange();
            short old = einzug[scrollx+cx];
            if (old==cy+1) einzug[scrollx+cx] = 0;
            else einzug[scrollx+cx] = short(cy+1);
            CalcRange();
            if (old!=0) {
                pbFixeinzug->Canvas->Pen->Color = clBtnFace;
                pbFixeinzug->Canvas->Brush->Color = clBtnFace;
                int x, y;
                if (frm->righttoleft) x = (maxx-cx-1)*dx;
                else x = cx*dx;
                if (frm->toptobottom) y = (old-1)*dy;
                else y = (maxy-old)*dy;
                pbFixeinzug->Canvas->Rectangle (x+2, y+2, x+dx-1, y+dy-1);
            }
            DrawData(pbFixeinzug, cx);
            DrawRange();
            CurMove();
            DrawCursor();
            changed = true;
            break;
        }
        case VK_LEFT:
            if (Shift.Contains(ssCtrl) && Shift.Contains(ssAlt)) {
                if (frm->righttoleft) CurDirRight();
                else CurDirLeft();
                break;
            }
            if (frm->righttoleft) CurRight(Shift.Contains(ssCtrl));
            else CurLeft (Shift.Contains(ssCtrl));
            break;
        case VK_RIGHT:
            if (Shift.Contains(ssCtrl) && Shift.Contains(ssAlt)) {
                if (frm->righttoleft) CurDirLeft();
                else CurDirRight();
                break;
            }
            if (frm->righttoleft) CurLeft(Shift.Contains(ssCtrl));
            else CurRight (Shift.Contains(ssCtrl));
            break;
        case VK_UP:
            if (Shift.Contains(ssCtrl) && Shift.Contains(ssAlt)) {
                if (frm->toptobottom) CurDirDown();
                else CurDirUp();
                break;
            }
            if (frm->toptobottom) CurDown (Shift.Contains(ssCtrl));
            else CurUp (Shift.Contains(ssCtrl));
            break;
        case VK_DOWN:
            if (Shift.Contains(ssCtrl) && Shift.Contains(ssAlt)) {
                if (frm->toptobottom) CurDirUp();
                else CurDirDown();
                break;
            }
            if (frm->toptobottom) CurUp (Shift.Contains(ssCtrl));
            else CurDown (Shift.Contains(ssCtrl));
            break;
    }
}