Hi everybody,
I have a grid with a custom cell combo editor/renderer.
The Editor works fine, the renderer however is allowing the text to
overflow the cell boundaries even when the SetCellOverflow is set to False.
$grid->SetCellOverflow( $row, $col,0);
The other cells w/o custom renderer's work fine and properly cut the
text off when it is to big for the cell.
Below is the "Draw" method for my custom renderer. It is pretty much a
copy of the examples with extra combo box functionality thrown in.
If anyone has a clue as to what is going on I would appreciate some
assistance.
(I have also set SetDefaultCellOverflow(FALSE) in the creation of the grid.)
sub Draw {
debug "Renderer:Draw\n";
my( $self, $grid, $attr, $dc, $rect, $row, $col, $sel ) = ( shift, @_ );
$self->SUPER::Draw( @_ );
$dc->SetPen( wxBLACK_PEN );
$dc->SetBrush( wxWHITE_BRUSH );
$dc->SetFont(Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT ));
my $dbvalue = $grid->GetCellValue( $row, $col );
$grid->SetCellOverflow( $row, $col,0);
debug "Got Value of :$dbvalue:\n";
my $textvalue = $self->get_text_from_id($dbvalue);
debug "New Text is :$textvalue:\n";
$dc->DrawText( $textvalue, $rect->x, $rect->y );
}