# HG changeset patch
# User pyon@macmini
# Date 1559978500 -32400
# Node ID 2f5584f0d1279d04475ab5ee0df67bd3c940acd5
first commit.
diff -r 000000000000 -r 2f5584f0d127 Madnm.fbp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Madnm.fbp Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,4460 @@
+
+
+
+
+
diff -r 000000000000 -r 2f5584f0d127 Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,113 @@
+# Makefile for wxWidgets Application
+# Last Change: 2019-06-06 Ψ 16:07:28.
+# by Takayuki Mutoh
+#
+
+PROGNAME = madnm
+
+### Variables ###
+OBJDIR = ./obj
+CXX = g++
+ARCH = 32
+LOCAL = C:/msys64/home/muto/local$(ARCH)
+vpath %.cpp ./src
+vpath %.h ./include
+
+# For Microsoft Windows
+ifdef COMSPEC
+WXCXXFLAGS = -I$(LOCAL)/lib/wx/include/msw-unicode-static-3.1 -I$(LOCAL)/include/wx-3.1 -D_LARGEFILE_SOURCE=unknown -D__WXMSW__ -mthreads
+WXLIBS = -L$(LOCAL)/lib -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.1 -lwx_mswu_qa-3.1 -lwx_baseu_net-3.1 -lwx_mswu_html-3.1 -lwx_mswu_adv-3.1 -lwx_mswu_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu-3.1 -lwxtiff-3.1 -lwxjpeg-3.1 -lwxpng-3.1 -lwxregexu-3.1 -lwxscintilla-3.1 -lwxexpat-3.1 -lwxzlib-3.1 -lrpcrt4 -loleaut32 -lole32 -luuid -luxtheme -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32 -loleacc
+LIBS = $(WXLIBS) -static
+
+EXECUTABLE = $(PROGNAME).exe
+
+# For Apple OSX
+else
+WXCXXFLAGS = -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/lib/wx/include/osx_cocoa-unicode-3.1 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__
+WXLIBS = -L/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.1 -lwx_osx_cocoau_html-3.1 -lwx_osx_cocoau_qa-3.1 -lwx_osx_cocoau_adv-3.1 -lwx_osx_cocoau_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1
+LIBS = $(WXLIBS)
+
+EXECUTABLE = $(PROGNAME).app/Contents/PkgInfo
+
+endif
+
+CXXFLAGS = $(WXCXXFLAGS) -I./include -I./image
+
+
+OBJ = $(OBJDIR)/main.o \
+ $(OBJDIR)/appconf.o \
+ $(OBJDIR)/util.o \
+ $(OBJDIR)/custom.o \
+ $(OBJDIR)/mainframe.o
+
+ifdef COMSPEC
+OBJMSW = $(OBJ) $(OBJDIR)/sample_rc.o
+endif
+
+
+### Targets ###
+
+all: $(EXECUTABLE)
+
+
+$(PROGNAME): $(OBJ) $(OBJMSW)
+ $(CXX) $^ -o $@ $(LIBS)
+ @echo "----------------------------"
+ @echo " making $(ARCH) bit program "
+ @echo "----------------------------"
+
+$(OBJDIR)/main.o: main.cpp main.h mainframe.h appconf.h id.h
+ -mkdir -p $(OBJDIR)
+ $(CXX) -c $< -o $@ $(CXXFLAGS)
+
+$(OBJDIR)/custom.o: custom.cpp custom.h id.h
+ $(CXX) -c $< -o $@ $(CXXFLAGS)
+
+$(OBJDIR)/util.o: util.cpp util.h
+ $(CXX) -c $< -o $@ $(CXXFLAGS)
+
+$(OBJDIR)/appconf.o: appconf.cpp appconf.h
+ $(CXX) -c $< -o $@ $(CXXFLAGS)
+
+$(OBJDIR)/mainframe.o: mainframe.cpp mainframe.h custom.h appconf.h id.h
+ $(CXX) -c $< -o $@ $(CXXFLAGS)
+
+
+# for icon
+ifdef COMSPEC
+$(OBJDIR)/sample_rc.o: sample.rc
+ windres -i sample.rc -o $@ -I$(LOCAL)/include/wx-3.1
+endif
+
+$(EXECUTABLE): $(PROGNAME)
+ifdef COMSPEC
+ strip --strip-all $(EXECUTABLE)
+ ./$(PROGNAME).exe
+else
+ -mkdir -p $(PROGNAME).app/Contents
+ -mkdir -p $(PROGNAME).app/Contents/MacOS
+ -mkdir -p $(PROGNAME).app/Contents/Resources
+
+ sed -e "s/IDENTIFIER/$(PROGNAME)/" \
+ -e "s/EXECUTABLE/$(PROGNAME)/" \
+ -e "s/VERSION/0.0/" \
+ Info.plist.in > $(PROGNAME).app/Contents/Info.plist
+
+ echo "APPL????" > $(EXECUTABLE)
+
+ ln -f $(PROGNAME) $(PROGNAME).app/Contents/MacOS/$(PROGNAME)
+ cp -f wxmac.icns $(PROGNAME).app/Contents/Resources/wxmac.icns
+
+ open $(PROGNAME).app
+endif
+
+tgz:
+ tar cvfz a.tgz src include Makefile memo.txt
+
+clean:
+ rm -f $(PROGNAME) $(PROGNAME).exe
+ rm -f $(OBJDIR)/*.o
+ rm -rf $(PROGNAME).app
+
+.PHONY: all clean
+
diff -r 000000000000 -r 2f5584f0d127 TODO
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/TODO Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,5 @@
+mainframe.cpp
+ wxT("") πν
+ po
+ large size preview
+
diff -r 000000000000 -r 2f5584f0d127 app.conf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/app.conf Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,22 @@
+[Geometry]
+geo=1383x1057+245+23
+
+[Ccn]
+ccn=pΩP:pΩQ:pΩR:pΩS:ΌεP:ΌεQ:ΌεR:η¨P:η¨Q:η¨R:εΘP:εΘQ:εΘR:εΘS:εΘT:εΘU:Z½P:Z½Q:Z½R
+sss=0000000031:0000000032:0000000033:0000000034:0000000021:0000000022:0000000023:0000000041:0000000042:0000000043:0000000001:0000000002:0000000003:0000000004:0000000005:0000000006:00000000x1:00000000x2:00000000x3
+
+[Marksheet]
+hno=596x87+1378+217
+name=650x165+280+530
+mhno=596x514+1378+311
+
+[Mask]
+mask1=500x600+30+40
+mask2=500x600+30+40
+mask3=500x600+30+40
+mask4=500x600+30+40
+
+[Misc]
+scanner=C:\\WINDOWS\\twain_32\\escndv\\escndv.exe
+workdir=work
+
diff -r 000000000000 -r 2f5584f0d127 image/testpattern.jpg
Binary file image/testpattern.jpg has changed
diff -r 000000000000 -r 2f5584f0d127 image/testpattern.xcf
Binary file image/testpattern.xcf has changed
diff -r 000000000000 -r 2f5584f0d127 include/appconf.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/appconf.h Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,26 @@
+// Filename : appconf.h
+// Last Change: 2019-06-07 ΰ 14:39:29.
+//
+#pragma once
+
+#include
+#include
+#include
+#include
+
+class AppConf {
+ private:
+ wxFileConfig *config;
+ wxString conf_file;
+
+ public:
+ AppConf();
+ ~AppConf();
+
+ wxRect LoadRect( void );
+ wxRect LoadMask( int i );
+ void LoadCcn( wxComboBox ccn, wxComboBox sss );
+
+ void SaveRect( wxRect rect );
+};
+
diff -r 000000000000 -r 2f5584f0d127 include/custom.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/custom.h Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,58 @@
+// Filename : custom.h
+// Last Change: 2019-06-07 ΰ 16:39:35.
+//
+#pragma once
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "wx/dcclient.h"
+
+class LookWindow : public wxWindow
+{
+ DECLARE_EVENT_TABLE()
+ private:
+ int m_x0, m_y0, m_w0, m_h0; // default mask1 rect
+ int m_x1, m_y1, m_x2, m_y2; // variable mask1 rect
+
+ int m_s0, m_t0, m_u0, m_v0; // default mask2 rect
+ int m_s1, m_t1, m_s2, m_t2; // variable mask2 rect
+
+ int m_w, m_h, m_dcw, m_dch;
+ int m_scalex, m_scaley;
+
+ wxSpinCtrl *m_spnx, *m_spny, *m_spnw, *m_spnh;
+
+ wxString m_file;
+ wxBitmap m_bitmap;
+ int m_masknum = 1;
+
+ public:
+ LookWindow( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
+ ~LookWindow();
+
+ void OnPaint( wxPaintEvent& event );
+ void OnMotion( wxMouseEvent& event );
+ void OnLeftDown( wxMouseEvent& event );
+ void OnLeftUp( wxMouseEvent& event );
+ void OnRightDown( wxMouseEvent& event );
+ void OnRightUp( wxMouseEvent& event );
+
+ void SetDefaultParams( int i, int w, int h, int dcw, int dch );
+ void AddMask( void );
+ void SetFile( wxString file ) { m_file = file; };
+ void AssignSpinControl( wxSpinCtrl* spnx, wxSpinCtrl* spny, wxSpinCtrl* spnw, wxSpinCtrl* spnh );
+
+ void LoadImage( void );
+ void ReloadImage( void );
+ void ResetMask1( void );
+ void ResetMask2( void );
+ void DoMask1( void );
+ void DoMask2( void );
+ wxRect GetRealMask1Rect( void );
+ wxRect GetRealMask2Rect( void );
+};
+
diff -r 000000000000 -r 2f5584f0d127 include/id.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/id.h Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,75 @@
+// Filename : id.h
+// Last Change: 2019-06-07 Fri 22:31:04.
+//
+#pragma once
+
+#include
+
+/* Mask */
+// Pixel
+#define SPL_W 4900
+#define SPL_H 300
+#define OPN1_W SPL_W
+#define OPN1_H 300
+#define OPN2_W SPL_W
+#define OPN2_H 1800
+
+// Device Context
+#define SPL_DCW 800
+#define SPL_DCH 50
+#define OPN1_DCW SPL_DCW
+#define OPN1_DCH 50
+#define OPN2_DCW SPL_DCW
+#define OPN2_DCH 300
+
+/* Guess */
+// Pixel
+#define MNAME_W 288
+#define MNAME_H 86
+#define MHNO_W 288
+#define MHNO_H 49
+
+/* Thumbnail */
+#define THUMB_W 60
+#define THUMB_H 80
+
+/* Identifier */
+enum
+{
+ ID_SPNX1 = wxID_HIGHEST + 1,
+ ID_SPNY1,
+ ID_SPNW1,
+ ID_SPNH1,
+ ID_SPNX2,
+ ID_SPNY2,
+ ID_SPNW2,
+ ID_SPNH2,
+ ID_SPNX3,
+ ID_SPNY3,
+ ID_SPNW3,
+ ID_SPNH3,
+ ID_SPNX4,
+ ID_SPNY4,
+ ID_SPNW4,
+ ID_SPNH4,
+ ID_RST1,
+ ID_RST2,
+ ID_RST3,
+ ID_RST4,
+ ID_MERGE,
+ ID_PRINT,
+
+ ID_MKDIR,
+ ID_FMOVE,
+
+ ID_MOVE,
+
+ ID_WORK,
+ ID_SCAN,
+
+ ID_SLDR,
+ ID_SELALL,
+ ID_SELDEL,
+ ID_UPDT,
+};
+
diff -r 000000000000 -r 2f5584f0d127 include/main.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/main.h Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,24 @@
+// Filename : main.h
+// Last Change: 2019-06-05
12:37:13.
+//
+#pragma once
+
+#include
+
+// private classes
+// Define a new application type, each program should derive a class from wxApp
+class MyApp : public wxApp
+{
+ DECLARE_CLASS( MyApp )
+ private:
+
+ public:
+ MyApp();
+ ~MyApp();
+
+ virtual bool OnInit();
+ virtual int OnExit();
+};
+
+DECLARE_APP( MyApp )
+
diff -r 000000000000 -r 2f5584f0d127 include/mainframe.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/mainframe.h Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,152 @@
+// Filename : mainframe.h
+// Last Change: 2019-06-07 Fri 22:20:40.
+//
+#pragma once
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "util.h"
+#include "custom.h"
+
+class MainFrame : public wxFrame
+{
+ DECLARE_EVENT_TABLE()
+ private:
+ FileList *m_filelist;
+ wxString m_testpattern = "image/testpattern.jpg";
+
+ protected:
+ wxMenuBar* m_menubar;
+ wxMenu* m_menuFile;
+
+ wxStaticText *m_staticTextSpl, *m_staticTextOpn1, *m_staticTextOpn2;
+ wxStaticText *m_staticTextX, *m_staticTextY, *m_staticTextW, *m_staticTextH;
+ LookWindow *m_lookWindow1, *m_lookWindow2, *m_lookWindow3;
+ wxSpinCtrl *m_spinCtrlX1, *m_spinCtrlY1, *m_spinCtrlW1, *m_spinCtrlH1;
+ wxSpinCtrl *m_spinCtrlX2, *m_spinCtrlY2, *m_spinCtrlW2, *m_spinCtrlH2;
+ wxSpinCtrl *m_spinCtrlX3, *m_spinCtrlY3, *m_spinCtrlW3, *m_spinCtrlH3;
+ wxSpinCtrl *m_spinCtrlX4, *m_spinCtrlY4, *m_spinCtrlW4, *m_spinCtrlH4;
+ wxButton *m_buttonReset1, *m_buttonReset2, *m_buttonReset3, *m_buttonReset4;
+
+ wxButton* m_buttonMerge;
+ wxButton* m_buttonPrint;
+
+ wxStaticText* m_staticTextDate;
+ wxDatePickerCtrl* m_datePicker;
+ wxStaticText* m_staticTextCcn;
+ wxComboBox* m_comboBox;
+ wxStaticText* m_staticTextDrive;
+ //wxComboBox* m_comboBoxDrive2; // check list box
+ wxButton* m_buttonMkdir;
+
+ wxStaticLine* m_staticline;
+ wxCheckBox* m_checkBox;
+ wxButton* m_button30; // ?
+ wxButton* m_buttonFMove;
+
+ wxStaticText* m_staticTextNo;
+ wxStaticBitmap* m_bitmapNo;
+ wxTextCtrl* m_textCtrlNo;
+
+ wxStaticText* m_staticTextName;
+ wxStaticBitmap* m_bitmapName;
+ wxTextCtrl* m_textCtrlName;
+
+ wxGauge* m_gauge;
+ wxButton* m_buttonMove;
+
+ wxDataViewListCtrl* m_dataViewListCtrl;
+ wxDataViewColumn* m_dataViewListColumnNo;
+ wxDataViewColumn* m_dataViewListColumnHno;
+ wxDataViewColumn* m_dataViewListColumnName;
+ wxDataViewColumn* m_dataViewListColumnN;
+ wxDataViewColumn* m_dataViewListColumnDrv1;
+ wxDataViewColumn* m_dataViewListColumnDrv2;
+ wxDataViewColumn* m_dataViewListColumnDrv3;
+ wxDataViewColumn* m_dataViewListColumnEtc;
+
+ wxButton* m_buttonWork;
+ wxButton* m_buttonScan;
+
+ wxStaticText* m_staticTextWork;
+ wxDirPickerCtrl* m_dirPicker;
+ wxButton* m_buttonSelectAll;
+ wxButton* m_buttonDel;
+ wxSlider* m_slider;
+ wxButton* m_buttonUpdate;
+ //* m_customControl;
+
+ wxCollapsiblePane* m_collapsiblePane;
+ wxTextCtrl* m_textCtrlMsg;
+
+ public:
+ MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,600 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
+ ~MainFrame();
+
+ void OnReset1( wxCommandEvent& event );
+ void OnReset2( wxCommandEvent& event );
+ void OnReset3( wxCommandEvent& event );
+ void OnReset4( wxCommandEvent& event );
+
+ void OnSpinX1( wxSpinEvent& event );
+ void OnSpinX2( wxSpinEvent& event );
+ void OnSpinX3( wxSpinEvent& event );
+ void OnSpinX4( wxSpinEvent& event );
+
+ void OnSpinY1( wxSpinEvent& event );
+ void OnSpinY2( wxSpinEvent& event );
+ void OnSpinY3( wxSpinEvent& event );
+ void OnSpinY4( wxSpinEvent& event );
+
+ void OnSpinW1( wxSpinEvent& event );
+ void OnSpinW2( wxSpinEvent& event );
+ void OnSpinW3( wxSpinEvent& event );
+ void OnSpinW4( wxSpinEvent& event );
+
+ void OnSpinH1( wxSpinEvent& event );
+ void OnSpinH2( wxSpinEvent& event );
+ void OnSpinH3( wxSpinEvent& event );
+ void OnSpinH4( wxSpinEvent& event );
+
+ void OnMakeDir( wxCommandEvent& event );
+ void OnPrint( wxCommandEvent& event );
+ void OnMove( wxCommandEvent& event );
+
+ void OnClose( wxCloseEvent& event );
+
+ void CreateControls( void );
+ void SetCanvas( void );
+ void LookMarksheet( wxString file );
+ void DoMask( wxString file, wxRect rect );
+};
+
diff -r 000000000000 -r 2f5584f0d127 include/util.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/util.h Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,39 @@
+// Filename : util.h
+// Last Change: 2019-06-07 Fri 21:06:32.
+//
+#pragma once
+
+#include
+#include
+#include
+
+/*** Utility Class ***/
+class FileList
+{
+ private:
+ wxString m_dir;
+ wxArrayString m_files;
+
+ wxImageList m_image1; // zoom1
+ wxImageList m_image2; // zoom2
+ wxImageList m_image3; // zoom3
+
+ public:
+ FileList();
+ ~FileList();
+
+ void SetDirectory( wxString dir ) { m_dir = dir; };
+ int GetFileCount( void ) { return m_files.GetCount(); };
+ wxArrayString GetFiles( void ) { return m_files; };
+ wxArrayString Update( void );
+};
+
+
+/*** Utility Function ***/
+void MsgBox( wxString msg );
+void MsgBox( int n );
+wxRect Geo2Rect( wxString geo );
+wxString Rect2Geo( wxRect rect );
+void MaskRect( wxImage image, wxRect rect, int r, int g, int b );
+bool IsBlack( int r, int g, int b );
+
diff -r 000000000000 -r 2f5584f0d127 src/appconf.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/appconf.cpp Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,60 @@
+// Filename : appconf.cpp
+// Last Change: 2019-06-07 ΰ 14:38:53.
+//
+#include "appconf.h"
+#include "util.h"
+
+AppConf::AppConf()
+{
+ conf_file = wxGetCwd() + wxFILE_SEP_PATH + "app.conf";
+ config = new wxFileConfig( "MyApp", "T.Mutoh", conf_file, wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
+}
+
+AppConf::~AppConf()
+{
+}
+
+/* Load */
+wxRect AppConf::LoadRect()
+{
+ wxString buf;
+ config->SetPath( "/Geometry" );
+ config->Read( "geo", &buf );
+
+ delete config;
+
+ return Geo2Rect( buf );
+}
+
+void AppConf::LoadCcn( wxComboBox ccn, wxComboBox sss )
+{
+ wxString buf;
+ config->SetPath( "/Ccn" );
+ config->Read( "ccn", &buf );
+ config->Read( "sss", &buf );
+
+ delete config;
+}
+
+wxRect AppConf::LoadMask( int i )
+{
+ wxString buf;
+ wxString mask = wxString::Format( "mask%d", i );
+ config->SetPath( "/Mask" );
+ config->Read( mask, &buf );
+
+ delete config;
+
+ return Geo2Rect( buf );
+}
+
+
+/* Save */
+void AppConf::SaveRect( wxRect rect )
+{
+ config->SetPath( "/Geometry" );
+ config->Write( "geo", Rect2Geo( rect ) );
+
+ delete config;
+}
+
diff -r 000000000000 -r 2f5584f0d127 src/custom.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/custom.cpp Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,225 @@
+// Filename : custom.cpp
+// Last Change: 2019-06-07 ι 17:36:31.
+//
+
+#include "id.h"
+#include "appconf.h"
+#include "custom.h"
+
+/*** LookWindow Class ***/
+LookWindow::LookWindow( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
+ : wxWindow( parent, id, pos, size, style )
+{
+}
+
+LookWindow::~LookWindow()
+{
+}
+
+// Event Table
+BEGIN_EVENT_TABLE( LookWindow, wxWindow )
+ EVT_PAINT( LookWindow::OnPaint )
+ EVT_LEFT_DOWN( LookWindow::OnLeftDown )
+ EVT_RIGHT_DOWN( LookWindow::OnRightDown )
+ EVT_MOTION( LookWindow::OnMotion )
+END_EVENT_TABLE()
+
+/* Event Handlers & Functions */
+// Event Handlers
+void LookWindow::OnPaint( wxPaintEvent &event )
+{
+ LoadImage();
+}
+
+void LookWindow::OnMotion( wxMouseEvent &event )
+{
+ if ( event.Dragging() && event.LeftIsDown() ) {
+ event.GetPosition( &m_x2, &m_y2 );
+ //m_spnx->SetValue( m_x1 ); // **seg fault
+ DoMask1();
+ } else if ( event.Dragging() && event.RightIsDown() && m_masknum == 2 ) {
+ event.GetPosition( &m_s2, &m_t2 );
+ DoMask2();
+ }
+}
+
+void LookWindow::OnLeftDown( wxMouseEvent &event )
+{
+ event.GetPosition( &m_x1, &m_y1 );
+ ReloadImage();
+ if ( m_masknum == 2 ) DoMask2();
+}
+
+void LookWindow::OnLeftUp( wxMouseEvent &event )
+{
+ event.GetPosition( &m_x2, &m_y2 );
+}
+
+void LookWindow::OnRightDown( wxMouseEvent &event )
+{
+ if ( m_masknum == 1 ) return;
+
+ event.GetPosition( &m_s1, &m_t1 );
+ ReloadImage();
+ DoMask1();
+}
+
+void LookWindow::OnRightUp( wxMouseEvent &event )
+{
+ event.GetPosition( &m_s2, &m_t2 );
+}
+
+// Functions
+void LookWindow::SetDefaultParams( int i, int w, int h, int dcw, int dch )
+{
+ AppConf appconf;
+ wxRect r = appconf.LoadMask( i );
+
+ m_w = w; m_h = h;
+ m_dcw = dcw; m_dch = dch;
+
+ m_scalex = m_w / m_dcw;
+ m_scaley = m_h / m_dch;
+
+ m_x0 = r.x / m_scalex;
+ m_y0 = r.y / m_scaley;
+ m_w0 = r.width / m_scalex;
+ m_h0 = r.height / m_scaley;
+}
+
+void LookWindow::AddMask( void )
+{
+ AppConf appconf;
+ wxRect r = appconf.LoadMask( 4 );
+
+ m_s0 = r.x / m_scalex;
+ m_t0 = r.y / m_scaley;
+ m_u0 = r.width / m_scalex;
+ m_v0 = r.height / m_scaley;
+
+ m_masknum = 2;
+}
+
+void LookWindow::ResetMask1( void )
+{
+ m_x1 = m_x0;
+ m_y1 = m_y0;
+ m_x2 = m_x0 + m_w0;
+ m_y2 = m_y0 + m_h0;
+ DoMask1();
+ if ( m_masknum == 2 ) DoMask2();
+}
+
+void LookWindow::ResetMask2( void )
+{
+ m_s1 = m_s0;
+ m_t1 = m_t0;
+ m_s2 = m_s0 + m_u0;
+ m_t2 = m_t0 + m_v0;
+ DoMask2();
+ DoMask1();
+}
+
+void LookWindow::LoadImage( void )
+{
+ wxImage image( m_file, wxBITMAP_TYPE_JPEG );
+ wxRect rect( 0, 0, m_w, m_h );
+
+ image = image.GetSubImage( rect );
+ m_bitmap = wxBitmap( image.Scale( m_dcw, m_dch, wxIMAGE_QUALITY_HIGH ) );
+
+ wxPaintDC dc( this );
+ dc.DrawBitmap( m_bitmap, 0, 0 );
+}
+
+void LookWindow::ReloadImage( void )
+{
+ wxClientDC dc( this );
+ dc.DrawBitmap( m_bitmap, 0, 0 );
+}
+
+void LookWindow::DoMask1()
+{
+ wxClientDC dc( this );
+ wxPen pen( *wxRED, 10 );
+ dc.SetPen( pen );
+
+ int sx, sy, ex, ey;
+ int dx = 3, dy = 3;
+
+ if ( m_x1 < m_x2 ) {
+ sx = m_x1; ex = m_x2;
+ } else {
+ sx = m_x2; ex = m_x1; // **not perform
+ }
+ if ( m_y1 < m_y2 ) {
+ sy = m_y1; ey = m_y2;
+ } else {
+ sy = m_y2; ey = m_y1;
+ }
+
+ for ( int i = m_x1; i < m_x2; i += dx ) {
+ for ( int j = m_y1; j < m_y2; j += dy ) {
+ dc.DrawPoint( i, j );
+ }
+ }
+
+ dc.SetPen( wxNullPen );
+}
+
+void LookWindow::DoMask2()
+{
+ wxClientDC dc( this );
+ wxPen pen( *wxBLUE, 10 );
+ dc.SetPen( pen );
+
+ int ss, st, es, et;
+ int ds = 3, dt = 3;
+
+ if ( m_s1 < m_s2 ) {
+ ss = m_s1; es = m_s2;
+ } else {
+ ss = m_s2; es = m_s1; // **not perform
+ }
+ if ( m_t1 < m_t2 ) {
+ st = m_t1; et = m_t2;
+ } else {
+ st = m_t2; et = m_t1;
+ }
+
+ for ( int i = m_s1; i < m_s2; i += ds ) {
+ for ( int j = m_t1; j < m_t2; j += dt ) {
+ dc.DrawPoint( i, j );
+ }
+ }
+
+ dc.SetPen( wxNullPen );
+}
+
+
+wxRect LookWindow::GetRealMask1Rect( void )
+{
+ int x1 = m_x1 * m_scalex;
+ int x2 = m_x2 * m_scalex;
+ int y1 = m_y1 * m_scaley;
+ int y2 = m_y2 * m_scaley;
+ wxRect rect( wxPoint( x1, y1 ), wxPoint( x2, y2 ) );
+ return rect;
+}
+
+wxRect LookWindow::GetRealMask2Rect( void )
+{
+ int x1 = m_s1 * m_scalex;
+ int x2 = m_s2 * m_scalex;
+ int y1 = m_t1 * m_scaley;
+ int y2 = m_t2 * m_scaley;
+ wxRect rect( wxPoint( x1, y1 ), wxPoint( x2, y2 ) );
+ return rect;
+}
+
+void LookWindow::AssignSpinControl( wxSpinCtrl* spnx, wxSpinCtrl* spny, wxSpinCtrl* spnw, wxSpinCtrl* spnh )
+{
+ m_spnx = spnx; m_spny = spny;
+ m_spnw = spnw; m_spnh = spnh;
+}
+
diff -r 000000000000 -r 2f5584f0d127 src/main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main.cpp Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,43 @@
+// Filename : main.cpp
+// Last Change: 2019-06-05 ζ°΄ 12:53:55.
+//
+
+#include "id.h"
+#include "main.h"
+#include "appconf.h"
+#include "util.h"
+#include "mainframe.h"
+
+IMPLEMENT_APP( MyApp )
+
+IMPLEMENT_CLASS( MyApp, wxApp )
+
+MyApp::MyApp()
+{
+}
+MyApp::~MyApp()
+{
+}
+
+bool MyApp::OnInit()
+{
+ if ( !wxApp::OnInit() ) return false;
+
+ wxImage::AddHandler( new wxJPEGHandler );
+ wxImage::AddHandler( new wxPNGHandler );
+
+ AppConf appconf;
+ wxRect rect = appconf.LoadRect();
+ // Main Window
+ MainFrame *mainframe = new MainFrame( NULL, wxID_ANY, "MadnM", wxPoint( rect.x, rect.y ), rect.GetSize(), wxDEFAULT_FRAME_STYLE );
+ mainframe->Show( true );
+ mainframe->Raise();
+
+ return true;
+}
+
+int MyApp::OnExit()
+{
+ return 0;
+}
+
diff -r 000000000000 -r 2f5584f0d127 src/mainframe.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mainframe.cpp Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,505 @@
+// Filename : mainframe.cpp
+// Last Change: 2019-06-08 Sat 10:56:10.
+//
+
+#include "id.h"
+#include "appconf.h"
+#include "mainframe.h"
+
+MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style )
+ : wxFrame( parent, id, title, pos, size, style )
+{
+ CreateControls();
+
+ m_filelist = new FileList();
+ m_filelist->SetDirectory( "./work" );
+
+ m_lookWindow1->SetDefaultParams( 1, SPL_W, SPL_H, SPL_DCW, SPL_DCH );
+ m_lookWindow2->SetDefaultParams( 2, OPN1_W, OPN1_H, OPN1_DCW, OPN1_DCH );
+ m_lookWindow3->SetDefaultParams( 3, OPN2_W, OPN2_H, OPN2_DCW, OPN2_DCH );
+ m_lookWindow3->AddMask();
+
+ SetCanvas();
+}
+
+MainFrame::~MainFrame()
+{
+}
+
+// Event Table
+BEGIN_EVENT_TABLE( MainFrame, wxFrame )
+ /*
+ EVT_TEXT( ID_HHS, MoverFrame::OnHhs )
+ EVT_TEXT_ENTER( ID_HHS, MoverFrame::OnHhs )
+ EVT_CHOICE( ID_CHOICE, MoverFrame::OnChoice )
+ EVT_CHECKBOX( ID_CPAPER, MoverFrame::OnPaperCheck )
+ */
+ EVT_BUTTON( ID_RST1, MainFrame::OnReset1 )
+ EVT_BUTTON( ID_RST2, MainFrame::OnReset2 )
+ EVT_BUTTON( ID_RST3, MainFrame::OnReset3 )
+ EVT_BUTTON( ID_RST4, MainFrame::OnReset4 )
+ EVT_BUTTON( ID_PRINT, MainFrame::OnPrint )
+ EVT_SPINCTRL( ID_SPNW1, MainFrame::OnSpinW1 )
+ EVT_CLOSE( MainFrame::OnClose )
+ /*
+ EVT_LIST_ITEM_SELECTED( ID_THUMB, MoverFrame::OnThumbItemSelected )
+ EVT_LIST_ITEM_DESELECTED( ID_THUMB, MoverFrame::OnThumbItemDeselected )
+ EVT_LIST_ITEM_ACTIVATED( ID_THUMB, MoverFrame::OnThumbItemDClicked )
+ EVT_DATAVIEW_ITEM_ACTIVATED( ID_RESERVE, MoverFrame::OnListItemDClicked )
+ EVT_BUTTON( ID_TDEL, MoverFrame::OnThumbDelete)
+ EVT_SLIDER( ID_ZOOM, MoverFrame::OnZoom )
+ EVT_TIMER( ID_TIMER, MoverFrame::OnTimer )
+ EVT_IDLE( MoverFrame::OnIdle )
+ EVT_CHAR_HOOK( MoverFrame::OnKeyDown )
+ */
+END_EVENT_TABLE()
+
+/* Event Handlers & Functions */
+// Event Handlers
+void MainFrame::OnReset1( wxCommandEvent& WXUNUSED(event) )
+{
+ m_lookWindow1->ReloadImage();
+ m_lookWindow1->ResetMask1();
+}
+
+void MainFrame::OnReset2( wxCommandEvent& WXUNUSED(event) )
+{
+ m_lookWindow2->ReloadImage();
+ m_lookWindow2->ResetMask1();
+}
+
+void MainFrame::OnReset3( wxCommandEvent& WXUNUSED(event) )
+{
+ m_lookWindow3->ReloadImage();
+ m_lookWindow3->ResetMask1();
+}
+
+void MainFrame::OnReset4( wxCommandEvent& WXUNUSED(event) )
+{
+ m_lookWindow3->ReloadImage();
+ m_lookWindow3->ResetMask2();
+}
+
+void MainFrame::OnPrint( wxCommandEvent& WXUNUSED(event) )
+{
+ wxArrayString files = m_filelist->GetFiles();
+ if ( files.GetCount() < 6 ) {
+ MsgBox( "(^^;" );
+ return;
+ }
+
+ wxString file1 = files[5];
+ wxString file2 = files[2];
+ wxString file3 = files[3];
+ wxString file4 = files[4];
+
+ wxString temp1 = "_Trash/01.jpg";
+ wxString temp2 = "_Trash/02.jpg";
+ wxString temp3 = "_Trash/03.jpg";
+ wxString temp4 = "_Trash/04.jpg";
+
+ // copy & mask
+ wxCopyFile( file1, temp1, true );
+ wxCopyFile( file2, temp2, true );
+ wxCopyFile( file3, temp3, true );
+ wxCopyFile( file4, temp4, true );
+
+ wxRect rect1 = m_lookWindow1->GetRealMask1Rect();
+ wxRect rect2 = m_lookWindow2->GetRealMask1Rect();
+ wxRect rect3 = m_lookWindow3->GetRealMask1Rect();
+ wxRect rect4 = m_lookWindow3->GetRealMask2Rect();
+
+ DoMask( temp2, rect1 );
+ DoMask( temp3, rect3 );
+ DoMask( temp3, rect4 );
+ DoMask( temp4, rect2 );
+
+ // make html
+ int zoom = 100;
+ wxString html, file;
+
+ html = "\n";
+ wxString imgsz = wxString::Format( "\" width=\"%d\" height=\"%d\"", 750 * zoom / 100, 1060 * zoom / 100 );
+
+ html = html + "
\n";
+ html = html + "
\n";
+
+ html = html + "
\n";
+ html = html + "
\n";
+
+ html = html + "";
+
+ // start printing
+ wxHtmlPrintout hpout( "Merge & Move" );
+ hpout.SetMargins( 0, 0, 0, 0, 0 );
+ wxPrintDialogData pd;
+ wxPrinter p( &pd );
+
+ hpout.SetHtmlText( html, wxEmptyString, false );
+ p.Print( NULL, &hpout, true );
+}
+
+void MainFrame::OnSpinW1( wxSpinEvent& WXUNUSED(event) )
+{
+}
+
+/*
+void MainFrame::OnScanner( wxCommandEvent& WXUNUSED(event) )
+{
+ wxExecute( m_scanner );
+}
+*/
+
+void MainFrame::OnClose( wxCloseEvent& WXUNUSED(event) )
+{
+ if ( !IsIconized() && !IsMaximized() ) {
+ AppConf appconf;
+ appconf.SaveRect( GetRect() );
+ }
+ Destroy();
+}
+
+// Functions
+void MainFrame::CreateControls( void )
+{
+ this->SetSizeHints( wxDefaultSize, wxDefaultSize );
+
+ // Menu
+ m_menubar = new wxMenuBar( 0 );
+ m_menuFile = new wxMenu();
+ m_menubar->Append( m_menuFile, wxT("File") );
+
+ this->SetMenuBar( m_menubar );
+
+ wxBoxSizer* bSizerTop = new wxBoxSizer( wxVERTICAL );
+
+ // Main
+ wxFlexGridSizer* fgSizerMain = new wxFlexGridSizer( 0, 2, 0, 0 );
+ fgSizerMain->SetFlexibleDirection( wxBOTH );
+ fgSizerMain->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ // Mask & Mearge
+ wxStaticBoxSizer* sbSizerMerge = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Mask and Merge") ), wxHORIZONTAL );
+
+ wxGridBagSizer* gbSizerMask = new wxGridBagSizer( 0, 0 );
+ gbSizerMask->SetFlexibleDirection( wxBOTH );
+ gbSizerMask->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ m_staticTextSpl = new wxStaticText( sbSizerMerge->GetStaticBox(), wxID_ANY, wxT("Special"), wxDefaultPosition, wxDefaultSize, 0 );
+ gbSizerMask->Add( m_staticTextSpl, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT, 5 );
+
+ m_staticTextOpn1 = new wxStaticText( sbSizerMerge->GetStaticBox(), wxID_ANY, wxT("Opinion1"), wxDefaultPosition, wxDefaultSize, 0 );
+ gbSizerMask->Add( m_staticTextOpn1, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT, 5 );
+
+ m_staticTextOpn2 = new wxStaticText( sbSizerMerge->GetStaticBox(), wxID_ANY, wxT("Opinion2"), wxDefaultPosition, wxDefaultSize, 0 );
+ gbSizerMask->Add( m_staticTextOpn2, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT, 5 );
+
+ m_lookWindow1 = new LookWindow( sbSizerMerge->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( SPL_DCW, SPL_DCH ), 0 );
+ gbSizerMask->Add( m_lookWindow1, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_TOP, 5 );
+
+ m_lookWindow2 = new LookWindow( sbSizerMerge->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( OPN1_DCW, OPN1_DCH ), 0 );
+ gbSizerMask->Add( m_lookWindow2, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_TOP, 5 );
+
+ m_lookWindow3 = new LookWindow( sbSizerMerge->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( OPN2_DCW, OPN2_DCH ), 0 );
+ gbSizerMask->Add( m_lookWindow3, wxGBPosition( 3, 1 ), wxGBSpan( 3, 1 ), wxALL|wxALIGN_TOP, 5 );
+
+ m_staticTextX = new wxStaticText( sbSizerMerge->GetStaticBox(), wxID_ANY, wxT("X"), wxDefaultPosition, wxDefaultSize, 0 );
+ gbSizerMask->Add( m_staticTextX, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );
+
+ m_staticTextY = new wxStaticText( sbSizerMerge->GetStaticBox(), wxID_ANY, wxT("Y"), wxDefaultPosition, wxDefaultSize, 0 );
+ gbSizerMask->Add( m_staticTextY, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL, 5 );
+
+ m_staticTextW = new wxStaticText( sbSizerMerge->GetStaticBox(), wxID_ANY, wxT("W"), wxDefaultPosition, wxDefaultSize, 0 );
+ gbSizerMask->Add( m_staticTextW, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL, 5 );
+
+ m_staticTextH = new wxStaticText( sbSizerMerge->GetStaticBox(), wxID_ANY, wxT("H"), wxDefaultPosition, wxDefaultSize, 0 );
+ gbSizerMask->Add( m_staticTextH, wxGBPosition( 0, 5 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );
+
+ m_spinCtrlX1 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNX1, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 0 );
+ gbSizerMask->Add( m_spinCtrlX1, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlX2 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNX2, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 0 );
+ gbSizerMask->Add( m_spinCtrlX2, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlX3 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNX3, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 0 );
+ gbSizerMask->Add( m_spinCtrlX3, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlX4 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNX4, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 0 );
+ gbSizerMask->Add( m_spinCtrlX4, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlY1 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNY1, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 50 );
+ gbSizerMask->Add( m_spinCtrlY1, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlY2 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNY2, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 50 );
+ gbSizerMask->Add( m_spinCtrlY2, wxGBPosition( 2, 3 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlY3 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNY3, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 50 );
+ gbSizerMask->Add( m_spinCtrlY3, wxGBPosition( 3, 3 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlY4 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNY4, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 50 );
+ gbSizerMask->Add( m_spinCtrlY4, wxGBPosition( 4, 3 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlW1 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNW1, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 300 );
+ gbSizerMask->Add( m_spinCtrlW1, wxGBPosition( 1, 4 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlW2 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNW2, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 300 );
+ gbSizerMask->Add( m_spinCtrlW2, wxGBPosition( 2, 4 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlW3 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNW3, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 300 );
+ gbSizerMask->Add( m_spinCtrlW3, wxGBPosition( 3, 4 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlW4 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNW4, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 300 );
+ gbSizerMask->Add( m_spinCtrlW4, wxGBPosition( 4, 4 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlH1 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNH1, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 100 );
+ gbSizerMask->Add( m_spinCtrlH1, wxGBPosition( 1, 5 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlH2 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNH2, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 100 );
+ gbSizerMask->Add( m_spinCtrlH2, wxGBPosition( 2, 5 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlH3 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNH3, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 100 );
+ gbSizerMask->Add( m_spinCtrlH3, wxGBPosition( 3, 5 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_spinCtrlH4 = new wxSpinCtrl( sbSizerMerge->GetStaticBox(), ID_SPNH4, wxEmptyString, wxDefaultPosition, wxSize( 60, -1 ), wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 9999, 100 );
+ gbSizerMask->Add( m_spinCtrlH4, wxGBPosition( 4, 5 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_buttonReset1 = new wxButton( sbSizerMerge->GetStaticBox(), ID_RST1, wxT("Reset"), wxDefaultPosition, wxSize( 60, -1 ), 0 );
+ gbSizerMask->Add( m_buttonReset1, wxGBPosition( 1, 6 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_buttonReset2 = new wxButton( sbSizerMerge->GetStaticBox(), ID_RST2, wxT("Reset"), wxDefaultPosition, wxSize( 60, -1 ), 0 );
+ gbSizerMask->Add( m_buttonReset2, wxGBPosition( 2, 6 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_buttonReset3 = new wxButton( sbSizerMerge->GetStaticBox(), ID_RST3, wxT("Reset"), wxDefaultPosition, wxSize( 60, -1 ), 0 );
+ gbSizerMask->Add( m_buttonReset3, wxGBPosition( 3, 6 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_buttonReset4 = new wxButton( sbSizerMerge->GetStaticBox(), ID_RST4, wxT("Reset"), wxDefaultPosition, wxSize( 60, -1 ), 0 );
+ gbSizerMask->Add( m_buttonReset4, wxGBPosition( 4, 6 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP, 5 );
+
+ m_buttonMerge = new wxButton( sbSizerMerge->GetStaticBox(), ID_MERGE, wxT("Merge"), wxDefaultPosition, wxSize( 60, -1 ), 0 );
+ m_buttonMerge->Enable( false );
+ gbSizerMask->Add( m_buttonMerge, wxGBPosition( 5, 5 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );
+
+ m_buttonPrint = new wxButton( sbSizerMerge->GetStaticBox(), ID_PRINT, wxT("Print"), wxDefaultPosition, wxSize( 60, -1 ), 0 );
+ gbSizerMask->Add( m_buttonPrint, wxGBPosition( 5, 6 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 );
+
+ sbSizerMerge->Add( gbSizerMask, 1, wxEXPAND, 5 );
+
+ fgSizerMain->Add( sbSizerMerge, 0, wxEXPAND, 5 );
+
+ // Dir
+ wxStaticBoxSizer* sbSizerDir = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Directory Setup") ), wxVERTICAL );
+
+ wxFlexGridSizer* fgSizerSetup = new wxFlexGridSizer( 0, 2, 0, 0 );
+ fgSizerSetup->SetFlexibleDirection( wxBOTH );
+ fgSizerSetup->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ m_staticTextDate = new wxStaticText( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("Date"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
+ sbSizerDir->Add( m_staticTextDate, 0, wxALL, 5 );
+
+ m_datePicker = new wxDatePickerCtrl( sbSizerDir->GetStaticBox(), wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN|wxDP_SHOWCENTURY );
+ sbSizerDir->Add( m_datePicker, 0, wxALL, 5 );
+
+ m_staticTextCcn = new wxStaticText( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("CCN"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
+ sbSizerDir->Add( m_staticTextCcn, 0, wxALL, 5 );
+
+ m_comboBox = new wxComboBox( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("Combo!"), wxDefaultPosition, wxSize( 100, -1 ), 0, NULL, 0 );
+ sbSizerDir->Add( m_comboBox, 0, wxALL, 5 );
+
+ m_staticTextDrive = new wxStaticText( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("Drive"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
+ sbSizerDir->Add( m_staticTextDrive, 0, wxALL, 5 );
+
+ //m_listBox = new wxListBox( sbSizerDir->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
+ //fgSizerSetup->Add( m_listBox, 0, wxALL, 5 );
+
+ fgSizerSetup->Add( 0, 0, 1, wxEXPAND, 5 );
+
+ m_buttonMkdir = new wxButton( sbSizerDir->GetStaticBox(), ID_MKDIR, wxT("Mkdir"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerDir->Add( m_buttonMkdir, 0, wxALL, 5 );
+
+ sbSizerDir->Add( fgSizerSetup, 0, wxEXPAND, 5 );
+
+ m_staticline = new wxStaticLine( sbSizerDir->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
+ sbSizerDir->Add( m_staticline, 0, wxEXPAND|wxALL, 5 );
+
+ m_checkBox = new wxCheckBox( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("FilingMode"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerDir->Add( m_checkBox, 0, wxALL, 5 );
+
+ m_button30 = new wxButton( sbSizerDir->GetStaticBox(), wxID_ANY, wxT("MyButton"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerDir->Add( m_button30, 0, wxALL|wxALIGN_RIGHT, 5 );
+
+ m_buttonFMove = new wxButton( sbSizerDir->GetStaticBox(), ID_FMOVE, wxT("Move"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerDir->Add( m_buttonFMove, 0, wxALL|wxALIGN_RIGHT, 5 );
+
+ fgSizerMain->Add( sbSizerDir, 0, wxEXPAND, 5 );
+
+ // Move
+ wxStaticBoxSizer* sbSizerMove = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Move") ), wxHORIZONTAL );
+
+ wxFlexGridSizer* fgSizerMove = new wxFlexGridSizer( 0, 3, 0, 0 );
+ fgSizerMove->SetFlexibleDirection( wxBOTH );
+ fgSizerMove->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ m_staticTextName = new wxStaticText( sbSizerMove->GetStaticBox(), wxID_ANY, wxT("Name"), wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizerMove->Add( m_staticTextName, 0, wxALL|wxALIGN_RIGHT, 5 );
+
+ m_bitmapName = new wxStaticBitmap( sbSizerMove->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( MNAME_W, MNAME_H ), 0 );
+ fgSizerMove->Add( m_bitmapName, 0, wxALL, 5 );
+
+ m_textCtrlName = new wxTextCtrl( sbSizerMove->GetStaticBox(), wxID_ANY, wxT("Nobi Nobita"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_textCtrlName->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
+ fgSizerMove->Add( m_textCtrlName, 0, wxALL|wxALIGN_BOTTOM, 5 );
+
+ m_staticTextNo = new wxStaticText( sbSizerMove->GetStaticBox(), wxID_ANY, wxT("No"), wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizerMove->Add( m_staticTextNo, 0, wxALL|wxALIGN_RIGHT, 5 );
+
+ m_bitmapNo = new wxStaticBitmap( sbSizerMove->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( MHNO_W, MHNO_H ), 0 );
+ fgSizerMove->Add( m_bitmapNo, 0, wxALL, 5 );
+
+ m_textCtrlNo = new wxTextCtrl( sbSizerMove->GetStaticBox(), wxID_ANY, wxT("1234567890"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_textCtrlNo->SetMaxLength( 10 );
+ fgSizerMove->Add( m_textCtrlNo, 0, wxALL|wxALIGN_BOTTOM, 5 );
+
+ fgSizerMove->Add( 50, 0, 1, wxEXPAND, 5 );
+
+ m_gauge = new wxGauge( sbSizerMove->GetStaticBox(), wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL );
+ m_gauge->SetValue( 0 );
+ fgSizerMove->Add( m_gauge, 1, wxALL|wxEXPAND, 5 );
+
+ m_buttonMove = new wxButton( sbSizerMove->GetStaticBox(), ID_MOVE, wxT("Move"), wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizerMove->Add( m_buttonMove, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ sbSizerMove->Add( fgSizerMove, 0, 0, 5 );
+
+ m_dataViewListCtrl = new wxDataViewListCtrl( sbSizerMove->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE|wxDV_ROW_LINES|wxDV_VERT_RULES );
+ m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT("No"), wxDATAVIEW_CELL_INERT, 30, static_cast(wxALIGN_RIGHT) , wxDATAVIEW_COL_RESIZABLE );
+ m_dataViewListColumnHno = m_dataViewListCtrl->AppendTextColumn( wxT("Hno"), wxDATAVIEW_CELL_INERT, 80, static_cast(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
+ m_dataViewListColumnName = m_dataViewListCtrl->AppendTextColumn( wxT("Name"), wxDATAVIEW_CELL_INERT, 80, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
+ m_dataViewListColumnN = m_dataViewListCtrl->AppendTextColumn( wxT("N"), wxDATAVIEW_CELL_INERT, 40, static_cast(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE );
+ m_dataViewListColumnDrv1 = m_dataViewListCtrl->AppendTextColumn( wxT("C:"), wxDATAVIEW_CELL_INERT, 30, static_cast(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE );
+ m_dataViewListColumnDrv2 = m_dataViewListCtrl->AppendTextColumn( wxT("Y:"), wxDATAVIEW_CELL_INERT, 30, static_cast(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE );
+ m_dataViewListColumnDrv3 = m_dataViewListCtrl->AppendTextColumn( wxT("Z:"), wxDATAVIEW_CELL_INERT, 30, static_cast(wxALIGN_CENTER), wxDATAVIEW_COL_RESIZABLE );
+ m_dataViewListColumnEtc = m_dataViewListCtrl->AppendTextColumn( wxT("Status"), wxDATAVIEW_CELL_INERT, -1, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE );
+ sbSizerMove->Add( m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5 );
+
+ fgSizerMain->Add( sbSizerMove, 0, wxEXPAND, 5 );
+
+ wxStaticBoxSizer* sbSizerManip;
+ sbSizerManip = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Manip") ), wxVERTICAL );
+
+ m_buttonWork = new wxButton( sbSizerManip->GetStaticBox(), ID_WORK, wxT("WorkDir"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerManip->Add( m_buttonWork, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+
+ m_buttonScan = new wxButton( sbSizerManip->GetStaticBox(), ID_SCAN, wxT("Scanner"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizerManip->Add( m_buttonScan, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+
+ fgSizerMain->Add( sbSizerManip, 1, wxEXPAND, 5 );
+
+ bSizerTop->Add( fgSizerMain, 1, wxEXPAND, 5 );
+
+ // Work
+ wxStaticBoxSizer* sbSizerWork = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Work") ), wxVERTICAL );
+
+ wxBoxSizer* bSizerWork = new wxBoxSizer( wxHORIZONTAL );
+
+ m_staticTextWork = new wxStaticText( sbSizerWork->GetStaticBox(), wxID_ANY, wxT("Folder"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
+ bSizerWork->Add( m_staticTextWork, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_dirPicker = new wxDirPickerCtrl( sbSizerWork->GetStaticBox(), wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_CHANGE_DIR|wxDIRP_DIR_MUST_EXIST|wxDIRP_SMALL|wxDIRP_USE_TEXTCTRL );
+ bSizerWork->Add( m_dirPicker, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_buttonSelectAll = new wxButton( sbSizerWork->GetStaticBox(), ID_SELALL, wxT("Select All"), wxDefaultPosition, wxSize( 60, -1 ), 0 );
+ bSizerWork->Add( m_buttonSelectAll, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_buttonDel = new wxButton( sbSizerWork->GetStaticBox(), ID_SELDEL, wxT("Delete"), wxDefaultPosition, wxSize( 60, -1 ), 0 );
+ bSizerWork->Add( m_buttonDel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_slider = new wxSlider( sbSizerWork->GetStaticBox(), ID_SLDR, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
+ bSizerWork->Add( m_slider, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_buttonUpdate = new wxButton( sbSizerWork->GetStaticBox(), ID_UPDT, wxT("Refresh"), wxDefaultPosition, wxSize( 60,-1 ), 0 );
+ bSizerWork->Add( m_buttonUpdate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ sbSizerWork->Add( bSizerWork, 1, wxEXPAND, 5 );
+
+ //m_customControl = new ( sbSizerWork->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
+ //m_customControl->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) );
+
+ //sbSizerWork->Add( m_customControl, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
+
+ bSizerTop->Add( sbSizerWork, 1, wxEXPAND, 5 );
+
+ // Log
+ m_collapsiblePane = new wxCollapsiblePane( this, wxID_ANY, wxT("Message"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE );
+ m_collapsiblePane->Collapse( false );
+
+ wxBoxSizer* bSizerMsg = new wxBoxSizer( wxVERTICAL );
+
+ m_textCtrlMsg = new wxTextCtrl( m_collapsiblePane->GetPane(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ bSizerMsg->Add( m_textCtrlMsg, 1, wxALL|wxEXPAND, 5 );
+
+ m_collapsiblePane->GetPane()->SetSizer( bSizerMsg );
+ m_collapsiblePane->GetPane()->Layout();
+ bSizerMsg->Fit( m_collapsiblePane->GetPane() );
+
+ bSizerTop->Add( m_collapsiblePane, 1, wxEXPAND|wxALL, 5 );
+
+ this->SetSizer( bSizerTop );
+ this->Layout();
+
+ this->Centre( wxBOTH );
+}
+
+void MainFrame::SetCanvas( void )
+{
+ wxArrayString files = m_filelist->Update();
+ int n = files.GetCount();
+ if ( n < 6 ) {
+ LookMarksheet( m_testpattern );
+ m_lookWindow1->SetFile( m_testpattern );
+ m_lookWindow2->SetFile( m_testpattern );
+ m_lookWindow3->SetFile( m_testpattern );
+ } else {
+ LookMarksheet( files[0] );
+ m_lookWindow1->SetFile( files[2] );
+ m_lookWindow2->SetFile( files[4] );
+ m_lookWindow3->SetFile( files[3] );
+ }
+
+ m_lookWindow1->ResetMask1();
+ m_lookWindow2->ResetMask1();
+ m_lookWindow3->ResetMask1();
+ m_lookWindow3->ResetMask2();
+}
+
+void MainFrame::LookMarksheet( wxString file )
+{
+ wxImage marksheet( file, wxBITMAP_TYPE_JPEG );
+ wxRect rect_name( 480, 1040, 1400, 380 );
+ wxRect rect_hno( 2700, 440, 1200, 200 );
+
+ // ζ°εη»εγ葨瀺
+ wxImage name_image = marksheet.GetSubImage( rect_name );
+ wxBitmap name_bmp = name_image.Scale( MNAME_W, MNAME_H, wxIMAGE_QUALITY_HIGH );
+ m_bitmapName->SetBitmap( name_bmp );
+
+ // θ’«δΏιΊθ
ηͺε·η»εγ葨瀺
+ wxImage hhsno_image = marksheet.GetSubImage( rect_hno );
+ wxBitmap hhsno_bmp = hhsno_image.Scale( MHNO_W, MHNO_H, wxIMAGE_QUALITY_HIGH );
+ m_bitmapNo->SetBitmap( hhsno_bmp );
+
+ /*
+ // ζ¨ζΈ¬
+ wxString hhsno = GuessHhs( file, rect_mhno );
+ m_textCtrlHhs->SetValue( hhsno );
+ SetHhsName( hhsno );
+ */
+}
+
+void MainFrame::DoMask( wxString file, wxRect rect )
+{
+ wxImage img_org( file, wxBITMAP_TYPE_JPEG );
+ //img_org.SetRGB( rect, 255, 255, 255 );
+ img_org.SetRGB( rect, 0, 255, 0 );
+ img_org.SaveFile( file );
+}
+
diff -r 000000000000 -r 2f5584f0d127 src/util.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/util.cpp Sat Jun 08 16:21:40 2019 +0900
@@ -0,0 +1,69 @@
+// Filename : util.cpp
+// Last Change: 2019-06-07 ΰ 12:32:39.
+//
+#include "util.h"
+
+/*** Utility Class ***/
+// FileList Class
+FileList::FileList()
+{
+}
+
+FileList::~FileList()
+{
+}
+
+wxArrayString FileList::Update( void )
+{
+ unsigned int m = wxDir::GetAllFiles( m_dir, &m_files, wxT("*.jpg"), wxDIR_FILES );
+ for ( int i = 0; i < m; i++ ) {
+ //wxFileName filename( m_files[i] );
+ }
+ return m_files;
+}
+
+
+/*** Utility Function ***/
+void MsgBox( wxString msg )
+{
+ wxMessageBox( msg );
+}
+
+void MsgBox( int n )
+{
+ wxMessageBox( wxString::Format( "%d", n ) );
+}
+
+
+wxRect Geo2Rect( wxString geo )
+{
+ long w, h, x, y;
+ wxString sw = geo.BeforeFirst( 'x' );
+ wxString sh = geo.AfterFirst( 'x' ).BeforeFirst( '+' );
+ wxString sx = geo.AfterFirst( '+' ).BeforeFirst( '+' );
+ wxString sy = geo.AfterLast( '+' );
+
+ sw.ToLong( &w, 10 );
+ sh.ToLong( &h, 10 );
+ sx.ToLong( &x, 10 );
+ sy.ToLong( &y, 10 );
+
+ return wxRect( (int)x, (int)y, (int)w, (int)h );
+}
+
+wxString Rect2Geo( wxRect rect )
+{
+ return wxString::Format( "%dx%d+%d+%d", rect.width, rect.height, rect.x, rect.y );
+}
+
+void MaskRect( wxImage image, wxRect rect, int r, int g, int b )
+{
+}
+
+bool IsBlack( int r, int g, int b )
+{
+ int th = 38;
+ if ( r < th && g < th && b < th ) return true;
+ return false;
+}
+