Mercurial > mercurial > hgweb_golang.cgi
changeset 46:6ec28d3c3e00
small changes.
author | pyon@macmini |
---|---|
date | Sat, 18 Apr 2020 21:10:29 +0900 |
parents | 20b42e2deae1 |
children | 169936fed61b |
files | src/kaigo/horori/horori.fbp src/kaigo/horori/searcher/include/searcher.h src/kaigo/horori/searcher/server/searcher.go src/kaigo/horori/searcher/src/searcher.cpp |
diffstat | 4 files changed, 515 insertions(+), 92 deletions(-) [+] |
line wrap: on
line diff
--- a/src/kaigo/horori/horori.fbp Thu Apr 16 20:59:35 2020 +0900 +++ b/src/kaigo/horori/horori.fbp Sat Apr 18 21:10:29 2020 +0900 @@ -3137,6 +3137,7 @@ <property name="window_extra_style"></property> <property name="window_name"></property> <property name="window_style"></property> + <event name="OnNotebookPageChanged">OnPageChanged</event> <object class="notebookpage" expanded="0"> <property name="bitmap"></property> <property name="label">Mシート1</property> @@ -3432,11 +3433,11 @@ <property name="window_style">wxHSCROLL|wxVSCROLL</property> </object> </object> - <object class="notebookpage" expanded="0"> + <object class="notebookpage" expanded="1"> <property name="bitmap"></property> <property name="label">バッチ印刷</property> - <property name="select">0</property> - <object class="wxPanel" expanded="0"> + <property name="select">1</property> + <object class="wxPanel" expanded="1"> <property name="BottomDockable">1</property> <property name="LeftDockable">1</property> <property name="RightDockable">1</property> @@ -3487,7 +3488,7 @@ <property name="window_extra_style"></property> <property name="window_name"></property> <property name="window_style">wxTAB_TRAVERSAL</property> - <object class="wxGridBagSizer" expanded="0"> + <object class="wxGridBagSizer" expanded="1"> <property name="empty_cell_size"></property> <property name="flexible_direction">wxBOTH</property> <property name="growablecols"></property> @@ -3671,7 +3672,8 @@ <property name="window_extra_style"></property> <property name="window_name"></property> <property name="window_style"></property> - <event name="OnDataViewListCtrlSelectionChanged">OnSelectBatchListItem</event> + <event name="OnChar">OnSelectBatchListCtrlA</event> + <event name="OnDataViewListCtrlItemActivated">OnSelectBatchDClick</event> <object class="dataViewListColumn" expanded="0"> <property name="align">wxALIGN_RIGHT</property> <property name="ellipsize"></property> @@ -3757,8 +3759,8 @@ <object class="notebookpage" expanded="1"> <property name="bitmap"></property> <property name="label">メンテナンス</property> - <property name="select">1</property> - <object class="wxPanel" expanded="1"> + <property name="select">0</property> + <object class="wxPanel" expanded="0"> <property name="BottomDockable">1</property> <property name="LeftDockable">1</property> <property name="RightDockable">1</property> @@ -3809,7 +3811,7 @@ <property name="window_extra_style"></property> <property name="window_name"></property> <property name="window_style">wxTAB_TRAVERSAL</property> - <object class="wxBoxSizer" expanded="1"> + <object class="wxBoxSizer" expanded="0"> <property name="minimum_size"></property> <property name="name">bSizerMainte</property> <property name="orient">wxVERTICAL</property> @@ -3875,12 +3877,12 @@ <property name="wrap">-1</property> </object> </object> - <object class="sizeritem" expanded="1"> + <object class="sizeritem" expanded="0"> <property name="border">15</property> <property name="flag">wxEXPAND|wxLEFT</property> <property name="proportion">0</property> - <object class="wxFlexGridSizer" expanded="1"> - <property name="cols">4</property> + <object class="wxFlexGridSizer" expanded="0"> + <property name="cols">5</property> <property name="flexible_direction">wxBOTH</property> <property name="growablecols"></property> <property name="growablerows"></property> @@ -4076,6 +4078,67 @@ </object> <object class="sizeritem" expanded="0"> <property name="border">5</property> + <property name="flag">wxALL</property> + <property name="proportion">0</property> + <object class="wxStaticText" expanded="0"> + <property name="BottomDockable">1</property> + <property name="LeftDockable">1</property> + <property name="RightDockable">1</property> + <property name="TopDockable">1</property> + <property name="aui_layer"></property> + <property name="aui_name"></property> + <property name="aui_position"></property> + <property name="aui_row"></property> + <property name="best_size"></property> + <property name="bg"></property> + <property name="caption"></property> + <property name="caption_visible">1</property> + <property name="center_pane">0</property> + <property name="close_button">1</property> + <property name="context_help"></property> + <property name="context_menu">1</property> + <property name="default_pane">0</property> + <property name="dock">Dock</property> + <property name="dock_fixed">0</property> + <property name="docking">Left</property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="floatable">1</property> + <property name="font"></property> + <property name="gripper">0</property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="label">審査会</property> + <property name="markup">0</property> + <property name="max_size"></property> + <property name="maximize_button">0</property> + <property name="maximum_size"></property> + <property name="min_size"></property> + <property name="minimize_button">0</property> + <property name="minimum_size"></property> + <property name="moveable">1</property> + <property name="name">m_staticTextCcn</property> + <property name="pane_border">1</property> + <property name="pane_position"></property> + <property name="pane_size"></property> + <property name="permission">protected</property> + <property name="pin_button">1</property> + <property name="pos"></property> + <property name="resize">Resizable</property> + <property name="show">1</property> + <property name="size"></property> + <property name="style"></property> + <property name="subclass">; ; forward_declare</property> + <property name="toolbar_pane">0</property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_name"></property> + <property name="window_style"></property> + <property name="wrap">-1</property> + </object> + </object> + <object class="sizeritem" expanded="0"> + <property name="border">5</property> <property name="flag">wxALL|wxALIGN_BOTTOM</property> <property name="proportion">0</property> <object class="wxStaticText" expanded="0"> @@ -4313,6 +4376,67 @@ </object> <object class="sizeritem" expanded="0"> <property name="border">5</property> + <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property> + <property name="proportion">0</property> + <object class="wxStaticText" expanded="0"> + <property name="BottomDockable">1</property> + <property name="LeftDockable">1</property> + <property name="RightDockable">1</property> + <property name="TopDockable">1</property> + <property name="aui_layer"></property> + <property name="aui_name"></property> + <property name="aui_position"></property> + <property name="aui_row"></property> + <property name="best_size"></property> + <property name="bg"></property> + <property name="caption"></property> + <property name="caption_visible">1</property> + <property name="center_pane">0</property> + <property name="close_button">1</property> + <property name="context_help"></property> + <property name="context_menu">1</property> + <property name="default_pane">0</property> + <property name="dock">Dock</property> + <property name="dock_fixed">0</property> + <property name="docking">Left</property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="floatable">1</property> + <property name="font"></property> + <property name="gripper">0</property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="label">---</property> + <property name="markup">0</property> + <property name="max_size"></property> + <property name="maximize_button">0</property> + <property name="maximum_size"></property> + <property name="min_size"></property> + <property name="minimize_button">0</property> + <property name="minimum_size"></property> + <property name="moveable">1</property> + <property name="name">m_staticTextIdxCcn</property> + <property name="pane_border">1</property> + <property name="pane_position"></property> + <property name="pane_size"></property> + <property name="permission">protected</property> + <property name="pin_button">1</property> + <property name="pos"></property> + <property name="resize">Resizable</property> + <property name="show">1</property> + <property name="size"></property> + <property name="style"></property> + <property name="subclass">; ; forward_declare</property> + <property name="toolbar_pane">0</property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_name"></property> + <property name="window_style"></property> + <property name="wrap">-1</property> + </object> + </object> + <object class="sizeritem" expanded="0"> + <property name="border">5</property> <property name="flag">wxALL|wxEXPAND</property> <property name="proportion">1</property> <object class="wxDataViewListCtrl" expanded="0"> @@ -4566,6 +4690,46 @@ <property name="id">wxID_ANY</property> <property name="maximum_size"></property> <property name="minimum_size"></property> + <property name="name">m_dataViewListCtrlDrvCcn</property> + <property name="permission">protected</property> + <property name="pos"></property> + <property name="size">100,-1</property> + <property name="style"></property> + <property name="subclass">; ; forward_declare</property> + <property name="tooltip"></property> + <property name="window_extra_style"></property> + <property name="window_name"></property> + <property name="window_style"></property> + <event name="OnDataViewListCtrlItemActivated">OnDrvCcnDClicked</event> + <event name="OnDataViewListCtrlSelectionChanged">OnDrvCcnSelected</event> + <object class="dataViewListColumn" expanded="0"> + <property name="align">wxALIGN_CENTER</property> + <property name="ellipsize"></property> + <property name="flags">wxDATAVIEW_COL_RESIZABLE</property> + <property name="label">合議対</property> + <property name="mode">wxDATAVIEW_CELL_INERT</property> + <property name="name">m_dataViewListColumnDrvCcn</property> + <property name="permission">protected</property> + <property name="type">Text</property> + <property name="width">-1</property> + </object> + </object> + </object> + <object class="sizeritem" expanded="0"> + <property name="border">5</property> + <property name="flag">wxALL|wxEXPAND</property> + <property name="proportion">1</property> + <object class="wxDataViewListCtrl" expanded="0"> + <property name="bg"></property> + <property name="context_help"></property> + <property name="context_menu">1</property> + <property name="enabled">1</property> + <property name="fg"></property> + <property name="font"></property> + <property name="hidden">0</property> + <property name="id">wxID_ANY</property> + <property name="maximum_size"></property> + <property name="minimum_size"></property> <property name="name">m_dataViewListCtrlDrv</property> <property name="permission">protected</property> <property name="pos"></property> @@ -4733,7 +4897,7 @@ <property name="wrap">-1</property> </object> </object> - <object class="sizeritem" expanded="1"> + <object class="sizeritem" expanded="0"> <property name="border">15</property> <property name="flag">wxEXPAND|wxLEFT</property> <property name="proportion">1</property>
--- a/src/kaigo/horori/searcher/include/searcher.h Thu Apr 16 20:59:35 2020 +0900 +++ b/src/kaigo/horori/searcher/include/searcher.h Sat Apr 18 21:10:29 2020 +0900 @@ -1,5 +1,5 @@ // Filename : searcher.h -// Last Change: 2020-04-16 木 16:10:37. +// Last Change: 2020-04-17 金 16:09:33. // #pragma once @@ -34,6 +34,8 @@ #include <wx/scrolwin.h> #include <wx/gbsizer.h> +class SearchFrame; + class MyStaticBitmap : public wxStaticBitmap { private: @@ -41,6 +43,8 @@ int cx, cy; // for mouse-gesture //bool with_stl = false; wxScrolledWindow* m_parent; + wxNotebook* m_parent1; + SearchFrame* m_parent2; public: int zoom = 0; @@ -57,10 +61,9 @@ void OnEndRGesture(wxMouseEvent& event); void OnMotion(wxMouseEvent& event); void OnWheel(wxMouseEvent& event); - /* - void ChangeBook( int i ); - void WithSatellite( bool sw ) { with_stl = sw; }; - */ + + void ChangeBook(int i); + void SetParentWidows(SearchFrame *sf, wxNotebook *nb) {m_parent2 = sf; m_parent1 = nb;}; void ParentWinGetSize(int *ww, int *wh) {m_parent->GetSize(ww, wh);}; void ParentWinScroll(int x, int y) {m_parent->Scroll(x, y);}; void ParentWinSetScrollbars(int x, int y, int s, int t) {m_parent->SetScrollbars(x, y, s, t);}; @@ -109,22 +112,27 @@ wxStaticText* m_staticTextDrive; wxStaticText* m_staticTextYear; wxStaticText* m_staticTextDate; + wxStaticText* m_staticTextCcn; wxStaticText* m_staticTextData; - wxStaticText* m_staticTextDB; + wxStaticText* m_staticTextDB; wxChoice* m_choiceIdxYear; wxDataViewListCtrl* m_dataViewListCtrlIdxDate; wxDataViewColumn* m_dataViewListColumnIdxDateNo; wxDataViewColumn* m_dataViewListColumnIdxDate; + wxStaticText* m_staticTextIdxCcn; wxDataViewListCtrl* m_dataViewListCtrlIdx; wxDataViewColumn* m_dataViewListColumnIdxNo; wxDataViewColumn* m_dataViewListColumnIdxHno; wxDataViewColumn* m_dataViewListColumnIdxName; - + // - + wxChoice* m_choiceDrv; wxChoice* m_choiceDrvYear; wxDataViewListCtrl* m_dataViewListCtrlDrvDate; wxDataViewColumn* m_dataViewListColumnDrvDateNo; wxDataViewColumn* m_dataViewListColumnDrvDate; + wxDataViewListCtrl* m_dataViewListCtrlDrvCcn; + wxDataViewColumn* m_dataViewListColumnDrvCcn; wxDataViewListCtrl* m_dataViewListCtrlDrv; wxDataViewColumn* m_dataViewListColumnDrvNo; wxDataViewColumn* m_dataViewListColumnDrvHno; @@ -161,17 +169,21 @@ // Virtual event handlers, overide them in your derived class virtual void OnChar(wxKeyEvent& event); + virtual void OnPageChanged(wxNotebookEvent& event); virtual void OnFile(wxFileDirPickerEvent& event); virtual void OnRead(wxCommandEvent& event); virtual void OnHist(wxCommandEvent& event); - virtual void OnSelectBatchListItem(wxDataViewEvent& event); + virtual void OnSelectBatchListCtrlA(wxKeyEvent& event); + virtual void OnSelectBatchDClick(wxDataViewEvent& event); virtual void OnSelectListAnyItem(wxDataViewEvent& event); virtual void OnPrint(wxCommandEvent& event); virtual void OnIdxYearChoice(wxCommandEvent& event); virtual void OnIdxDateSelected(wxDataViewEvent& event); virtual void OnDrvYearChoice(wxCommandEvent& event); + virtual void OnDrvDateSelected(wxDataViewEvent& event); virtual void OnDrvDateDClicked(wxDataViewEvent& event); - virtual void OnDrvDateSelected(wxDataViewEvent& event); + virtual void OnDrvCcnSelected(wxDataViewEvent& event); + virtual void OnDrvCcnDClicked(wxDataViewEvent& event); virtual void OnDrvDClicked(wxDataViewEvent& event); virtual void OnUploadHhsDB(wxCommandEvent& event); virtual void OnUploadImage(wxCommandEvent& event);
--- a/src/kaigo/horori/searcher/server/searcher.go Thu Apr 16 20:59:35 2020 +0900 +++ b/src/kaigo/horori/searcher/server/searcher.go Sat Apr 18 21:10:29 2020 +0900 @@ -1,5 +1,5 @@ /* - Last Change: 2020-04-16 木 17:15:49. + Last Change: 2020-04-17 金 17:04:25. */ package main @@ -84,12 +84,14 @@ } // Http-Handler - http.HandleFunc("/h/", hhs_handler) - http.HandleFunc("/ha/", hhsdb_handler) - http.HandleFunc("/u/", uphhsdb_handler) - http.HandleFunc("/i/", image_handler) - http.HandleFunc("/r/", recent_handler) - http.HandleFunc("/d/", index_handler) + http.HandleFunc("/h/", hhs_handler) // Get /h/0800012345 -> name:addr:20200101#20210701#... + http.HandleFunc("/hn/", hhsnm_handler) // Get /h/0800012345:0800098765:... -> name1:name2:... + http.HandleFunc("/ht/", hhstm_handler) // Get /ht -> 20200314 + http.HandleFunc("/ha/", hhsdb_handler) // Get /ha/ -> hhsdb.csv for Mover + http.HandleFunc("/i/", image_handler) // Get /i/20200110/0800012345.tgz + http.HandleFunc("/r/", recent_handler) // Get /r/0800012345:0800067890:0800099999:... -> 0800012345,name1,20200101:0800067890,name2,20210405:... + http.HandleFunc("/d/", index_handler) // Get /d/20xx -> 20xx0401:2020xx0408:... , /d/20xx0401 -> 0800012345:0800098765:... + http.HandleFunc("/u/", uphhsdb_handler) // Get /u/ -> ? log.Fatal(http.ListenAndServe(server, nil)) } @@ -152,7 +154,7 @@ return nil } -/* Get /h/0800012345 -> name:addr:ymd1#ymd2#... */ +/* Get /h/0800012345 -> name:addr:20200101#20210701#... */ func hhs_handler(w http.ResponseWriter, r *http.Request) { hno := r.URL.Path[len("/h/"):] s := "" @@ -162,6 +164,26 @@ w.Write([]byte(s)) } +/* Get /hn/0800012345:0800098765:... -> name1:name2:... */ +func hhsnm_handler(w http.ResponseWriter, r *http.Request) { + hnolist := strings.Split(r.URL.Path[len("/hn/"):], ":") + var buf []string + for _, hno := range hnolist { + var n string + if h, ok := hhash[hno]; ok { + n = h.Name + } + buf = append(buf, n) + } + w.Write([]byte(strings.Join(buf, ":"))) +} + +/* Get /ht > 20200314 */ +func hhstm_handler(w http.ResponseWriter, r *http.Request) { + date := "" + w.Write([]byte(date)) +} + /* Get /ha/ -> hhsdb.csv for Mover */ func hhsdb_handler(w http.ResponseWriter, r *http.Request) { b, _ := ioutil.ReadFile(hhsdb) @@ -187,7 +209,7 @@ io.Copy(w, f) } -/* Get /r/0800012345:0800067890:0800099999:... */ +/* Get /r/0800012345:0800067890:0800099999:... -> 0800012345,name1,20200101:0800067890,name2,20210405:... */ func recent_handler(w http.ResponseWriter, r *http.Request) { hnolist := strings.Split(r.URL.Path[len("/r/"):], ":") var buf []string @@ -217,6 +239,7 @@ w.Write([]byte(buf[1:])) } +/* /u */ func uphhsdb_handler(w http.ResponseWriter, r *http.Request) { server_root := filepath.Dir(os.Args[0]) file := filepath.Join(server_root, "db", hhsdb)
--- a/src/kaigo/horori/searcher/src/searcher.cpp Thu Apr 16 20:59:35 2020 +0900 +++ b/src/kaigo/horori/searcher/src/searcher.cpp Sat Apr 18 21:10:29 2020 +0900 @@ -1,7 +1,8 @@ // Filename : searcher.cpp -// Last Change: 2020-04-16 木 17:26:54. +// Last Change: 2020-04-17 金 16:22:32. // #include <wx/msgdlg.h> +#include <wx/dir.h> #include <wx/fileconf.h> #include <wx/html/htmprint.h> @@ -9,32 +10,34 @@ #include "utils.h" #include "net.h" -/* MyStaticBitmap */ +/** MyStaticBitmap **/ MyStaticBitmap::MyStaticBitmap(wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name) : wxStaticBitmap(parent, id, label, pos, size, style, name) { m_parent = parent; - 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_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); + Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(MyStaticBitmap::OnEndRGesture ), NULL, this); } MyStaticBitmap::~MyStaticBitmap() { - 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_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); + Disconnect(wxEVT_RIGHT_UP, wxMouseEventHandler(MyStaticBitmap::OnEndRGesture ), NULL, this); } + +/* Event Handlers */ void MyStaticBitmap::OnWheel(wxMouseEvent& event) { /* @@ -119,49 +122,61 @@ // to right if (rad < pi / 8 && dx > 0) { - //ChangeBook(1); + ChangeBook(1); } // to left else if (rad > pi / 8 * 7 && rad < pi && dx < 0) { - //ChangeBook(-1); + ChangeBook(-1); } // to up-right else if (rad > pi / 8 && rad < pi / 8 * 3 && dx > 0) { - /* - MainFrame* mf = (MainFrame*)FindWindowById(ID_MAIN); - mf->Close(); - */ + m_parent2->Close(); } // down else if (rad > pi / 8 * 3 && rad < pi / 8 * 5 && dy > 0) { - /* - MainFrame* mf = (MainFrame*)FindWindowById(ID_MAIN); - mf->PrintImages(); - */ + //mf->PrintImages(); } } +/* Functions */ +void MyStaticBitmap::ChangeBook(int i) +{ + int n = m_parent1->GetSelection(); + if (i < 0) { + if (n > 1) m_parent1->SetSelection(n - 1); + } else { + if (n < 6) m_parent1->SetSelection(n + 1); + } +} -/* SearcherFrame */ +/** SearcherFrame **/ SearchFrame::SearchFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style) { CreateControls(); InitializeControlsValue(); // Connect Events + m_searchCtrl->Connect(wxEVT_CHAR, wxKeyEventHandler(SearchFrame::OnChar), NULL, this); + + m_notebook->Connect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler(SearchFrame::OnPageChanged), NULL, this); + m_filePicker->Connect(wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler(SearchFrame::OnFile), NULL, this); m_buttonRead->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SearchFrame::OnRead), NULL, this); - m_searchCtrl->Connect(wxEVT_CHAR, wxKeyEventHandler(SearchFrame::OnChar), NULL, this); - m_dataViewListCtrlBatch->Connect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnSelectBatchListItem), NULL, this); + m_dataViewListCtrlBatch->Connect(wxEVT_CHAR, wxKeyEventHandler(SearchFrame::OnSelectBatchListCtrlA), NULL, this); + m_dataViewListCtrlBatch->Connect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(SearchFrame::OnSelectBatchDClick), NULL, this); + m_buttonHist->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SearchFrame::OnHist), NULL, this); m_dataViewListCtrlAny->Connect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnSelectListAnyItem), NULL, this); m_buttonPrint->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SearchFrame::OnPrint), NULL, this); m_choiceIdxYear->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(SearchFrame::OnIdxYearChoice), NULL, this); m_dataViewListCtrlIdxDate->Connect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnIdxDateSelected), NULL, this); + m_choiceDrvYear->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(SearchFrame::OnDrvYearChoice), NULL, this); m_dataViewListCtrlDrvDate->Connect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(SearchFrame::OnDrvDateDClicked), NULL, this); m_dataViewListCtrlDrvDate->Connect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnDrvDateSelected), NULL, this); + m_dataViewListCtrlDrvCcn->Connect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(SearchFrame::OnDrvCcnDClicked), NULL, this); + m_dataViewListCtrlDrvCcn->Connect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnDrvCcnSelected), NULL, this); m_dataViewListCtrlDrv->Connect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(SearchFrame::OnDrvDClicked), NULL, this); m_buttonRegHhs->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SearchFrame::OnUploadHhsDB), NULL, this); @@ -173,19 +188,27 @@ SearchFrame::~SearchFrame() { // Disconnect Events + m_searchCtrl->Disconnect(wxEVT_CHAR, wxKeyEventHandler(SearchFrame::OnChar), NULL, this); + + m_notebook->Disconnect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler(SearchFrame::OnPageChanged), NULL, this); + m_buttonRead->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SearchFrame::OnRead), NULL, this); m_filePicker->Disconnect(wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler(SearchFrame::OnFile), NULL, this); - m_searchCtrl->Disconnect(wxEVT_CHAR, wxKeyEventHandler(SearchFrame::OnChar), NULL, this); m_buttonHist->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SearchFrame::OnHist), NULL, this); - m_dataViewListCtrlBatch->Disconnect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnSelectBatchListItem), NULL, this); + + m_dataViewListCtrlBatch->Disconnect(wxEVT_CHAR, wxKeyEventHandler(SearchFrame::OnSelectBatchListCtrlA), NULL, this); + m_dataViewListCtrlBatch->Disconnect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(SearchFrame::OnSelectBatchDClick), NULL, this); m_dataViewListCtrlAny->Disconnect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnSelectListAnyItem), NULL, this); m_buttonPrint->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SearchFrame::OnPrint), NULL, this); m_choiceIdxYear->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(SearchFrame::OnIdxYearChoice), NULL, this); m_dataViewListCtrlIdxDate->Disconnect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnIdxDateSelected), NULL, this); + m_choiceDrvYear->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(SearchFrame::OnDrvYearChoice), NULL, this); m_dataViewListCtrlDrvDate->Disconnect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(SearchFrame::OnDrvDateDClicked), NULL, this); m_dataViewListCtrlDrvDate->Disconnect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnDrvDateSelected), NULL, this); + m_dataViewListCtrlDrvCcn->Disconnect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(SearchFrame::OnDrvCcnDClicked), NULL, this); + m_dataViewListCtrlDrvCcn->Disconnect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(SearchFrame::OnDrvCcnSelected), NULL, this); m_dataViewListCtrlDrv->Disconnect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(SearchFrame::OnDrvDClicked), NULL, this); m_buttonRegHhs->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SearchFrame::OnUploadHhsDB), NULL, this); @@ -197,7 +220,9 @@ /* Event-Handlers */ void SearchFrame::OnChar(wxKeyEvent& event) { + int mod = event.GetModifiers(); int keycode = event.GetKeyCode(); + //wxMessageBox(wxString::Format(wxT("%d-%d"), mod, keycode)); if (keycode == 13) { // Enter m_dataViewListCtrlAny->DeleteAllItems(); @@ -245,11 +270,28 @@ } return; } + event.Skip(); } +void SearchFrame::OnPageChanged(wxNotebookEvent& event) +{ + wxString pw = m_textCtrlPasswd->GetValue(); + + if (pw.IsEmpty()) { + int n = event.GetSelection(); + if (n != 5 && n != 6) return; + + int m = event.GetOldSelection(); + m_notebook->ChangeSelection(m); + } +} + void SearchFrame::OnIdxYearChoice(wxCommandEvent& WXUNUSED(evnet)) { + m_dataViewListCtrlIdxDate->DeleteAllItems(); + m_dataViewListCtrlIdx->DeleteAllItems(); + int n = m_choiceIdxYear->GetSelection(); wxString url = wxT("/d/") + m_choiceIdxYear->GetString(n); wxString buf = HttpGetText(m_addr, m_port, url); @@ -258,7 +300,8 @@ wxVector<wxVariant> data; for (int i = 0; i < ymd.GetCount(); i++) { data.push_back(wxVariant(wxString::Format(wxT("%02d"), i + 1))); - data.push_back(wxVariant(ymd[i])); + wxString buf = ymd[i].Left(4) + wxT("-") + ymd[i].Mid(4,2) + wxT("-") + ymd[i].Right(2); + data.push_back(wxVariant(buf)); m_dataViewListCtrlIdxDate->AppendItem(data); data.clear(); } @@ -266,27 +309,161 @@ void SearchFrame::OnIdxDateSelected(wxDataViewEvent& WXUNUSED(evnet)) { - wxMessageBox("2"); + m_dataViewListCtrlIdx->DeleteAllItems(); + + int r = m_dataViewListCtrlIdxDate->GetSelectedRow(); + wxString date = m_dataViewListCtrlIdxDate->GetTextValue(r, 1); + date.Replace(wxT("-"), wxEmptyString, true); + + wxString url = wxT("/d/") + date; + wxString buf = HttpGetText(m_addr, m_port, url); + wxArrayString hhs = wxSplit(buf, ':', '\\'); + + url = wxT("/hn/") + buf; + buf = HttpGetText(m_addr, m_port, url); + wxArrayString name = wxSplit(buf, ':', '\\'); + + wxVector<wxVariant> data; + for (int i = 0; i < hhs.GetCount(); i++) { + data.push_back(wxVariant(wxString::Format(wxT("%02d"), i + 1))); + data.push_back(wxVariant(hhs[i])); + data.push_back(wxVariant(name[i])); + m_dataViewListCtrlIdx->AppendItem(data); + data.clear(); + } } void SearchFrame::OnDrvYearChoice(wxCommandEvent& WXUNUSED(evnet)) { - wxMessageBox("3"); + m_dataViewListCtrlDrvDate->DeleteAllItems(); + m_dataViewListCtrlDrvCcn->DeleteAllItems(); + m_dataViewListCtrlDrv->DeleteAllItems(); + + int n = m_choiceDrvYear->GetSelection(); + if (n == 0) return; + + wxString year = wxFILE_SEP_PATH + m_choiceDrvYear->GetString(n); + wxDir dir(year); + if (!dir.IsOpened()) return; + + wxString dirname; + bool cont = dir.GetFirst(&dirname, wxEmptyString, wxDIR_DIRS); + + wxVector<wxVariant> data; + for (int i = 0; cont; i++) { + wxString n = wxString::Format(wxT("%02d"), i + 1); + data.push_back(wxVariant(n)); + data.push_back(wxVariant(dirname)); + + m_dataViewListCtrlDrvDate->AppendItem(data); + data.clear(); + + cont = dir.GetNext(&dirname); + } +} + +void SearchFrame::OnDrvDateSelected(wxDataViewEvent& WXUNUSED(evnet)) +{ + m_dataViewListCtrlDrvCcn->DeleteAllItems(); + m_dataViewListCtrlDrv->DeleteAllItems(); + + int n = m_choiceDrvYear->GetSelection(); + int r = m_dataViewListCtrlDrvDate->GetSelectedRow(); + + wxString date = wxFILE_SEP_PATH + m_choiceDrvYear->GetString(n) + wxFILE_SEP_PATH + m_dataViewListCtrlDrvDate->GetTextValue(r, 1); + + wxDir dir(date); + if (!dir.IsOpened()) return; + + wxString dirname; + bool cont = dir.GetFirst(&dirname, wxEmptyString, wxDIR_DIRS); + + wxVector<wxVariant> data; + for (int i = 0; cont; i++) { + data.push_back(wxVariant(dirname)); + m_dataViewListCtrlDrvCcn->AppendItem(data); + data.clear(); + cont = dir.GetNext(&dirname); + } } void SearchFrame::OnDrvDateDClicked(wxDataViewEvent& WXUNUSED(evnet)) { - wxMessageBox("4"); + int n = m_choiceDrvYear->GetSelection(); + int r = m_dataViewListCtrlDrvDate->GetSelectedRow(); + + wxString date = wxFILE_SEP_PATH + m_choiceDrvYear->GetString(n) + wxFILE_SEP_PATH + m_dataViewListCtrlDrvDate->GetTextValue(r, 1); + wxString cmd = wxT("explorer.exe ") + date; + wxExecute(cmd); } -void SearchFrame::OnDrvDateSelected(wxDataViewEvent& WXUNUSED(evnet)) +void SearchFrame::OnDrvCcnSelected(wxDataViewEvent& event) { - wxMessageBox("5"); + m_dataViewListCtrlDrv->DeleteAllItems(); + + int n = m_choiceDrvYear->GetSelection(); + int r1 = m_dataViewListCtrlDrvDate->GetSelectedRow(); + int r2 = m_dataViewListCtrlDrvCcn->GetSelectedRow(); + + wxString ccn = wxFILE_SEP_PATH + m_choiceDrvYear->GetString(n); + ccn += wxFILE_SEP_PATH + m_dataViewListCtrlDrvDate->GetTextValue(r1, 1); + ccn += wxFILE_SEP_PATH + m_dataViewListCtrlDrvCcn->GetTextValue(r2, 0); + + wxDir dir(ccn); + if (!dir.IsOpened()) return; + + wxString dirname; + bool cont = dir.GetFirst(&dirname, wxEmptyString, wxDIR_DIRS); + + wxArrayString hno; + wxVector<wxVariant> data; + for (int i = 0; cont; i++) { + wxString n = wxString::Format(wxT("%02d"), i); + data.push_back(wxVariant(n)); + data.push_back(wxVariant(dirname)); + hno.Add(dirname); + data.push_back(wxVariant(wxEmptyString)); + m_dataViewListCtrlDrv->AppendItem(data); + data.clear(); + cont = dir.GetNext(&dirname); + } + + wxString url = wxT("/hn/") + wxJoin(hno, ':', '\\'); + wxString buf = HttpGetText(m_addr, m_port, url); + wxArrayString name = wxSplit(buf, ':', '\\'); + for (int r = 0; r < name.GetCount(); r++) { + m_dataViewListCtrlDrv->SetTextValue(name[r], r, 2); + } +} + +void SearchFrame::OnDrvCcnDClicked(wxDataViewEvent& event) +{ + int n = m_choiceDrvYear->GetSelection(); + int r1 = m_dataViewListCtrlDrvDate->GetSelectedRow(); + int r2 = m_dataViewListCtrlDrvCcn->GetSelectedRow(); + + wxString ccn = wxFILE_SEP_PATH + m_choiceDrvYear->GetString(n); + ccn += wxFILE_SEP_PATH + m_dataViewListCtrlDrvDate->GetTextValue(r1, 1); + ccn += wxFILE_SEP_PATH + m_dataViewListCtrlDrvCcn->GetTextValue(r2, 0); + + wxString cmd = wxT("explorer.exe ") + ccn; + wxExecute(cmd); } void SearchFrame::OnDrvDClicked(wxDataViewEvent& WXUNUSED(evnet)) { - wxMessageBox("6"); + int n = m_choiceDrvYear->GetSelection(); + int r1 = m_dataViewListCtrlDrvDate->GetSelectedRow(); + int r2 = m_dataViewListCtrlDrvCcn->GetSelectedRow(); + int r3 = m_dataViewListCtrlDrv->GetSelectedRow(); + + wxString hno = wxFILE_SEP_PATH + m_choiceDrvYear->GetString(n); + hno += wxFILE_SEP_PATH + m_dataViewListCtrlDrvDate->GetTextValue(r1, 1); + hno += wxFILE_SEP_PATH + m_dataViewListCtrlDrvCcn->GetTextValue(r2, 0); + hno += wxFILE_SEP_PATH + m_dataViewListCtrlDrv->GetTextValue(r3, 1); + + wxString cmd = wxT("explorer.exe ") + hno; + wxExecute(cmd); } void SearchFrame::OnUploadHhsDB(wxCommandEvent& WXUNUSED(event)) @@ -328,8 +505,33 @@ SetListAny(wxEmptyString); } -void SearchFrame::OnSelectBatchListItem(wxDataViewEvent& WXUNUSED(event)) +void SearchFrame::OnSelectBatchListCtrlA(wxKeyEvent& event) +{ + int mod = event.GetModifiers(); + int keycode = event.GetKeyCode(); + //wxMessageBox(wxString::Format(wxT("%d-%d"), mod, keycode)); + + if (keycode == 1) + m_dataViewListCtrlBatch->SelectAll(); + + event.Skip(); +} + +void SearchFrame::OnSelectBatchDClick(wxDataViewEvent& WXUNUSED(event)) { + int r = m_dataViewListCtrlBatch->GetSelectedRow(); + wxString hno = m_dataViewListCtrlBatch->GetTextValue(r, 1); + m_searchCtrl->SetValue(hno); + + wxString url = wxT("/h/") + hno; + wxString h = HttpGetText(m_addr, m_port, url); // Get /h/0800012345 -> name:addr:ymd1#ymd2#... + + SetHhsInfo(h); + SetImages(); + + m_searchmode = 0; + SetListAny(h); + m_notebook->SetSelection(0); } void SearchFrame::OnSelectListAnyItem(wxDataViewEvent& WXUNUSED(event)) @@ -487,12 +689,12 @@ m_buttonRead = new wxButton(m_panelBatch, wxID_ANY, wxT("読込み"), wxDefaultPosition, wxDefaultSize, 0); gbSizerBatch->Add(m_buttonRead, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL|wxALIGN_CENTER_VERTICAL, 5); - m_dataViewListCtrlBatch = new wxDataViewListCtrl(m_panelBatch, wxID_ANY, wxDefaultPosition, wxSize(800, 600), wxDV_MULTIPLE|wxDV_ROW_LINES); - m_dataViewListColumnBPNo = m_dataViewListCtrlBatch->AppendTextColumn(wxT("No"), wxDATAVIEW_CELL_INERT, 40, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); + m_dataViewListCtrlBatch = new wxDataViewListCtrl(m_panelBatch, wxID_ANY, wxDefaultPosition, wxSize(700, 800), wxDV_MULTIPLE|wxDV_ROW_LINES); + m_dataViewListColumnBPNo = m_dataViewListCtrlBatch->AppendTextColumn(wxT("No"), wxDATAVIEW_CELL_INERT, 40, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE); m_dataViewListColumnBPHno = m_dataViewListCtrlBatch->AppendTextColumn(wxT("被保険者番号"), wxDATAVIEW_CELL_INERT, 100, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListColumnBPName = m_dataViewListCtrlBatch->AppendTextColumn(wxT(" 氏名"), wxDATAVIEW_CELL_INERT, 120, static_cast<wxAlignment>(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE); - m_dataViewListColumnBPDate = m_dataViewListCtrlBatch->AppendTextColumn(wxT("日付"), wxDATAVIEW_CELL_INERT, 90, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); - m_dataViewListColumnOnlyIk = m_dataViewListCtrlBatch->AppendToggleColumn(wxT("意見書のみ"), wxDATAVIEW_CELL_INERT, 80, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); + m_dataViewListColumnBPDate = m_dataViewListCtrlBatch->AppendTextColumn(wxT("日付"), wxDATAVIEW_CELL_INERT, 90, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE); + m_dataViewListColumnOnlyIk = m_dataViewListCtrlBatch->AppendToggleColumn(wxT("意見書のみ"), wxDATAVIEW_CELL_INERT, 80, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE); m_dataViewListColumnProgress = m_dataViewListCtrlBatch->AppendProgressColumn(wxT("状態"), wxDATAVIEW_CELL_INERT, 100, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListColumnDummy = m_dataViewListCtrlBatch->AppendTextColumn(wxEmptyString, wxDATAVIEW_CELL_INERT, 80, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListCtrlBatch->SetAlternateRowColour(wxColour(230, 230, 255)) ; @@ -510,7 +712,7 @@ m_staticTextIndex->SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, true, wxEmptyString)); bSizerMainte->Add(m_staticTextIndex, 0, wxALL, 5); - wxFlexGridSizer* fgSizerIdx = new wxFlexGridSizer(0, 4, 0, 0); + wxFlexGridSizer* fgSizerIdx = new wxFlexGridSizer(0, 5, 0, 0); fgSizerIdx->SetFlexibleDirection(wxBOTH); fgSizerIdx->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); @@ -523,9 +725,13 @@ m_staticTextDate = new wxStaticText(m_panelMainte, wxID_ANY, wxT("日付"), wxDefaultPosition, wxDefaultSize, 0); fgSizerIdx->Add(m_staticTextDate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); + m_staticTextCcn = new wxStaticText(m_panelMainte, wxID_ANY, wxT("審査会"), wxDefaultPosition, wxDefaultSize, 0); + fgSizerIdx->Add(m_staticTextCcn, 0, wxALL, 5); + m_staticTextData = new wxStaticText(m_panelMainte, wxID_ANY, wxT("データ"), wxDefaultPosition, wxDefaultSize, 0); fgSizerIdx->Add(m_staticTextData, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); + // -- m_staticTextDB = new wxStaticText(m_panelMainte, wxID_ANY, wxT("DB"), wxDefaultPosition, wxDefaultSize, 0); fgSizerIdx->Add(m_staticTextDB, 0, wxALL, 5); @@ -535,24 +741,28 @@ m_choiceIdxYear->SetSelection(0); fgSizerIdx->Add(m_choiceIdxYear, 0, wxALL, 5); - m_dataViewListCtrlIdxDate = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(130, 280), wxDV_HORIZ_RULES); + m_dataViewListCtrlIdxDate = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(130, 330), wxDV_SINGLE|wxDV_ROW_LINES); m_dataViewListColumnIdxDateNo = m_dataViewListCtrlIdxDate->AppendTextColumn(wxT("No"), wxDATAVIEW_CELL_INERT, 40, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListColumnIdxDate = m_dataViewListCtrlIdxDate->AppendTextColumn(wxT("日付"), wxDATAVIEW_CELL_INERT, 80, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListCtrlIdxDate->SetAlternateRowColour(wxColour(230, 230, 255)) ; fgSizerIdx->Add(m_dataViewListCtrlIdxDate, 1, wxALL|wxEXPAND, 5); - m_dataViewListCtrlIdx = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(280, -1), wxDV_HORIZ_RULES); + m_staticTextIdxCcn = new wxStaticText(m_panelMainte, wxID_ANY, wxT("---"), wxDefaultPosition, wxDefaultSize, 0); + fgSizerIdx->Add(m_staticTextIdxCcn, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); + + m_dataViewListCtrlIdx = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(300, -1), wxDV_SINGLE|wxDV_ROW_LINES); m_dataViewListColumnIdxNo = m_dataViewListCtrlIdx->AppendTextColumn(wxT("No"), wxDATAVIEW_CELL_INERT, 40, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListColumnIdxHno = m_dataViewListCtrlIdx->AppendTextColumn(wxT("被保険者番号"), wxDATAVIEW_CELL_INERT, 100, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListColumnIdxName = m_dataViewListCtrlIdx->AppendTextColumn(wxT(" 氏名"), wxDATAVIEW_CELL_INERT, 120, static_cast<wxAlignment>(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE); m_dataViewListCtrlIdx->SetAlternateRowColour(wxColour(230, 230, 255)) ; fgSizerIdx->Add(m_dataViewListCtrlIdx, 1, wxALL|wxEXPAND, 5); + // -- wxString m_choiceDrvChoices[] = {wxT("C"), wxT("Y"), wxT("Z")}; int m_choiceDrvNChoices = sizeof(m_choiceDrvChoices) / sizeof(wxString); - m_choiceDrvYear = new wxChoice(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(50, -1), m_choiceDrvNChoices, m_choiceDrvChoices, 0); - m_choiceDrvYear->SetSelection(0); - fgSizerIdx->Add(m_choiceDrvYear, 0, wxALL, 5); + m_choiceDrv = new wxChoice(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(50, -1), m_choiceDrvNChoices, m_choiceDrvChoices, 0); + m_choiceDrv->SetSelection(0); + fgSizerIdx->Add(m_choiceDrv, 0, wxALL, 5); wxString m_choiceDrvYearChoices[] = {wxEmptyString, wxT("2020"), wxT("2021"), wxT("2022"), wxT("2023"), wxT("2024"), wxT("2026"), wxT("2027"), wxT("2028"), wxT("2029"), wxT("2030"), wxT("2031"), wxT("2032"), wxT("2033"), wxT("2034")}; int m_choiceDrvYearNChoices = sizeof(m_choiceDrvYearChoices) / sizeof(wxString); @@ -560,21 +770,27 @@ m_choiceDrvYear->SetSelection(0); fgSizerIdx->Add(m_choiceDrvYear, 0, wxALL, 5); - m_dataViewListCtrlDrvDate = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(130,280), wxDV_HORIZ_RULES); + m_dataViewListCtrlDrvDate = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(130, 330), wxDV_SINGLE|wxDV_ROW_LINES); m_dataViewListColumnDrvDateNo = m_dataViewListCtrlDrvDate->AppendTextColumn(wxT("No"), wxDATAVIEW_CELL_INERT, 40, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListColumnDrvDate = m_dataViewListCtrlDrvDate->AppendTextColumn(wxT("日付"), wxDATAVIEW_CELL_INERT, 80, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListCtrlDrvDate->SetAlternateRowColour(wxColour(230, 230, 255)) ; - fgSizerIdx->Add(m_dataViewListCtrlDrvDate, 0, wxALL, 5); + fgSizerIdx->Add(m_dataViewListCtrlDrvDate, 1, wxALL|wxEXPAND, 5); - m_dataViewListCtrlDrv = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(280, -1), wxDV_HORIZ_RULES); + m_dataViewListCtrlDrvCcn = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(80,-1 ), wxDV_SINGLE|wxDV_ROW_LINES); + m_dataViewListColumnDrvCcn = m_dataViewListCtrlDrvCcn->AppendTextColumn(wxT("合議対"), wxDATAVIEW_CELL_INERT, -1, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); + m_dataViewListCtrlDrvCcn->SetAlternateRowColour(wxColour(230, 230, 255)) ; + fgSizerIdx->Add(m_dataViewListCtrlDrvCcn, 1, wxALL|wxEXPAND, 5); + + m_dataViewListCtrlDrv = new wxDataViewListCtrl(m_panelMainte, wxID_ANY, wxDefaultPosition, wxSize(300, -1), wxDV_SINGLE|wxDV_ROW_LINES); m_dataViewListColumnDrvNo = m_dataViewListCtrlDrv->AppendTextColumn(wxT("No"), wxDATAVIEW_CELL_INERT, 40, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListColumnDrvHno = m_dataViewListCtrlDrv->AppendTextColumn(wxT("被保険者番号"), wxDATAVIEW_CELL_INERT, 100, static_cast<wxAlignment>(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE); m_dataViewListColumnDrvName = m_dataViewListCtrlDrv->AppendTextColumn(wxT(" 氏名"), wxDATAVIEW_CELL_INERT, 120, static_cast<wxAlignment>(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE); m_dataViewListCtrlDrv->SetAlternateRowColour(wxColour(230, 230, 255)) ; - fgSizerIdx->Add(m_dataViewListCtrlDrv, 0, wxALL, 5); + fgSizerIdx->Add(m_dataViewListCtrlDrv, 1, wxALL|wxEXPAND, 5); bSizerMainte->Add(fgSizerIdx, 0, wxLEFT|wxEXPAND, 30); + // ---- m_staticline = new wxStaticLine(m_panelMainte, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL); bSizerMainte->Add(m_staticline, 0, wxEXPAND|wxALL, 5); @@ -702,6 +918,12 @@ 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); + m_staticBitmap1->SetParentWidows(this, m_notebook); + m_staticBitmap2->SetParentWidows(this, m_notebook); + m_staticBitmap3->SetParentWidows(this, m_notebook); + m_staticBitmap4->SetParentWidows(this, m_notebook); + m_staticBitmap5->SetParentWidows(this, m_notebook); + m_searchmode = 0; m_buttonHist->Enable(false); @@ -749,8 +971,7 @@ void SearchFrame::SetImages() { - if (m_dataViewListCtrlAny->GetSelectedRow() == wxNOT_FOUND) - return; + if (m_dataViewListCtrlAny->GetSelectedRow() == wxNOT_FOUND) return; int r = m_dataViewListCtrlAny->GetSelectedRow(); wxString date = m_dataViewListCtrlAny->GetTextValue(r, 1); @@ -768,8 +989,8 @@ mysb.zoom = 0; mysb.ParentWinScroll(0, 0); - if (!wxFileExists(file)) - file = wxT("image/testpattern.tif"); + if (!wxFileExists(file)) file = wxT("image/testpattern.tif"); + wxBitmap bmp(file, wxBITMAP_TYPE_TIFF); int width = bmp.GetWidth(); int height = bmp.GetHeight(); @@ -812,10 +1033,11 @@ if (buf.StartsWith(wxT("0"))) { hhslist.Add(buf.Left(10)); wxArrayString cols = wxSplit(buf, ',', '\\'); - if (cols[2].IsEmpty()) + if (cols[2].IsEmpty()) { iklist.Add(wxEmptyString); - else + } else { iklist.Add(wxT("1")); + } m_hist.Add(buf.Left(10)); } } @@ -831,13 +1053,15 @@ data.push_back(wxVariant(wxString::Format(wxT("%03d"), i + 1))); data.push_back(wxVariant(hinfo[0])); data.push_back(wxVariant(hinfo[1])); - if (hinfo[2] != wxEmptyString) + if (hinfo[2] != wxEmptyString) { hinfo[2] = hinfo[2].Left(4) + wxT("-") + hinfo[2].Mid(4,2) + wxT("-") + hinfo[2].Right(2); + } data.push_back(wxVariant(hinfo[2])); - if (iklist[i].IsEmpty()) + if (iklist[i].IsEmpty()) { data.push_back(wxVariant(false)); - else + } else { data.push_back(wxVariant(true)); + } data.push_back(wxVariant(1)); // status data.push_back(wxVariant(wxEmptyString)); // dummy