Debian Codegraph @

wxcrafter/src/duplicateTLWdlg.cpp

raw
1 #include "duplicateTLWdlg.h"
2
3 DuplicateTLWDlg::DuplicateTLWDlg(wxWindow* parent)
4 : DuplicateTLWBaseDlg(parent)
5 {
6 }
7
8 DuplicateTLWDlg::~DuplicateTLWDlg() {}
9
10 void DuplicateTLWDlg::OnInheritedNameFocus(wxFocusEvent& event)
11 {
12 event.Skip();
13
14 if(!m_textInheritedName->IsEmpty() || m_textBasename->IsEmpty()) {
15 // There's nothing to copy, or we already have an entry
16 return;
17 }
18
19 wxString suggestion = m_textBasename->GetValue();
20 if(suggestion.Replace("Base", "") || suggestion.Replace("base", "")) {
21 m_textInheritedName->ChangeValue(suggestion);
22 }
23 }
24
25 void DuplicateTLWDlg::OnFilenameFocus(wxFocusEvent& event)
26 {
27 event.Skip();
28
29 if(!m_textFilename->IsEmpty() || m_textInheritedName->IsEmpty()) {
30 // There's nothing to copy, or we already have an entry
31 return;
32 }
33
34 wxString suggestion = m_textInheritedName->GetValue();
35 if(suggestion.Lower() != suggestion) { m_textFilename->ChangeValue(suggestion.Lower()); }
36 }