Mercurial > mercurial > hgweb_mover2.cgi
comparison src/myframe.cpp @ 1:b47bd4618c16
design done.
author | pyon@macmini |
---|---|
date | Sat, 15 Oct 2011 20:07:12 +0900 |
parents | 7bf900d47e9e |
children | e4ba3cc9b4b1 |
comparison
equal
deleted
inserted
replaced
0:7bf900d47e9e | 1:b47bd4618c16 |
---|---|
2 // Last Change: 15-Oct-2011. | 2 // Last Change: 15-Oct-2011. |
3 // | 3 // |
4 | 4 |
5 #include "main.h" | 5 #include "main.h" |
6 #include "myframe.h" | 6 #include "myframe.h" |
7 #include "marksheet.h" | |
7 | 8 |
8 ////////////////////////////////////////////////////////////////////////// | 9 ////////////////////////////////////////////////////////////////////////// |
9 // frame constructor | 10 // frame constructor |
10 MyFrame::MyFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) | 11 MyFrame::MyFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) |
11 { | 12 { |
46 m_dirPickerWork = new wxDirPickerCtrl( this, wxID_ANY, wxGetApp().workdir, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE ); | 47 m_dirPickerWork = new wxDirPickerCtrl( this, wxID_ANY, wxGetApp().workdir, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE ); |
47 bSizerFrom->Add( m_dirPickerWork, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | 48 bSizerFrom->Add( m_dirPickerWork, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
48 | 49 |
49 bSizerTop->Add( bSizerFrom, 0, wxEXPAND, 5 ); | 50 bSizerTop->Add( bSizerFrom, 0, wxEXPAND, 5 ); |
50 | 51 |
51 wxBoxSizer* bSizerCcn = new wxBoxSizer( wxHORIZONTAL ); | 52 wxBoxSizer* bSizerDist = new wxBoxSizer( wxHORIZONTAL ); |
53 | |
54 m_staticTextDist = new wxStaticText( this, wxID_ANY, wxT("保存フォルダ"), wxDefaultPosition, wxDefaultSize, 0 ); | |
55 bSizerDist->Add( m_staticTextDist, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |
56 | |
57 m_textCtrlDist = new wxTextCtrl( this, ID_TEXTCTRLDIST, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); | |
58 m_textCtrlDist->SetMaxLength( 15 ); | |
59 bSizerDist->Add( m_textCtrlDist, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |
60 bSizerDist->Add( 0, 0, 1, wxEXPAND, 5 ); | |
52 | 61 |
53 m_staticTextDrive = new wxStaticText( this, wxID_ANY, wxT("ドライブ"), wxDefaultPosition, wxDefaultSize, 0 ); | 62 m_staticTextDrive = new wxStaticText( this, wxID_ANY, wxT("ドライブ"), wxDefaultPosition, wxDefaultSize, 0 ); |
54 bSizerCcn->Add( m_staticTextDrive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | 63 bSizerDist->Add( m_staticTextDrive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
55 | 64 |
56 wxArrayString drives; | 65 wxArrayString drives; |
57 drives.Add(wxT("C:")); | 66 drives.Add(wxT("C:")); |
58 drives.Add(wxT("Y:")); | 67 drives.Add(wxT("Y:")); |
59 drives.Add(wxT("Z:")); | 68 drives.Add(wxT("Z:")); |
60 m_comboBoxDrive = new wxComboBox( this, wxID_ANY, wxT("C:"), wxDefaultPosition, wxSize(50,-1), drives, 0 ); | 69 m_comboBoxDrive = new wxComboBox( this, wxID_ANY, wxT("C:"), wxDefaultPosition, wxSize(50,-1), drives, 0 ); |
61 bSizerCcn->Add( m_comboBoxDrive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | 70 bSizerDist->Add( m_comboBoxDrive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
62 | 71 |
63 m_staticTextDate = new wxStaticText( this, wxID_ANY, wxT("開催日"), wxDefaultPosition, wxDefaultSize, 0 ); | 72 m_staticTextDate = new wxStaticText( this, wxID_ANY, wxT("開催日"), wxDefaultPosition, wxDefaultSize, 0 ); |
64 bSizerCcn->Add( m_staticTextDate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | 73 bSizerDist->Add( m_staticTextDate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
65 | 74 |
66 m_datePicker = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN ); | 75 m_datePicker = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN ); |
67 bSizerCcn->Add( m_datePicker, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | 76 bSizerDist->Add( m_datePicker, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
68 | 77 |
69 m_staticTextCcn = new wxStaticText( this, wxID_ANY, wxT("合議体"), wxDefaultPosition, wxDefaultSize, 0 ); | 78 m_staticTextCcn = new wxStaticText( this, wxID_ANY, wxT("合議体"), wxDefaultPosition, wxDefaultSize, 0 ); |
70 bSizerCcn->Add( m_staticTextCcn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | 79 bSizerDist->Add( m_staticTextCcn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
71 | 80 |
72 wxArrayString ccns; | 81 wxArrayString ccns; |
73 ccns.Add(wxT("角館1")); ccns.Add(wxT("角館2")); ccns.Add(wxT("角館3")); ccns.Add(wxT("角館4")); | 82 ccns.Add(wxT("角館1")); ccns.Add(wxT("角館2")); ccns.Add(wxT("角館3")); ccns.Add(wxT("角館4")); |
74 ccns.Add(wxT("西仙1")); ccns.Add(wxT("西仙2")); ccns.Add(wxT("西仙3")); | 83 ccns.Add(wxT("西仙1")); ccns.Add(wxT("西仙2")); ccns.Add(wxT("西仙3")); |
75 ccns.Add(wxT("千畑1")); ccns.Add(wxT("千畑2")); ccns.Add(wxT("千畑3")); | 84 ccns.Add(wxT("千畑1")); ccns.Add(wxT("千畑2")); ccns.Add(wxT("千畑3")); |
76 ccns.Add(wxT("大曲1")); ccns.Add(wxT("大曲2")); ccns.Add(wxT("大曲3")); ccns.Add(wxT("大曲4")); ccns.Add(wxT("大曲5")); ccns.Add(wxT("大曲6")); | 85 ccns.Add(wxT("大曲1")); ccns.Add(wxT("大曲2")); ccns.Add(wxT("大曲3")); ccns.Add(wxT("大曲4")); ccns.Add(wxT("大曲5")); ccns.Add(wxT("大曲6")); |
77 ccns.Add(wxT("六郷1")); ccns.Add(wxT("六郷2")); ccns.Add(wxT("六郷3")); | 86 ccns.Add(wxT("六郷1")); ccns.Add(wxT("六郷2")); ccns.Add(wxT("六郷3")); |
78 m_comboBoxCcn = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100,-1), ccns, 0 ); | 87 m_comboBoxCcn = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100,-1), ccns, 0 ); |
79 bSizerCcn->Add( m_comboBoxCcn, 0, wxALL, 5 ); | 88 bSizerDist->Add( m_comboBoxCcn, 0, wxALL, 5 ); |
80 | 89 |
81 m_buttonMkDir = new wxButton( this, ID_BUTTONMKDIR, wxT("適用"), wxDefaultPosition, wxDefaultSize, 0 ); | 90 m_buttonMkDir = new wxButton( this, ID_BUTTONMKDIR, wxT("適用"), wxDefaultPosition, wxDefaultSize, 0 ); |
82 bSizerCcn->Add( m_buttonMkDir, 0, wxALL, 5 ); | 91 bSizerDist->Add( m_buttonMkDir, 0, wxALL, 5 ); |
83 | 92 |
84 bSizerTop->Add( bSizerCcn, 0, wxEXPAND, 5 ); | |
85 | |
86 wxBoxSizer* bSizerDist = new wxBoxSizer( wxHORIZONTAL ); | |
87 | |
88 m_staticTextDist = new wxStaticText( this, wxID_ANY, wxT("保存フォルダ"), wxDefaultPosition, wxDefaultSize, 0 ); | |
89 bSizerDist->Add( m_staticTextDist, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |
90 | |
91 m_textCtrlDist = new wxTextCtrl( this, ID_TEXTCTRLDIST, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); | |
92 m_textCtrlDist->SetMaxLength( 15 ); | |
93 bSizerDist->Add( m_textCtrlDist, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |
94 | |
95 bSizerDist->Add( 0, 0, 1, wxEXPAND, 5 ); | |
96 | 93 |
97 bSizerTop->Add( bSizerDist, 0, wxEXPAND, 5 ); | 94 bSizerTop->Add( bSizerDist, 0, wxEXPAND, 5 ); |
98 | 95 |
99 wxBoxSizer* bSizerManip = new wxBoxSizer( wxHORIZONTAL ); | 96 wxBoxSizer* bSizerManip = new wxBoxSizer( wxHORIZONTAL ); |
100 | 97 |
101 wxBoxSizer* bSizerGuess = new wxBoxSizer( wxVERTICAL ); | 98 wxBoxSizer* bSizerGuess = new wxBoxSizer( wxVERTICAL ); |
102 | 99 |
103 m_staticTextName = new wxStaticText( this, wxID_ANY, wxT("氏名"), wxDefaultPosition, wxDefaultSize, 0 ); | 100 m_staticTextName = new wxStaticText( this, wxID_ANY, wxT("氏名"), wxDefaultPosition, wxDefaultSize, 0 ); |
104 bSizerGuess->Add( m_staticTextName, 0, wxALL, 5 ); | 101 bSizerGuess->Add( m_staticTextName, 0, wxTOP|wxLEFT, 5 ); |
105 m_bitmapName = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); | 102 m_bitmapName = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(320,95), 0 ); |
106 bSizerGuess->Add( m_bitmapName, 0, wxALL, 5 ); | 103 bSizerGuess->Add( m_bitmapName, 0, wxALL, 5 ); |
107 | 104 |
108 m_staticTextHhsno = new wxStaticText( this, wxID_ANY, wxT("被保険者番号"), wxDefaultPosition, wxDefaultSize, 0 ); | 105 m_staticTextHhsno = new wxStaticText( this, wxID_ANY, wxT("被保険者番号"), wxDefaultPosition, wxDefaultSize, 0 ); |
109 bSizerGuess->Add( m_staticTextHhsno, 0, wxALL, 5 ); | 106 bSizerGuess->Add( m_staticTextHhsno, 0, wxTOP|wxLEFT, 5 ); |
110 m_bitmapHHsno = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); | 107 m_bitmapHHsno = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(320,54), 0 ); |
111 bSizerGuess->Add( m_bitmapHHsno, 0, wxALL, 5 ); | 108 bSizerGuess->Add( m_bitmapHHsno, 0, wxALL, 5 ); |
112 | 109 |
113 m_staticTextGuess = new wxStaticText( this, wxID_ANY, wxT("推定値"), wxDefaultPosition, wxDefaultSize, 0 ); | 110 m_staticTextGuess = new wxStaticText( this, wxID_ANY, wxT("推定値"), wxDefaultPosition, wxDefaultSize, 0 ); |
114 bSizerGuess->Add( m_staticTextGuess, 0, wxALL, 5 ); | 111 bSizerGuess->Add( m_staticTextGuess, 0, wxTOP|wxLEFT, 5 ); |
115 m_textCtrlGuess = new wxTextCtrl( this, ID_TEXTCTRLGUESS, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); | 112 m_textCtrlGuess = new wxTextCtrl( this, ID_TEXTCTRLGUESS, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
116 m_textCtrlGuess->SetMaxLength( 10 ); | 113 m_textCtrlGuess->SetMaxLength( 10 ); |
117 bSizerGuess->Add( m_textCtrlGuess, 0, wxALL, 5 ); | 114 bSizerGuess->Add( m_textCtrlGuess, 0, wxALL, 5 ); |
118 | 115 |
119 bSizerManip->Add( bSizerGuess, 0, wxEXPAND, 5 ); | 116 bSizerManip->Add( bSizerGuess, 0, wxEXPAND, 5 ); |
120 | 117 |
121 m_listCtrlView = new wxListCtrl( this, ID_LISTCTRLVIEW, wxDefaultPosition, wxDefaultSize, wxLC_ICON ); | 118 m_listCtrlView = new wxListCtrl( this, ID_LISTCTRLVIEW, wxDefaultPosition, wxDefaultSize, wxLC_ICON ); |
119 m_listCtrlView->SetBackgroundColour(wxT("LIGHT GREY")); | |
122 bSizerManip->Add( m_listCtrlView, 1, wxALL|wxEXPAND, 5 ); | 120 bSizerManip->Add( m_listCtrlView, 1, wxALL|wxEXPAND, 5 ); |
123 m_imageList = new wxImageList( 63, 89 ); | 121 m_imageList = new wxImageList( 189, 267 ); |
124 m_listCtrlView->AssignImageList( m_imageList, wxIMAGE_LIST_NORMAL ); | 122 m_listCtrlView->AssignImageList( m_imageList, wxIMAGE_LIST_NORMAL ); |
125 | 123 |
126 wxBoxSizer* bSizerButton = new wxBoxSizer( wxVERTICAL ); | 124 wxBoxSizer* bSizerButton = new wxBoxSizer( wxVERTICAL ); |
127 | 125 |
126 m_buttonDetect = new wxButton( this, ID_BUTTONDETECT, wxT("検知"), wxDefaultPosition, wxDefaultSize, 0 ); | |
127 bSizerButton->Add( m_buttonDetect, 0, wxALL, 5 ); | |
128 m_buttonMove = new wxButton( this, ID_BUTTONMOVE, wxT("移動"), wxDefaultPosition, wxDefaultSize, 0 ); | 128 m_buttonMove = new wxButton( this, ID_BUTTONMOVE, wxT("移動"), wxDefaultPosition, wxDefaultSize, 0 ); |
129 bSizerButton->Add( m_buttonMove, 0, wxALL, 5 ); | 129 bSizerButton->Add( m_buttonMove, 0, wxALL, 5 ); |
130 m_buttonMD = new wxButton( this, ID_BUTTONMD, wxT("移動&検知"), wxDefaultPosition, wxDefaultSize, 0 ); | |
131 bSizerButton->Add( m_buttonMD, 0, wxALL, 5 ); | |
130 m_buttonDel = new wxButton( this, ID_BUTTONDEL, wxT("削除"), wxDefaultPosition, wxDefaultSize, 0 ); | 132 m_buttonDel = new wxButton( this, ID_BUTTONDEL, wxT("削除"), wxDefaultPosition, wxDefaultSize, 0 ); |
131 bSizerButton->Add( m_buttonDel, 0, wxALL, 5 ); | 133 bSizerButton->Add( m_buttonDel, 0, wxALL, 5 ); |
132 m_buttonUndo = new wxButton( this, ID_BUTTONUNDO, wxT("戻す"), wxDefaultPosition, wxDefaultSize, 0 ); | 134 m_buttonUndo = new wxButton( this, ID_BUTTONUNDO, wxT("戻す"), wxDefaultPosition, wxDefaultSize, 0 ); |
133 bSizerButton->Add( m_buttonUndo, 0, wxALL, 5 ); | 135 bSizerButton->Add( m_buttonUndo, 0, wxALL, 5 ); |
134 | 136 |
138 | 140 |
139 this->SetSizer( bSizerTop ); | 141 this->SetSizer( bSizerTop ); |
140 this->Layout(); | 142 this->Layout(); |
141 | 143 |
142 // ステータスバー | 144 // ステータスバー |
143 int widths[] = { -1, 150, 120, 120 }; | 145 int widths[] = { -1, 150, 200, 120 }; |
144 m_statusBar = this->CreateStatusBar( WXSIZEOF(widths), wxST_SIZEGRIP ); | 146 m_statusBar = this->CreateStatusBar( WXSIZEOF(widths), wxST_SIZEGRIP ); |
145 m_statusBar->SetStatusWidths( WXSIZEOF(widths), widths ); | 147 m_statusBar->SetStatusWidths( WXSIZEOF(widths), widths ); |
146 m_statusBar->SetStatusText( wxEmptyString, 0 ); | 148 m_statusBar->SetStatusText( wxEmptyString, 0 ); |
147 | 149 |
148 this->Centre( wxBOTH ); | 150 this->Centre( wxBOTH ); |
149 | |
150 ReadyImage(); | |
151 } | 151 } |
152 | 152 |
153 // destructor | 153 // destructor |
154 MyFrame::~MyFrame() | 154 MyFrame::~MyFrame() |
155 { | 155 { |
156 } | 156 } |
157 | 157 |
158 // Event Table | 158 // Event Table |
159 BEGIN_EVENT_TABLE( MyFrame, wxFrame ) | 159 BEGIN_EVENT_TABLE( MyFrame, wxFrame ) |
160 EVT_SIZE( MyFrame::OnSize ) | 160 EVT_SIZE( MyFrame::OnWinSize ) |
161 EVT_MOVE( MyFrame::OnMove ) | 161 EVT_MOVE( MyFrame::OnWinMove ) |
162 /* | 162 EVT_MENU( ID_MENUITEMPARAM, MyFrame::OnParam ) |
163 EVT_MENU( wxID_EXIT, MyFrame::OnQuit ) | 163 EVT_MENU( ID_MENUITEMAPPDIR, MyFrame::OnOpenAppDir ) |
164 EVT_MENU( wxID_ABOUT, MyFrame::OnAbout ) | 164 EVT_MENU( wxID_EXIT, MyFrame::OnQuit ) |
165 EVT_MENU( ID_OPWORK, MyFrame::OnOpenWorkDir ) | 165 EVT_BUTTON( ID_BUTTONDETECT, MyFrame::OnDetect ) |
166 EVT_BUTTON( ID_STDIR, MyFrame::SetDir ) | 166 EVT_BUTTON( ID_BUTTONMOVE, MyFrame::OnMove ) |
167 EVT_BUTTON( ID_MKDIR, MyFrame::MakeDir ) | 167 EVT_BUTTON( ID_BUTTONMD, MyFrame::OnMoveAndDetect ) |
168 EVT_BUTTON( ID_DOMOVE, MyFrame::MoveImages ) | 168 //EVT_BUTTON( ID_BUTTONDEL, MyFrame::Delete ) |
169 EVT_LIST_ITEM_ACTIVATED( ID_LIST, MyFrame::OnOpenHhsDir ) | 169 //EVT_BUTTON( ID_BUTTONUNDO, MyFrame::Undo ) |
170 */ | 170 //EVT_LIST_ITEM_MIDDLE_CLICK( ID_LISTCTRLVIEW, MyFrame::ToggleSelect ) |
171 EVT_LIST_ITEM_RIGHT_CLICK( ID_LISTCTRLVIEW, MyFrame::ToggleSelect ) | |
172 //EVT_LIST_ITEM_ACTIVATED( ID_LIST, MyFrame::OnOpenHhsDir ) | |
171 EVT_CLOSE( MyFrame::SaveConfig ) | 173 EVT_CLOSE( MyFrame::SaveConfig ) |
172 END_EVENT_TABLE() | 174 END_EVENT_TABLE() |
173 | 175 |
174 // Event Handlers | 176 // Event Handlers |
175 /* 移動先フォルダセット */ | |
176 void MyFrame::SetDir(wxCommandEvent& WXUNUSED(event)) | |
177 { | |
178 wxString dir; | |
179 dir.Append( m_comboBoxDrive->GetValue() ); | |
180 dir.Append( wxFILE_SEP_PATH ); | |
181 wxDateTime dt = m_datePicker->GetValue(); | |
182 dir.Append( dt.Format(wxT("%Y%m%d")) ); | |
183 dir.Append( wxFILE_SEP_PATH ); | |
184 dir.Append( m_comboBoxCcn->GetValue() ); | |
185 m_textCtrlDist->SetValue( dir ); | |
186 } | |
187 | |
188 /* 移動先フォルダ作成 */ | 177 /* 移動先フォルダ作成 */ |
189 void MyFrame::MakeDir(wxCommandEvent& WXUNUSED(event)) | 178 void MyFrame::MakeDir(wxCommandEvent& WXUNUSED(event)) |
190 { | 179 { |
191 wxString distdir = m_textCtrlDist->GetValue(); | 180 wxString to; |
181 to.Append( m_comboBoxDrive->GetValue() ); | |
182 to.Append( wxFILE_SEP_PATH ); | |
183 wxDateTime dt = m_datePicker->GetValue(); | |
184 to.Append( dt.Format(wxT("%Y%m%d")) ); | |
185 to.Append( wxFILE_SEP_PATH ); | |
186 to.Append( m_comboBoxCcn->GetValue() ); | |
187 m_textCtrlDist->SetValue( to ); | |
188 | |
192 wxString ccn = m_comboBoxCcn->GetValue(); | 189 wxString ccn = m_comboBoxCcn->GetValue(); |
193 if ( distdir.Len() < 15 || ccn.IsEmpty() ) { | 190 if ( to.Len() < 15 || ccn.IsEmpty() ) { |
194 wxMessageBox(wxT("フォルダを指定してください.")); | 191 wxMessageBox(wxT("フォルダを指定してください.")); |
195 return; | 192 return; |
196 } | 193 } |
197 | 194 |
198 wxStringTokenizer tkz( distdir, wxFILE_SEP_PATH ); | 195 wxStringTokenizer tkz( to, wxFILE_SEP_PATH ); |
199 wxString d; | 196 wxString d; |
200 while ( tkz.HasMoreTokens() ) { | 197 while ( tkz.HasMoreTokens() ) { |
201 d.Append( tkz.GetNextToken() ); | 198 d.Append( tkz.GetNextToken() ); |
202 d.Append( wxFILE_SEP_PATH ); | 199 d.Append( wxFILE_SEP_PATH ); |
203 if ( !wxDirExists( d ) ) wxMkdir( d ); | 200 if ( !wxDirExists( d ) ) wxMkdir( d ); |
204 } | 201 } |
205 | 202 |
206 wxMessageBox(wxT("移動先フォルダ準備完了")); | 203 wxMessageBox(wxT("移動先フォルダ準備完了")); |
207 wxString cmd = wxT("explorer ") + distdir; | 204 wxString cmd = wxT("explorer ") + to; |
208 wxExecute( cmd ); | 205 wxExecute( cmd ); |
209 } | 206 } |
210 | 207 |
211 void MyFrame::Do(wxCommandEvent& WXUNUSED(event)) | 208 /* 移動 */ |
209 void MyFrame::OnMove(wxCommandEvent& WXUNUSED(event)) | |
210 { | |
211 MoveImage(); | |
212 } | |
213 /* 検知 */ | |
214 void MyFrame::OnDetect(wxCommandEvent& WXUNUSED(event)) | |
215 { | |
216 ReadyImage(); | |
217 } | |
218 /* 移動し検知 */ | |
219 void MyFrame::OnMoveAndDetect(wxCommandEvent& WXUNUSED(event)) | |
212 { | 220 { |
213 MoveImage(); | 221 MoveImage(); |
214 ReadyImage(); | 222 ReadyImage(); |
215 } | 223 } |
216 | 224 |
226 | 234 |
227 int i = 0; | 235 int i = 0; |
228 m_listCtrlView->DeleteAllItems(); | 236 m_listCtrlView->DeleteAllItems(); |
229 m_imageList->RemoveAll(); | 237 m_imageList->RemoveAll(); |
230 wxListItem item; | 238 wxListItem item; |
239 wxString first; | |
240 float b; long l; | |
231 while ( cout ) { | 241 while ( cout ) { |
232 if ( i > 7 ) break; | 242 if ( i > 7 ) break; |
233 | 243 |
234 wxString imagefile = workdir + wxFILE_SEP_PATH + filename; | 244 wxString imagefile = workdir + wxFILE_SEP_PATH + filename; |
235 if ( i > 1 && IsMarksheet() ) cout = false; | 245 if ( i == 0 ) { |
246 IsMarksheet( imagefile, &b, &l ); | |
247 first = imagefile; | |
248 SetStatusText( wxString::Format(wxT("z = %f, l = %d"),b,l), 2 ); | |
249 } | |
250 if ( i > 1 && IsMarksheet( imagefile, &b, &l ) ) cout = false; | |
236 | 251 |
237 item.SetId(i); | 252 item.SetId(i); |
238 item.SetMask(wxLIST_MASK_STATE|wxLIST_MASK_TEXT|wxLIST_MASK_IMAGE); | 253 item.SetMask(wxLIST_MASK_STATE|wxLIST_MASK_TEXT|wxLIST_MASK_IMAGE); |
239 item.SetStateMask(wxLIST_STATE_SELECTED); | 254 item.SetStateMask(wxLIST_STATE_SELECTED); |
240 item.SetState(wxLIST_STATE_SELECTED); | 255 item.SetState(wxLIST_STATE_SELECTED); |
241 item.SetImage(i); | 256 item.SetImage(i); |
242 item.SetText(filename); | 257 item.SetText(filename); |
243 m_listCtrlView->InsertItem( item ); | 258 m_listCtrlView->InsertItem( item ); |
244 m_listCtrlView->SetItem( item ); | 259 m_listCtrlView->SetItem( item ); |
245 | 260 |
246 wxImage img( imagefile, wxBITMAP_TYPE_JPEG ); | 261 wxImage image( imagefile, wxBITMAP_TYPE_JPEG ); |
247 wxBitmap bmp( img.Scale( 63, 89, wxIMAGE_QUALITY_HIGH ) ); | 262 wxBitmap bmp( image.Scale( 189, 267, wxIMAGE_QUALITY_HIGH ) ); |
248 m_imageList->Add( bmp ); | 263 m_imageList->Add( bmp ); |
249 // write log | 264 // write log |
250 i++; | 265 i++; |
251 cout = dir.GetNext( &filename ); | 266 cout = dir.GetNext( &filename ); |
252 } | 267 } |
253 /* | 268 |
254 wxImage img_org( s, wxBITMAP_TYPE_JPEG ); | 269 wxImage marksheet( first, wxBITMAP_TYPE_JPEG ); |
255 wxImage img_name; | 270 wxImage name_image; |
256 img_name = img_org.GetSubImage( wxRect( wxPoint(328,556), wxSize(626,288) ) ); | 271 name_image = marksheet.GetSubImage( wxRect( wxPoint(300,550), wxSize(640,190) ) ); |
257 img_name = img_name.Scale( 200, 92 ); | 272 wxBitmap name_bmp = ( name_image.Scale( 320, 95, wxIMAGE_QUALITY_HIGH ) ); |
258 */ | 273 m_bitmapName->SetBitmap( name_bmp ); |
274 | |
275 wxImage hhsno_image; | |
276 hhsno_image = marksheet.GetSubImage( wxRect( wxPoint(1800,210), wxSize(594,100) ) ); | |
277 wxBitmap hhsno_bmp = ( hhsno_image.Scale( 320, 54, wxIMAGE_QUALITY_HIGH ) ); | |
278 m_bitmapHHsno->SetBitmap( hhsno_bmp ); | |
279 | |
280 wxString hhsno = GuessHhs( first ); | |
281 m_textCtrlGuess->SetValue( hhsno ); | |
259 } | 282 } |
260 | 283 |
261 /* 画像移動 */ | 284 /* 画像移動 */ |
262 void MyFrame::MoveImage() | 285 void MyFrame::MoveImage() |
263 { | 286 { |
278 wxString to = distdir + wxFILE_SEP_PATH + hhs + wxFILE_SEP_PATH + filename; | 301 wxString to = distdir + wxFILE_SEP_PATH + hhs + wxFILE_SEP_PATH + filename; |
279 wxRenameFile( from, to, false ); | 302 wxRenameFile( from, to, false ); |
280 */ | 303 */ |
281 } | 304 } |
282 | 305 |
306 /* 画像を選択 */ | |
307 void MyFrame::ToggleSelect(wxListEvent& event) | |
308 { | |
309 } | |
310 | |
311 /* パラメータダイアログ */ | |
312 void MyFrame::OnParam(wxCommandEvent& WXUNUSED(event)) | |
313 { | |
314 } | |
315 | |
283 // 以下,定型もの | 316 // 以下,定型もの |
284 /* アプリフォルダを開く */ | 317 /* アプリフォルダを開く */ |
285 void MyFrame::OnOpenAppDir(wxCommandEvent& WXUNUSED(event)) | 318 void MyFrame::OnOpenAppDir(wxCommandEvent& WXUNUSED(event)) |
286 { | 319 { |
287 wxString appdir = m_dirPickerWork->GetPath(); | 320 wxString appdir = m_dirPickerWork->GetPath(); |
288 wxString execmd = wxT("explorer ") + appdir; | 321 wxString execmd = wxT("explorer ") + appdir; |
289 wxExecute( execmd ); | 322 wxExecute( execmd ); |
290 } | 323 } |
291 | 324 |
292 /* サイズ変更 */ | 325 /* サイズ変更 */ |
293 void MyFrame::OnSize(wxSizeEvent& event) | 326 void MyFrame::OnWinSize(wxSizeEvent& event) |
294 { | 327 { |
295 this->Refresh( true, NULL ); | 328 this->Refresh( true, NULL ); |
296 TellLocation(); | 329 TellLocation(); |
297 event.Skip(); | 330 event.Skip(); |
298 } | 331 } |
299 /* ウィンドウ移動 */ | 332 /* ウィンドウ移動 */ |
300 void MyFrame::OnMove(wxMoveEvent& WXUNUSED(event)) | 333 void MyFrame::OnWinMove(wxMoveEvent& WXUNUSED(event)) |
301 { | 334 { |
302 TellLocation(); | 335 TellLocation(); |
303 return; | 336 return; |
304 } | 337 } |
305 /* ウィンドウ位置とサイズを表示 */ | 338 /* ウィンドウ位置とサイズを表示 */ |
308 wxRect r = this->GetRect(); | 341 wxRect r = this->GetRect(); |
309 int x = r.GetX(); | 342 int x = r.GetX(); |
310 int y = r.GetY(); | 343 int y = r.GetY(); |
311 int w = r.GetWidth(); | 344 int w = r.GetWidth(); |
312 int h = r.GetHeight(); | 345 int h = r.GetHeight(); |
313 SetStatusText( wxString::Format(wxT("(%d,%d) %dx%d"),x,y,w,h), 2 ); | 346 SetStatusText( wxString::Format(wxT("(%d,%d) %dx%d"),x,y,w,h), 3 ); |
314 } | 347 } |
315 /* 終了 */ | 348 /* 終了 */ |
316 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) | 349 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) |
317 { | 350 { |
318 Close(true); | 351 Close(true); |