Пример #1
0
    void move_xy(int16_t x, int16_t y) {
        CompositeContainer::iterator iter_w_first = this->impl->get_first();
        if (iter_w_first != reinterpret_cast<CompositeContainer::iterator>(CompositeContainer::invalid_iterator)) {
            CompositeContainer::iterator iter_w_current = iter_w_first;
            do {
                Widget2 * w = this->impl->get(iter_w_current);
                REDASSERT(w);
                w->set_xy(x + w->dx(), y + w->dy());

                iter_w_current = this->impl->get_next(iter_w_current);
            }
            while ((iter_w_current != iter_w_first) &&
                   (iter_w_current != reinterpret_cast<CompositeContainer::iterator>(CompositeContainer::invalid_iterator)));
        }
    }
Пример #2
0
    void draw_row(uint16_t row_index, const Rect & clip) {
        uint32_t bg_color;
        uint32_t fg_color;

        if (this->selection_y == row_index) {
            bg_color = (this->has_focus ? this->bg_color_focus : this->bg_color_selection);
            fg_color = (this->has_focus ? this->fg_color_focus : this->fg_color_selection);
        }
        else {
            const bool odd = row_index & 1;
            bg_color = (odd ? this->bg_color_1 : this->bg_color_2);
            fg_color = (odd ? this->fg_color_1 : this->fg_color_2);
        }

        uint16_t y = this->rect.y;
        for (uint16_t r_index = 0, r_count = std::min<uint16_t>(row_index, this->nb_rows);
             r_index < r_count; r_index++) {
            y += this->row_height[r_index] + this->border * 2;
        }

        uint16_t x = this->rect.x;
        Rect rectRow(x, y, this->rect.cx, this->row_height[row_index] + this->border * 2);
        this->drawable.draw(RDPOpaqueRect(rectRow, bg_color), clip);

        x += this->border;
        y += this->border;

        for (uint16_t column_index = 0; column_index < this->nb_columns; column_index++) {
            Widget2 * w = this->widgets[column_index][row_index];
            Rect rectCell(x, y, this->column_width[column_index], this->row_height[row_index]);
            if (w) {
                w->set_xy(rectCell.x, rectCell.y);
                w->set_wh(rectCell.cx, rectCell.cy);

                w->set_color(bg_color, fg_color);

                Rect destRect = clip.intersect(rectCell);
                if (!destRect.isempty()) {
                    w->draw(destRect);
                }
            }

            x += this->column_width[column_index] + this->border * 2;
        }
    }
Пример #3
0
 void move_xy(int16_t x, int16_t y) {
     for (size_t i = 0, max = this->size; i < max; ++i) {
         Widget2 * w = this->child_list[i];
         w->set_xy(x + w->dx(), y + w->dy());
     }
 }