# HG changeset patch # User pyon@macmini # Date 1544333895 -32400 # Node ID c1dc1fcee7fee1cd90e2b1b7fd77518f29540c76 # Parent f5ffc34f045a258f97aaa1e2a55f2c831c0b2227 print zoom. diff -r f5ffc34f045a -r c1dc1fcee7fe app.conf --- a/app.conf Wed Nov 14 19:43:40 2018 +0900 +++ b/app.conf Sun Dec 09 14:38:15 2018 +0900 @@ -5,15 +5,17 @@ h=724 [Server] -address=192.168.79.124 +address=192.168.0.124 port=3910 proxy_address= proxy_port= [DBManage] -dbdir=C:\\MinGW\\msys\\1.0\\home\\muto\\wx\\rsearcher\\searcher03db +;dbdir=C:\\MinGW\\msys\\1.0\\home\\muto\\wx\\rsearcher\\searcher03db +dbdir=/Users/takayuki/wx/rsearcher/db [Misc] splash=-1 ;unlock_key=054fa2ab56938fc46ed69eb7ad93fa4828e4963b8a82f9514c3e2e86940510ed +print_zoom=100 diff -r f5ffc34f045a -r c1dc1fcee7fe go/client.go --- a/go/client.go Wed Nov 14 19:43:40 2018 +0900 +++ b/go/client.go Sun Dec 09 14:38:15 2018 +0900 @@ -1,7 +1,7 @@ /* client.go : client-program. - Version : 1.3a - Last Change: 2018-11-14 水 16:58:29. + Version : 1.4 + Last Change: 2018-12-05 水 08:29:02. install to: rsearcher_root/ @@ -34,6 +34,7 @@ "io/ioutil" "log" "net/http" + "net/url" "os" "path/filepath" "regexp" @@ -43,7 +44,7 @@ var version string func init() { - version = "1.3a" // manual.pdf version + version = "1.4" // image query version } func main() { @@ -111,19 +112,19 @@ host := flag.Args()[0] fmt.Print( "Getting client.exe..." ) - if _, err := get_file( host, "/release/client.exe", "client1.exe" ); err != nil { + if _, err := get_file( host, "/release/client.exe", "", "client1.exe" ); err != nil { log.Fatal( err ) } fmt.Print( "Getting crypto.exe..." ) - if _, err := get_file( host, "/release/crypto.exe", "crypto.exe" ); err != nil { + if _, err := get_file( host, "/release/crypto.exe", "", "crypto.exe" ); err != nil { log.Fatal( err ) } fmt.Print( "Getting grsearcher.exe..." ) - if _, err := get_file( host, "/release/grsearcher.exe", "grsearcher.exe" ); err != nil { + if _, err := get_file( host, "/release/grsearcher.exe", "", "grsearcher.exe" ); err != nil { log.Fatal( err ) } fmt.Print( "Getting manual.pdf..." ) - if _, err := get_file( host, "/release/manual.pdf", "manual.pdf" ); err != nil { + if _, err := get_file( host, "/release/manual.pdf", "", "manual.pdf" ); err != nil { log.Fatal( err ) } @@ -141,17 +142,17 @@ } fmt.Print( "Getting auth.db..." ) host := flag.Args()[0] - if _, err := get_file( host, "/db/auth.db", "auth.db" ); err != nil { + if _, err := get_file( host, "/db/auth.db", "", "auth.db" ); err != nil { log.Fatal( err ) } fmt.Print( "Getting hhs.db..." ) - if _, err := get_file( host, "/db/hhs.db", "hhs.db" ); err != nil { + if _, err := get_file( host, "/db/hhs.db", "", "hhs.db" ); err != nil { log.Fatal( err ) } if time.Now().Day() % 14 == 0 { fmt.Print( "Getting index.db..." ) - if _, err := get_file( host, "/db/index.db", "index.db" ); err != nil { + if _, err := get_file( host, "/db/index.db", "", "index.db" ); err != nil { log.Fatal( err ) } } @@ -182,9 +183,13 @@ os.Exit( 1 ) } + v := url.Values{} + v.Set( "q", "12345" ) + q := "" + rfile := "/images/" + d + "/" + h + ".tgz" - fmt.Print( "Getting", rfile ) - b, err := get_file( host, rfile, "" ) + fmt.Print( "Getting ", rfile ) + b, err := get_file( host, rfile, q, "" ) if err != nil { log.Fatal( err ) } @@ -215,7 +220,7 @@ } // HTTP GET -func get_file( host, rfile, lfile string ) ( []byte, error ) { +func get_file( host, rfile, query, lfile string ) ( []byte, error ) { res, err := http.Get( "http://" + host + "/" + rfile ) if err != nil { return nil, err diff -r f5ffc34f045a -r c1dc1fcee7fe go/server.go --- a/go/server.go Wed Nov 14 19:43:40 2018 +0900 +++ b/go/server.go Sun Dec 09 14:38:15 2018 +0900 @@ -1,7 +1,7 @@ /* server.go : server-program. - Version : 1.3 - Last Change: 2018-11-14 水 17:03:30. + Version : 1.4 + Last Change: 2018-12-05 水 08:08:02. install to: server_root/ @@ -13,13 +13,15 @@ package main import( - "path/filepath" + "bufio" + "flag" "fmt" "io" "log" "net" "net/http" "os" + "path/filepath" "time" ) @@ -29,17 +31,23 @@ port string server_root string logfile string + not_ac bool + wlfile string ) func init() { - version = "1.3" // manage-db version + version = "1.4" // piece-image version port = ":3910" server_root = filepath.Dir( os.Args[0] ) logfile = filepath.Join( server_root, "rsearcher.log" ) + wlfile = "rsearcher.whitelist" } func main() { + flag.BoolVar( ¬_ac, "d", false, "no access control ( for debug )" ) + flag.Parse() + // setting IP-Address & Port addrs, err := net.InterfaceAddrs() if err != nil { @@ -62,9 +70,16 @@ } func handler( w http.ResponseWriter, r *http.Request ) { + if !not_ac && !is_valid_host( r.RemoteAddr ) { + http.NotFound( w, r ) + return + } + file := filepath.Join( server_root, filepath.FromSlash( r.URL.Path ) ) + img := r.URL.Query().Get( "q" ) fmt.Println( "[access]", r.RemoteAddr, "|", time.Now().Format( "2006-01-02 15:04" ), "|", file ) + fmt.Println( "--", img , "--") write_log( "[access] " + r.RemoteAddr + " " + file ) f, err := os.Open( file ) @@ -82,6 +97,11 @@ } func upload_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" ), "|", "/upload" ) now := time.Now().Format( "20060102_150405" ) file := filepath.Join( server_root, "upload", now ) @@ -100,6 +120,11 @@ } func mngdb_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" ), "|", "/mngdb" ) write_log( "[access] " + r.RemoteAddr + "manage-db" ) db := r.URL.Path[ len( "/mngdb/" ): ] @@ -119,6 +144,18 @@ f.Close() } +func is_valid_host( host string ) bool { + f, _ := os.Open( wlfile ) + defer f.Close() + input := bufio.NewScanner( f ) + for input.Scan() { + if input.Text() == host { + return true + } + } + return false +} + 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 f5ffc34f045a -r c1dc1fcee7fe include/id.h --- a/include/id.h Wed Nov 14 19:43:40 2018 +0900 +++ b/include/id.h Sun Dec 09 14:38:15 2018 +0900 @@ -1,5 +1,5 @@ // Filename : id.h -// Last Change: 2018-11-14 13:54:49. +// Last Change: 2018-11-21 08:25:58. // #ifndef __ID_H__ @@ -7,8 +7,8 @@ #include -#define RSVER "1.6a" -#define RSRELEASE "2018.11.19" +#define RSVER "1.6b" +#define RSRELEASE "2018.11.30" enum { /* for mainframe */ @@ -39,7 +39,12 @@ /* for mange db */ ID_MNGBLD, ID_MNGUPLD, + ID_MNGIDX, ID_MNGEXIT, + + /* for index */ + ID_DPBGN, + ID_DPEND, }; #endif // __ID_H__ diff -r f5ffc34f045a -r c1dc1fcee7fe include/mngdb.h --- a/include/mngdb.h Wed Nov 14 19:43:40 2018 +0900 +++ b/include/mngdb.h Sun Dec 09 14:38:15 2018 +0900 @@ -1,5 +1,5 @@ // Filename : mngdb.h -// Last Change: 2018-11-14 13:53:29. +// Last Change: 2018-11-21 08:27:58. // #ifndef __MNGDB_H__ @@ -34,6 +34,7 @@ wxStaticLine* m_staticline; wxButton* m_buttonBuild; wxButton* m_buttonUpld; + wxButton* m_buttonIdx; wxButton* m_buttonExit; public: @@ -42,6 +43,7 @@ void OnBuild( wxCommandEvent& event ); void OnUpload( wxCommandEvent& event ); + void OnIndex( wxCommandEvent& event ); void OnExit( wxCommandEvent& event ); void SetDBdir( wxString dir ); diff -r f5ffc34f045a -r c1dc1fcee7fe include/rsearcher.h --- a/include/rsearcher.h Wed Nov 14 19:43:40 2018 +0900 +++ b/include/rsearcher.h Sun Dec 09 14:38:15 2018 +0900 @@ -1,5 +1,5 @@ // Filename : rsearcher.h -// Last Change: 2018-11-14 11:34:55. +// Last Change: 2018-12-04 12:51:07. // #ifndef __RSEARCH_H__ @@ -14,9 +14,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -148,9 +150,11 @@ wxDataViewColumn* m_dataViewListColumnKNo; wxDataViewColumn* m_dataViewListColumnName; wxDataViewColumn* m_dataViewListColumnAddr; + wxCheckListBox* m_checkListBox; wxTextCtrl* m_textCtrlLog; wxButton* m_buttonPsearch; wxButton* m_buttonPrint; + wxSpinCtrl* m_spinCtrl; // invisible button for shortcut-key wxSlider* m_slider; @@ -189,6 +193,7 @@ void PrintImages( void ); void WriteLog( wxString msg ); void Close( void ); + void SetControlsValue( void ); void InDevelop( bool ); void OnSplitWin( wxSplitterEvent & event ); diff -r f5ffc34f045a -r c1dc1fcee7fe searcherR.fbp --- a/searcherR.fbp Wed Nov 14 19:43:40 2018 +0900 +++ b/searcherR.fbp Sun Dec 09 14:38:15 2018 +0900 @@ -1,6 +1,6 @@ - + C++ @@ -54,54 +54,6 @@ wxTAB_TRAVERSAL 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizerTop @@ -164,38 +116,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Image-01 @@ -253,36 +173,6 @@ wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -342,36 +232,6 @@ wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -431,36 +291,6 @@ wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -520,36 +350,6 @@ wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -609,36 +409,6 @@ wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -698,36 +468,6 @@ wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -804,40 +544,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -902,40 +608,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1000,40 +672,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1061,54 +699,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - wxALIGN_LEFT @@ -1136,6 +726,129 @@ 5 wxALL|wxEXPAND + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_dataViewListCtrl1 + protected + + + wxDV_ROW_LINES|wxDV_SINGLE + + + + + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + No + wxDATAVIEW_CELL_INERT + m_dataViewListColumnHno + protected + Text + -1 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Name + wxDATAVIEW_CELL_INERT + m_dataViewListColumnName + protected + Text + -1 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Addr + wxDATAVIEW_CELL_INERT + m_dataViewListColumnAddr + protected + Text + -1 + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_listBox1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL|wxEXPAND 1 1 @@ -1195,40 +908,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1294,263 +973,240 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - ID_PRINT - Print - - 0 - - 0 - - - 0 + wxEXPAND + 1 + + 2 + wxBOTH + + + 0 - 1 - m_buttonPrint - 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_TEST - MyButton - - 0 - - 0 - - - 0 - - 1 - m_button - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + fgSizerButton + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_TEST + Paste & Search + + 0 + + 0 + + + 0 + + 1 + m_buttonPsearch + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 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 + ID_PRINT + Print + + 0 + + 0 + + + 0 + + 1 + m_buttonPrint + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 100 + 100 + + 0 + + 1 + + 0 + + 1 + m_spinCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + @@ -1583,55 +1239,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 0 @@ -1699,36 +1306,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1793,40 +1370,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1888,36 +1431,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1979,36 +1492,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2073,40 +1556,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2168,36 +1617,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2229,54 +1648,6 @@ wxTAB_TRAVERSAL 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizerTop @@ -2357,36 +1728,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2449,37 +1790,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2541,36 +1851,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2636,37 +1916,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2728,36 +1977,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2823,37 +2042,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2914,36 +2102,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3025,37 +2183,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3128,37 +2255,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3231,39 +2327,309 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + IndexFrame + + 500,300 + wxCAPTION|wxCLOSE_BOX|wxRESIZE_BORDER + ; ; forward_declare + + + + + wxTAB_TRAVERSAL + 1 + + + bSizerTop + wxVERTICAL + none + + 5 + wxALIGN_CENTER_HORIZONTAL + 0 + + + bSizerFilter + wxHORIZONTAL + none + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_DPBGN + + 0 + + + 0 + + 1 + m_datePickerBgn + 1 + + + protected + 1 + + Resizable + 1 + + wxDP_DEFAULT + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + + 0 + + 1 + m_staticText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_DPEND + + 0 + + + 0 + + 1 + m_datePickerEnd + 1 + + + protected + 1 + + Resizable + 1 + + wxDP_DEFAULT + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_dataViewListCtrl + protected + + + wxDV_HORIZ_RULES|wxDV_ROW_LINES|wxDV_VERT_RULES + ; ; forward_declare + + + + + + wxALIGN_CENTER + + wxDATAVIEW_COL_RESIZABLE + No + wxDATAVIEW_CELL_INERT + m_dataViewListColumnHno + protected + Text + -1 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Name + wxDATAVIEW_CELL_INERT + m_dataViewListColumnName + protected + Text + -1 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Kana + wxDATAVIEW_CELL_INERT + m_dataViewListColumnKana + protected + Text + -1 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE + Addr + wxDATAVIEW_CELL_INERT + m_dataViewListColumnAddr + protected + Text + -1 + diff -r f5ffc34f045a -r c1dc1fcee7fe src/mngdb.cpp --- a/src/mngdb.cpp Wed Nov 14 19:43:40 2018 +0900 +++ b/src/mngdb.cpp Sun Dec 09 14:38:15 2018 +0900 @@ -1,11 +1,12 @@ // Filename : mngdeb.cpp -// Last Change: 2018-11-14 水 13:48:58. +// Last Change: 2018-11-21 水 08:36:02. // #include #include #include "id.h" #include "mngdb.h" +#include "index.h" ManageDBFrame::ManageDBFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) @@ -51,6 +52,9 @@ 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 ); @@ -71,6 +75,7 @@ BEGIN_EVENT_TABLE( ManageDBFrame, wxFrame ) EVT_BUTTON( ID_MNGBLD, ManageDBFrame::OnBuild ) EVT_BUTTON( ID_MNGUPLD, ManageDBFrame::OnUpload ) + EVT_BUTTON( ID_MNGIDX, ManageDBFrame::OnIndex ) EVT_BUTTON( ID_MNGEXIT, ManageDBFrame::OnExit ) END_EVENT_TABLE() @@ -125,6 +130,12 @@ wxMessageBox( wxT( "upload done." ) ); } +void ManageDBFrame::OnIndex( wxCommandEvent& WXUNUSED(event) ) +{ + IndexFrame *idxframe = new IndexFrame( this, wxID_ANY, wxT( "View Index" ), wxDefaultPosition, wxSize( 400, 480 ), wxDEFAULT_FRAME_STYLE ); + idxframe->Show(); +} + void ManageDBFrame::OnExit( wxCommandEvent& WXUNUSED(event) ) { Close(); diff -r f5ffc34f045a -r c1dc1fcee7fe src/rsearcher.cpp --- a/src/rsearcher.cpp Wed Nov 14 19:43:40 2018 +0900 +++ b/src/rsearcher.cpp Sun Dec 09 14:38:15 2018 +0900 @@ -1,5 +1,5 @@ // Filename : rsearcher.cpp -// Last Change: 2018-11-14 水 14:06:25. +// Last Change: 2018-12-04 火 16:00:36. // #include @@ -548,6 +548,14 @@ m_textCtrlAddr->SetBackgroundColour( wxColour( 180, 210, 240 ) ); bSizerRight->Add( m_textCtrlAddr, 0, wxALL|wxEXPAND, 5 ); + m_checkListBox = new wxCheckListBox( m_panelRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + m_checkListBox->Append( wxT( "1: Marksheet" ) ); + m_checkListBox->Append( wxT( "2: Marksheet ( R )" ) ); + m_checkListBox->Append( wxT( "3: Special Mention" ) ); + m_checkListBox->Append( wxT( "4: Opinion" ) ); + m_checkListBox->Append( wxT( "5: Opinion ( R )" ) ); + bSizerRight->Add( m_checkListBox, 0, wxALL|wxEXPAND, 5 ); + m_dataViewListCtrl = new wxDataViewListCtrl( m_panelRight, ID_LIST, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE ); m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ), wxDATAVIEW_CELL_INERT, 30, wxALIGN_RIGHT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( " Date" ), wxDATAVIEW_CELL_INERT, 80, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); @@ -563,13 +571,24 @@ m_textCtrlLog = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 40 ), 0 ); bSizerRight->Add( m_textCtrlLog, 0, wxALL|wxEXPAND, 5 ); + wxFlexGridSizer* fgSizerButton = new wxFlexGridSizer( 0, 2, 0, 0 ); + fgSizerButton->SetFlexibleDirection( wxBOTH ); + fgSizerButton->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + m_buttonPsearch = new wxButton( m_panelRight, ID_PSEARCH, wxT( "Paste-Search" ), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerRight->Add( m_buttonPsearch, 0, wxALL, 5 ); + fgSizerButton->Add( m_buttonPsearch, 0, wxALL, 5 ); + fgSizerButton->Add( 0, 0, 1, wxEXPAND, 5 ); + m_buttonPrint = new wxButton( m_panelRight, wxID_PRINT, wxT( "Print" ), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerRight->Add( m_buttonPrint, 0, wxALL, 5 ); + fgSizerButton->Add( m_buttonPrint, 0, wxALL, 5 ); - // now building... + m_spinCtrl = new wxSpinCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 1, 100, 100 ); + fgSizerButton->Add( m_spinCtrl, 0, wxALL, 5 ); + + bSizerRight->Add( fgSizerButton, 0, wxEXPAND, 5 ); + + /* now building... */ m_slider = new wxSlider( m_panelRight, ID_SLDR, 1, 1, 5, wxDefaultPosition, wxSize( -1, 200 ), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LABELS|wxSL_VERTICAL ); //bSizerRight->Add( m_slider, 0, wxALL, 5 ); @@ -605,11 +624,20 @@ this->Layout(); //this->Centre( wxBOTH ); + + SetControlsValue(); +} + +void MainFrame::SetControlsValue( void ) +{ m_staticBitmap1 = new MyStaticBitmap( m_scrolledWindow1, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); m_staticBitmap2 = new MyStaticBitmap( m_scrolledWindow2, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); m_staticBitmap3 = new MyStaticBitmap( m_scrolledWindow3, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); m_staticBitmap4 = new MyStaticBitmap( m_scrolledWindow4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); m_staticBitmap5 = new MyStaticBitmap( m_scrolledWindow5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); + + for ( int i = 0; i < m_checkListBox->GetCount(); i++ ) + m_checkListBox->Check( i, true ); } void MainFrame::SetAccelerator( void ) @@ -651,7 +679,7 @@ } if ( cmd.IsSameAs( wxT( "3915" ), true ) && m_user.IsSameAs( wxT( "root" ) ) ) { - ManageDBFrame *mngframe = new ManageDBFrame( this, wxID_ANY, wxT( "Management Window" ), wxDefaultPosition, wxSize( 300, 180 ), wxCAPTION|wxTAB_TRAVERSAL ); + ManageDBFrame *mngframe = new ManageDBFrame( this, wxID_ANY, wxT( "Management Window" ), wxDefaultPosition, wxSize( 400, 160 ), wxCAPTION|wxTAB_TRAVERSAL ); mngframe->SetDBdir( m_dbdir ); mngframe->SetServer( m_server ); mngframe->Show(); @@ -845,7 +873,13 @@ wxProgressDialog pd( wxT( "Connecting Server" ), wxT( "Start..." ), estimate, NULL, wxPD_APP_MODAL|wxPD_ELAPSED_TIME|wxPD_REMAINING_TIME|wxPD_AUTO_HIDE ); pd.SetSize( wxSize( 320, 140 ) ); - http.GetImages( hhs, date ); + unsigned int flag = 0; + if ( m_checkListBox->IsChecked( 0 ) ) flag += 1; + if ( m_checkListBox->IsChecked( 1 ) ) flag += 10; + if ( m_checkListBox->IsChecked( 2 ) ) flag += 100; + if ( m_checkListBox->IsChecked( 3 ) ) flag += 1000; + if ( m_checkListBox->IsChecked( 4 ) ) flag += 10000; + http.GetImages( hhs, date, wxString::Format( wxT( "%d" ), flag ) ); for ( int i = 0; i < estimate; i++ ) { wxMilliSleep( 1 ); pd.Update( i, wxT( "Now Loading..." ) ); @@ -987,9 +1021,11 @@ wxString html, file; html = wxT( "\n" ); + int zoom = m_spinCtrl->GetValue(); + wxString imgsz = wxString::Format( wxT( "\" width=\"%d\" height=\"%d\"" ), 750 * zoom / 100, 1060 * zoom / 100 ); for ( int i = 1; i < 6; i++ ) { file = wxString::Format( wxT( ".cache/%08s_%d" ), date, i ); - html = html + wxT( "\n" ); + html = html + wxT( "\n" ); html = html + wxT( "
" ) + m_hhs + wxT( "@" ) + m_user + wxT( "#" ) + nowstr + wxT( "
\n\n" ); } html = html + wxT( "" );