wxPoint& pos = wxDefaultPosition,
59 constwxSize&
size= wxDefaultSize
70 void OnPaint(wxPaintEvent& event);
100 constwxPoint& pos = wxDefaultPosition,
101 constwxSize&
size= wxDefaultSize,
102 longstyle = wxHSCROLL | wxVSCROLL,
103 constwxString& name =
"scrolledWindow" 119 void OnPaint(wxPaintEvent& event);
135 void DrawCell(wxDC& dc,
unsigned intx,
unsigned inty,
unsigned intvsX,
unsigned intvsY,
boolredrawBackground);
142 void DrawLine(wxDC& dc,
unsigned intx1,
unsigned inty1,
unsigned intx2,
unsigned inty2);
144 unsigned intfromX,
unsigned intfromY,
unsigned inttoX,
unsigned inttoY,
unsigned intvsX,
unsigned intvsY);
145 void MoveRubberband(wxDC &dc,
unsigned intfromX,
unsigned intfromY,
146 unsigned intprevToX,
unsigned intprevToY,
unsigned inttoX,
unsigned inttoY,
unsigned intvsX,
unsigned intvsY);
148 unsigned inttoX,
unsigned inttoY,
unsigned intvsX,
unsigned intvsY);
150DECLARE_EVENT_TABLE()
179wxScrolledWindow(parent, -1, pos,
size, style, name),
183currentBackgroundColor = *wxWHITE;
189currentRubberbandColor = *wxRED;
241 #if defined(__WXMAC__) 242 static const intcellWidthSpacer = 2;
244 static const intcellWidthSpacer = 1;
247wxClientDC dc(
this);
248dc.SetFont(wxNullFont);
255dc.SetMapMode(wxMM_TEXT);
256dc.GetTextExtent(
"A", &chW, &chH);
277 if(!
bitmap||
bitmap->GetWidth() != GetClientSize().GetWidth() ||
278 bitmap->GetHeight() != GetClientSize().GetHeight()) {
280 bitmap=
newwxBitmap(GetClientSize().GetWidth(), GetClientSize().GetHeight());
284memDC.SelectObject(*
bitmap);
287updLeft, updRight, updTop, updBottom,
288firstCellX, firstCellY,
289lastCellX, lastCellY,
291 static intprevVsY = -1;
298memDC.SetMapMode(wxMM_TEXT);
300memDC.SetBackgroundMode(wxTRANSPARENT);
303GetViewStart(&vsX, &vsY);
305 if(vsY != prevVsY) {
314wxRegionIterator upd(GetUpdateRegion());
321memDC.SetPen(*(wxThePenList->
323memDC.SetBrush(*(wxTheBrushList->
325memDC.DrawRectangle(upd.GetX(), upd.GetY(), upd.GetW(), upd.GetH());
334updRight = updLeft + upd.GetW() - 1;
335updBottom = updTop + upd.GetH() - 1;
356 for(y=firstCellY; y<=lastCellY; ++y) {
357 for(x=firstCellX; x<=lastCellX; ++x) {
358 DrawCell(memDC, x, y, vsX, vsY,
false);
366wxPaintDC paintDC(
this);
367paintDC.Blit(0, 0, GetClientSize().GetWidth(), GetClientSize().GetHeight(), &memDC, 0,0, wxCOPY);
372 unsigned intx,
unsigned inty,
unsigned intvsX,
unsigned intvsY,
boolredrawBackground)
375wxColor
color, cellBackgroundColor;
376 booldrawBackground, drawChar;
385 if((drawChar && drawBackground) || redrawBackground) {
386 if(drawChar && drawBackground) {
387dc.SetPen(*(wxThePenList->FindOrCreatePen(cellBackgroundColor, 1, wxSOLID)));
388dc.SetBrush(*(wxTheBrushList->FindOrCreateBrush(cellBackgroundColor, wxSOLID)));
396 if(!drawChar)
return;
399dc.SetTextForeground(
color);
402wxString
buf(character);
404dc.GetTextExtent(
buf, &chW, &chH);
428dc.DrawLine(x1, y1, x2, y2);
434 for(;
i<=ie; ++
i)
435 if(
i%4 == 0) dc.DrawLine(x1,
i, x1,
i+ 2);
439 for(;
i<=ie; ++
i)
440 if(
i%4 == 0) dc.DrawLine(
i, y1,
i+ 2, y1);
447 unsigned inttoX,
unsigned inttoY,
unsigned intvsX,
unsigned intvsY)
450 intminX, minY, maxX, maxY;
451 min_max((
int)fromX, (
int)toX, &minX, &maxX);
452 min_max((
int)fromY, (
int)toY, &minY, &maxY);
459 if(maxX < minX || maxY < minY)
467 DrawLine(dc, minX, minY, maxX, minY);
469 DrawLine(dc, maxX, minY, maxX, maxY);
471 DrawLine(dc, maxX, maxY, minX, maxY);
473 DrawLine(dc, minX, maxY, minX, minY);
479 unsigned intprevToX,
unsigned intprevToY,
unsigned inttoX,
unsigned inttoY,
unsigned intvsX,
unsigned intvsY)
483 if((prevToX >= fromX && toX < fromX) ||
484(prevToX < fromX && toX >= fromX) ||
485(prevToY >= fromY && toY < fromY) ||
486(prevToY < fromY && toY >= fromY)) {
494 if(toY != prevToY) {
496 for(
i=
a;
i<=
b; ++
i)
DrawCell(dc,
i, prevToY, vsX, vsY,
true);
501 if(fromX <= toX && toX < prevToX) {
504}
else if(prevToX < toX && toX < fromX) {
508 for(
i=
a;
i<=
b; ++
i) {
509 DrawCell(dc,
i, fromY, vsX, vsY,
true);
510 DrawCell(dc,
i, prevToY, vsX, vsY,
true);
514 if(toX != prevToX) {
516 for(
i=
a;
i<=
b; ++
i)
DrawCell(dc, prevToX,
i, vsX, vsY,
true);
521 if(fromY <= toY && toY < prevToY) {
524}
else if(prevToY < toY && toY < fromY) {
528 for(
i=
a;
i<=
b; ++
i) {
529 DrawCell(dc, fromX,
i, vsX, vsY,
true);
530 DrawCell(dc, prevToX,
i, vsX, vsY,
true);
540 unsigned inttoX,
unsigned inttoY,
unsigned intvsX,
unsigned intvsY)
547 DrawCell(dc,
i, fromY, vsX, vsY,
true);
554 DrawCell(dc, fromX,
i, vsX, vsY,
true);
564wxMouseEvent fake(wxEVT_MOUSEWHEEL);
565fake.m_wheelRotation = 0;
566fake.m_wheelDelta = 120;
567fake.m_linesPerAction = 3;
568AddPendingEvent(fake);
575 static intprevMOX = -1, prevMOY = -1;
576 static booldragging =
false;
579prevAlignment =
NULL;
580prevMOX = prevMOY = -1;
585prevMOX = prevMOY = -1;
592 event.GetPosition(&mX, &mY);
596GetViewStart(&vsX, &vsY);
599 staticwxCoord windowMX = 0, windowMY = 0;
600 boolwheelEvent = (
event.GetEventType() == wxEVT_MOUSEWHEEL);
602 if(dragging || windowMX < 0 || windowMY < 0 ||
603windowMX >= GetClientSize().GetWidth() || windowMY >= GetClientSize().GetHeight())
607 static intaccumulatedRotation = 0;
608accumulatedRotation -=
event.GetWheelRotation();
609 intnDeltas = accumulatedRotation /
event.GetWheelDelta();
611accumulatedRotation -= nDeltas *
event.GetWheelDelta();
612 inttoY = vsY + nDeltas *
event.GetLinesPerAction();
618GetViewStart(&vsX, &vsY);
626 intcellX, cellY, MOX, MOY;
632 if(event.Leaving()) {
641 if(MOX != prevMOX || MOY != prevMOY)
651cellY = vsY + GetClientSize().GetHeight() /
cellHeight;
653cellX = vsX + GetClientSize().GetWidth() /
cellWidth;
656 if(cellX < 0) cellX = 0;
658 if(cellY < 0) cellY = 0;
664 static unsigned intfromX, fromY, prevToX, prevToY;
673 if(event.LeftDown()) {
676 unsigned intcontrols = 0;
679 if(event.MetaDown())
681 if(event.ControlDown())
689prevToX = fromX = cellX;
690prevToY = fromY = cellY;
693 TRACEMSG(
"drawing initial rubberband");
694wxClientDC dc(
this);
718 else if(dragging && (event.LeftUp() || event.Leaving() || event.Entering())) {
719 if(!event.LeftUp()) {
725wxClientDC dc(
this);
737 DrawCell(dc, fromX, fromY, vsX, vsY,
true);
738 if(cellX != (
int)fromX || cellY != (
int)fromY)
739 DrawCell(dc, cellX, cellY, vsX, vsY,
true);
759((
int)fromX < cellX) ? fromX : cellX,
760((
int)fromY < cellY) ? fromY : cellY,
761(cellX > (
int)fromX) ? cellX : fromX,
762(cellY > (
int)fromY) ? cellY : fromY);
769 else if(dragging && (cellX != (
int)prevToX || cellY != (
int)prevToY)) {
771wxClientDC dc(
this);
780 MoveRubberband(dc, fromX, fromY, prevToX, prevToY, cellX, cellY, vsX, vsY);
782 if(prevToX != fromX || prevToY != fromY)
783 DrawCell(dc, prevToX, prevToY, vsX, vsY,
true);
784 if(cellX != (
int)fromX || cellY != (
int)fromY) {
809wxWindow(parent,
id, pos,
size, wxNO_BORDER),
811cellHeight(0), maxTitleWidth(20)
813currentBackgroundColor = *wxWHITE;
828wxClientDC dc(
this);
830dc.SetMapMode(wxMM_TEXT);
844dc.GetTextExtent(title, &tW, &tH);
867wxPaintDC dc(
this);
869 intvsX, vsY, updTop, updBottom, firstRow, lastRow,
row;
876dc.SetMapMode(wxMM_TEXT);
878dc.SetBackgroundMode(wxTRANSPARENT);
887wxRegionIterator upd(GetUpdateRegion());
896dc.SetPen(*(wxThePenList->
898dc.SetBrush(*(wxTheBrushList->
900dc.DrawRectangle(upd.GetX(), upd.GetY(), upd.GetW(), upd.GetH());
908updBottom = updTop + upd.GetH() - 1;
920 for(
row=firstRow;
row<=lastRow; ++
row) {
926dc.SetTextForeground(*wxRED);
928dc.SetTextForeground(
color);
931dc.GetTextExtent(title, &tW, &tH);
942 static intprevMOY = -1;
945prevAlignment =
NULL;
956 event.GetPosition(&mX, &mY);
973 if(event.LeftDown()) {
975 unsigned intcontrols = 0;
978 if(event.MetaDown())
980 if(event.ControlDown())
1007wxSplitterWindow(parent, -1, wxPoint(0,0), parent->GetClientSize(), wxSP_BORDER)
1016SetMinimumPaneSize(50);
1080wxFont *newFont =
newwxFont(font->GetPointSize(), font->GetFamily(),
1081wxNORMAL, wxNORMAL,
false, font->GetFaceName(), font->GetDefaultEncoding());
1083newFont =
newwxFont(font->GetPointSize(), font->GetFamily(),
1084wxITALIC, wxNORMAL,
false, font->GetFaceName(), font->GetDefaultEncoding());
1112 unsigned intnCells;
1118 if(column < vsX || column >= vsX + (
int)nCells) {
1119vsX =
column- nCells / 2;
1120 if(vsX < 0) vsX = 0;
1127 if(row < vsY || row >= vsY + (
int)nCells) {
1128vsY =
row- nCells / 2;
1129 if(vsY < 0) vsY = 0;
1139 titleArea->Refresh(eraseBackground, rect);
virtual bool MouseDown(int column, int row, unsigned int controls)
virtual void MouseOver(int column, int row) const
virtual void SelectedRectangle(int columnLeft, int rowTop, int columnRight, int rowBottom)
virtual void DraggedCell(int columnFrom, int rowFrom, int columnTo, int rowTo)
virtual bool GetCharacterTraitsAt(unsigned int column, unsigned int row, char *character, wxColour *color, bool *drawBackground, wxColour *cellBackgroundColor) const =0
virtual void GetSize(unsigned int *columns, unsigned int *rows) const =0
virtual bool GetRowTitle(unsigned int row, wxString *title, wxColour *color) const =0
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * column
const struct ncbi::grid::netcache::search::fields::SIZE size
#define row(bind, expected)
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