mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-09-04 14:14:56 -06:00
bug fix
Export to excel Cluster table wait Add sql resul color
This commit is contained in:
parent
b0afa4ead2
commit
39b8fbc0ab
11 changed files with 123 additions and 37 deletions
|
|
@ -38,7 +38,8 @@ public:
|
|||
wxSize GetBestSize(int row, int col);
|
||||
void OnLabelDoubleClick(wxGridEvent &event);
|
||||
void OnLabelClick(wxGridEvent &event);
|
||||
|
||||
void OnCellRightClick(wxGridEvent &event);
|
||||
|
||||
void AutoSizeColumn(int col, bool setAsMin = false, bool doLimit = true);
|
||||
void AutoSizeColumns(bool setAsMin);
|
||||
|
||||
|
|
@ -62,4 +63,54 @@ private:
|
|||
wxArrayInt colMaxSizes;
|
||||
};
|
||||
|
||||
class CursorCellRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
virtual void Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
|
||||
const wxRect& rect, int row, int col, bool isSelected)
|
||||
{
|
||||
int hAlign, vAlign;
|
||||
attr.GetAlignment(&hAlign, &vAlign);
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//CursorCellRenderer::Draw(grid, attr, dc, rect, row, col, isSelected); //
|
||||
dc.SetBackgroundMode( wxSOLID );
|
||||
wxString text=grid.GetCellValue(row, col);
|
||||
// grey out fields if the grid is disabled
|
||||
if ( grid.IsEnabled() )
|
||||
{
|
||||
if ( isSelected )
|
||||
{
|
||||
wxColour clr;
|
||||
if ( wxWindow::FindFocus() == grid.GetGridWindow() )
|
||||
clr = grid.GetSelectionBackground();
|
||||
else
|
||||
clr = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW);
|
||||
dc.SetBrush( wxBrush(clr, wxSOLID) );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxColor color;
|
||||
color.Set(239, 228, 176);
|
||||
if (text.Find(wxT('\n'))!=wxNOT_FOUND )
|
||||
dc.SetBrush( wxBrush(color, wxSOLID) );
|
||||
else
|
||||
dc.SetBrush( wxBrush(attr.GetBackgroundColour(), wxSOLID) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE), wxSOLID));
|
||||
}
|
||||
|
||||
dc.SetPen( *wxTRANSPARENT_PEN );
|
||||
dc.DrawRectangle(rect);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
SetTextColoursAndFont(grid, attr, dc, isSelected);
|
||||
grid.DrawTextRectangle(dc, text,
|
||||
rect, hAlign, vAlign);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue