Mercurial > mercurial > hgweb_rsearcher.cgi
comparison src/rsearcher.cpp @ 14:c1dc1fcee7fe
print zoom.
| author | pyon@macmini |
|---|---|
| date | Sun, 09 Dec 2018 14:38:15 +0900 |
| parents | f5ffc34f045a |
| children | c262e17de9b1 |
comparison
equal
deleted
inserted
replaced
| 13:f5ffc34f045a | 14:c1dc1fcee7fe |
|---|---|
| 1 // Filename : rsearcher.cpp | 1 // Filename : rsearcher.cpp |
| 2 // Last Change: 2018-11-14 水 14:06:25. | 2 // Last Change: 2018-12-04 火 16:00:36. |
| 3 // | 3 // |
| 4 | 4 |
| 5 #include <wx/arrstr.h> | 5 #include <wx/arrstr.h> |
| 6 #include <wx/html/htmprint.h> | 6 #include <wx/html/htmprint.h> |
| 7 #include <wx/clipbrd.h> | 7 #include <wx/clipbrd.h> |
| 546 | 546 |
| 547 m_textCtrlAddr = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 160, -1 ), wxTE_READONLY ); | 547 m_textCtrlAddr = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 160, -1 ), wxTE_READONLY ); |
| 548 m_textCtrlAddr->SetBackgroundColour( wxColour( 180, 210, 240 ) ); | 548 m_textCtrlAddr->SetBackgroundColour( wxColour( 180, 210, 240 ) ); |
| 549 bSizerRight->Add( m_textCtrlAddr, 0, wxALL|wxEXPAND, 5 ); | 549 bSizerRight->Add( m_textCtrlAddr, 0, wxALL|wxEXPAND, 5 ); |
| 550 | 550 |
| 551 m_checkListBox = new wxCheckListBox( m_panelRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); | |
| 552 m_checkListBox->Append( wxT( "1: Marksheet" ) ); | |
| 553 m_checkListBox->Append( wxT( "2: Marksheet ( R )" ) ); | |
| 554 m_checkListBox->Append( wxT( "3: Special Mention" ) ); | |
| 555 m_checkListBox->Append( wxT( "4: Opinion" ) ); | |
| 556 m_checkListBox->Append( wxT( "5: Opinion ( R )" ) ); | |
| 557 bSizerRight->Add( m_checkListBox, 0, wxALL|wxEXPAND, 5 ); | |
| 558 | |
| 551 m_dataViewListCtrl = new wxDataViewListCtrl( m_panelRight, ID_LIST, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE ); | 559 m_dataViewListCtrl = new wxDataViewListCtrl( m_panelRight, ID_LIST, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE ); |
| 552 m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ), wxDATAVIEW_CELL_INERT, 30, wxALIGN_RIGHT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | 560 m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ), wxDATAVIEW_CELL_INERT, 30, wxALIGN_RIGHT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); |
| 553 m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( " Date" ), wxDATAVIEW_CELL_INERT, 80, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | 561 m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( " Date" ), wxDATAVIEW_CELL_INERT, 80, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); |
| 554 m_dataViewListColumnReady = m_dataViewListCtrl->AppendTextColumn( wxT( "Ready" ), wxDATAVIEW_CELL_INERT, 60, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | 562 m_dataViewListColumnReady = m_dataViewListCtrl->AppendTextColumn( wxT( "Ready" ), wxDATAVIEW_CELL_INERT, 60, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); |
| 555 bSizerRight->Add( m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5 ); | 563 bSizerRight->Add( m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5 ); |
| 561 bSizerRight->Add( m_dataViewListKana, 1, wxALL|wxEXPAND, 5 ); | 569 bSizerRight->Add( m_dataViewListKana, 1, wxALL|wxEXPAND, 5 ); |
| 562 | 570 |
| 563 m_textCtrlLog = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 40 ), 0 ); | 571 m_textCtrlLog = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 40 ), 0 ); |
| 564 bSizerRight->Add( m_textCtrlLog, 0, wxALL|wxEXPAND, 5 ); | 572 bSizerRight->Add( m_textCtrlLog, 0, wxALL|wxEXPAND, 5 ); |
| 565 | 573 |
| 574 wxFlexGridSizer* fgSizerButton = new wxFlexGridSizer( 0, 2, 0, 0 ); | |
| 575 fgSizerButton->SetFlexibleDirection( wxBOTH ); | |
| 576 fgSizerButton->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); | |
| 577 | |
| 566 m_buttonPsearch = new wxButton( m_panelRight, ID_PSEARCH, wxT( "Paste-Search" ), wxDefaultPosition, wxDefaultSize, 0 ); | 578 m_buttonPsearch = new wxButton( m_panelRight, ID_PSEARCH, wxT( "Paste-Search" ), wxDefaultPosition, wxDefaultSize, 0 ); |
| 567 bSizerRight->Add( m_buttonPsearch, 0, wxALL, 5 ); | 579 fgSizerButton->Add( m_buttonPsearch, 0, wxALL, 5 ); |
| 568 | 580 |
| 581 fgSizerButton->Add( 0, 0, 1, wxEXPAND, 5 ); | |
| 582 | |
| 569 m_buttonPrint = new wxButton( m_panelRight, wxID_PRINT, wxT( "Print" ), wxDefaultPosition, wxDefaultSize, 0 ); | 583 m_buttonPrint = new wxButton( m_panelRight, wxID_PRINT, wxT( "Print" ), wxDefaultPosition, wxDefaultSize, 0 ); |
| 570 bSizerRight->Add( m_buttonPrint, 0, wxALL, 5 ); | 584 fgSizerButton->Add( m_buttonPrint, 0, wxALL, 5 ); |
| 571 | 585 |
| 572 // now building... | 586 m_spinCtrl = new wxSpinCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 1, 100, 100 ); |
| 587 fgSizerButton->Add( m_spinCtrl, 0, wxALL, 5 ); | |
| 588 | |
| 589 bSizerRight->Add( fgSizerButton, 0, wxEXPAND, 5 ); | |
| 590 | |
| 591 /* now building... */ | |
| 573 m_slider = new wxSlider( m_panelRight, ID_SLDR, 1, 1, 5, wxDefaultPosition, wxSize( -1, 200 ), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LABELS|wxSL_VERTICAL ); | 592 m_slider = new wxSlider( m_panelRight, ID_SLDR, 1, 1, 5, wxDefaultPosition, wxSize( -1, 200 ), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LABELS|wxSL_VERTICAL ); |
| 574 //bSizerRight->Add( m_slider, 0, wxALL, 5 ); | 593 //bSizerRight->Add( m_slider, 0, wxALL, 5 ); |
| 575 | 594 |
| 576 m_buttonLogout = new wxButton( m_panelRight, ID_LOGOUT, wxT( "Logout" ), wxDefaultPosition, wxDefaultSize, 0 ); | 595 m_buttonLogout = new wxButton( m_panelRight, ID_LOGOUT, wxT( "Logout" ), wxDefaultPosition, wxDefaultSize, 0 ); |
| 577 //bSizerRight->Add( m_buttonLogout, 0, wxALL, 5 ); | 596 //bSizerRight->Add( m_buttonLogout, 0, wxALL, 5 ); |
| 603 | 622 |
| 604 this->SetSizer( bSizerTop ); | 623 this->SetSizer( bSizerTop ); |
| 605 this->Layout(); | 624 this->Layout(); |
| 606 | 625 |
| 607 //this->Centre( wxBOTH ); | 626 //this->Centre( wxBOTH ); |
| 627 | |
| 628 SetControlsValue(); | |
| 629 } | |
| 630 | |
| 631 void MainFrame::SetControlsValue( void ) | |
| 632 { | |
| 608 m_staticBitmap1 = new MyStaticBitmap( m_scrolledWindow1, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); | 633 m_staticBitmap1 = new MyStaticBitmap( m_scrolledWindow1, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); |
| 609 m_staticBitmap2 = new MyStaticBitmap( m_scrolledWindow2, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); | 634 m_staticBitmap2 = new MyStaticBitmap( m_scrolledWindow2, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); |
| 610 m_staticBitmap3 = new MyStaticBitmap( m_scrolledWindow3, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); | 635 m_staticBitmap3 = new MyStaticBitmap( m_scrolledWindow3, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); |
| 611 m_staticBitmap4 = new MyStaticBitmap( m_scrolledWindow4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); | 636 m_staticBitmap4 = new MyStaticBitmap( m_scrolledWindow4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); |
| 612 m_staticBitmap5 = new MyStaticBitmap( m_scrolledWindow5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); | 637 m_staticBitmap5 = new MyStaticBitmap( m_scrolledWindow5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); |
| 638 | |
| 639 for ( int i = 0; i < m_checkListBox->GetCount(); i++ ) | |
| 640 m_checkListBox->Check( i, true ); | |
| 613 } | 641 } |
| 614 | 642 |
| 615 void MainFrame::SetAccelerator( void ) | 643 void MainFrame::SetAccelerator( void ) |
| 616 { | 644 { |
| 617 wxAcceleratorEntry entries[11]; | 645 wxAcceleratorEntry entries[11]; |
| 649 if ( cmd.IsSameAs( wxT( "c" ), true ) || cmd.IsSameAs( wxT( "cmd" ), true ) ) { | 677 if ( cmd.IsSameAs( wxT( "c" ), true ) || cmd.IsSameAs( wxT( "cmd" ), true ) ) { |
| 650 return; | 678 return; |
| 651 } | 679 } |
| 652 | 680 |
| 653 if ( cmd.IsSameAs( wxT( "3915" ), true ) && m_user.IsSameAs( wxT( "root" ) ) ) { | 681 if ( cmd.IsSameAs( wxT( "3915" ), true ) && m_user.IsSameAs( wxT( "root" ) ) ) { |
| 654 ManageDBFrame *mngframe = new ManageDBFrame( this, wxID_ANY, wxT( "Management Window" ), wxDefaultPosition, wxSize( 300, 180 ), wxCAPTION|wxTAB_TRAVERSAL ); | 682 ManageDBFrame *mngframe = new ManageDBFrame( this, wxID_ANY, wxT( "Management Window" ), wxDefaultPosition, wxSize( 400, 160 ), wxCAPTION|wxTAB_TRAVERSAL ); |
| 655 mngframe->SetDBdir( m_dbdir ); | 683 mngframe->SetDBdir( m_dbdir ); |
| 656 mngframe->SetServer( m_server ); | 684 mngframe->SetServer( m_server ); |
| 657 mngframe->Show(); | 685 mngframe->Show(); |
| 658 m_searchCtrl->Clear(); | 686 m_searchCtrl->Clear(); |
| 659 return; | 687 return; |
| 843 { | 871 { |
| 844 int estimate = http.GetImagesSize( hhs, date ) / 1000000; | 872 int estimate = http.GetImagesSize( hhs, date ) / 1000000; |
| 845 wxProgressDialog pd( wxT( "Connecting Server" ), wxT( "Start..." ), estimate, NULL, wxPD_APP_MODAL|wxPD_ELAPSED_TIME|wxPD_REMAINING_TIME|wxPD_AUTO_HIDE ); | 873 wxProgressDialog pd( wxT( "Connecting Server" ), wxT( "Start..." ), estimate, NULL, wxPD_APP_MODAL|wxPD_ELAPSED_TIME|wxPD_REMAINING_TIME|wxPD_AUTO_HIDE ); |
| 846 pd.SetSize( wxSize( 320, 140 ) ); | 874 pd.SetSize( wxSize( 320, 140 ) ); |
| 847 | 875 |
| 848 http.GetImages( hhs, date ); | 876 unsigned int flag = 0; |
| 877 if ( m_checkListBox->IsChecked( 0 ) ) flag += 1; | |
| 878 if ( m_checkListBox->IsChecked( 1 ) ) flag += 10; | |
| 879 if ( m_checkListBox->IsChecked( 2 ) ) flag += 100; | |
| 880 if ( m_checkListBox->IsChecked( 3 ) ) flag += 1000; | |
| 881 if ( m_checkListBox->IsChecked( 4 ) ) flag += 10000; | |
| 882 http.GetImages( hhs, date, wxString::Format( wxT( "%d" ), flag ) ); | |
| 849 for ( int i = 0; i < estimate; i++ ) { | 883 for ( int i = 0; i < estimate; i++ ) { |
| 850 wxMilliSleep( 1 ); | 884 wxMilliSleep( 1 ); |
| 851 pd.Update( i, wxT( "Now Loading..." ) ); | 885 pd.Update( i, wxT( "Now Loading..." ) ); |
| 852 } | 886 } |
| 853 } | 887 } |
| 985 date.Replace( wxT( "-" ), wxEmptyString, true ); | 1019 date.Replace( wxT( "-" ), wxEmptyString, true ); |
| 986 | 1020 |
| 987 wxString html, file; | 1021 wxString html, file; |
| 988 html = wxT( "<html><body>\n" ); | 1022 html = wxT( "<html><body>\n" ); |
| 989 | 1023 |
| 1024 int zoom = m_spinCtrl->GetValue(); | |
| 1025 wxString imgsz = wxString::Format( wxT( "\" width=\"%d\" height=\"%d\"" ), 750 * zoom / 100, 1060 * zoom / 100 ); | |
| 990 for ( int i = 1; i < 6; i++ ) { | 1026 for ( int i = 1; i < 6; i++ ) { |
| 991 file = wxString::Format( wxT( ".cache/%08s_%d" ), date, i ); | 1027 file = wxString::Format( wxT( ".cache/%08s_%d" ), date, i ); |
| 992 html = html + wxT( "<img src=\"" ) + file + wxT( "\" width=\"750\" height=\"1060\"/>\n" ); | 1028 html = html + wxT( "<img src=\"" ) + file + imgsz + wxT( "/>\n" ); |
| 993 html = html + wxT( "<div align=right><font size=-2><u>" ) + m_hhs + wxT( "@" ) + m_user + wxT( "#" ) + nowstr + wxT( "</u></font></div>\n\n" ); | 1029 html = html + wxT( "<div align=right><font size=-2><u>" ) + m_hhs + wxT( "@" ) + m_user + wxT( "#" ) + nowstr + wxT( "</u></font></div>\n\n" ); |
| 994 } | 1030 } |
| 995 html = html + wxT( "</body></html>" ); | 1031 html = html + wxT( "</body></html>" ); |
| 996 | 1032 |
| 997 // start printing | 1033 // start printing |
