39 #include <wx/settings.h>
64 m_DragIndex(-1), m_ResizableIndex(-1),
67 m_DragArea = wxSystemSettings::GetMetric(wxSYS_DRAG_X);
105 wxPoint ms_pos =
event.GetPosition();
118 wxPoint ms_pos =
event.GetPosition();
120 if(event.Dragging()) {
129 int dd = d_x * d_x + d_y * d_y;
181 int key =
event.GetKeyCode();
182 if(
key == WXK_ESCAPE) {
201 if(index >= 0 && index < col_n) {
206 if(x >= right -
kGrabZone && index < col_n - 1) {
209 for( index--; index >= 0; index--) {
240 for(
int i = 0;
i < col_n;
i++ ) {
284 _ASSERT(index >= 0 && index < col_n);
287 for(
int i = index + 1;
i < col_n;
i++ ) {
293 for(
int i = index - 1;
i >= 0;
i--) {
317 for(
int i = 0;
i < col_n;
i++ ) {
390 resizable_index =
min(resizable_index, col_n);
421 int new_width = new_value -
column.m_Pos;
422 int d_width = new_width -
column.m_Width;
425 column.m_Width = new_width;
437 int d_pos = new_value -
column.m_Pos;
452 int new_width = new_value -
column.m_Pos;
453 int d_width = new_width -
column.m_Width;
456 column.m_Width = new_width;
481 for(
int i = 0;
i < col_n;
i++ ) {
491 _ASSERT(ins_pos >=0 && ins_pos <= col_n);
532 CGlAttrGuard guard(GL_LINE_BIT | GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT );
558 gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
560 gl.
Enable(GL_LINE_SMOOTH);
561 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
572 int y2 = rc_vp.
Top();
574 gl.
Color4d(0.0, 0.0, 1.0, 0.25);
625 gl.
Color4d(0.0, 0.0, 1.0, 0.25);
671 gl.
Color4d(1.0, 0.0, 0.0, 0.5);
static const int kGrabZone
CAlnMultiHeaderHandler.
static const int kMinWidth
virtual wxEvtHandler * GetEvtHandler()
void OnLeftUp(wxMouseEvent &event)
void x_SwitchToIdleState(bool apply)
void OnLeftDown(wxMouseEvent &event)
void OnKeyDown(wxKeyEvent &event)
bool x_HasResizableColumn()
IAMHeaderHandlerHost * m_Host
int x_NextVisibleColumn(int index, bool right)
virtual bool IsActive() const
void x_MoveColumnSeparator(int d_x)
void x_SwitchToMoveMode()
virtual void SetPane(CGlPane *pane)
void x_SwitchToResizeMode()
virtual void SetHost(IAMHeaderHandlerHost *host)
virtual void Render(CGlPane &pane)
void x_RenderMoveMode(CGlPane &pane)
virtual IGenericHandlerHost * GetGenericHost()
void x_RenderResizeMode(CGlPane &pane)
int m_CurrInsIndex
insertion point for the column being moved (new index for this column)
void OnMotion(wxMouseEvent &event)
TVPPoint m_VPPrevMousePos
EHitResult x_HitTest(const TVPPoint &point, int &index)
CGlAttrGuard - guard class for restoring OpenGL attributes.
virtual IAlnMultiHeaderContext * HHH_GetContext()=0
virtual TVPRect HHH_GetHeaderRect()=0
virtual void HHH_SetColumns(const TColumns &columns, int resizable_index)=0
change order of columns, their width and posisitions
virtual void HHH_SortByColumn(int index)=0
virtual TVPPoint HHH_GetVPPosByWindowPos(const wxPoint &pos)=0
returns bounds of the Header
virtual void HHH_RenderColumnHeader(int index, const TVPRect &rc)=0
virtual void GHH_Redraw()=0
redraws the Host and the handler
virtual void GHH_SetCursor(const wxCursor &cursor)=0
changes the cursor in the hosting window
virtual void Enable(GLenum glstate)=0
virtual void Begin(GLenum mode)=0
Start rendering.
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0
Options to be used when GL_BLEND is enabled.
void Offset(T d_x, T d_y)
IRender & GetGl()
convenience function for getting current render manager
void RectC(const TVPRect &rc)
void Vertex2d(GLdouble x, GLdouble y)
TVPRect & GetViewport(void)
void Color4d(GLdouble r, GLdouble g, GLdouble b, GLdouble a)
virtual void End()=0
Finish rendering (create buffer and send to renderer)
virtual void LineWidth(GLfloat w)=0
Set line width for drawing: glLineWidth()
void SetHorz(T left, T right)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int
A callback function used to compare two keys in a database.
const struct ncbi::grid::netcache::search::fields::KEY key
static const char * column
SColumn describes a single column.
int m_Width
horizontal position in viewport
bool m_Visible
can be used to identify column