diff src/rsearcher.cpp @ 14:c1dc1fcee7fe

print zoom.
author pyon@macmini
date Sun, 09 Dec 2018 14:38:15 +0900
parents f5ffc34f045a
children c262e17de9b1
line wrap: on
line diff
--- 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 <wx/arrstr.h> 
@@ -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( "<html><body>\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( "<img src=\"" ) + file + wxT( "\" width=\"750\" height=\"1060\"/>\n" );
+		html = html + wxT( "<img src=\"" ) + file + imgsz + wxT( "/>\n" );
 		html = html + wxT( "<div align=right><font size=-2><u>" ) + m_hhs + wxT( "@" ) + m_user + wxT( "#" ) + nowstr + wxT( "</u></font></div>\n\n" );
 	}
 	html = html + wxT( "</body></html>" );