Example #1
0
        private void draw_selection(Graphics g)
        {
            Point pt = AutoScrollPosition;

            if (prev_col != -1 && prev_row != -1)
            {
                draw_item(prev_col, prev_row, g, true);
                g.DrawRectangle(new Pen(Palette.getSelectionColor()), pt.X + prev_col * col_sz, pt.Y, col_sz, row_sz * table[prev_col].Count);
            }
        }
Example #2
0
        private Brush[] AssembleFillBrushes(EventRecord rec, bool focus, bool selected, ref Color color)
        {
            if (selected)
            {
                return new Brush[1] {
                           new SolidBrush(color = Palette.getSelectionColor())
                }
            }
            ;
            else if (!focus && useOldStyle)
            {
                return new Brush[1] {
                           new SolidBrush(color = Palette.getTaskColor(rec.tid))
                }
            }
            ;
            else if (rec.mop == "TASK_FENCE" || rec.mop == "TRACED_EVENT")
            {
                return new Brush[1] {
                           new SolidBrush(color = Color.Black)
                }
            }
            ;
            else if (rec.vars.Count > 0 && useOldStyle)
            {
                Brush[] brushes = new Brush[rec.vars.Count];

                int pos = 0;
                IEnumerator <KeyValuePair <int, int> > en = rec.vars.GetEnumerator();
                while (en.MoveNext())
                {
                    int var = en.Current.Key;
                    brushes[pos++] = new SolidBrush(color =
                                                        rec.isData ? Palette.getDataVarColor(var) :
                                                        (var < 256) ? Palette.getTaskColor(var) :
                                                        Palette.getSyncVarColor(var)
                                                    );
                }
                return(brushes);
            }
            else
            {
                return(new Brush[1] {
                    new SolidBrush(color = useOldStyle ? Palette.getTaskColor(rec.tid) : Color.Gray)
                });
            }
        }