# HG changeset patch # User pyon@macmini # Date 1563141785 -32400 # Node ID b651aa41b9d46993735e35fd9fe0430a784e8ee1 # Parent c262e17de9b19418aab092f52c330064a05f19da hhsinfo method (server) diff -r c262e17de9b1 -r b651aa41b9d4 Makefile --- a/Makefile Sat Jun 08 15:50:59 2019 +0900 +++ b/Makefile Mon Jul 15 07:03:05 2019 +0900 @@ -1,5 +1,5 @@ # Makefile for wxWidgets Application -# Last Change: 2019-05-29 … 15:43:02. +# Last Change: 2019-07-08 ŒŽ 17:58:49. # by Takayuki Mutoh # @@ -8,8 +8,8 @@ ### Variables ### OBJDIR = ./obj CXX = g++ -ARCH = 32 -#ARCH = 64 +#ARCH = 32 +ARCH = 64 LOCAL = C:/msys64/home/muto/local$(ARCH) vpath %.cpp ./src vpath %.h ./include @@ -40,6 +40,7 @@ $(OBJDIR)/auth.o \ $(OBJDIR)/mngdb.o \ $(OBJDIR)/index.o \ + $(OBJDIR)/batchprint.o \ $(OBJDIR)/net.o ifdef COMSPEC @@ -66,6 +67,9 @@ $(OBJDIR)/auth.o: auth.cpp auth.h id.h $(CXX) -c $< -o $@ $(CXXFLAGS) +$(OBJDIR)/batchprint.o: batchprint.cpp batchprint.h id.h + $(CXX) -c $< -o $@ $(CXXFLAGS) + $(OBJDIR)/index.o: index.cpp index.h id.h $(CXX) -c $< -o $@ $(CXXFLAGS) @@ -84,7 +88,6 @@ $(EXECUTABLE): $(PROGNAME) ifdef COMSPEC - strip --strip-all $(EXECUTABLE) ./$(PROGNAME).exe else -mkdir -p $(PROGNAME).app/Contents @@ -104,13 +107,20 @@ open $(PROGNAME).app endif +# for archive +TARFILE=$(shell date "+del_%Y%m%d.tgz") tgz: - tar cvfz a.tgz src include Makefile memo.txt + tar cvfz $(TARFILE) src include manual.pdf Makefile app.conf +# for release +release: + strip --strip-all $(EXECUTABLE) + +# clean clean: rm -f $(PROGNAME) $(PROGNAME).exe rm -f $(OBJDIR)/*.o rm -rf $(PROGNAME).app -.PHONY: all clean +.PHONY: all release tgz clean diff -r c262e17de9b1 -r b651aa41b9d4 app.conf --- a/app.conf Sat Jun 08 15:50:59 2019 +0900 +++ b/app.conf Mon Jul 15 07:03:05 2019 +0900 @@ -21,3 +21,9 @@ [Print] zoom=99 +[BatchPrint] +excel=E:\\hoge.xlsx +mask_name=1200x80+1000+75 +mask_no=960x80+1300+120 +mask_barcode=450x60+1000+160 + diff -r c262e17de9b1 -r b651aa41b9d4 go/mkidx.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/go/mkidx.go Mon Jul 15 07:03:05 2019 +0900 @@ -0,0 +1,96 @@ +package main + +import ( + "fmt" + "flag" + "io/ioutil" + "log" + "os" + "path/filepath" + "regexp" + "sort" + "strings" +) + +func main() { + var list = flag.Bool( "l", false, "list db." ) + var newest = flag.Bool( "n", false, "only save newest." ) + var output = flag.String( "o", "", "output filename." ) + var help = flag.Bool( "h", false, "print help." ) + flag.Parse() + + idxdb := "index.db" + + content, err := ioutil.ReadFile( idxdb ) + if err != nil { + log.Fatal( err ) + } + + if *list { + fmt.Printf( "%s", content ) + os.Exit( 0 ) + } + + if *help || flag.NArg()!= 1 { + fmt.Fprintf( os.Stderr, "$ mkidx [20201231]\n" ) + flag.PrintDefaults() + os.Exit( 1 ) + } + + if *output == "" { + *output = idxdb + } + + d := flag.Args()[0] + r, err := regexp.Compile( "^20[0-9]{6}$" ) + if err != nil { + log.Fatal( err ) + } + m := r.FindString( d ) + if len( m ) == 0 { + fmt.Fprintf( os.Stderr, "bad directory.\n" ) + os.Exit( 1 ) + } + + var hs []string + + fi, _ := os.Stat( d ) + if fi.IsDir() { + filepath.Walk( d, func( path string, info os.FileInfo, err error ) error { + if !info.IsDir() && strings.HasSuffix( path, ".tgz" ) { + h := strings.TrimSuffix( path, ".tgz" )[9:] + hs = append( hs, h + ":" + d ) + } + return nil + } ) + } else { + fmt.Fprintf( os.Stderr, "%s: not directory\n", d ) + log.Fatal( err ) + } + + for _, s := range strings.Split( string( content ), "\n" ) { + hs = append( hs, s ) + } + + sort.Strings( hs ) + var str string + + if !*newest { + for _, s := range hs { + str += s + "\n" + } + } else { + seen := make( map[string]int ) + for _, s := range hs { + if seen[s] == 0 { + str += s + "\n" + } + seen[s]++ + } + } + + if err := ioutil.WriteFile( *output, []byte( str ), 0644 ); err !=nil { + log.Fatal( err ) + } +} + diff -r c262e17de9b1 -r b651aa41b9d4 go/server.go --- a/go/server.go Sat Jun 08 15:50:59 2019 +0900 +++ b/go/server.go Mon Jul 15 07:03:05 2019 +0900 @@ -1,7 +1,7 @@ /* server.go : server-program. - Version : 1.5 - Last Change: 2019-05-29 æ°´ 08:58:19. + Version : 1.6 + Last Change: 2019-07-15 Mon 06:34:42. install to: server_root/ @@ -14,9 +14,13 @@ import( "bufio" + "crypto/aes" + "crypto/cipher" + "encoding/hex" "flag" "fmt" "io" + "io/ioutil" "log" "net" "net/http" @@ -26,22 +30,49 @@ "time" ) +type hhs struct { + no string + name string + kana string + addr string + birth string + sex string +} + +func (h *hhs) String() string { + s := []string{h.no, h.name, h.kana, h.addr, h.birth, h.sex} + return strings.Join(s, ",") +} + +func (h *hhs) SString() string { + s := []string{h.no, h.name, h.kana} + return strings.Join(s, ",") +} + var ( version string server string - port string + port string server_root string logfile string not_ac bool wlfile string + + hdbfile string + key string + hhash map[string]hhs ) func init() { - version = "1.5" // piece-image version + version = "1.6" // 1.6: hhs info version port = ":3910" server_root = filepath.Dir(os.Args[0]) logfile = filepath.Join(server_root, "rsearcher.log") - wlfile = "rsearcher.whitelist" + wlfile = filepath.Join(server_root, "rsearcher.whitelist") + + hdbfile = filepath.Join(server_root, "db", "hhs.db") + key = "1234567890abcdef1234567890abcdef" // len = 32 + read_hhsdb() } func main() { @@ -67,12 +98,16 @@ // start Web-server fmt.Println("server start [", server, "] ( program version", version, ")") - http.HandleFunc("/", handler ) + http.HandleFunc("/", handler) http.HandleFunc("/upload/", upload_handler) - http.HandleFunc("/mngdb/", mngdb_handler ) + http.HandleFunc("/mngdb/", mngdb_handler) + http.HandleFunc("/hinfo/", hinfo_handler) + http.HandleFunc("/hlist/", hlist_handler) log.Fatal(http.ListenAndServe(server, nil)) } +/* å„種ãƒãƒ³ãƒ‰ãƒ© */ +// é™çš„ファイル func handler(w http.ResponseWriter, r *http.Request) { if !not_ac && !is_valid_host(r.RemoteAddr) { http.NotFound(w, r) @@ -100,6 +135,7 @@ io.Copy(w, f) } +// アップローダ func upload_handler(w http.ResponseWriter, r *http.Request) { if !not_ac && !is_valid_host(r.RemoteAddr) { http.NotFound(w, r) @@ -123,6 +159,7 @@ w.Write([]byte(fmt.Sprintf("%d bytes are recieved.\n", n))) } +// データベースä¿å­˜ func mngdb_handler(w http.ResponseWriter, r *http.Request) { if !not_ac && !is_valid_host(r.RemoteAddr) { http.NotFound(w, r) @@ -131,6 +168,7 @@ fmt.Println("[access]", r.RemoteAddr, "|", time.Now().Format("2006-01-02 15:04" ), "|", "/mngdb") write_log("[access] " + r.RemoteAddr + "manage-db") + db := r.URL.Path[len("/mngdb/"):] file := filepath.Join(server_root, "db", db) @@ -148,6 +186,40 @@ f.Close() } +// 被ä¿é™ºè€…情報å–å¾— +func hinfo_handler(w http.ResponseWriter, r *http.Request) { + if !not_ac && !is_valid_host(r.RemoteAddr) { + http.NotFound(w, r) + return + } + fmt.Println("[access]", r.RemoteAddr, "|", time.Now().Format("2006-01-02 15:04" ), "|", "/hinfo") + write_log("[access] " + r.RemoteAddr + "hinfo") + + h := r.URL.Path[len("/hinfo/"):] + hhs := hhash[h] + + w.Write([]byte(hhs.String())) +} + +func hlist_handler(w http.ResponseWriter, r *http.Request) { + if !not_ac && !is_valid_host(r.RemoteAddr) { + http.NotFound(w, r) + return + } + fmt.Println("[access]", r.RemoteAddr, "|", time.Now().Format("2006-01-02 15:04" ), "|", "/hlist") + write_log("[access] " + r.RemoteAddr + "list") + + hlist := r.URL.Path[len("/hlist/"):] + var s string + for _, h := range strings.Split(hlist, ":") { + hhs := hhash[h] + s += hhs.SString() + "\n" + } + + w.Write([]byte(s)) +} + +// ホワイトリスト判定 func is_valid_host(host string) bool { f, _ := os.Open(wlfile) defer f.Close() @@ -160,6 +232,39 @@ return false } +// 被ä¿é™ºè€…DB読ã¿è¾¼ã¿ +func read_hhsdb() { + hhash = make(map[string]hhs) + pt := decrypto(key, hdbfile) + for _, line := range strings.Split(pt, "\n") { + c := strings.Split(line, ",") + if len(c) == 6 { + hhash[c[0]] = hhs{no: c[0], name: c[1], kana: c[2], addr: c[3], birth: c[4], sex: c[5]} + } + } +} + +// 復å·åŒ– +func decrypto( key, file string ) string { + k, _ := hex.DecodeString(key) + block, err := aes.NewCipher(k) + if err != nil { + panic( err ) + } + ciphertext, err := ioutil.ReadFile(file) + if err != nil { + log.Fatal(err) + } + + iv := ciphertext[ :aes.BlockSize ] + plaintext := make([]byte, len(ciphertext[ aes.BlockSize: ])) + stream := cipher.NewCTR(block, iv) + stream.XORKeyStream(plaintext, ciphertext[ aes.BlockSize: ]) + + return string(plaintext) +} + +// ログ func write_log(msg string) { f, err := os.OpenFile(logfile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { diff -r c262e17de9b1 -r b651aa41b9d4 include/auth.h --- a/include/auth.h Sat Jun 08 15:50:59 2019 +0900 +++ b/include/auth.h Mon Jul 15 07:03:05 2019 +0900 @@ -1,9 +1,8 @@ // Filename : auth.h -// Last Change: 2018-10-31 … 11:06:01. +// Last Change: 2019-07-08 ŒŽ 08:46:18. // -#ifndef __AUTH_H__ -#define __AUTH_H__ +#pragma once #include #include @@ -53,5 +52,3 @@ void OnCheckPassword( wxCommandEvent& event ); }; -#endif //__AUTH_H__ - diff -r c262e17de9b1 -r b651aa41b9d4 include/batchprint.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/batchprint.h Mon Jul 15 07:03:05 2019 +0900 @@ -0,0 +1,59 @@ +// Filename : batchprint.h +// Last Change: 2019-07-09 ‰Î 08:18:52. +// + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class BatchPrintFrame : public wxFrame +{ + DECLARE_EVENT_TABLE() + private: + + protected: + wxStaticText* m_staticText; + wxFilePickerCtrl* m_filePicker; + wxButton* m_buttonLoad; + + wxDataViewListCtrl* m_dataViewListCtrl; + wxDataViewColumn* m_dataViewListColumnCheck; + wxDataViewColumn* m_dataViewListColumnNo; + wxDataViewColumn* m_dataViewListColumnHno; + wxDataViewColumn* m_dataViewListColumnName; + wxDataViewColumn* m_dataViewListColumnKana; + wxDataViewColumn* m_dataViewListColumnStatus; + + wxButton* m_buttonMaskPrint; + wxButton* m_buttonPrint; + wxButton* m_buttonUnCheckAll; + wxButton* m_buttonCheckAll; + wxButton* m_buttonClear; + wxButton* m_buttonDel; + wxButton* m_buttonClose; + + public: + BatchPrintFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); + ~BatchPrintFrame(); + + void OnCheckAll(); + void OnUnCheckAll(); + void OnClear(); +}; + diff -r c262e17de9b1 -r b651aa41b9d4 include/id.h --- a/include/id.h Sat Jun 08 15:50:59 2019 +0900 +++ b/include/id.h Mon Jul 15 07:03:05 2019 +0900 @@ -1,9 +1,8 @@ // Filename : id.h -// Last Change: 2019-05-28 ‰Î 10:01:22. +// Last Change: 2019-07-09 ‰Î 08:08:05. // -#ifndef __ID_H__ -#define __ID_H__ +#pragma once #include @@ -22,6 +21,8 @@ // invisible for shortcut-key ID_DLMAN, + ID_INDEX, + ID_BPRINT, ID_SLDR, ID_FOCUS, ID_PZOOM, @@ -43,9 +44,18 @@ ID_MNGEXIT, /* for index */ - ID_DPBGN, - ID_DPEND, + ID_DRIVE, + ID_YEAR, + ID_DATE, + ID_CCN, + + /* for batch-print */ + ID_LOAD, + ID_MANDP, + ID_CHECKALL, + ID_UNCHECKALL, + ID_CLEAR, + ID_DELETE, }; -#endif // __ID_H__ diff -r c262e17de9b1 -r b651aa41b9d4 include/index.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/index.h Mon Jul 15 07:03:05 2019 +0900 @@ -0,0 +1,56 @@ +// Filename : index.h +// Last Change: 2019-07-09 ‰Î 12:59:22. +// + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class IndexFrame : public wxFrame +{ + DECLARE_EVENT_TABLE() + private: + + protected: + wxStaticText* m_staticTextDrive; + wxChoice* m_choiceDrive; + wxStaticText* m_staticTextYear; + wxChoice* m_choiceYear; + wxStaticText* m_staticTextDate; + wxListBox* m_listBoxDate; + wxStaticText* m_staticTextCcn; + wxListBox* m_listBoxCcn; + + wxDataViewListCtrl* m_dataViewListCtrl; + wxDataViewColumn* m_dataViewListColumnNo; + wxDataViewColumn* m_dataViewListColumnHno; + wxDataViewColumn* m_dataViewListColumnName; + wxDataViewColumn* m_dataViewListColumnKana; + + public: + IndexFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxCAPTION|wxCLOSE_BOX|wxRESIZE_BORDER|wxTAB_TRAVERSAL ); + ~IndexFrame(); + + void OnDrive( wxCommandEvent& event ); + void OnYear( wxCommandEvent& event ); + void OnDate( wxCommandEvent& event ); + void OnCcn( wxCommandEvent& event ); + + void CreateControls( void ); +}; + diff -r c262e17de9b1 -r b651aa41b9d4 include/main.h --- a/include/main.h Sat Jun 08 15:50:59 2019 +0900 +++ b/include/main.h Mon Jul 15 07:03:05 2019 +0900 @@ -1,6 +1,8 @@ // Filename : main.h -// Last Change: 2019-05-28 ‰Î 10:08:07. +// Last Change: 2019-07-08 ŒŽ 08:45:17. // +#pragma once + #include #include #include diff -r c262e17de9b1 -r b651aa41b9d4 include/mngdb.h --- a/include/mngdb.h Sat Jun 08 15:50:59 2019 +0900 +++ b/include/mngdb.h Mon Jul 15 07:03:05 2019 +0900 @@ -1,9 +1,8 @@ // Filename : mngdb.h -// Last Change: 2018-11-21 … 08:27:58. +// Last Change: 2019-07-15 Mon 06:54:37. // -#ifndef __MNGDB_H__ -#define __MNGDB_H__ +#pragma once #include #include @@ -46,10 +45,9 @@ void OnIndex( wxCommandEvent& event ); void OnExit( wxCommandEvent& event ); + void CreateControls( void ); void SetDBdir( wxString dir ); void SetServer( wxString server ) { m_server = server; }; void Upload( wxString file ); }; -#endif //__MNGDB_H__ - diff -r c262e17de9b1 -r b651aa41b9d4 include/net.h --- a/include/net.h Sat Jun 08 15:50:59 2019 +0900 +++ b/include/net.h Mon Jul 15 07:03:05 2019 +0900 @@ -1,9 +1,8 @@ // Filename : net.h -// Last Change: 2019-05-24 金 16:03:16. +// Last Change: 2019-07-08 月 08:45:51. // -#ifndef __NET_H__ -#define __NET_H__ +#pragma once #include #include @@ -25,5 +24,3 @@ void GetImages( wxString hhs, wxString date, wxString flag ); }; -#endif //__NET_H__ - diff -r c262e17de9b1 -r b651aa41b9d4 include/rsearcher.h --- a/include/rsearcher.h Sat Jun 08 15:50:59 2019 +0900 +++ b/include/rsearcher.h Mon Jul 15 07:03:05 2019 +0900 @@ -1,9 +1,8 @@ // Filename : rsearcher.h -// Last Change: 2019-05-28 ‰Î 09:29:59. +// Last Change: 2019-07-08 ŒŽ 15:42:44. // -#ifndef __RSEARCH_H__ -#define __RSEARCH_H__ +#pragma once #include #include @@ -165,6 +164,8 @@ wxButton* m_buttonSatellite; wxButton* m_buttonUpdateIndex; wxButton* m_buttonDLMan; + wxButton* m_buttonBPrint; + wxButton* m_buttonIndex; wxButton* m_buttonHelp; wxButton* m_buttonClose; wxButton* m_buttonLogout; @@ -217,9 +218,9 @@ void OnSatellite( wxCommandEvent& event ); void OnUpdateIndex( wxCommandEvent& event ); void OnDownloadManual( wxCommandEvent& event ); + void OnBatchPrint( wxCommandEvent& event ); + void OnIndex( wxCommandEvent& event ); void OnHelp( wxCommandEvent& event ); void OnLogout( wxCommandEvent& event ); }; -#endif // __RSEARCH_H__ - diff -r c262e17de9b1 -r b651aa41b9d4 searcherR.fbp --- a/searcherR.fbp Sat Jun 08 15:50:59 2019 +0900 +++ b/searcherR.fbp Mon Jul 15 07:03:05 2019 +0900 @@ -27,7 +27,7 @@ UI 1 0 - + 0 wxAUI_MGR_DEFAULT 0,153,227 @@ -54,16 +54,16 @@ wxTAB_TRAVERSAL 1 - + bSizerTop wxHORIZONTAL none - + 5 wxEXPAND | wxALL 1 - + 1 1 1 @@ -116,11 +116,11 @@ - + Image-01 0 - + 1 1 1 @@ -175,11 +175,11 @@ wxHSCROLL|wxVSCROLL - + Image-02 0 - + 1 1 1 @@ -234,11 +234,11 @@ wxHSCROLL|wxVSCROLL - + Image-03 0 - + 1 1 1 @@ -293,11 +293,11 @@ wxHSCROLL|wxVSCROLL - + a page 0 - + 1 1 1 @@ -352,11 +352,11 @@ wxHSCROLL|wxVSCROLL - + a page 0 - + 1 1 1 @@ -411,11 +411,11 @@ wxHSCROLL|wxVSCROLL - + Image-06 0 - + 1 1 1 @@ -472,20 +472,20 @@ - + 5 wxEXPAND 0 - + bSizerRight wxVERTICAL none - + 5 wxALL 0 - + 1 1 1 @@ -546,11 +546,11 @@ - + 5 wxALL 0 - + 1 1 1 @@ -610,11 +610,11 @@ - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -674,11 +674,11 @@ - + 5 wxALL|wxEXPAND 1 - + 1 @@ -699,7 +699,7 @@ - + wxALIGN_LEFT wxDATAVIEW_COL_RESIZABLE @@ -710,7 +710,7 @@ Text -1 - + wxALIGN_LEFT wxDATAVIEW_COL_RESIZABLE @@ -723,11 +723,11 @@ - + 5 wxALL|wxEXPAND 0 - + 1 @@ -748,7 +748,7 @@ - + wxALIGN_LEFT wxDATAVIEW_COL_RESIZABLE @@ -759,7 +759,7 @@ Text -1 - + wxALIGN_LEFT wxDATAVIEW_COL_RESIZABLE @@ -770,7 +770,7 @@ Text -1 - + wxALIGN_LEFT wxDATAVIEW_COL_RESIZABLE @@ -783,11 +783,11 @@ - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -846,11 +846,11 @@ - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -910,11 +910,11 @@ - + 5 wxALL 0 - + 1 1 1 @@ -975,11 +975,11 @@ - + 5 wxEXPAND 1 - + 2 wxBOTH @@ -991,11 +991,11 @@ none 0 0 - + 5 wxALL 0 - + 1 1 1 @@ -1063,21 +1063,21 @@ - + 5 wxEXPAND 1 - + 0 protected 0 - + 5 wxALL 0 - + 1 1 1 @@ -1145,11 +1145,11 @@ - + 5 wxALL 0 - + 1 1 1 @@ -1213,7 +1213,7 @@ - + 0 wxAUI_MGR_DEFAULT @@ -1239,7 +1239,7 @@ - + 3 0 @@ -1247,11 +1247,11 @@ none 0 0 - + 5 wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT 0 - + 1 1 1 @@ -1308,11 +1308,11 @@ -1 - + 5 wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND 0 - + 1 1 1 @@ -1372,11 +1372,11 @@ - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1433,11 +1433,11 @@ -1 - + 5 wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT 0 - + 1 1 1 @@ -1494,11 +1494,11 @@ -1 - + 5 wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND 0 - + 1 1 1 @@ -1558,11 +1558,11 @@ - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1621,7 +1621,7 @@ - + 0 wxAUI_MGR_DEFAULT @@ -1648,16 +1648,16 @@ wxTAB_TRAVERSAL 1 - + bSizerTop wxVERTICAL none - + 5 wxALIGN_CENTER_HORIZONTAL 0 - + 2 wxBOTH @@ -1669,11 +1669,11 @@ none 0 0 - + 5 wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1730,11 +1730,11 @@ -1 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1792,11 +1792,11 @@ - + 5 wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT 0 - + 1 1 1 @@ -1853,11 +1853,11 @@ -1 - + 5 wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND 0 - + 1 1 1 @@ -1918,11 +1918,11 @@ - + 5 wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -1979,11 +1979,11 @@ -1 - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2046,11 +2046,11 @@ - + 5 wxEXPAND | wxALL 0 - + 1 1 1 @@ -2104,20 +2104,20 @@ - + 5 wxALIGN_CENTER_HORIZONTAL 0 - + bSizerBtn wxHORIZONTAL none - + 5 wxALL 0 - + 1 1 1 @@ -2185,11 +2185,11 @@ - + 5 wxALL 0 - + 1 1 1 @@ -2257,11 +2257,11 @@ - + 5 wxALL 0 - + 1 1 1 @@ -2363,22 +2363,29 @@ bSizerTop - wxVERTICAL + wxHORIZONTAL none 5 - wxALIGN_CENTER_HORIZONTAL + wxEXPAND 0 - + + 2 + wxBOTH + + + 0 - bSizerFilter - wxHORIZONTAL + fgSizerSelect + wxFLEX_GROWMODE_SPECIFIED none + 0 + 0 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL 0 - + 1 1 1 @@ -2405,7 +2412,9 @@ 0 0 - ID_DPBGN + wxID_ANY + Drive + 0 0 @@ -2413,7 +2422,7 @@ 0 1 - m_datePickerBgn + m_staticTextDrive 1 @@ -2423,7 +2432,68 @@ Resizable 1 - wxDP_DEFAULT + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "server" "C:\\" "Y:\\" "Z:\\" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_DRIVE + + 0 + + + 0 + + 1 + m_choiceDrive + 1 + + + protected + 1 + + Resizable + 0 + 1 + + ; ; forward_declare 0 @@ -2438,7 +2508,7 @@ 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL 0 1 @@ -2468,7 +2538,7 @@ 0 0 wxID_ANY - 〜 + Year 0 0 @@ -2477,7 +2547,7 @@ 0 1 - m_staticText + m_staticTextYear 1 @@ -2501,7 +2571,71 @@ 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_DATE + + 0 + + + 0 + + 1 + m_choiceYear + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL|wxALIGN_RIGHT + 0 + 1 1 1 @@ -2528,7 +2662,9 @@ 0 0 - ID_DPEND + wxID_ANY + Date + 0 0 @@ -2536,7 +2672,67 @@ 0 1 - m_datePickerEnd + m_staticTextDate + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_listBoxDate 1 @@ -2546,7 +2742,131 @@ Resizable 1 - wxDP_DEFAULT + wxLB_ALWAYS_SB|wxLB_SINGLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL|wxALIGN_RIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Ccn + 0 + + 0 + + + 0 + + 1 + m_staticTextCcn + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_listBoxCcn + 1 + + + protected + 1 + + Resizable + 1 + + wxLB_ALWAYS_SB|wxLB_SINGLE ; ; forward_declare 0 @@ -2587,10 +2907,21 @@ + wxALIGN_RIGHT + + wxDATAVIEW_COL_RESIZABLE + No + wxDATAVIEW_CELL_INERT + m_dataViewListColumnNo + protected + Text + -1 + + wxALIGN_CENTER wxDATAVIEW_COL_RESIZABLE - No + HNo wxDATAVIEW_CELL_INERT m_dataViewListColumnHno protected @@ -2619,16 +2950,904 @@ Text -1 - - wxALIGN_LEFT - - wxDATAVIEW_COL_RESIZABLE - Addr - wxDATAVIEW_CELL_INERT - m_dataViewListColumnAddr - protected - Text - -1 + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + BatchPrintFrame + + 500,300 + wxDEFAULT_FRAME_STYLE + ; ; forward_declare + + + + + wxTAB_TRAVERSAL + 1 + + + bSizerTop + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + wxBOTH + + + 0 + + gbSizer + wxFLEX_GROWMODE_SPECIFIED + none + 0 + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Excel File + 0 + + 0 + + + 0 + + 1 + m_staticText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + Select a file + + 0 + + 1 + m_filePicker + 1 + + + protected + 1 + + Resizable + 1 + + wxFLP_CHANGE_DIR|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_SMALL|wxFLP_USE_TEXTCTRL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + *.xlsx + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_LOAD + Load + + 0 + + 0 + + + 0 + + 1 + m_buttonLoad + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 3 + 0 + wxALL|wxEXPAND + 1 + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_dataViewListCtrl + protected + + + + ; ; forward_declare + + + + + + wxALIGN_CENTER|wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Check + wxDATAVIEW_CELL_INERT + m_dataViewListColumnCheck + protected + Toggle + -1 + + + wxALIGN_RIGHT + + wxDATAVIEW_COL_RESIZABLE + No + wxDATAVIEW_CELL_INERT + m_dataViewListColumnNo + protected + Text + 60 + + + wxALIGN_CENTER + + wxDATAVIEW_COL_RESIZABLE + Hno + wxDATAVIEW_CELL_INERT + m_dataViewListColumnHno + protected + Text + 100 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Name + wxDATAVIEW_CELL_INERT + m_dataViewListColumnName + protected + Text + 200 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Kana + wxDATAVIEW_CELL_INERT + m_dataViewListColumnKana + protected + Text + 200 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Status + wxDATAVIEW_CELL_INERT + m_dataViewListColumnStatus + protected + Progress + -1 + + + + + + + 5 + wxEXPAND + 0 + + + bSizerButton + wxVERTICAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_MANDP + Mask & Print + + 0 + + 0 + + + 0 + + 1 + m_buttonMaskPrint + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_PRINT + Print + + 0 + + 0 + + + 0 + + 1 + m_buttonPrint + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + + 0 + + 30 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_UNALL + UnCheck All + + 0 + + 0 + + + 0 + + 1 + m_buttonUnCheckAll + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_CHECKALL + Check All + + 0 + + 0 + + + 0 + + 1 + m_buttonCheckAll + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 1 + + 50 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_CLEAR + Clear + + 0 + + 0 + + + 0 + + 1 + m_buttonClear + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_DELETE + Delete + + 0 + + 0 + + + 0 + + 1 + m_buttonDel + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_CLOSE + Close + + 0 + + 0 + + + 0 + + 1 + m_buttonClose + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + diff -r c262e17de9b1 -r b651aa41b9d4 src/batchprint.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/batchprint.cpp Mon Jul 15 07:03:05 2019 +0900 @@ -0,0 +1,91 @@ +// Filename : batchprint.h +// Last Change: 2019-07-09 ‰Î 08:16:04. +// + +#include "id.h" +#include "batchprint.h" + +BatchPrintFrame::BatchPrintFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) + : wxFrame( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxColour( 0, 0, 0 ) ); + + wxBoxSizer* bSizerTop = new wxBoxSizer( wxHORIZONTAL ); + + wxGridBagSizer* gbSizer; + gbSizer = new wxGridBagSizer( 0, 0 ); + gbSizer->SetFlexibleDirection( wxBOTH ); + gbSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + // Head + m_staticText = new wxStaticText( this, wxID_ANY, wxT("Excel File"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer->Add( m_staticText, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_filePicker = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*.xlsx"), wxDefaultPosition, wxDefaultSize, wxFLP_CHANGE_DIR|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_SMALL|wxFLP_USE_TEXTCTRL ); + gbSizer->Add( m_filePicker, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonLoad = new wxButton( this, ID_LOAD, wxT("Load"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer->Add( m_buttonLoad, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + // Left + m_dataViewListCtrl = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_dataViewListColumnCheck = m_dataViewListCtrl->AppendToggleColumn( wxT("Check"), wxDATAVIEW_CELL_INERT, -1, static_cast(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE ); + m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT("No"), wxDATAVIEW_CELL_INERT, 60, static_cast(wxALIGN_RIGHT), wxDATAVIEW_COL_RESIZABLE ); + m_dataViewListColumnHno = m_dataViewListCtrl->AppendTextColumn( wxT("Hno"), wxDATAVIEW_CELL_INERT, 100, static_cast(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE ); + m_dataViewListColumnName = m_dataViewListCtrl->AppendTextColumn( wxT("Name"), wxDATAVIEW_CELL_INERT, 200, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE ); + m_dataViewListColumnKana = m_dataViewListCtrl->AppendTextColumn( wxT("Kana"), wxDATAVIEW_CELL_INERT, 200, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE ); + m_dataViewListColumnStatus = m_dataViewListCtrl->AppendProgressColumn( wxT("Status"), wxDATAVIEW_CELL_INERT, -1, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE ); + gbSizer->Add( m_dataViewListCtrl, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxALL|wxEXPAND, 5 ); + + bSizerTop->Add( gbSizer, 1, wxEXPAND, 5 ); + + // Right + wxBoxSizer* bSizerButton = new wxBoxSizer( wxVERTICAL ); + + m_buttonMaskPrint = new wxButton( this, ID_MANDP, wxT("Mask & Print"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButton->Add( m_buttonMaskPrint, 0, wxALL, 5 ); + + m_buttonPrint = new wxButton( this, wxID_PRINT, wxT("Print"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButton->Add( m_buttonPrint, 0, wxALL, 5 ); + + bSizerButton->Add( 0, 30, 0, 0, 5 ); + + m_buttonUnCheckAll = new wxButton( this, ID_UNCHECKALL, wxT("UnCheck All"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButton->Add( m_buttonUnCheckAll, 0, wxALL, 5 ); + + m_buttonCheckAll = new wxButton( this, ID_CHECKALL, wxT("Check All"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButton->Add( m_buttonCheckAll, 0, wxALL, 5 ); + + bSizerButton->Add( 0, 50, 1, wxEXPAND, 5 ); + + m_buttonClear = new wxButton( this, ID_CLEAR, wxT("Clear"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButton->Add( m_buttonClear, 0, wxALL, 5 ); + + m_buttonDel = new wxButton( this, ID_DELETE, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButton->Add( m_buttonDel, 0, wxALL, 5 ); + + bSizerButton->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_buttonClose = new wxButton( this, wxID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButton->Add( m_buttonClose, 0, wxALL, 5 ); + + + bSizerTop->Add( bSizerButton, 0, wxEXPAND, 5 ); + + + this->SetSizer( bSizerTop ); + this->Layout(); + + this->Centre( wxBOTH ); +} + +BatchPrintFrame::~BatchPrintFrame() +{ +} + +// Event Table +BEGIN_EVENT_TABLE( BatchPrintFrame, wxFrame ) +END_EVENT_TABLE() + +// Event Handlers & Functions diff -r c262e17de9b1 -r b651aa41b9d4 src/index.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/index.cpp Mon Jul 15 07:03:05 2019 +0900 @@ -0,0 +1,130 @@ +// Filename : id.cpp +// Last Change: 2019-07-15 Mon 07:00:57. +// +#include +#include "id.h" +#include "index.h" + +IndexFrame::IndexFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) + : wxFrame( parent, id, title, pos, size, style ) +{ + wxTextFile file; + file.Open( wxT( "index.db" ) ); + for ( int i = 0; i < file.GetLineCount(); i++ ) { + wxArrayString buf = wxSplit( file.GetLine( i ), ':', '\\' ); + } + file.Close(); + + CreateControls(); +} + +IndexFrame::~IndexFrame() +{ +} + +// Event Table +BEGIN_EVENT_TABLE( IndexFrame, wxFrame ) + EVT_CHOICE( ID_DRIVE, IndexFrame::OnDrive ) + EVT_CHOICE( ID_YEAR, IndexFrame::OnYear ) + EVT_LISTBOX( ID_DATE, IndexFrame::OnDate ) + EVT_LISTBOX( ID_CCN, IndexFrame::OnCcn ) +END_EVENT_TABLE() + +// Event Handlers & Functions +// Event Handlers +void IndexFrame::OnDrive( wxCommandEvent& event ) +{ + m_dataViewListCtrl->DeleteAllItems(); + m_choiceYear->SetSelection( 0 ); + m_listBoxDate->Clear(); + + if ( m_choiceDrive->GetSelection() == 0 ) { + m_listBoxCcn->Enable( false ); + } else { + m_listBoxCcn->Enable( true ); + } +} + +void IndexFrame::OnYear( wxCommandEvent& event ) +{ + m_dataViewListCtrl->DeleteAllItems(); + + if ( m_choiceDrive->GetSelection() == 0 ) { + } else { + wxString drive = m_choiceDrive->GetStringSelection(); + wxString year = m_choiceYear->GetStringSelection(); + } +} + +void IndexFrame::OnDate( wxCommandEvent& event ) +{ +} + +void IndexFrame::OnCcn( wxCommandEvent& event ) +{ + m_dataViewListCtrl->DeleteAllItems(); +} + +// Functions +void IndexFrame::CreateControls() +{ + this->SetBackgroundColour( wxColour( 166, 126, 66 ) ); + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizerTop = new wxBoxSizer( wxHORIZONTAL ); + + wxFlexGridSizer* fgSizerSelect; + fgSizerSelect = new wxFlexGridSizer( 0, 2, 0, 0 ); + fgSizerSelect->SetFlexibleDirection( wxBOTH ); + fgSizerSelect->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + // Left + m_dataViewListCtrl = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_HORIZ_RULES|wxDV_ROW_LINES|wxDV_VERT_RULES ); + m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT("No"), wxDATAVIEW_CELL_INERT, 30, static_cast(wxALIGN_RIGHT), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); + m_dataViewListColumnHno = m_dataViewListCtrl->AppendTextColumn( wxT("HNo"), wxDATAVIEW_CELL_INERT, 100, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); + m_dataViewListColumnName = m_dataViewListCtrl->AppendTextColumn( wxT("Name"), wxDATAVIEW_CELL_INERT, 120, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); + m_dataViewListColumnKana = m_dataViewListCtrl->AppendTextColumn( wxT("Kana"), wxDATAVIEW_CELL_INERT, 120, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); + bSizerTop->Add( m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5 ); + + // Right + m_staticTextDrive = new wxStaticText( this, wxID_ANY, wxT("Drive"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerSelect->Add( m_staticTextDrive, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + wxString choiceDrive[] = { wxT("server"), wxT("C:\\"), wxT("Y:\\"), wxT("Z:\\") }; + int n = sizeof( choiceDrive ) / sizeof( wxString ); + m_choiceDrive = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxSize( 100, -1 ), n, choiceDrive, 0 ); + m_choiceDrive->SetSelection( 0 ); + fgSizerSelect->Add( m_choiceDrive, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextYear = new wxStaticText( this, wxID_ANY, wxT("Year"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerSelect->Add( m_staticTextYear, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + wxArrayString m_choiceYearChoices; + for ( int y = 2005; y < 2030; y++ ) + m_choiceYearChoices.Add( wxString::Format( "%d", y ) ); + m_choiceYear = new wxChoice( this, ID_DATE, wxDefaultPosition, wxSize( 100, -1 ), m_choiceYearChoices, 0 ); + m_choiceYear->SetSelection( 0 ); + fgSizerSelect->Add( m_choiceYear, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextDate = new wxStaticText( this, wxID_ANY, wxT("Date"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerSelect->Add( m_staticTextDate, 0, wxALL|wxALIGN_RIGHT, 5 ); + + m_listBoxDate = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxSize( 100, 300 ), 0, NULL, wxLB_ALWAYS_SB|wxLB_SINGLE ); + fgSizerSelect->Add( m_listBoxDate, 0, wxALL, 5 ); + + m_staticTextCcn = new wxStaticText( this, wxID_ANY, wxT("Ccn"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerSelect->Add( m_staticTextCcn, 0, wxALL|wxALIGN_RIGHT, 5 ); + + m_listBoxCcn = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxSize( 100, 100 ), 0, NULL, wxLB_ALWAYS_SB|wxLB_SINGLE ); + fgSizerSelect->Add( m_listBoxCcn, 0, wxALL, 5 ); + m_listBoxCcn->Enable( false ); + + bSizerTop->Add( fgSizerSelect, 0, wxEXPAND, 5 ); + + + this->SetSizer( bSizerTop ); + this->Layout(); + + this->Centre( wxBOTH ); +} + diff -r c262e17de9b1 -r b651aa41b9d4 src/mngdb.cpp --- a/src/mngdb.cpp Sat Jun 08 15:50:59 2019 +0900 +++ b/src/mngdb.cpp Mon Jul 15 07:03:05 2019 +0900 @@ -1,5 +1,5 @@ // Filename : mngdeb.cpp -// Last Change: 2018-11-21 æ°´ 08:36:02. +// Last Change: 2019-07-15 Mon 06:58:48. // #include @@ -11,60 +11,7 @@ ManageDBFrame::ManageDBFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) { - this->SetBackgroundColour( wxColour( 140, 240, 140 ) ); - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizerTop = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 0, 2, 0, 0 ); - fgSizer->SetFlexibleDirection( wxBOTH ); - fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticTextDate = new wxStaticText( this, wxID_ANY, wxT( "Date" ), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer->Add( m_staticTextDate, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_datePicker = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize( 180, -1 ), wxDP_DROPDOWN|wxDP_SHOWCENTURY ); - fgSizer->Add( m_datePicker, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextHhs = new wxStaticText( this, wxID_ANY, wxT( "HHS" ), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer->Add( m_staticTextHhs, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); - - m_filePickerHhs = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT( "Select a file" ), wxT( "*.db" ), wxDefaultPosition, wxSize( 180, -1 ), wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_SMALL|wxFLP_USE_TEXTCTRL ); - fgSizer->Add( m_filePickerHhs, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticTextCcn = new wxStaticText( this, wxID_ANY, wxT( "CCN" ), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer->Add( m_staticTextCcn, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_filePickerCcn = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT( "Select a file" ), wxT( "*.db" ), wxDefaultPosition, wxSize( 180, -1 ), wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_SMALL|wxFLP_USE_TEXTCTRL ); - fgSizer->Add( m_filePickerCcn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizerTop->Add( fgSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - //--- - m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerTop->Add( m_staticline, 0, wxEXPAND|wxALL, 5 ); - - wxBoxSizer* bSizerBtn = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonBuild = new wxButton( this, ID_MNGBLD, wxT( "Build" ), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerBtn->Add( m_buttonBuild, 0, wxALL, 5 ); - - m_buttonUpld = new wxButton( this, ID_MNGUPLD, wxT( "Upload" ), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerBtn->Add( m_buttonUpld, 0, wxALL, 5 ); - - m_buttonIdx = new wxButton( this, ID_MNGIDX, wxT( "Index" ), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerBtn->Add( m_buttonIdx, 0, wxALL, 5 ); - - m_buttonExit = new wxButton( this, ID_MNGEXIT, wxT( "Exit" ), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerBtn->Add( m_buttonExit, 0, wxALL, 5 ); - - bSizerTop->Add( bSizerBtn, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - this->SetSizer( bSizerTop ); - this->Layout(); - - this->Centre( wxBOTH ); - m_buttonUpld->Enable( false ); + CreateControls(); } ManageDBFrame::~ManageDBFrame() @@ -163,3 +110,61 @@ m_filePickerCcn->SetPath( dir + wxFILE_SEP_PATH + wxT( "ccn.db") ); } +void ManageDBFrame::CreateControls() +{ + this->SetBackgroundColour( wxColour( 140, 240, 140 ) ); + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizerTop = new wxBoxSizer( wxVERTICAL ); + + wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 0, 2, 0, 0 ); + fgSizer->SetFlexibleDirection( wxBOTH ); + fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextDate = new wxStaticText( this, wxID_ANY, wxT( "Date" ), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer->Add( m_staticTextDate, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_datePicker = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize( 180, -1 ), wxDP_DROPDOWN|wxDP_SHOWCENTURY ); + fgSizer->Add( m_datePicker, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextHhs = new wxStaticText( this, wxID_ANY, wxT( "HHS" ), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer->Add( m_staticTextHhs, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_filePickerHhs = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT( "Select a file" ), wxT( "*.db" ), wxDefaultPosition, wxSize( 180, -1 ), wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_SMALL|wxFLP_USE_TEXTCTRL ); + fgSizer->Add( m_filePickerHhs, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticTextCcn = new wxStaticText( this, wxID_ANY, wxT( "CCN" ), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer->Add( m_staticTextCcn, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_filePickerCcn = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT( "Select a file" ), wxT( "*.db" ), wxDefaultPosition, wxSize( 180, -1 ), wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_SMALL|wxFLP_USE_TEXTCTRL ); + fgSizer->Add( m_filePickerCcn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizerTop->Add( fgSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + //--- + m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerTop->Add( m_staticline, 0, wxEXPAND|wxALL, 5 ); + + wxBoxSizer* bSizerBtn = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonBuild = new wxButton( this, ID_MNGBLD, wxT( "Build" ), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerBtn->Add( m_buttonBuild, 0, wxALL, 5 ); + + m_buttonUpld = new wxButton( this, ID_MNGUPLD, wxT( "Upload" ), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerBtn->Add( m_buttonUpld, 0, wxALL, 5 ); + m_buttonUpld->Enable( false ); + + m_buttonIdx = new wxButton( this, ID_MNGIDX, wxT( "Index" ), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerBtn->Add( m_buttonIdx, 0, wxALL, 5 ); + + m_buttonExit = new wxButton( this, ID_MNGEXIT, wxT( "Exit" ), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerBtn->Add( m_buttonExit, 0, wxALL, 5 ); + + bSizerTop->Add( bSizerBtn, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + this->SetSizer( bSizerTop ); + this->Layout(); + + this->Centre( wxBOTH ); +} + diff -r c262e17de9b1 -r b651aa41b9d4 src/rsearcher.cpp --- a/src/rsearcher.cpp Sat Jun 08 15:50:59 2019 +0900 +++ b/src/rsearcher.cpp Mon Jul 15 07:03:05 2019 +0900 @@ -1,5 +1,5 @@ // Filename : rsearcher.cpp -// Last Change: 2019-05-29 æ°´ 15:37:32. +// Last Change: 2019-07-15 Mon 06:58:17. // #include @@ -7,6 +7,8 @@ #include #include "id.h" #include "mngdb.h" +#include "batchprint.h" +#include "index.h" #include "rsearcher.h" #include "main.h" @@ -92,26 +94,26 @@ : wxStaticBitmap( parent, id, label, pos, size, style, name ) { m_parent = parent; - Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( OnLeftDown ), NULL, this ); - Connect( wxEVT_LEFT_UP, wxMouseEventHandler( OnLeftUp ), NULL, this ); - Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( OnLeftDClick ), NULL, this ); - Connect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( OnRightDClick ), NULL, this ); - Connect( wxEVT_MOTION, wxMouseEventHandler( OnMotion ), NULL, this ); - Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( OnWheel ), NULL, this ); - Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( OnStartRGesture ), NULL, this ); - Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( OnEndRGesture ), NULL, this ); + Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( MyStaticBitmap::OnLeftDown ), NULL, this ); + Connect( wxEVT_LEFT_UP, wxMouseEventHandler( MyStaticBitmap::OnLeftUp ), NULL, this ); + Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( MyStaticBitmap::OnLeftDClick ), NULL, this ); + Connect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( MyStaticBitmap::OnRightDClick ), NULL, this ); + Connect( wxEVT_MOTION, wxMouseEventHandler( MyStaticBitmap::OnMotion ), NULL, this ); + Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( MyStaticBitmap::OnWheel ), NULL, this ); + Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MyStaticBitmap::OnStartRGesture ), NULL, this ); + Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( MyStaticBitmap::OnEndRGesture ), NULL, this ); } MyStaticBitmap::~MyStaticBitmap() { - Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( OnLeftDown ), NULL, this ); - Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( OnLeftUp ), NULL, this ); - Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( OnLeftDClick ), NULL, this ); - Disconnect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( OnRightDClick ), NULL, this ); - Disconnect( wxEVT_MOTION, wxMouseEventHandler( OnMotion ), NULL, this ); - Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( OnWheel ), NULL, this ); - Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( OnStartRGesture ), NULL, this ); - Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( OnEndRGesture ), NULL, this ); + Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( MyStaticBitmap::OnLeftDown ), NULL, this ); + Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( MyStaticBitmap::OnLeftUp ), NULL, this ); + Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( MyStaticBitmap::OnLeftDClick ), NULL, this ); + Disconnect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( MyStaticBitmap::OnRightDClick ), NULL, this ); + Disconnect( wxEVT_MOTION, wxMouseEventHandler( MyStaticBitmap::OnMotion ), NULL, this ); + Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( MyStaticBitmap::OnWheel ), NULL, this ); + Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MyStaticBitmap::OnStartRGesture ), NULL, this ); + Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( MyStaticBitmap::OnEndRGesture ), NULL, this ); } // Event Handlers @@ -285,16 +287,18 @@ EVT_IDLE( MainFrame::OnIdle ) EVT_TIMER( ID_TIMER, MainFrame::OnTimer ) // shortcut-key - EVT_BUTTON( ID_FOCUS, MainFrame::OnFocus ) - EVT_BUTTON( ID_PZOOM, MainFrame::OnPlusZoom ) - EVT_BUTTON( ID_MZOOM, MainFrame::OnMinusZoom ) - EVT_BUTTON( ID_DARK, MainFrame::OnDark ) - EVT_BUTTON( ID_SWIN, MainFrame::OnSatellite ) - EVT_BUTTON( ID_UPIDX, MainFrame::OnUpdateIndex ) - EVT_BUTTON( ID_DLMAN, MainFrame::OnDownloadManual ) - EVT_BUTTON( wxID_HELP, MainFrame::OnHelp ) + EVT_BUTTON( ID_FOCUS, MainFrame::OnFocus ) + EVT_BUTTON( ID_PZOOM, MainFrame::OnPlusZoom ) + EVT_BUTTON( ID_MZOOM, MainFrame::OnMinusZoom ) + EVT_BUTTON( ID_DARK, MainFrame::OnDark ) + EVT_BUTTON( ID_SWIN, MainFrame::OnSatellite ) + EVT_BUTTON( ID_UPIDX, MainFrame::OnUpdateIndex ) + EVT_BUTTON( ID_DLMAN, MainFrame::OnDownloadManual ) + EVT_BUTTON( ID_BPRINT, MainFrame::OnBatchPrint ) + EVT_BUTTON( ID_INDEX, MainFrame::OnIndex ) + EVT_BUTTON( wxID_HELP, MainFrame::OnHelp ) EVT_BUTTON( wxID_CLOSE, MainFrame::OnBClose ) - EVT_BUTTON( ID_LOGOUT, MainFrame::OnLogout ) + EVT_BUTTON( ID_LOGOUT, MainFrame::OnLogout ) END_EVENT_TABLE() @@ -442,6 +446,20 @@ wxExecute( execmd ); } +void MainFrame::OnIndex( wxCommandEvent& WXUNUSED(event) ) +{ + IndexFrame *idx = new IndexFrame( NULL, wxID_ANY, wxT( "Index" ), wxPoint( 0, 0 ), wxSize( 800, 500 ), wxDEFAULT_FRAME_STYLE ); + idx->Show( true ); + idx->Raise(); +} + +void MainFrame::OnBatchPrint( wxCommandEvent& WXUNUSED(event) ) +{ + BatchPrintFrame *bp = new BatchPrintFrame( NULL, wxID_ANY, wxT( "Batch Print" ), wxPoint( 0, 0 ), wxSize( 800, 500 ), wxDEFAULT_FRAME_STYLE ); + bp->Show( true ); + bp->Raise(); +} + void MainFrame::OnHelp( wxCommandEvent& WXUNUSED(event) ) { wxString version, build; @@ -606,6 +624,10 @@ m_buttonDark->Hide(); m_buttonSatellite = new wxButton( this, ID_SWIN, wxT( "Satellite" ), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonSatellite->Hide(); + m_buttonIndex = new wxButton( this, ID_INDEX, wxT( "Index" ), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonIndex->Hide(); + m_buttonBPrint = new wxButton( this, ID_BPRINT, wxT( "Batch Print" ), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonBPrint->Hide(); m_buttonDLMan = new wxButton( this, ID_DLMAN, wxT( "Manual" ), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonDLMan->Hide(); m_buttonUpdateIndex = new wxButton( this, ID_UPIDX, wxT( "Update Index" ), wxDefaultPosition, wxDefaultSize, 0 ); @@ -644,19 +666,21 @@ void MainFrame::SetAccelerator( void ) { - wxAcceleratorEntry entries[11]; + wxAcceleratorEntry entries[13]; entries[0].Set( wxACCEL_CTRL, (int)'P', wxID_PRINT ); entries[1].Set( wxACCEL_NORMAL, WXK_F1, wxID_HELP ); entries[2].Set( wxACCEL_NORMAL, WXK_F2, ID_DLMAN ); - entries[3].Set( wxACCEL_NORMAL, WXK_F4, ID_FOCUS ); - entries[4].Set( wxACCEL_NORMAL, (int)'Z', ID_PZOOM ); - entries[5].Set( wxACCEL_NORMAL, (int)'X', ID_MZOOM ); - entries[6].Set( wxACCEL_NORMAL, (int)'D', ID_DARK ); - entries[7].Set( wxACCEL_CTRL, (int)'Q', wxID_CLOSE ); - entries[8].Set( wxACCEL_SHIFT, (int)'W', ID_SWIN ); - entries[9].Set( wxACCEL_SHIFT, (int)'R', ID_UPIDX ); - entries[10].Set( wxACCEL_SHIFT, (int)'L', ID_DARK ); // now building ( logout ) - wxAcceleratorTable accel( 10, entries ); + entries[3].Set( wxACCEL_NORMAL, WXK_F3, ID_BPRINT ); + entries[4].Set( wxACCEL_NORMAL, WXK_F4, ID_FOCUS ); + entries[5].Set( wxACCEL_NORMAL, WXK_F7, ID_INDEX ); + entries[6].Set( wxACCEL_NORMAL, (int)'Z', ID_PZOOM ); + entries[7].Set( wxACCEL_NORMAL, (int)'X', ID_MZOOM ); + entries[8].Set( wxACCEL_NORMAL, (int)'D', ID_DARK ); + entries[9].Set( wxACCEL_CTRL, (int)'Q', wxID_CLOSE ); + entries[10].Set( wxACCEL_SHIFT, (int)'W', ID_SWIN ); + entries[11].Set( wxACCEL_SHIFT, (int)'R', ID_UPIDX ); + entries[12].Set( wxACCEL_SHIFT, (int)'L', ID_DARK ); // now building ( logout ) + wxAcceleratorTable accel( 13, entries ); SetAcceleratorTable( accel ); }