ALBA
albaGUICrossSplitter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUICrossSplitter
5 Authors: Silvano Imboden
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaGUICrossSplitter_H__
17#define __albaGUICrossSplitter_H__
18//----------------------------------------------------------------------------
19// Include:
20//----------------------------------------------------------------------------
21#include <wx/laywin.h>
22#include <wx/splitter.h>
23#include <wx/hash.h>
24#include "albaDecl.h"
25#include "albaEvent.h"
26#include "albaObserver.h"
27#include "albaGUIPanel.h"
28//----------------------------------------------------------------------------
29// constant :
30//----------------------------------------------------------------------------
31
33{
41 VA_FOUR
42};
43
45{
49 drag_xy
50};
51//----------------------------------------------------------------------------
52// albaGUICrossSplitter :
53//----------------------------------------------------------------------------
58class ALBA_EXPORT albaGUICrossSplitter: public albaGUIPanel
59{
60public:
61 albaGUICrossSplitter(wxWindow* parent,wxWindowID id = -1);
63
64 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
65 //void OnEvent(albaEventBase *event);
66
69
71 void SetSplitPos(int x,int y);
72
74 void SetSplitPosRel(float x,float y);
75
77 void Maximize();
78
80 void Put(wxWindow* w,int i);
81
83 void SetFocusedPanel(wxWindow* w);
84
85protected:
87
88 wxCursor *m_CursorWE;
89 wxCursor *m_CursorNS;
90 wxCursor *m_CursorNSWE;
91 wxPen *m_Pen;
92
95
97 int m_XPos,m_YPos,m_With,m_Height;
98 int m_OldXPos,m_OldYPos;
99 float m_RelXPos,m_RelYPos;
100
101 wxWindow *m_FocusedPanel;
102 wxWindow *m_ViewPanel1;
103 wxWindow *m_ViewPanel2;
104 wxWindow *m_ViewPanel3;
105 wxWindow *m_ViewPanel4;
106
108 void OnSize(wxSizeEvent &event);
109
111 void OnLeftMouseButtonDown(wxMouseEvent &event);
112
114 void OnLeftMouseButtonUp(wxMouseEvent &event);
115
117 void OnMouseMotion(wxMouseEvent &event);
118
120 void OnLayout();
121
123 CrossSplitterDragModes HitTest(wxMouseEvent &event);
124
126 void DrawTracker(int x, int y);
127 DECLARE_EVENT_TABLE()
128
129 bool m_Maximized;
130};
131#endif
LAYOUT_ONE
Definition: albaDecl.h:151
CrossSplitterModes
@ VA_THREE_UP
@ VA_TWO_VERT
@ VA_THREE_RIGHT
@ VA_TWO_HORZ
@ VA_THREE_DOWN
@ VA_THREE_LEFT
CrossSplitterDragModes
@ drag_none
Use Put(w,id) to place widgets on the various pane - id should be in 0..3.
void SetSplitPosRel(float x, float y)
Set the split position in relative coordinates and redraw the four panels.
void OnLayout()
Adjust the four panel.
void SetFocusedPanel(wxWindow *w)
Set the focus on window 'w'.
CrossSplitterDragModes HitTest(wxMouseEvent &event)
Hit the mouse position and return the drag modality.
void Put(wxWindow *w, int i)
Put the window into the panel 'i'.
void SetSplitPos(int x, int y)
Set the split position and redraw the four panels.
void OnMouseMotion(wxMouseEvent &event)
Manage the mouse movement to draw the cross of cross splitter.
void SetListener(albaObserver *Listener)
void OnSize(wxSizeEvent &event)
Adjust the panels size.
virtual ~albaGUICrossSplitter()
albaGUICrossSplitter(wxWindow *parent, wxWindowID id=-1)
void Maximize()
Maximize the founded panel.
void Split(CrossSplitterModes mode)
Show/Hide the four panel according to a splitting modality.
CrossSplitterDragModes m_Dragging
void DrawTracker(int x, int y)
Draw the cross representing the position of creoss splitter.
CrossSplitterModes m_Mode
void OnLeftMouseButtonUp(wxMouseEvent &event)
Intercept the mouse button up and call SetSplitPos with new position.
void OnLeftMouseButtonDown(wxMouseEvent &event)
Intercept the mouse button down and call DrawTracker with mouse position.
class name: albaGUIPanel Inherits directly from wxPanel and adds the pointer to the next panel
Definition: albaGUIPanel.h:27
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36