Add new feature frmLog

Для окна состояние выполняется: set log_min_messages = FATAL
Для Log view добавлена: подержка быстрой навигации: Shift+KeyUP,KeyDOWN
переход на запись с тем же sql_state,
Alt+KeyUP,KeyDOWN - переход на запись с другим sql_state
Добавлена колонка Server - сервер с которого получен лог.
This commit is contained in:
lsv 2021-10-22 18:06:26 +05:00
parent 592cd1110b
commit 4db8267ae6
11 changed files with 196 additions and 44 deletions

View file

@ -186,7 +186,8 @@ private:
wxArrayInt rowsGroup, end;
wxArrayDouble run;
};
//#define TEST_wxGridCellAutoWrapStringRenderer
#ifndef TEST_wxGridCellAutoWrapStringRenderer
class CursorCellRenderer : public wxGridCellStringRenderer
{
public:
@ -197,46 +198,75 @@ class CursorCellRenderer : public wxGridCellStringRenderer
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.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) );
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(attr.GetBackgroundColour(), wxSOLID) );
}
}
else
{
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE), wxSOLID));
}
{
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE), wxSOLID));
}
dc.SetPen( *wxTRANSPARENT_PEN );
dc.DrawRectangle(rect);
dc.SetPen( *wxTRANSPARENT_PEN );
dc.DrawRectangle(rect);
//////////////////////////////////////////////////////////////////////////////
SetTextColoursAndFont(grid, attr, dc, isSelected);
grid.DrawTextRectangle(dc, text,
rect, hAlign, vAlign);
}
#else
class CursorCellRenderer : public wxGridCellAutoWrapStringRenderer
{
public:
virtual void Draw(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
const wxRect& rectCell,
int row, int col,
bool isSelected) {
bool f = false;
wxString text = grid.GetCellValue(row, col);
wxColor prev;
if (!isSelected) {
wxColor color;
color.Set(239, 228, 176);
if (text.Find(wxT('\n')) != wxNOT_FOUND)
{
//dc.SetBrush(wxBrush(color, wxSOLID));
prev = attr.GetBackgroundColour();
attr.SetBackgroundColour(color);
f = true;
}
}
wxGridCellAutoWrapStringRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected);
if (f) attr.SetBackgroundColour(prev);
}
#endif
};
#endif

View file

@ -30,6 +30,7 @@ public:
void AddRow(wxString csvtext);
void OnMouseMove(wxMouseEvent& event);
void OnKEY_DOWN(wxKeyEvent& event);
void OnKEY_UP(wxKeyEvent& event);
#ifdef MYTEST
void OnTimer(wxTimerEvent& event);
#endif

View file

@ -26,6 +26,7 @@ namespace MyConst {
logHint,
logappname,
logbtype,
logSERVER,
Col_Max
};
enum iconIndex {
@ -67,6 +68,7 @@ struct Line {
ps logHint = { 0,0 };
ps logappname = { 0,0 };
ps logbtype = { 0,0 };
ps logSERVER = { 0,0 };
wxString text;
};
struct LineFilter {

View file

@ -23,6 +23,7 @@ public:
Col_Hint,
Col_Detail,
Col_Message,
Col_Server,
Col_Max
};