view include/rsearcher.h @ 2:7fe3417cefc8

GUI.
author pyon@macmini
date Tue, 02 Oct 2018 21:20:05 +0900
parents eaa27e4ed5be
children db4813125eb8
line wrap: on
line source

// Filename   : rsearcher.h
// Last Change: 2018-10-02 Tue 19:36:21.
//

#ifndef __RSEARCH_H__
#define __RSEARCH_H__

#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/string.h>
#include <wx/srchctrl.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/notebook.h>
#include <wx/dataview.h>
#include <wx/slider.h>
#include <wx/sizer.h>
#include <wx/html/htmlwin.h>
#include <wx/frame.h>
#include <wx/statbmp.h>
#include <wx/msgdlg.h> 
#include <wx/filefn.h> 
#include <wx/regex.h>
#include <wx/textfile.h>

class MySearchCtrl : public wxSearchCtrl
{
    DECLARE_EVENT_TABLE()
	public:
		MySearchCtrl( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style );
		~MySearchCtrl();

        void OnKey( wxKeyEvent& event );
};

class MyStaticBitmap : public wxStaticBitmap
{
	private:
        int m_dragx, m_dragy;
        int m_zoom = 0;
        wxBitmap m_bmp[5];
		wxScrolledWindow* m_parent;

	public:
        MyStaticBitmap( wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name );
        ~MyStaticBitmap();

        void OnLeftDown( wxMouseEvent& event );
        void OnLeftUp( wxMouseEvent& event );
        void OnMotion( wxMouseEvent& event );
        void OnWheel( wxMouseEvent& event );
        void SetImage( int i, wxBitmap bmp ) { m_bmp[i] = bmp; };
        void SetZoom( int m_zoom );
};

class MainFrame : public wxFrame 
{
	DECLARE_EVENT_TABLE()
	private:
		bool		  startup = true;
		wxString	  m_server;
		wxString	  m_hhs;
		wxArrayString m_index;
	
	protected:
		enum {
			ID_SEARCH = wxID_HIGHEST + 100,
			ID_LIST,
			ID_NBOOK,
			ID_SLDR,
			ID_PRINT,
            ID_TEST,
		};
		
		MySearchCtrl*		m_searchCtrl;
        MyStaticBitmap*     m_staticBitmap1;
        MyStaticBitmap*     m_staticBitmap2;
        MyStaticBitmap*     m_staticBitmap3;
        MyStaticBitmap*     m_staticBitmap4;
        MyStaticBitmap*     m_staticBitmap5;
        MyStaticBitmap*     m_staticBitmap6;

		wxNotebook*         m_notebook;
		wxScrolledWindow*   m_scrolledWindow1;
		wxScrolledWindow*   m_scrolledWindow2;
		wxScrolledWindow*   m_scrolledWindow3;
		wxScrolledWindow*   m_scrolledWindow4;
		wxScrolledWindow*   m_scrolledWindow5;
		wxScrolledWindow*   m_scrolledWindow6;

		wxTextCtrl* 		m_textCtrlName;
		wxTextCtrl* 		m_textCtrlAddr;
		wxDataViewListCtrl* m_dataViewListCtrl;
		wxDataViewColumn* 	m_dataViewListColumnNo;
		wxDataViewColumn* 	m_dataViewListColumnDate;
		wxTextCtrl* 		m_textCtrlLog;
		wxSlider*           m_slider;
		wxButton*           m_buttonPrint;
		wxButton*           m_buttonTest;
	
	public:
		MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT( "Searcher Remote" ), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
		~MainFrame();
		void SetServer( wxString server ) { m_server = server; };
		void CreateControls( void );
		void Cmd( wxString cmd );
		void Search( void );
		void LoadIndex( void );
        void LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file );
        void LoadBitmaps( wxString date );
        void GetImages( wxString hhs, wxString date );
		void RemoveFile( wxString pattern );
		void SaveConfig( wxCloseEvent& event );
        void InDevelop( bool );

		void OnItemSelected( wxDataViewEvent& event );
		void OnItemDClicked( wxDataViewEvent& event );
        void OnNBookChanged( wxBookCtrlEvent& event );
		//void OnIdle( wxIdleEvent& event );
        void OnTestButton( wxCommandEvent& event );
};


#endif // __RSEARCH_H__