예제 #1
0
 public void SetColor(grcolor color)
 {
     //if(this.fgcolor == color)
     //  return;
     //this.fgcolor = color;
     //change_coord(this.x, this.y);
     //if(color == conf.fgcolor)
     //  OnSetFree();
     //else
     //  OnSetBusy();
 }
예제 #2
0
 public void DrawLineCenterCell(int x0, int y0, int x1, int y1, grcolor col)
 {
     DrawLineCenterCellRGB(x0, y0, x1, y1, (Globals.colortable[col][0] << 16) | (Globals.colortable[col][1] << 8) | Globals.colortable[col][2]);
 }
예제 #3
0
 public void DrawLine(int x0, int y0, int x1, int y1, grcolor col)
 {
     DrawLineRGB(x0, y0, x1, y1, (Globals.colortable[col][0] << 16) | (Globals.colortable[col][1] | 8) | Globals.colortable[col][2]);
 }
예제 #4
0
 public void DrawLayout(int x0, int y0, VLines[] p, grcolor col)
 {
     byte[] row = Globals.colortable[col];
     DrawLayoutRGB(x0, y0, p, Color.FromArgb(row[0], row[1], row[2]));
 }
예제 #5
0
        public void Draw()
        {
            grcolor color = Globals.color_red;
            int     i;

            System.Drawing.Image p = null;
            Signal t = this;

            i = 0;                              /* RR */
            if (t._interpreterData == null || (p = FindIcon()) == null)
            {
                if (t.fleeted)
                {
                    if (t.status == trkstat.ST_GREEN)
                    {
                        if (t.nowfleeted)
                        {
                            i = 2;      /* GG */
                        }
                        else
                        {
                            i = 1;      /* GR */
                        }
                    }
                    else if (t.nowfleeted)
                    {
                        i = 3;                  /* RO */
                    }
                    switch (t.direction)
                    {
                    case trkdir.W_E:
                        p = Globals.signal_traditional ?
                            (t.signalx ? e_sig2x_pmap[i] : e_sig2_pmap[i]) : e_sigP_pmap[i];
                        break;

                    case trkdir.E_W:
                        p = Globals.signal_traditional ?
                            (t.signalx ? w_sig2x_pmap[i] : w_sig2_pmap[i]) : w_sigP_pmap[i];
                        break;

                    case trkdir.N_S:
                        p = t.signalx ? s_sig2x_pmap[i] : s_sig2_pmap[i];
                        break;

                    case trkdir.S_N:
                        p = t.signalx ? n_sig2x_pmap[i] : n_sig2_pmap[i];
                        break;
                    }
                    if (p != null)
                    {
                        Globals.draw_pixmap(t.x, t.y, p);
                    }
                    if (Globals.editing && Globals.show_links && t.controls != null)
                    {
                        Globals.draw_link(t.x, t.y, t.controls.x, t.controls.y, Globals.conf.linkcolor);
                    }
                    return;
                }
                if (t.status == trkstat.ST_GREEN)
                {
                    i = 1;
                }
                switch (t.direction)
                {
                case trkdir.W_E:
                    p = t.signalx ? e_sigx_pmap[i] : e_sig_pmap[i];
                    break;

                case trkdir.E_W:
                    p = t.signalx ? w_sigx_pmap[i] : w_sig_pmap[i];
                    break;

                case trkdir.N_S:
                    p = t.signalx ? s_sigx_pmap[i] : s_sig_pmap[i];
                    break;

                case trkdir.S_N:
                    p = t.signalx ? n_sigx_pmap[i] : n_sig_pmap[i];
                    break;
                }
            }
            if (p != null)
            {
                Globals.draw_pixmap(t.x, t.y, p);
            }
            if (Globals.editing && Globals.show_links && t.controls != null)
            {
                Globals.draw_link(t.x, t.y, t.controls.x, t.controls.y, Globals.conf.linkcolor);
            }
        }