Hugintrunk
0.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
hugin1
hugin
TextKillFocusHandler.cpp
Go to the documentation of this file.
1
// -*- c-basic-offset: 4 -*-
2
27
#include "hugin_config.h"
28
#include "
panoinc_WX.h
"
29
#include "
panoinc.h
"
30
#include "
hugin/TextKillFocusHandler.h
"
31
32
BEGIN_EVENT_TABLE(
TextKillFocusHandler
, wxEvtHandler)
33
EVT_KILL_FOCUS(
TextKillFocusHandler
::OnKillFocus)
34
EVT_TEXT_ENTER(-1,
TextKillFocusHandler
::OnTextEnter)
35
EVT_TEXT(-1,
TextKillFocusHandler
::OnTextChange)
36
END_EVENT_TABLE
()
37
38
39
TextKillFocusHandler
::~
TextKillFocusHandler
()
40
{
41
42
}
43
44
void
TextKillFocusHandler::OnKillFocus
(wxFocusEvent & e)
45
{
46
DEBUG_TRACE
(
"Control ID:"
<< e.GetId());
47
// create a text changed event
48
// need to get id of the eve
49
if
(
dirty
) {
50
DEBUG_DEBUG
(
"forwarding focus change"
);
51
wxCommandEvent cmdEvt(wxEVT_COMMAND_TEXT_ENTER, e.GetId());
52
cmdEvt.SetEventObject(e.GetEventObject());
53
m_parent
->GetEventHandler()->ProcessEvent(cmdEvt);
54
dirty
=
false
;
55
}
56
e.Skip();
57
}
58
59
void
TextKillFocusHandler::OnTextEnter
(wxCommandEvent & e)
60
{
61
DEBUG_TRACE
(
"Control ID:"
<< e.GetId());
62
// create a text changed event
63
// need to get id of the event
64
if
(
dirty
) {
65
// let the event through
66
dirty
=
false
;
67
e.Skip();
68
}
else
{
69
// do not skip the event -> block
70
}
71
}
72
73
74
void
TextKillFocusHandler::OnTextChange
(wxCommandEvent & e)
75
{
76
DEBUG_TRACE
(
"Control ID:"
<< e.GetId());
77
// check if it was an enter event.
78
DEBUG_DEBUG
(
"event: int: "
<< e.GetInt() <<
" sel: "
<< e.GetSelection()
79
<<
" string: "
<< e.GetString().mb_str(wxConvLocal));
80
dirty
=
true
;
81
e.Skip();
82
}
83
84
DEBUG_TRACE
#define DEBUG_TRACE(msg)
Definition:
utils.h:67
wxcode::END_EVENT_TABLE
END_EVENT_TABLE()
panoinc.h
include file for the hugin project
TextKillFocusHandler::m_parent
wxWindow * m_parent
Definition:
TextKillFocusHandler.h:55
TextKillFocusHandler::OnTextEnter
void OnTextEnter(wxCommandEvent &e)
Definition:
TextKillFocusHandler.cpp:59
TextKillFocusHandler.h
TextKillFocusHandler::OnKillFocus
void OnKillFocus(wxFocusEvent &e)
Definition:
TextKillFocusHandler.cpp:44
panoinc_WX.h
include file for the hugin project
TextKillFocusHandler
Handle EVT_KILL_FOCUS and convert it to a EVT_TEXT_ENTER event.
Definition:
TextKillFocusHandler.h:34
TextKillFocusHandler::dirty
bool dirty
Definition:
TextKillFocusHandler.h:57
DEBUG_DEBUG
#define DEBUG_DEBUG(msg)
Definition:
utils.h:68
TextKillFocusHandler::OnTextChange
void OnTextChange(wxCommandEvent &e)
Definition:
TextKillFocusHandler.cpp:74
Generated on Sun Nov 10 2024 01:25:38 for Hugintrunk by
1.8.5