comparison src/mngdb.cpp @ 16:b651aa41b9d4 default tip

hhsinfo method (server)
author pyon@macmini
date Mon, 15 Jul 2019 07:03:05 +0900
parents c1dc1fcee7fe
children
comparison
equal deleted inserted replaced
15:c262e17de9b1 16:b651aa41b9d4
1 // Filename : mngdeb.cpp 1 // Filename : mngdeb.cpp
2 // Last Change: 2018-11-21 水 08:36:02. 2 // Last Change: 2019-07-15 Mon 06:58:48.
3 // 3 //
4 4
5 #include <wx/datetime.h> 5 #include <wx/datetime.h>
6 #include <wx/textfile.h> 6 #include <wx/textfile.h>
7 #include "id.h" 7 #include "id.h"
9 #include "index.h" 9 #include "index.h"
10 10
11 ManageDBFrame::ManageDBFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) 11 ManageDBFrame::ManageDBFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style )
12 : wxFrame( parent, id, title, pos, size, style ) 12 : wxFrame( parent, id, title, pos, size, style )
13 { 13 {
14 this->SetBackgroundColour( wxColour( 140, 240, 140 ) ); 14 CreateControls();
15 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
16
17 wxBoxSizer* bSizerTop = new wxBoxSizer( wxVERTICAL );
18
19 wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
20 fgSizer->SetFlexibleDirection( wxBOTH );
21 fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
22
23 m_staticTextDate = new wxStaticText( this, wxID_ANY, wxT( "Date" ), wxDefaultPosition, wxDefaultSize, 0 );
24 fgSizer->Add( m_staticTextDate, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
25
26 m_datePicker = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize( 180, -1 ), wxDP_DROPDOWN|wxDP_SHOWCENTURY );
27 fgSizer->Add( m_datePicker, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
28
29 m_staticTextHhs = new wxStaticText( this, wxID_ANY, wxT( "HHS" ), wxDefaultPosition, wxDefaultSize, 0 );
30 fgSizer->Add( m_staticTextHhs, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
31
32 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 );
33 fgSizer->Add( m_filePickerHhs, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
34
35 m_staticTextCcn = new wxStaticText( this, wxID_ANY, wxT( "CCN" ), wxDefaultPosition, wxDefaultSize, 0 );
36 fgSizer->Add( m_staticTextCcn, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
37
38 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 );
39 fgSizer->Add( m_filePickerCcn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
40
41 bSizerTop->Add( fgSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
42
43 //---
44 m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
45 bSizerTop->Add( m_staticline, 0, wxEXPAND|wxALL, 5 );
46
47 wxBoxSizer* bSizerBtn = new wxBoxSizer( wxHORIZONTAL );
48
49 m_buttonBuild = new wxButton( this, ID_MNGBLD, wxT( "Build" ), wxDefaultPosition, wxDefaultSize, 0 );
50 bSizerBtn->Add( m_buttonBuild, 0, wxALL, 5 );
51
52 m_buttonUpld = new wxButton( this, ID_MNGUPLD, wxT( "Upload" ), wxDefaultPosition, wxDefaultSize, 0 );
53 bSizerBtn->Add( m_buttonUpld, 0, wxALL, 5 );
54
55 m_buttonIdx = new wxButton( this, ID_MNGIDX, wxT( "Index" ), wxDefaultPosition, wxDefaultSize, 0 );
56 bSizerBtn->Add( m_buttonIdx, 0, wxALL, 5 );
57
58 m_buttonExit = new wxButton( this, ID_MNGEXIT, wxT( "Exit" ), wxDefaultPosition, wxDefaultSize, 0 );
59 bSizerBtn->Add( m_buttonExit, 0, wxALL, 5 );
60
61 bSizerTop->Add( bSizerBtn, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
62
63 this->SetSizer( bSizerTop );
64 this->Layout();
65
66 this->Centre( wxBOTH );
67 m_buttonUpld->Enable( false );
68 } 15 }
69 16
70 ManageDBFrame::~ManageDBFrame() 17 ManageDBFrame::~ManageDBFrame()
71 { 18 {
72 } 19 }
161 m_datePicker->SetValue( dt ); 108 m_datePicker->SetValue( dt );
162 m_filePickerHhs->SetPath( dir + wxFILE_SEP_PATH + wxT( "hhs.db") ); 109 m_filePickerHhs->SetPath( dir + wxFILE_SEP_PATH + wxT( "hhs.db") );
163 m_filePickerCcn->SetPath( dir + wxFILE_SEP_PATH + wxT( "ccn.db") ); 110 m_filePickerCcn->SetPath( dir + wxFILE_SEP_PATH + wxT( "ccn.db") );
164 } 111 }
165 112
113 void ManageDBFrame::CreateControls()
114 {
115 this->SetBackgroundColour( wxColour( 140, 240, 140 ) );
116 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
117
118 wxBoxSizer* bSizerTop = new wxBoxSizer( wxVERTICAL );
119
120 wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
121 fgSizer->SetFlexibleDirection( wxBOTH );
122 fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
123
124 m_staticTextDate = new wxStaticText( this, wxID_ANY, wxT( "Date" ), wxDefaultPosition, wxDefaultSize, 0 );
125 fgSizer->Add( m_staticTextDate, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
126
127 m_datePicker = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize( 180, -1 ), wxDP_DROPDOWN|wxDP_SHOWCENTURY );
128 fgSizer->Add( m_datePicker, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
129
130 m_staticTextHhs = new wxStaticText( this, wxID_ANY, wxT( "HHS" ), wxDefaultPosition, wxDefaultSize, 0 );
131 fgSizer->Add( m_staticTextHhs, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
132
133 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 );
134 fgSizer->Add( m_filePickerHhs, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
135
136 m_staticTextCcn = new wxStaticText( this, wxID_ANY, wxT( "CCN" ), wxDefaultPosition, wxDefaultSize, 0 );
137 fgSizer->Add( m_staticTextCcn, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
138
139 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 );
140 fgSizer->Add( m_filePickerCcn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
141
142 bSizerTop->Add( fgSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
143
144 //---
145 m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
146 bSizerTop->Add( m_staticline, 0, wxEXPAND|wxALL, 5 );
147
148 wxBoxSizer* bSizerBtn = new wxBoxSizer( wxHORIZONTAL );
149
150 m_buttonBuild = new wxButton( this, ID_MNGBLD, wxT( "Build" ), wxDefaultPosition, wxDefaultSize, 0 );
151 bSizerBtn->Add( m_buttonBuild, 0, wxALL, 5 );
152
153 m_buttonUpld = new wxButton( this, ID_MNGUPLD, wxT( "Upload" ), wxDefaultPosition, wxDefaultSize, 0 );
154 bSizerBtn->Add( m_buttonUpld, 0, wxALL, 5 );
155 m_buttonUpld->Enable( false );
156
157 m_buttonIdx = new wxButton( this, ID_MNGIDX, wxT( "Index" ), wxDefaultPosition, wxDefaultSize, 0 );
158 bSizerBtn->Add( m_buttonIdx, 0, wxALL, 5 );
159
160 m_buttonExit = new wxButton( this, ID_MNGEXIT, wxT( "Exit" ), wxDefaultPosition, wxDefaultSize, 0 );
161 bSizerBtn->Add( m_buttonExit, 0, wxALL, 5 );
162
163 bSizerTop->Add( bSizerBtn, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
164
165 this->SetSizer( bSizerTop );
166 this->Layout();
167
168 this->Centre( wxBOTH );
169 }
170