source: eviacam/trunk/fuentes/src/clickwindow.h @ 567

Last change on this file since 567 was 567, checked in by mabarracus, 4 years ago

updated sources to version 2.0.3

File size: 3.2 KB
Line 
1/////////////////////////////////////////////////////////////////////////////
2// Name:        clickwindow.h
3// Purpose: 
4// Author:      Cesar Mauri Loba (cesar at crea-si dot com)
5// Modified by:
6// Created:     
7// Copyright:   (C) 2008-09 Cesar Mauri Loba - CREA Software Systems
8//
9//  This program is free software: you can redistribute it and/or modify
10//  it under the terms of the GNU General Public License as published by
11//  the Free Software Foundation, either version 3 of the License, or
12//  (at your option) any later version.
13//
14//  This program is distributed in the hope that it will be useful,
15//  but WITHOUT ANY WARRANTY; without even the implied warranty of
16//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17//  GNU General Public License for more details.
18//
19//  You should have received a copy of the GNU General Public License
20//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21/////////////////////////////////////////////////////////////////////////////
22
23#ifndef _CLICKWINDOW_H_
24#define _CLICKWINDOW_H_
25
26
27#include "wxappbar.h"
28#include "clickwindowcontroller.h"
29
30#define SYMBOL_CCLICKWINDOW_STYLE wxSTAY_ON_TOP|wxSIMPLE_BORDER
31#define SYMBOL_CCLICKWINDOW_TITLE _("Click Window")
32#define SYMBOL_CCLICKWINDOW_IDNAME ID_CCLICKWINDOW
33#define SYMBOL_CCLICKWINDOW_SIZE wxDefaultSize
34#define SYMBOL_CCLICKWINDOW_POSITION wxPoint(0, 0)
35
36class CClickWindow: public WXAppBar
37{   
38    DECLARE_EVENT_TABLE()
39
40public:
41    /// Constructors
42    CClickWindow();
43    CClickWindow( wxWindow* parent, wxWindowID id, const wxString& caption = SYMBOL_CCLICKWINDOW_TITLE, const wxPoint& pos = SYMBOL_CCLICKWINDOW_POSITION, const wxSize& size = SYMBOL_CCLICKWINDOW_SIZE, long style = SYMBOL_CCLICKWINDOW_STYLE );
44
45    /// Creation
46    bool Create( wxWindow* parent, wxWindowID id, const wxString& caption = SYMBOL_CCLICKWINDOW_TITLE, const wxPoint& pos = SYMBOL_CCLICKWINDOW_POSITION, const wxSize& size = SYMBOL_CCLICKWINDOW_SIZE, long style = SYMBOL_CCLICKWINDOW_STYLE );
47
48    /// Destructor
49    ~CClickWindow();
50
51    /// Initialises member variables
52    void Init();
53
54    void ConnectEvents();
55       
56        void SetController (CClickWindowController& controller);
57
58        virtual void UpdateButtons (bool noClickStatus, CClickWindowController::EButton selected, CClickWindowController::EButton locked)= 0;
59
60        virtual void OnMainWindowShow ( wxShowEvent& event );
61        virtual wxControl* GetNoClickButton()= 0;
62protected:
63    virtual wxControl* GetLeftButton()= 0;
64    virtual wxControl* GetMiddleButton()= 0;
65    virtual wxControl* GetRightButton()= 0;
66    virtual wxControl* GetDragButton()= 0;
67    virtual wxControl* GetDblClickButton()= 0;
68    virtual wxControl* GetShowFrame()= 0;
69         
70        void OnCloseWindow( wxCloseEvent& event );
71
72        void OnLeftUp( wxMouseEvent& event );
73
74        void OnEnterWindow( wxMouseEvent& event );
75
76    void OnEventSkipperMouse( wxMouseEvent& event );
77       
78        void OnEventSkipperFocus( wxFocusEvent& event );
79       
80        CClickWindowController::EButton ButtonId2EButton (int id);
81       
82        CClickWindowController* m_pController;
83};
84
85inline void CClickWindow::SetController (CClickWindowController& controller)
86{
87        assert (m_pController== NULL);
88        m_pController= &controller;
89}
90
91#endif
92    // _CLICKWINDOW_H_
Note: See TracBrowser for help on using the repository browser.