annotate src/myframe.cpp @ 2:1ea4f7981ff5

create window.
author pyon@macmini
date Sun, 02 Oct 2011 18:44:03 +0900
parents
children a5bddd859104
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
1 // Filename : mainframe.cpp
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
2 // Last Change: 02-Oct-2011.
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
3 //
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
4 #include "symbol.h"
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
5 #include "common.h"
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
6 #include "myframe.h"
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
7 #include "delwhite.h"
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
8 #include "main.h"
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
9
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
10 // resources
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
11 // the application icon (under Windows and OS/2 it is in resources and even
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
12 // though we could still include the XPM here it would be unused)
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
13 #if !defined(__WXMSW__) && !defined(__WXPM__)
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
14 #include "sample.xpm"
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
15 #endif
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
16
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
17 //////////////////////////////////////////////////////////////////////////
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
18 // control constructor
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
19
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
20 // 検索履歴をログに保存
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
21 /*
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
22 void MyCmdBox::WriteLog( wxString& cmd, wxString& path )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
23 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
24 wxString logfn = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("log.txt");
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
25 wxTextFile logFile;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
26 logFile.Open( logfn );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
27 wxDateTime now = wxDateTime::Now();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
28 wxString log = now.Format( wxT("%Y-%m-%d %H:%M:%S") ) + wxT(" ") + cmd + wxT(" ") + path;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
29 logFile.AddLine( log );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
30 logFile.Write();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
31 logFile.Close();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
32
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
33 return;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
34 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
35 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
36
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
37 //////////////////////////////////////////////////////////////////////////
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
38 // frame constructor
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
39 MyFrame::MyFrame( wxWindow* parent, wxWindowID id, const wxString& title )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
40 : wxFrame( parent, id, title )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
41 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
42 //this->SetSizeHints( wxDefaultSize, wxDefaultSize );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
43 this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
44 // set the frame icon
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
45 SetIcon(wxICON(sample));
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
46
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
47 // メニューバー
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
48 m_menubar = new wxMenuBar();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
49
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
50 m_menuFile = new wxMenu();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
51 m_menuFile->Append( wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about dialog") );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
52 //m_menuFile->AppendSeparator(); //----
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
53 m_menuFile->Append( wxID_EXIT, wxT("終了(&X)\tAlt-X"), wxT("Quit this program") );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
54
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
55 m_menubar->Append( m_menuFile, wxT("ファイル(&F)") );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
56
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
57 this->SetMenuBar( m_menubar );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
58
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
59 // ステータスバー
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
60 int widths[] = { -1, 150, 120 };
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
61 m_statusBar = this->CreateStatusBar( WXSIZEOF(widths), wxST_SIZEGRIP );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
62 m_statusBar->SetStatusWidths( WXSIZEOF(widths), widths );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
63 m_statusBar->SetStatusText( wxEmptyString, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
64
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
65 // コントロール
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
66 wxBoxSizer* bSizerTop;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
67 bSizerTop = new wxBoxSizer( wxVERTICAL );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
68
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
69 wxBoxSizer* bSizerWork;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
70 bSizerWork = new wxBoxSizer( wxHORIZONTAL );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
71
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
72 m_staticTextWork = new wxStaticText( this, wxID_ANY, wxT("作業用フォルダ"), wxDefaultPosition, wxDefaultSize, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
73 bSizerWork->Add( m_staticTextWork, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
74
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
75 m_dirPickerWork = new wxDirPickerCtrl( this, ID_WORKDIR, wxGetApp().dir, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
76 bSizerWork->Add( m_dirPickerWork, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
77
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
78 m_buttonDetWhite = new wxButton( this, ID_DTWHITE, wxT("白紙検知"), wxDefaultPosition, wxDefaultSize, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
79 bSizerWork->Add( m_buttonDetWhite, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
80
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
81 bSizerTop->Add( bSizerWork, 0, wxEXPAND, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
82
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
83 wxBoxSizer* bSizerMoveTo;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
84 bSizerMoveTo = new wxBoxSizer( wxHORIZONTAL );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
85
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
86 m_staticTextMoveTo = new wxStaticText( this, wxID_ANY, wxT("移動先フォルダ"), wxDefaultPosition, wxDefaultSize, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
87 bSizerMoveTo->Add( m_staticTextMoveTo, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
88
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
89 m_comboBoxMoveDrive = new wxComboBox( this, ID_DRIVE, wxT("C:"), wxDefaultPosition, wxSize( 50,-1 ), 0, NULL, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
90 bSizerMoveTo->Add( m_comboBoxMoveDrive, 0, wxALL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
91
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
92 m_datePickerCcn = new wxDatePickerCtrl( this, ID_DATE, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
93 bSizerMoveTo->Add( m_datePickerCcn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
94
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
95 m_comboBoxCcn = new wxComboBox( this, ID_CCN, wxT("1\n2\n3\n"), wxDefaultPosition, wxSize( 100,-1 ), 0, NULL, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
96 bSizerMoveTo->Add( m_comboBoxCcn, 0, wxALL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
97
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
98 bSizerMoveTo->Add( 0, 0, 0, 0, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
99
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
100 m_buttonMkDir = new wxButton( this, ID_MKDIR, wxT("ファルダ作成"), wxDefaultPosition, wxDefaultSize, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
101 bSizerMoveTo->Add( m_buttonMkDir, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
102
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
103 bSizerTop->Add( bSizerMoveTo, 0, 0, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
104
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
105 wxBoxSizer* bSizerDoMove;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
106 bSizerDoMove = new wxBoxSizer( wxHORIZONTAL );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
107
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
108 m_staticTextDummy = new wxStaticText( this, wxID_ANY, wxT("移動先ふぉるだ"), wxDefaultPosition, wxDefaultSize, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
109 m_staticTextDummy->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
110
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
111 bSizerDoMove->Add( m_staticTextDummy, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
112
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
113 m_textCtrlMoveDir = new wxTextCtrl( this, ID_DIR, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
114 m_textCtrlMoveDir->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVEBORDER ) );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
115
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
116 bSizerDoMove->Add( m_textCtrlMoveDir, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
117
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
118 m_buttonDoMove = new wxButton( this, ID_DOMOVE, wxT("画像移動"), wxDefaultPosition, wxDefaultSize, 0 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
119 m_buttonDoMove->Enable( false );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
120
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
121 bSizerDoMove->Add( m_buttonDoMove, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
122
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
123 bSizerTop->Add( bSizerDoMove, 0, wxEXPAND, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
124
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
125 m_listCtrl = new wxListCtrl( this, ID_LIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
126 bSizerTop->Add( m_listCtrl, 1, wxALL|wxEXPAND, 5 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
127
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
128 this->SetSizer( bSizerTop );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
129 this->Layout();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
130
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
131 this->Centre( wxBOTH );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
132 //this->SetDefaultItem(m_buttonDetWhite);
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
133 m_buttonDetWhite->SetFocus();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
134 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
135
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
136 // destructor
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
137 MyFrame::~MyFrame()
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
138 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
139 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
140
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
141 // Event Table
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
142 BEGIN_EVENT_TABLE( MyFrame, wxFrame )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
143 EVT_SIZE( MyFrame::OnSize )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
144 EVT_MOVE( MyFrame::OnMove )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
145 EVT_MENU( wxID_EXIT, MyFrame::OnQuit )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
146 EVT_MENU( wxID_ABOUT, MyFrame::OnAbout )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
147 EVT_BUTTON( ID_DTWHITE, MyFrame::OnDetectWhite )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
148 EVT_CLOSE( MyFrame::SaveConfig )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
149 END_EVENT_TABLE()
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
150
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
151 // Event Handlers
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
152 /* サイズ変更 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
153 void MyFrame::OnSize(wxSizeEvent& event)
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
154 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
155 this->Refresh( true, NULL );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
156 TellLocation();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
157 event.Skip();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
158 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
159 /* ウィンドウ移動 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
160 void MyFrame::OnMove(wxMoveEvent& WXUNUSED(event))
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
161 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
162 TellLocation();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
163 return;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
164 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
165 /* ウィンドウ位置とサイズを表示 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
166 void MyFrame::TellLocation( void )
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
167 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
168 wxRect r = this->GetRect();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
169 int x = r.GetX();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
170 int y = r.GetY();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
171 int w = r.GetWidth();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
172 int h = r.GetHeight();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
173 SetStatusText( wxString::Format(wxT("(%d,%d) %dx%d"),x,y,w,h), 2 );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
174 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
175 /* 終了 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
176 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
177 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
178 Close(true);
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
179 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
180
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
181 /* バージョン情報 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
182 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
183 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
184 wxMessageBox(
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
185 wxString::Format(
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
186 wxT("Version %d.%d ( build %d ) by %s\n")
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
187 wxT("running under %s."),
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
188 VER, REV, BLD, wxVERSION_STRING,
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
189 wxGetOsDescription().c_str()
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
190 ),
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
191 wxT("About this program"), wxOK | wxICON_INFORMATION, this );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
192 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
193
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
194 /* 白紙検知 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
195 void MyFrame::OnDetectWhite(wxCommandEvent& WXUNUSED(event))
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
196 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
197 FrameDelWhite* dw = new FrameDelWhite( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxCAPTION|wxFRAME_NO_TASKBAR|wxMAXIMIZE_BOX|wxRESIZE_BORDER );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
198 dw->SetMinSize( wxSize( 580, 680 ) );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
199
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
200 dw->m_dir = m_dirPickerWork->GetPath();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
201 dw->SetTitle( wxT("Delete White Sheet - ") + dw->m_dir );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
202 dw->LoadImages();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
203
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
204 dw->Show(true);
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
205 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
206
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
207 /* アプリケーションフォルダを開く */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
208 /*
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
209 void MyFrame::OnOpenAppDir(wxCommandEvent& WXUNUSED(event))
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
210 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
211 wxStandardPaths appdir;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
212 wxString execmd = wxT("explorer ") + appdir.GetDataDir();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
213 wxExecute( execmd );
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
214 return;
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
215 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
216 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
217
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
218
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
219 /* 設定を保存 */
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
220 void MyFrame::SaveConfig(wxCloseEvent& WXUNUSED(event))
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
221 {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
222 if ( !IsIconized() && !IsMaximized() ) {
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
223 wxGetApp().rect = this->GetRect();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
224 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
225 wxGetApp().dir = m_dirPickerWork->GetPath();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
226
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
227 Destroy();
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
228 }
1ea4f7981ff5 create window.
pyon@macmini
parents:
diff changeset
229