37 #include <wx/dcclient.h>
38 #include <wx/txtstrm.h>
70 wxBrush saveBrush = dc.GetBrush();
71 wxPen savePen = dc.GetPen();
76 wxPoint dcOrigin =
context->GetDeviceOrigin();
77 context->SetDeviceOrigin(wxPoint(dcOrigin.x + updateRect.GetLeft(), dcOrigin.y + updateRect.GetTop()));
80 itemSelRect = itemSelRect.Intersect(updateRect);
81 itemSelRect.Offset(-updateRect.GetLeft(), -updateRect.GetTop());
82 rect.SetPosition(wxPoint(-updateRect.GetLeft(), -updateRect.GetTop()));
85 wxColor
color(128,128,64);
86 dc.SetBrush(wxBrush(
color));
87 dc.SetPen(wxPen(
color, 1));
89 wxColor
color = dc.GetTextBackground().ChangeLightness(95);
90 dc.SetBrush(wxBrush(
color));
91 dc.SetPen(wxPen(
color, 1));
93 dc.DrawRectangle(itemSelRect);
96 wxColor
color(128,128,64);
97 dc.SetPen(wxPen(
color, 1));
98 int yt = rect.GetTop();
99 int yb = rect.GetBottom();
100 if (yt < updateRect.GetHeight() && yb > 0) {
102 dc.DrawLine(rect.GetLeft(), yt, rect.GetRight(), yt);
103 if (yb < updateRect.GetHeight())
104 dc.DrawLine(rect.GetLeft(), yb, rect.GetRight(), yb);
106 yb =
min(yb, updateRect.GetHeight() - 1);
107 dc.DrawLine(rect.GetLeft(), yt, rect.GetLeft(), yb);
108 dc.DrawLine(rect.GetRight(), yt, rect.GetRight(), yb);
112 dc.SetBrush(saveBrush);
115 context->SetDeviceOrigin(dcOrigin);
126 if (itemSelRect.Contains(event.m_x, event.m_y)) {
131 panel->SetCursor(wxCursor(wxCURSOR_ARROW));
135 if (
context->GetHighlightedItem() != 0) {
136 context->SetHighlightedItem(0);
139 panel->SetCursor(wxCursor(wxCURSOR_IBEAM));
151 if (itemSelRect.Contains(event.m_x, event.m_y)) {
152 context->SelectItem(
m_Item, event.ControlDown(), event.ShiftDown());
154 wxRect leftSpace(0, itemSelRect.GetTop(), itemSelRect.GetRight(), itemSelRect.GetHeight());
155 if (leftSpace.Contains(event.m_x, event.m_y))
156 context->SelectItem(0, event.ControlDown(), event.ShiftDown());
167 wxRect itemSelRect = (
context->IsEditingEnabled() ||
event.ControlDown()) ?
170 if (itemSelRect.Contains(event.m_x, event.m_y)) {
void OnMouseMove(wxMouseEvent &event)
wxRect x_GetSelectionRect(CTextPanelContext *context) const
void x_DrawSelectionArea(wxDC &dc, const wxRect &updateRect, CTextPanelContext *context)
void OnLeftDClick(wxMouseEvent &event)
void OnLeftDown(wxMouseEvent &event)
void Draw(wxDC &dc, const wxRect &updateRect, CTextPanelContext *context)
CTextPanelContext * GetContext()
virtual wxSize GetSize() const =0
virtual int GetTextLeftMargin(CTextPanelContext *context) const =0
virtual wxRect GetRect() const
virtual const CConstRef< CObject > GetAssosiatedObject() const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static CS_CONTEXT * context