# HG changeset patch # User pyon@macmini # Date 1560113796 -32400 # Node ID f40a656870795b9408a041d8939e52c1e5ce8e10 # Parent 2f5584f0d1279d04475ab5ee0df67bd3c940acd5 small fix. diff -r 2f5584f0d127 -r f40a65687079 Madnm.fbp --- a/Madnm.fbp Sat Jun 08 16:21:40 2019 +0900 +++ b/Madnm.fbp Mon Jun 10 05:56:36 2019 +0900 @@ -2267,11 +2267,11 @@ wxVERTICAL 1 none - + 5 wxEXPAND 1 - + 2 wxBOTH @@ -2593,11 +2593,11 @@ -1 - + 5 wxALL 0 - + 1 1 1 @@ -2611,7 +2611,7 @@ 1 0 - + "C:\\" "Y:\\" "Z:\\" 1 1 @@ -2633,7 +2633,7 @@ 0 1 - m_listBox + m_checkList 1 @@ -2643,7 +2643,7 @@ Resizable 1 - + wxLB_MULTIPLE|wxLB_NO_SB ; ; forward_declare 0 @@ -3831,7 +3831,7 @@ 5 wxEXPAND 1 - + wxID_ANY Work @@ -4256,11 +4256,11 @@ - + 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + wxALL|wxEXPAND 1 - + 1 1 1 @@ -4270,16 +4270,13 @@ - wxSYS_COLOUR_WINDOWTEXT + 1 0 - 1 - 1 - 0 Dock 0 @@ -4291,7 +4288,6 @@ 0 0 wxID_ANY - 0 @@ -4299,7 +4295,7 @@ 0 1 - m_customControl + m_listCtrl 1 @@ -4307,12 +4303,16 @@ 1 Resizable - 1 + wxLC_ICON ; ; forward_declare 0 + + wxFILTER_NONE + wxDefaultValidator + diff -r 2f5584f0d127 -r f40a65687079 Makefile --- a/Makefile Sat Jun 08 16:21:40 2019 +0900 +++ b/Makefile Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ # Makefile for wxWidgets Application -# Last Change: 2019-06-06 –Ø 16:07:28. +# Last Change: 2019-06-10 Mon 05:55:50. # by Takayuki Mutoh # @@ -38,6 +38,7 @@ $(OBJDIR)/appconf.o \ $(OBJDIR)/util.o \ $(OBJDIR)/custom.o \ + #$(OBJDIR)/wxsqlite3.o \ $(OBJDIR)/mainframe.o ifdef COMSPEC @@ -72,6 +73,9 @@ $(OBJDIR)/mainframe.o: mainframe.cpp mainframe.h custom.h appconf.h id.h $(CXX) -c $< -o $@ $(CXXFLAGS) +$(OBJDIR)/wxsqlite3.o: wxsqlite3.cpp wx/wxsqlite3.h + $(CXX) -c $< -o $@ $(CXXFLAGS) + # for icon ifdef COMSPEC diff -r 2f5584f0d127 -r f40a65687079 app.conf --- a/app.conf Sat Jun 08 16:21:40 2019 +0900 +++ b/app.conf Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ [Geometry] -geo=1383x1057+245+23 +geo=1557x1057+181+23 [Ccn] ccn=ŠpŠÙ‚P:ŠpŠÙ‚Q:ŠpŠÙ‚R:ŠpŠÙ‚S:¼å‚P:¼å‚Q:¼å‚R:用‚P:用‚Q:用‚R:‘å‹È‚P:‘å‹È‚Q:‘å‹È‚R:‘å‹È‚S:‘å‹È‚T:‘å‹È‚U:˜Z‹½‚P:˜Z‹½‚Q:˜Z‹½‚R diff -r 2f5584f0d127 -r f40a65687079 include/appconf.h --- a/include/appconf.h Sat Jun 08 16:21:40 2019 +0900 +++ b/include/appconf.h Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ // Filename : appconf.h -// Last Change: 2019-06-07 ‹à 14:39:29. +// Last Change: 2019-06-09 Sun 16:54:00. // #pragma once @@ -19,8 +19,11 @@ wxRect LoadRect( void ); wxRect LoadMask( int i ); + wxString LoadWork( void ); + wxString LoadScanner( void ); void LoadCcn( wxComboBox ccn, wxComboBox sss ); void SaveRect( wxRect rect ); + void SaveWork( wxString dir ); }; diff -r 2f5584f0d127 -r f40a65687079 include/custom.h --- a/include/custom.h Sat Jun 08 16:21:40 2019 +0900 +++ b/include/custom.h Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ // Filename : custom.h -// Last Change: 2019-06-07 ‹à 16:39:35. +// Last Change: 2019-06-09 Sun 16:57:24. // #pragma once @@ -9,7 +9,10 @@ #include #include #include -#include "wx/dcclient.h" +#include +#include + +#include "util.h" class LookWindow : public wxWindow { @@ -56,3 +59,21 @@ wxRect GetRealMask2Rect( void ); }; +class ListThumbnail : public wxListView +{ + DECLARE_EVENT_TABLE() + private: + FileList m_filelist; + wxImageList m_imageListZ1; + wxImageList m_imageListZ2; + wxImageList m_imageListZ3; + + public: + ListThumbnail( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON ); + ~ListThumbnail(); + + int Reload( void ); + void SetDirectory( wxString dir ) { m_filelist.SetDirectory( dir ); }; + //void OnDClick( wx); +}; + diff -r 2f5584f0d127 -r f40a65687079 include/id.h --- a/include/id.h Sat Jun 08 16:21:40 2019 +0900 +++ b/include/id.h Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ // Filename : id.h -// Last Change: 2019-06-07 Fri 22:31:04. +// Last Change: 2019-06-08 Sat 22:47:18. // #pragma once @@ -62,6 +62,7 @@ ID_MKDIR, ID_FMOVE, + ID_HNO, ID_MOVE, ID_WORK, @@ -71,5 +72,6 @@ ID_SELALL, ID_SELDEL, ID_UPDT, + ID_THUMB, }; diff -r 2f5584f0d127 -r f40a65687079 include/mainframe.h --- a/include/mainframe.h Sat Jun 08 16:21:40 2019 +0900 +++ b/include/mainframe.h Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ // Filename : mainframe.h -// Last Change: 2019-06-07 Fri 22:20:40. +// Last Change: 2019-06-09 Sun 16:31:59. // #pragma once @@ -66,7 +66,7 @@ wxStaticText* m_staticTextCcn; wxComboBox* m_comboBox; wxStaticText* m_staticTextDrive; - //wxComboBox* m_comboBoxDrive2; // check list box + wxCheckListBox* m_checkList; wxButton* m_buttonMkdir; wxStaticLine* m_staticline; @@ -104,7 +104,7 @@ wxButton* m_buttonDel; wxSlider* m_slider; wxButton* m_buttonUpdate; - //* m_customControl; + ListThumbnail* m_listViewThumb; wxCollapsiblePane* m_collapsiblePane; wxTextCtrl* m_textCtrlMsg; @@ -140,12 +140,17 @@ void OnMakeDir( wxCommandEvent& event ); void OnPrint( wxCommandEvent& event ); + + void OnHno( wxCommandEvent& event ); void OnMove( wxCommandEvent& event ); + void OnUpdate( wxCommandEvent& event); + void OnClose( wxCloseEvent& event ); void CreateControls( void ); - void SetCanvas( void ); + void UpdateCanvas( void ); + void UpdateThumbnail( void ); void LookMarksheet( wxString file ); void DoMask( wxString file, wxRect rect ); }; diff -r 2f5584f0d127 -r f40a65687079 include/util.h --- a/include/util.h Sat Jun 08 16:21:40 2019 +0900 +++ b/include/util.h Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ // Filename : util.h -// Last Change: 2019-06-07 Fri 21:06:32. +// Last Change: 2019-06-09 Sun 16:36:33. // #pragma once @@ -11,7 +11,7 @@ class FileList { private: - wxString m_dir; + wxString m_dir; wxArrayString m_files; wxImageList m_image1; // zoom1 diff -r 2f5584f0d127 -r f40a65687079 src/appconf.cpp --- a/src/appconf.cpp Sat Jun 08 16:21:40 2019 +0900 +++ b/src/appconf.cpp Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ // Filename : appconf.cpp -// Last Change: 2019-06-07 ‹à 14:38:53. +// Last Change: 2019-06-09 Sun 16:56:39. // #include "appconf.h" #include "util.h" @@ -48,6 +48,28 @@ return Geo2Rect( buf ); } +wxString AppConf::LoadWork( void ) +{ + wxString dir; + config->SetPath( "/Misc" ); + config->Read( "workdir", &dir ); + + delete config; + + return dir; +} + +wxString AppConf::LoadScanner( void ) +{ + wxString scan; + config->SetPath( "/Misc" ); + config->Read( "scanner", &scan ); + + delete config; + + return scan; +} + /* Save */ void AppConf::SaveRect( wxRect rect ) @@ -58,3 +80,11 @@ delete config; } +void AppConf::SaveWork( wxString dir ) +{ + config->SetPath( "/Misc" ); + config->Write( "workdir", dir ); + + delete config; +} + diff -r 2f5584f0d127 -r f40a65687079 src/custom.cpp --- a/src/custom.cpp Sat Jun 08 16:21:40 2019 +0900 +++ b/src/custom.cpp Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ // Filename : custom.cpp -// Last Change: 2019-06-07 金 17:36:31. +// Last Change: 2019-06-09 Sun 16:57:44. // #include "id.h" @@ -223,3 +223,29 @@ m_spnw = spnw; m_spnh = spnh; } +/*** ListThumbnail Class ***/ +ListThumbnail::ListThumbnail( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) + : wxListView( parent, id, pos, size, style ) +{ + FileList m_filelist; + // array imagelist + // array imagelist ( selected : blue ) + // array selected +} + +ListThumbnail::~ListThumbnail() +{ +} + +// Event Table +BEGIN_EVENT_TABLE( ListThumbnail, wxListView ) +END_EVENT_TABLE() + +/* Event Handlers & Functions */ +// Event Handlers +// Functions +int ListThumbnail::Reload( void ) +{ + return 1000; +} + diff -r 2f5584f0d127 -r f40a65687079 src/mainframe.cpp --- a/src/mainframe.cpp Sat Jun 08 16:21:40 2019 +0900 +++ b/src/mainframe.cpp Mon Jun 10 05:56:36 2019 +0900 @@ -1,5 +1,5 @@ // Filename : mainframe.cpp -// Last Change: 2019-06-08 Sat 10:56:10. +// Last Change: 2019-06-09 Sun 17:05:28. // #include "id.h" @@ -11,15 +11,23 @@ { CreateControls(); + AppConf appconf; + wxString dir = appconf.LoadWork(); + m_dirPicker->SetPath( dir ); + m_filelist = new FileList(); - m_filelist->SetDirectory( "./work" ); + m_filelist->SetDirectory( dir ); m_lookWindow1->SetDefaultParams( 1, SPL_W, SPL_H, SPL_DCW, SPL_DCH ); m_lookWindow2->SetDefaultParams( 2, OPN1_W, OPN1_H, OPN1_DCW, OPN1_DCH ); m_lookWindow3->SetDefaultParams( 3, OPN2_W, OPN2_H, OPN2_DCW, OPN2_DCH ); m_lookWindow3->AddMask(); - SetCanvas(); + UpdateCanvas(); + + m_listViewThumb->SetDirectory( dir ); + + UpdateThumbnail(); } MainFrame::~MainFrame() @@ -29,8 +37,6 @@ // Event Table BEGIN_EVENT_TABLE( MainFrame, wxFrame ) /* - EVT_TEXT( ID_HHS, MoverFrame::OnHhs ) - EVT_TEXT_ENTER( ID_HHS, MoverFrame::OnHhs ) EVT_CHOICE( ID_CHOICE, MoverFrame::OnChoice ) EVT_CHECKBOX( ID_CPAPER, MoverFrame::OnPaperCheck ) */ @@ -40,6 +46,9 @@ EVT_BUTTON( ID_RST4, MainFrame::OnReset4 ) EVT_BUTTON( ID_PRINT, MainFrame::OnPrint ) EVT_SPINCTRL( ID_SPNW1, MainFrame::OnSpinW1 ) + EVT_TEXT( ID_HNO, MainFrame::OnHno ) + EVT_TEXT_ENTER( ID_HNO, MainFrame::OnHno ) + EVT_BUTTON( ID_UPDT, MainFrame::OnUpdate ) EVT_CLOSE( MainFrame::OnClose ) /* EVT_LIST_ITEM_SELECTED( ID_THUMB, MoverFrame::OnThumbItemSelected ) @@ -143,6 +152,13 @@ { } +void MainFrame::OnHno( wxCommandEvent& WXUNUSED(event) ) +{ + wxString no = m_textCtrlNo->GetValue(); + m_textCtrlName->SetBackgroundColour( *wxRED ); + m_textCtrlName->SetValue( wxT("It's not a No. style !") ); + //if ( no.Len() == 10 ) SetHhsName( no ); +} /* void MainFrame::OnScanner( wxCommandEvent& WXUNUSED(event) ) { @@ -150,12 +166,20 @@ } */ +void MainFrame::OnUpdate( wxCommandEvent& WXUNUSED(event) ) +{ + UpdateCanvas(); + UpdateThumbnail(); +} + void MainFrame::OnClose( wxCloseEvent& WXUNUSED(event) ) { if ( !IsIconized() && !IsMaximized() ) { AppConf appconf; appconf.SaveRect( GetRect() ); } + AppConf appconf; + appconf.SaveWork( m_dirPicker->GetPath() ); Destroy(); } @@ -308,21 +332,26 @@ m_staticTextDrive = new wxStaticText( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("Drive"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); sbSizerDir->Add( m_staticTextDrive, 0, wxALL, 5 ); - //m_listBox = new wxListBox( sbSizerDir->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - //fgSizerSetup->Add( m_listBox, 0, wxALL, 5 ); + wxString m_checkListChoices[] = { wxT("C:\\"), wxT("Y:\\"), wxT("Z:\\") }; + int m_checkListNChoices = sizeof( m_checkListChoices ) / sizeof( wxString ); + m_checkList = new wxCheckListBox( sbSizerDir->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( 100, -1 ), m_checkListNChoices, m_checkListChoices, wxLB_MULTIPLE ); + m_checkList->Check( 0, true ); + m_checkList->Check( 1, true ); + m_checkList->Check( 2, true ); + fgSizerSetup->Add( m_checkList, 0, wxALL, 5 ); fgSizerSetup->Add( 0, 0, 1, wxEXPAND, 5 ); m_buttonMkdir = new wxButton( sbSizerDir->GetStaticBox(), ID_MKDIR, wxT("Mkdir"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerDir->Add( m_buttonMkdir, 0, wxALL, 5 ); - sbSizerDir->Add( fgSizerSetup, 0, wxEXPAND, 5 ); + sbSizerDir->Add( fgSizerSetup, 1, wxEXPAND, 5 ); m_staticline = new wxStaticLine( sbSizerDir->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); sbSizerDir->Add( m_staticline, 0, wxEXPAND|wxALL, 5 ); m_checkBox = new wxCheckBox( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("FilingMode"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerDir->Add( m_checkBox, 0, wxALL, 5 ); + sbSizerDir->Add( m_checkBox, 0, wxALL|wxALIGN_LEFT, 5 ); m_button30 = new wxButton( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("MyButton"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerDir->Add( m_button30, 0, wxALL|wxALIGN_RIGHT, 5 ); @@ -330,7 +359,7 @@ m_buttonFMove = new wxButton( sbSizerDir->GetStaticBox(), ID_FMOVE, wxT("Move"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerDir->Add( m_buttonFMove, 0, wxALL|wxALIGN_RIGHT, 5 ); - fgSizerMain->Add( sbSizerDir, 0, wxEXPAND, 5 ); + fgSizerMain->Add( sbSizerDir, 1, wxEXPAND, 5 ); // Move wxStaticBoxSizer* sbSizerMove = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Move") ), wxHORIZONTAL ); @@ -349,7 +378,7 @@ m_textCtrlName->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); fgSizerMove->Add( m_textCtrlName, 0, wxALL|wxALIGN_BOTTOM, 5 ); - m_staticTextNo = new wxStaticText( sbSizerMove->GetStaticBox(), wxID_ANY, wxT("No"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextNo = new wxStaticText( sbSizerMove->GetStaticBox(), ID_HNO, wxT("No"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizerMove->Add( m_staticTextNo, 0, wxALL|wxALIGN_RIGHT, 5 ); m_bitmapNo = new wxStaticBitmap( sbSizerMove->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( MHNO_W, MHNO_H ), 0 ); @@ -363,13 +392,15 @@ m_gauge = new wxGauge( sbSizerMove->GetStaticBox(), wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL ); m_gauge->SetValue( 0 ); - fgSizerMove->Add( m_gauge, 1, wxALL|wxEXPAND, 5 ); + fgSizerMove->Add( m_gauge, 1, wxALL|wxEXPAND|wxALIGN_TOP, 5 ); m_buttonMove = new wxButton( sbSizerMove->GetStaticBox(), ID_MOVE, wxT("Move"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerMove->Add( m_buttonMove, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizerMove->Add( m_buttonMove, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); sbSizerMove->Add( fgSizerMove, 0, 0, 5 ); + sbSizerMove->Add( 40, 0, 0, wxEXPAND, 5 ); + m_dataViewListCtrl = new wxDataViewListCtrl( sbSizerMove->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE|wxDV_ROW_LINES|wxDV_VERT_RULES ); m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT("No"), wxDATAVIEW_CELL_INERT, 30, static_cast(wxALIGN_RIGHT) , wxDATAVIEW_COL_RESIZABLE ); m_dataViewListColumnHno = m_dataViewListCtrl->AppendTextColumn( wxT("Hno"), wxDATAVIEW_CELL_INERT, 80, static_cast(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); @@ -419,12 +450,11 @@ m_buttonUpdate = new wxButton( sbSizerWork->GetStaticBox(), ID_UPDT, wxT("Refresh"), wxDefaultPosition, wxSize( 60,-1 ), 0 ); bSizerWork->Add( m_buttonUpdate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - sbSizerWork->Add( bSizerWork, 1, wxEXPAND, 5 ); + sbSizerWork->Add( bSizerWork, 0, wxEXPAND, 5 ); - //m_customControl = new ( sbSizerWork->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - //m_customControl->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) ); - - //sbSizerWork->Add( m_customControl, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_listViewThumb = new ListThumbnail( sbSizerWork->GetStaticBox(), ID_THUMB, wxDefaultPosition, wxDefaultSize, wxLC_ICON ); + //m_listViewThumb->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INFOBK ) ); + sbSizerWork->Add( m_listViewThumb, 1, wxALL|wxEXPAND, 5 ); bSizerTop->Add( sbSizerWork, 1, wxEXPAND, 5 ); @@ -449,7 +479,7 @@ this->Centre( wxBOTH ); } -void MainFrame::SetCanvas( void ) +void MainFrame::UpdateCanvas( void ) { wxArrayString files = m_filelist->Update(); int n = files.GetCount(); @@ -471,6 +501,11 @@ m_lookWindow3->ResetMask2(); } +void MainFrame::UpdateThumbnail( void ) +{ + m_listViewThumb->Reload(); +} + void MainFrame::LookMarksheet( wxString file ) { wxImage marksheet( file, wxBITMAP_TYPE_JPEG ); @@ -489,9 +524,9 @@ /* // 推測 - wxString hhsno = GuessHhs( file, rect_mhno ); - m_textCtrlHhs->SetValue( hhsno ); - SetHhsName( hhsno ); + wxString no = GuessHhs( file, rect_mhno ); + m_textCtrlNo->SetValue( no ); + SetHhsName( no ); */ }