680{
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736 ObjectGridTable * table =
dynamic_cast<ObjectGridTable *
>(
grid.GetTable());
737 ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col);
738 ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
740
743
744 wxGridCellRenderer::Draw(
grid, attr, dc, rect, row, col, isSelected);
745 wxString value = table->GetValue(row, col);
746 if (grid_row->row_type != table->GridRowType::row_volume || col != table->GridColType::col_printable) {
747 if (cur_option.value) {
748
750 dc.SetPen(*wxTRANSPARENT_PEN);
751
752 auto offsetx = 0;
753 auto offsety = 0;
754
755 #ifdef __WXOSX_MAC__
756 offsetx = (
width - 18) / 2;
757 offsety = (
height - 18) / 2;
758 #else
759 offsetx = (
width - check_on.GetSize().x) / 2;
760 offsety = (
height - check_on.GetSize().y) / 2;
761 #endif
762
763 dc.DrawBitmap(check_on, rect.x + offsetx, rect.y + offsety);
764 } else {
766 dc.SetPen(*wxTRANSPARENT_PEN);
767
768 auto offsetx = 0;
769 auto offsety = 0;
770
771 #ifdef __WXOSX_MAC__
772 offsetx = (
width - 18) / 2;
773 offsety = (
height - 18) / 2;
774 #else
775 offsetx = (
width - check_off.GetSize().x) / 2;
776 offsety = (
height - check_off.GetSize().y) / 2;
777 #endif
778
779 dc.DrawBitmap(check_off, rect.x + offsetx, rect.y + offsety);
780 }
781 }
782
783}
GridColType
Definition GUI_ObjectTable.hpp:294
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:1184
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185
std::vector< ArithmeticOnly< T > > grid(const T &start, const T &stop, const T &stride)
A set of equidistant values starting from 'start' (inclusive), ending in the closest multiple of 'str...
Definition MTUtils.hpp:127
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448