A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/grid_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/grid_widget/grid.cpp Source File

42 #include <wx/tipwin.h> 43 #include <wx/dcclient.h> 91 #define ID_FIRST_COLUMN_MENU 10000 92 #define MAX_COLUMNS_IN_MENU 20 93 #define ID_FILTER_COLUMNS_MENU ID_FIRST_COLUMN_MENU + MAX_COLUMNS_IN_MENU 97

BEGIN_EVENT_TABLE(

CGrid

, wxGrid )

109  const

wxString& name)

110

: wxGrid(parent,

id

, pos,

size

, style, name),

111

m_ImageList( 16, 16 ), m_CurLink(), m_Timer(this)

113

m_ImageList.Add( wxBitmap(

up_xpm

) );

114

m_ImageList.Add( wxBitmap(

down_xpm

) );

122  if

(col != GetSortingColumn() || m_nativeColumnLabels) {

123

wxGrid::DrawColLabel( dc, col );

127  if

( GetColWidth(col) <= 0 || m_colLabelHeight <= 0 )

130  int

imgWidth = 0, imgHeight = 0, imageIndex = (IsSortOrderAscending() ? 0 : 1);

131  m_ImageList

.GetSize(imageIndex, imgWidth, imgHeight);

133  int

colLeft = GetColLeft(col);

134

wxRect rect(colLeft, 0, GetColWidth(col), m_colLabelHeight);

136

wxGridCellAttrProvider *

const 137

attrProvider = m_table ? m_table->GetAttrProvider() :

NULL

;

139

wxGridColumnHeaderRendererDefault defaultRenderer;

141  const

wxGridColumnHeaderRenderer&

142

rend = attrProvider ? attrProvider->GetColumnHeaderRenderer(col)

147

wxDCBrushChanger setBrush(dc, GetGridColLabelWindow()->GetBackgroundColour());

148

dc.DrawRectangle(rect);

150

rend.DrawBorder(*

this

, dc, rect);

153

GetColLabelAlignment(&hAlign, &vAlign);

154  const int

orient = GetColLabelTextOrientation();

156

wxString labelText = GetColLabelValue(col);

157

wxSize labelSize = dc.GetTextExtent(labelText);

158

labelSize.x += imgWidth;

160  if

(labelSize.GetWidth() <= rect.GetWidth()) {

161  if

(hAlign&wxALIGN_RIGHT) {

162

rect.x = rect.GetRight() - labelSize.GetWidth();

164  else if

(hAlign&wxALIGN_CENTER_HORIZONTAL) {

165

rect.x += (rect.GetWidth() - labelSize.GetWidth())/2;

167

rect.SetWidth(labelSize.GetWidth());

171

rect.x, (m_colLabelHeight - 4 - imgHeight)/2 + 2,

172

wxIMAGELIST_DRAW_TRANSPARENT);

175

rect.width -= imgWidth;

177  if

(rect.width > 0) {

178

rend.DrawLabel(*

this

, dc, GetColLabelValue(col), rect, wxALIGN_LEFT, vAlign, orient);

184  static

wxTipWindow* s_tipWindow =

NULL

;

188

s_tipWindow->SetTipWindowPtr(

NULL

);

189

s_tipWindow->Close();

196  if

(IsCellEditControlShown())

202  if

(

row

< 0 && col < 0)

205

wxRect rect = CellToRect(

row

, col);

206

wxString

value

= GetCellValue(

row

, col);

207  if

(

value

.IsEmpty())

210

wxGridCellAttr* attr = GetCellAttr(

row

, col);

211

wxGridCellRenderer* renderer = attr->GetRenderer(

this

,

row

, col);

213

wxWindow* gridWindow = GetGridWindow();

216

wxClientDC dc(gridWindow);

217

wxSize

size

= renderer->GetBestSize(*

this

, *attr, dc,

row

, col);

218  if

(

size

.GetWidth() <= rect.GetWidth() &&

219  size

.GetHeight() <= rect.GetHeight()) {

226

gridWindow->SetCursor( *wxSTANDARD_CURSOR );

227

wxPoint posScrolled = CalcScrolledPosition(rect.GetTopLeft());

228

wxRect screenRect(gridWindow->ClientToScreen(posScrolled), rect.GetSize());

229

s_tipWindow =

new

wxTipWindow(GetGridWindow(),

value

, 1000, &s_tipWindow, &screenRect);

242  if

(event.Dragging()) {

247  const

wxPoint pos = CalcUnscrolledPosition(event.GetPosition());

249

wxGridCellCoords coords = XYToCell(pos);

251  int row

= coords.GetRow();

252  int

col = coords.GetCol();

254  if

(

row

< 0 || col < 0 ) {

278  m_Timer

.Start(500, wxTIMER_ONE_SHOT);

289

wxHyperlinkEvent hoverEvent(

this

,

GetId

(), url);

290

hoverEvent.SetEventType(wxEVT_COMMAND_HYPERLINK_HOVER);

291

wxPostEvent(

this

, hoverEvent);

294

GetGridWindow()->SetCursor( wxCursor(wxCURSOR_HAND) );

297

GetGridWindow()->SetCursor( *wxSTANDARD_CURSOR );

307  const

wxPoint pos = CalcUnscrolledPosition(event.GetPosition());

309

wxGridCellCoords coords = XYToCell(pos);

311  int row

= coords.GetRow();

312  int

col = coords.GetCol();

314  if

(

row

< 0 || col < 0 ) {

323

wxString url = link->

GetURL

();

325

wxHyperlinkEvent linkEvent(

this

,

GetId

(), url);

326  if

(!GetEventHandler()->ProcessEvent(linkEvent))

328  if

(!wxLaunchDefaultBrowser(url))

330

wxLogWarning(

wxT

(

"Could not launch the default browser with url '%s' !"

), url.c_str());

342  int

selRow = evt.GetRow();

343  if

(selRow > 0 && evt.ControlDown()) {

344

wxArrayInt selRows = GetSelectedRows();

345  if

(find(selRows.begin(), selRows.end(), selRow) != selRows.end()) {

351  int

selCol = evt.GetCol();

362  if

((

size_t

)selCol >= vis_columns.size())

369  if

(newSort.first == curSort.first) {

376

vector<size_t>::const_iterator it =

377

find (vis_columns.begin(), vis_columns.end(), newSort.first);

379

SetSortingColumn (

static_cast<int>

((it == vis_columns.end()) ? -1 : it - vis_columns.begin()),

397

wxArrayInt sel_rows = GetSelectedRows();

402

vector<size_t> selected_idx;

403  for

(

i

=0;

i

<sel_rows.size(); ++

i

) {

405

selected_idx.push_back(row_idx);

430  for

(

i

=0;

i

<selected_idx.size(); ++

i

) {

431  size_t

sorted_idx = gridAdapter->

GetCurrentRow

(selected_idx[

i

]);

432  if

(sorted_idx != (

size_t

)-1)

433

SelectRow(

static_cast<int>

(sorted_idx),

true

);

459  if

(evt.GetCol() < 0)

468

vis_set.

insert

(vis_columns.begin(), vis_columns.end());

480

PopupMenu(&menu, evt.GetPosition());

494  if

(vis_columns.size() == 1 && gridAdapter->

IsColumnShown

(col))

509

dlgFilterColumns.ShowModal();

std::invoke_result< _Fty, ICanceled & >::type GUI_AsyncExec(_Fty &&_Fnarg, const wxString &msg=wxT("Accessing network..."))

const CHyperlink * HitTest(const wxPoint &pt) const

void SetGridAdapter(IGridTableAdapter *gridAdapter)

const CCellHyperlinks * GetLink(int col, int row) const

virtual void DrawColLabel(wxDC &dc, int col)

CGridHyperlinks m_HyperLinks

const CCellHyperlinks::CHyperlink * m_CurLink

void OnShowHideColumn(wxCommandEvent &event)

void x_ShowTooltip(bool show)

void OnLeftDown(wxMouseEvent &event)

void OnFilterColumns(wxCommandEvent &event)

wxGridCellCoords m_MouseOverCell

void OnMouseMove(wxMouseEvent &event)

void OnTimer(wxTimerEvent &event)

void OnGridLabelLeftClick(wxGridEvent &evt)

void OnGridLabelRightClick(wxGridEvent &evt)

static void StripHtml(wxString &text)

Interface for testing cancellation request in a long lasting operation.

virtual size_t GetOriginalRow(size_t queryRow) const =0

virtual TSortColumn GetSortColumn() const =0

virtual bool IsColumnShown(size_t col) const =0

virtual size_t GetCurrentRow(size_t queryRow) const =0

virtual void ShowColumn(size_t col, bool show)=0

virtual void SortByColumn(TSortColumn sortColumn)=0

virtual vector< size_t > GetVisibleColumns() const

pair< size_t, ESort > TSortColumn

virtual string GetColumnLabel(size_t col) const =0

virtual size_t GetColsCount() const =0

iterator_bool insert(const value_type &val)

const_iterator find(const key_type &key) const

const_iterator end() const

static const char * down_xpm[]

#define ID_FIRST_COLUMN_MENU

static const char * up_xpm[]

#define MAX_COLUMNS_IN_MENU

#define ID_FILTER_COLUMNS_MENU

wxDEFINE_EVENT(wxEVT_COMMAND_HYPERLINK_HOVER, wxHyperlinkEvent)

const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)

If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static const char label[]

const struct ncbi::grid::netcache::search::fields::SIZE size

const GenericPointer< typename T::ValueType > T2 value

EVT_MENU_RANGE(MID_SHOW_TITLES, MID_HIDE_TITLES, ViewerWindowBase::OnTitleView) EVT_MENU_RANGE(MID_ENABLE_EDIT

ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN

#define row(bind, expected)

wxString ToWxString(const string &s)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4