File: wxFlatButtonBase.cpp

package info (click to toggle)
codelite 6.1.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 48,992 kB
  • ctags: 43,502
  • sloc: cpp: 334,263; ansic: 18,441; xml: 4,713; yacc: 2,653; lex: 2,449; python: 1,188; sh: 385; makefile: 40
file content (85 lines) | stat: -rw-r--r-- 3,709 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: wxFlatButton.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////

#include "wxFlatButtonBase.h"


// Declare the bitmap loading function
extern void wxC9ED9InitBitmapResources();

static bool bBitmapLoaded = false;


wxFlatButtonBase::wxFlatButtonBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC9ED9InitBitmapResources();
        bBitmapLoaded = true;
    }
    
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    Centre(wxBOTH);
    // Connect events
    this->Connect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(wxFlatButtonBase::OnEnterWindow), NULL, this);
    this->Connect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(wxFlatButtonBase::OnLeaveWindow), NULL, this);
    this->Connect(wxEVT_PAINT, wxPaintEventHandler(wxFlatButtonBase::OnPaint), NULL, this);
    this->Connect(wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(wxFlatButtonBase::OnEraseBackground), NULL, this);
    this->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(wxFlatButtonBase::OnLeftDown), NULL, this);
    this->Connect(wxEVT_SIZE, wxSizeEventHandler(wxFlatButtonBase::OnSize), NULL, this);
    this->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(wxFlatButtonBase::OnLeftDClick), NULL, this);
    this->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(wxFlatButtonBase::OnLeftUp), NULL, this);
    
}

wxFlatButtonBase::~wxFlatButtonBase()
{
    this->Disconnect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(wxFlatButtonBase::OnEnterWindow), NULL, this);
    this->Disconnect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(wxFlatButtonBase::OnLeaveWindow), NULL, this);
    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(wxFlatButtonBase::OnPaint), NULL, this);
    this->Disconnect(wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(wxFlatButtonBase::OnEraseBackground), NULL, this);
    this->Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(wxFlatButtonBase::OnLeftDown), NULL, this);
    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(wxFlatButtonBase::OnSize), NULL, this);
    this->Disconnect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(wxFlatButtonBase::OnLeftDClick), NULL, this);
    this->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(wxFlatButtonBase::OnLeftUp), NULL, this);
    
}

wxFlatButtonBarBase::wxFlatButtonBarBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC9ED9InitBitmapResources();
        bBitmapLoaded = true;
    }
    
    m_mainSizer = new wxBoxSizer(wxHORIZONTAL);
    this->SetSizer(m_mainSizer);
    
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    Centre(wxBOTH);
    // Connect events
    this->Connect(wxEVT_PAINT, wxPaintEventHandler(wxFlatButtonBarBase::OnPaint), NULL, this);
    this->Connect(wxEVT_SIZE, wxSizeEventHandler(wxFlatButtonBarBase::OnSize), NULL, this);
    
}

wxFlatButtonBarBase::~wxFlatButtonBarBase()
{
    this->Disconnect(wxEVT_PAINT, wxPaintEventHandler(wxFlatButtonBarBase::OnPaint), NULL, this);
    this->Disconnect(wxEVT_SIZE, wxSizeEventHandler(wxFlatButtonBarBase::OnSize), NULL, this);
    
}