Skip to content

Commit

Permalink
Add modificator Ctrl for popup menu "List columns header"
Browse files Browse the repository at this point in the history
При нажатом Ctrl в буфер обмена копируются только имена столбцов с разделителем ",".
  • Loading branch information
levinsv committed Jun 17, 2024
1 parent 38b4b4a commit e2eeabf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ctl/ctlSQLResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ wxString ctlSQLResult::OnGetItemText(long item, long col) const
}
return wxEmptyString;
}
wxString ctlSQLResult::CopySelColumnNameType()
wxString ctlSQLResult::CopySelColumnNameType(bool onlyname)
{
wxString ss = wxEmptyString;
if (GetSelectedCols().GetCount()) {
Expand All @@ -356,7 +356,8 @@ wxString ctlSQLResult::CopySelColumnNameType()
wxString colName = colNames.Item(cl);
wxString colType = colTypes.Item(cl);
if (!ss.IsEmpty()) ss.Append(", ");
ss.Append(colName + " " + colType);
ss.Append(colName);
if (!onlyname) ss.Append(" " + colType);

}
}
Expand Down
3 changes: 2 additions & 1 deletion frm/frmQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,8 @@ void frmQuery::OnCopy_NameTypeCols(wxCommandEvent& ev)
{
// if (currentControl() == sqlResult)
{
wxString s = sqlResult->CopySelColumnNameType();
bool press=wxGetKeyState(WXK_CONTROL);
wxString s = sqlResult->CopySelColumnNameType(press);
SetStatusText(s, STATUSPOS_MSGS);
}
}
Expand Down
2 changes: 1 addition & 1 deletion include/ctl/ctlSQLResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ctlSQLResult : public ctlSQLGrid
wxString CompareSelectCells();
wxString AutoColsPlot(int flags,frmQuery *parent);
wxString CheckSelColumnDate();
wxString CopySelColumnNameType();
wxString CopySelColumnNameType(bool onlyname);
void ClearFilter();
bool IsColText(int col);
bool hasRowNumber()
Expand Down

0 comments on commit e2eeabf

Please sign in to comment.