# HG changeset patch # User pyon@macmini # Date 1597342553 -32400 # Node ID 3334ef6892141ce042305b5f498e87aa1d3390a0 start develop. diff -r 000000000000 -r 3334ef689214 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,106 @@ +# Makefile for wxWidgets Application +# Last Change: 2020-08-13 –Ø 12:35:24. +# by Takayuki Mutoh +# + +PROGNAME = iv + +### Variables ### +OBJDIR = ./obj +CXX = g++ +ARCH = 64 +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)/iv.o + +ifdef COMSPEC + OBJMSW = $(OBJ) $(OBJDIR)/sample_rc.o +endif + + +### Targets ### + +all: $(EXECUTABLE) + @echo "----------------------------" + @echo " making $(ARCH) bit program " + @echo "----------------------------" + +$(PROGNAME): $(OBJ) $(OBJMSW) + @echo "" + @echo "=> $(EXECUTABLE) <=" + $(CXX) $^ -o $@ $(LIBS) + +$(OBJDIR)/main.o: main.cpp main.h iv.h + @echo "" + @echo "=> main.o <=" + -mkdir -p $(OBJDIR) + $(CXX) -c $< -o $@ $(CXXFLAGS) + +$(OBJDIR)/iv.o: iv.cpp iv.h + @echo "" + @echo "=> iv.o <=" + $(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 /C:/msys64/home/muto/wx/horori/mover/image/mover.png + ./$(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 + + +# clean +clean: + rm -f $(PROGNAME) $(PROGNAME).exe + rm -f $(OBJDIR)/*.o + rm -rf $(PROGNAME).app + +.PHONY: all clean + diff -r 000000000000 -r 3334ef689214 include/dndfile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/dndfile.h Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,26 @@ +// Filename : dndfile.h +// Last Change: 2020-08-13 木 12:16:35. +// + +#pragma once + +class DnDFile : public wxFileDropTarget +{ + public: + DnDFile( wxTextCtrl *textCtrl ) + { + m_textCtrl = textCtrl; + } + virtual bool OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames ) + { + size_t nFiles = filenames.GetCount(); + if ( nFiles != 1 ) return false; + m_textCtrl->SetValue( filenames[0] ); + + return true; + } + + private: + wxTextCtrl* m_textCtrl; +}; + diff -r 000000000000 -r 3334ef689214 include/iv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/iv.h Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,62 @@ +// Filename : iv.h +// Last Change: 2020-08-13 木 12:31:12. +// +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ivFrame : public wxFrame +{ + private: + + protected: + wxScrolledWindow* m_scrolledWindow; + //wxStaticBitmap* m_bitmap; + wxDirPickerCtrl* m_dirPicker; + wxTreeCtrl* m_treeCtrl; + wxDataViewListCtrl* m_dataViewListCtrl; + wxDataViewColumn* m_dataViewListColumnName; + wxDataViewColumn* m_dataViewListColumnSize; + wxDataViewColumn* m_dataViewListColumnTime; + wxTextCtrl* m_textCtrl; + wxStaticText* m_staticTextType; + wxChoice* m_choice; + wxButton* m_buttonConv; + wxStaticText* m_staticTextW; + wxTextCtrl* m_textCtrlW; + wxStaticText* m_staticTextH; + wxTextCtrl* m_textCtrlH; + wxButton* m_buttonResize; + + // Virtual event handlers, overide them in your derived class + virtual void OnDirChanged(wxFileDirPickerEvent& event); + virtual void OnConvert(wxCommandEvent& event); + virtual void OnResize(wxCommandEvent& event); + + public: + ivFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL); + ~ivFrame(); + + void Initialize(wxString file); +}; + diff -r 000000000000 -r 3334ef689214 include/main.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/main.h Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,42 @@ +// Filename : main.h +// Last Change: 2020-08-06 –Ø 09:07:24. +// +#pragma once + +#include +#include + +// private classes +// Define a new application type, each program should derive a class from wxApp +class MyApp : public wxApp +{ + DECLARE_CLASS(MyApp) + private: + bool silent_mode; + wxString m_file; + + public: + MyApp(); + ~MyApp(); + + virtual bool OnInit(); + virtual int OnExit(); + virtual int OnRun(); + virtual void OnInitCmdLine(wxCmdLineParser& parser); + virtual bool OnCmdLineParsed(wxCmdLineParser& parser); +}; + +static const wxCmdLineEntryDesc g_cmdLineDesc[] = +{ + /* + {wxCMD_LINE_SWITCH, wxT("h"), wxT("help"), wxT("displays help on the command line parameters"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP}, + {wxCMD_LINE_SWITCH, wxT("t"), wxT("test"), wxT("test switch"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_MANDATORY}, + {wxCMD_LINE_SWITCH, wxT("s"), wxT("silent"), wxT("disables the GUI")}, + */ + //{wxCMD_LINE_PARAM, NULL, NULL, "input file", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE}, + {wxCMD_LINE_NONE} +}; + + +DECLARE_APP(MyApp) + diff -r 000000000000 -r 3334ef689214 iv.fbp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/iv.fbp Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,944 @@ + + + + + ; + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + + 1000 + none + + 0 + iv + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + 164,169,208 + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + ivFrame + + 500,300 + wxDEFAULT_FRAME_STYLE + ; ; forward_declare + + + + + wxTAB_TRAVERSAL + 1 + + + bSizerTop + wxHORIZONTAL + none + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_scrolledWindow + 1 + + + protected + 1 + + Resizable + 5 + 5 + 1 + + ; ; forward_declare + 0 + + + + wxHSCROLL|wxVSCROLL + + + + 5 + wxEXPAND + 0 + + + bSizerRight + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + Select a folder + + 0 + + 1 + m_dirPicker + 1 + + + protected + 1 + + Resizable + 1 + + wxDIRP_DIR_MUST_EXIST|wxDIRP_SMALL|wxDIRP_USE_TEXTCTRL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnDirChanged + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_treeCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxTR_DEFAULT_STYLE|wxTR_SINGLE + ; ; forward_declare + 0 + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_dataViewListCtrl + protected + + + wxDV_HORIZ_RULES|wxDV_ROW_LINES|wxDV_SINGLE + ; ; forward_declare + + + + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE + Name + wxDATAVIEW_CELL_EDITABLE + m_dataViewListColumnName + protected + Text + -1 + + + wxALIGN_RIGHT + + wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE + Size + wxDATAVIEW_CELL_INERT + m_dataViewListColumnSize + protected + Text + -1 + + + wxALIGN_LEFT + + wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE + Time + wxDATAVIEW_CELL_INERT + m_dataViewListColumnTime + protected + Text + -1 + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_textCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_MULTILINE|wxTE_READONLY + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxEXPAND + 1 + + + wxBOTH + + + 0 + + gbSizerManip + wxFLEX_GROWMODE_SPECIFIED + none + 0 + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Type + 0 + + 0 + + + 0 + + 1 + m_staticTextType + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 2 + 1 + wxALL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "PNG" "JPEG" "TIFF" "BMP" "GIF" "XPM" "ICON" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 2 + 4 + wxALL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Convert + + 0 + + 0 + + + 0 + + 1 + m_buttonConv + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnConvert + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + W + 0 + + 0 + + + 0 + + 1 + m_staticTextW + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL|wxALIGN_CENTER_VERTICAL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 4 + + 0 + + 1 + m_textCtrlW + 1 + + + protected + 1 + + Resizable + 1 + 40,-1 + + ; ; forward_declare + 0 + + + wxFILTER_NUMERIC + wxDefaultValidator + + + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + H + 0 + + 0 + + + 0 + + 1 + m_staticTextH + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 3 + wxALL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 4 + + 0 + + 1 + m_textCtrlH + 1 + + + protected + 1 + + Resizable + 1 + 40,-1 + + ; ; forward_declare + 0 + + + wxFILTER_NUMERIC + wxDefaultValidator + + + + + + + + + 5 + 1 + 4 + wxALL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Resize + + 0 + + 0 + + + 0 + + 1 + m_buttonResize + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnResize + + + + + + + + + + diff -r 000000000000 -r 3334ef689214 sample.ico Binary file sample.ico has changed diff -r 000000000000 -r 3334ef689214 sample.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sample.rc Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: samples/samples.rc +// Purpose: a standard Win32 .rc file for the wxWindows samples +// Author: Vadim Zeitlin +// Modified by: +// Created: 04.08.03 +// RCS-ID: $Id: sample.rc 22863 2003-08-14 14:08:53Z VS $ +// Copyright: (c) 2003 Vadim Zeitlin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// this minimal resource file is all what is needed for most of the wxWindows +// samples + +// note that the icon used by the Explorer (i.e. the programs icon) is the +// first icon in the executable and the icons are sorted both by their order +// (Win9x) and by alphabetically (!) (NT), so put this icon first and give it +// a name starting with "a" +aaaaaaaa ICON "sample.ico" + +// this icon is used with wxFrame::SetIcon() +sample ICON "sample.ico" + +// set this to 1 if you don't want to use manifest resource (manifest resource +// is needed to enable visual styles on Windows XP - see docs/msw/winxp.txt +// for more information) +#define wxUSE_NO_MANIFEST 0 + +// this is not always needed but doesn't hurt (except making the executable +// very slightly larger): this file contains the standard icons, cursors, ... +#include "wx/msw/wx.rc" + diff -r 000000000000 -r 3334ef689214 src/iv.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/iv.cpp Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,116 @@ +// Filename : iv.cpp +// Last Change: 2020-08-13 木 12:33:22. +// +#include +#include "iv.h" + +ivFrame::ivFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) + : wxFrame(parent, id, title, pos, size, style) +{ + this->SetSizeHints(wxDefaultSize, wxDefaultSize); + this->SetBackgroundColour(wxColour(165, 165, 205)); + + wxBoxSizer* bSizerTop = new wxBoxSizer(wxHORIZONTAL); + + m_scrolledWindow = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL); + m_scrolledWindow->SetScrollRate(5, 5); + bSizerTop->Add(m_scrolledWindow, 1, wxEXPAND|wxALL, 5); + + wxBoxSizer* bSizerRight; + bSizerRight = new wxBoxSizer(wxVERTICAL); + + m_dirPicker = new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST|wxDIRP_SMALL|wxDIRP_USE_TEXTCTRL); + bSizerRight->Add(m_dirPicker, 0, wxALL|wxEXPAND, 5); + + m_treeCtrl = new wxTreeCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxTR_SINGLE); + bSizerRight->Add(m_treeCtrl, 0, wxALL|wxEXPAND, 5); + + m_dataViewListCtrl = new wxDataViewListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_HORIZ_RULES|wxDV_ROW_LINES|wxDV_SINGLE); + m_dataViewListColumnName = m_dataViewListCtrl->AppendTextColumn(wxT("Name"), wxDATAVIEW_CELL_EDITABLE, -1, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE); + m_dataViewListColumnSize = m_dataViewListCtrl->AppendTextColumn(wxT("Size"), wxDATAVIEW_CELL_INERT, -1, static_cast(wxALIGN_RIGHT), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE); + m_dataViewListColumnTime = m_dataViewListCtrl->AppendTextColumn(wxT("Time"), wxDATAVIEW_CELL_INERT, -1, static_cast(wxALIGN_LEFT), wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE); + bSizerRight->Add(m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5); + + m_textCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY); + bSizerRight->Add(m_textCtrl, 0, wxALL|wxEXPAND, 5); + + wxGridBagSizer* gbSizerManip; + gbSizerManip = new wxGridBagSizer(0, 0); + gbSizerManip->SetFlexibleDirection(wxBOTH); + gbSizerManip->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); + + m_staticTextType = new wxStaticText(this, wxID_ANY, wxT("Type"), wxDefaultPosition, wxDefaultSize, 0); + gbSizerManip->Add(m_staticTextType, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5); + + wxString m_choiceChoices[] = { wxT("PNG"), wxT("JPEG"), wxT("TIFF"), wxT("BMP"), wxT("GIF"), wxT("XPM"), wxT("ICON") }; + int m_choiceNChoices = sizeof(m_choiceChoices) / sizeof(wxString); + m_choice = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceNChoices, m_choiceChoices, 0); + m_choice->SetSelection(0); + gbSizerManip->Add(m_choice, wxGBPosition(0, 1), wxGBSpan(1, 2), wxALL, 5); + + m_buttonConv = new wxButton(this, wxID_ANY, wxT("Convert"), wxDefaultPosition, wxDefaultSize, 0); + gbSizerManip->Add(m_buttonConv, wxGBPosition(0, 4), wxGBSpan(1, 2), wxALL, 5); + + m_staticTextW = new wxStaticText(this, wxID_ANY, wxT("W"), wxDefaultPosition, wxDefaultSize, 0); + gbSizerManip->Add(m_staticTextW, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); + + m_textCtrlW = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0); + m_textCtrlW->SetMaxLength(4); + gbSizerManip->Add(m_textCtrlW, wxGBPosition(1, 1), wxGBSpan(1, 1), wxALL|wxALIGN_CENTER_VERTICAL, 5); + + m_staticTextH = new wxStaticText(this, wxID_ANY, wxT("H"), wxDefaultPosition, wxDefaultSize, 0); + gbSizerManip->Add(m_staticTextH, wxGBPosition(1, 2), wxGBSpan(1, 1), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); + + m_textCtrlH = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0); + m_textCtrlH->SetMaxLength(4); + gbSizerManip->Add(m_textCtrlH, wxGBPosition(1, 3), wxGBSpan(1, 1), wxALL, 5); + + m_buttonResize = new wxButton(this, wxID_ANY, wxT("Resize"), wxDefaultPosition, wxDefaultSize, 0); + gbSizerManip->Add(m_buttonResize, wxGBPosition(1, 4), wxGBSpan(1, 1), wxALL, 5); + + + bSizerRight->Add(gbSizerManip, 1, wxEXPAND, 5); + + + bSizerTop->Add(bSizerRight, 0, wxEXPAND, 5); + + + this->SetSizer(bSizerTop); + this->Layout(); + + this->Centre(wxBOTH); + + // Connect Events + m_dirPicker->Connect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(ivFrame::OnDirChanged), NULL, this); + m_buttonConv->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ivFrame::OnConvert), NULL, this); + m_buttonResize->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ivFrame::OnResize), NULL, this); +} + +ivFrame::~ivFrame() +{ + // Disconnect Events + m_dirPicker->Disconnect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(ivFrame::OnDirChanged), NULL, this); + m_buttonConv->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ivFrame::OnConvert), NULL, this); + m_buttonResize->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ivFrame::OnResize), NULL, this); +} + +// Event-Handlers +void ivFrame::OnDirChanged(wxFileDirPickerEvent& WXUNUSED(event)) +{ +} + +void ivFrame::OnConvert(wxCommandEvent& WXUNUSED(event)) +{ +} + +void ivFrame::OnResize(wxCommandEvent& WXUNUSED(event)) +{ +} + +// Functions +void ivFrame::Initialize(wxString file) +{ + if (file.IsEmpty()) return; + wxMessageBox(file); +} + diff -r 000000000000 -r 3334ef689214 src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main.cpp Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,65 @@ +// Filename : main.cpp +// Last Change: 2020-08-13 木 13:01:00. +// +#include + +#include "main.h" +#include "iv.h" + +IMPLEMENT_APP(MyApp) + +IMPLEMENT_CLASS(MyApp, wxApp) + +MyApp::MyApp() +{ +} + +MyApp::~MyApp() +{ +} + +bool MyApp::OnInit() +{ + if (!wxApp::OnInit()) return false; + + wxInitAllImageHandlers(); + + ivFrame *frame = new ivFrame(NULL, wxID_ANY, wxT("iv -"), wxDefaultPosition, wxSize(500, 400), wxDEFAULT_FRAME_STYLE); + frame->Initialize(m_file); + frame->Show(true); + frame->Raise(); + + return true; +} + +int MyApp::OnExit() +{ + return 0; +} + +int MyApp::OnRun() +{ + int exitcode = wxApp::OnRun(); + if (exitcode != 0) return exitcode; +} + +void MyApp::OnInitCmdLine(wxCmdLineParser& parser) +{ + parser.SetDesc(g_cmdLineDesc); + parser.SetSwitchChars(wxT("-")); +} + +bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser) +{ + //silent_mode = parser.Found(wxT("s")); + + if (parser.GetParamCount() != 0) + m_file = parser.GetParam(0); + + // and other command line parameters + + // then do what you need with them. + + return true; +} +