ALBA
albaGUIFlagSplitter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIFlagSplitter
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 __albaGUIFlagSplitter_H__
17#define __albaGUIFlagSplitter_H__
18
19//----------------------------------------------------------------------------
20// Include:
21//----------------------------------------------------------------------------
22#include <wx/laywin.h>
23#include <wx/splitter.h>
24#include <wx/hash.h>
25#include "albaDecl.h"
26#include "albaEvent.h"
27#include "albaObserver.h"
28#include "albaGUIPanel.h"
29
30//----------------------------------------------------------------------------
31// constant :
32//----------------------------------------------------------------------------
34{
38};
39
40//----------------------------------------------------------------------------
41// albaGUIFlagSplitter :
42//----------------------------------------------------------------------------
48{
49public:
50 albaGUIFlagSplitter(wxWindow* parent,wxWindowID id = -1);
52
53 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
54 //void OnEvent(albaEventBase *alba_event);
55
57 void SetSplitPos(int x1,int x2);
58
60 void Put(wxWindow* w,int i);
61
62protected:
64 wxCursor *m_CursorWE;
65 wxPen *m_Pen;
66
68
73
74 wxWindow *m_FocusedPanel;
75 wxWindow *m_ViewPanel1;
76 wxWindow *m_ViewPanel2;
77 wxWindow *m_ViewPanel3;
78
80 void OnSize(wxSizeEvent &event);
81
83 void OnLayout();
84
86 void OnLeftMouseButtonDown(wxMouseEvent &event);
87
89 void OnLeftMouseButtonUp(wxMouseEvent &event);
90
92 void OnMouseMotion(wxMouseEvent &event);
93
95 FlagSplitterDragModes HitTest(wxMouseEvent &event);
96
98 void DrawTracker(int x);
99
100DECLARE_EVENT_TABLE()
101
103};
104#endif
FlagSplitterDragModes
@ drag_x2
@ drag_none
@ drag_x1
Use Put(w,id) to place widgets on the various pane - id should be in 0..2.
virtual ~albaGUIFlagSplitter()
void SetSplitPos(int x1, int x2)
Set the split position and redraw the four panels.
FlagSplitterDragModes m_Dragging
FlagSplitterDragModes HitTest(wxMouseEvent &event)
Hit the mouse position and return the drag modality.
albaGUIFlagSplitter(wxWindow *parent, wxWindowID id=-1)
void DrawTracker(int x)
Draw the cross representing the position of cross splitter.
void SetListener(albaObserver *Listener)
void OnLayout()
Adjust the panels.
albaObserver * m_Listener
void OnLeftMouseButtonUp(wxMouseEvent &event)
Intercept the mouse button up and call SetSplitPos with new position.
void Put(wxWindow *w, int i)
Put the window into the panel 'i'.
void OnSize(wxSizeEvent &event)
Adjust the panels size.
void OnMouseMotion(wxMouseEvent &event)
Manage the mouse movement to draw the cross of cross splitter.
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