diff src/delwhite.cpp @ 3:a5bddd859104

implement delwhtie
author pyon@macmini
date Tue, 04 Oct 2011 07:43:08 +0900
parents 1ea4f7981ff5
children a505f7417742
line wrap: on
line diff
--- a/src/delwhite.cpp	Sun Oct 02 18:44:03 2011 +0900
+++ b/src/delwhite.cpp	Tue Oct 04 07:43:08 2011 +0900
@@ -1,5 +1,5 @@
 // Filename   : delwhite.cpp
-// Last Change: 02-Oct-2011.
+// Last Change: 03-Oct-2011.
 //
 
 #include "delwhite.h"
@@ -17,15 +17,14 @@
 FrameDelWhite::FrameDelWhite( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
 {
 	this->SetSize( 1200, 1000 );
-    //this->SetBackgroundColour( wxColour(wxT("WHEAT")) );
-    //this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
+    this->SetBackgroundColour( wxColour(wxT("WHEAT")) );
 	
 	wxBoxSizer* bSizer;
 	bSizer = new wxBoxSizer( wxVERTICAL );
 	
 	m_listCtrl = new wxListCtrl( this, ID_LSWHITE, wxDefaultPosition, wxDefaultSize, wxLC_ICON );
 	bSizer->Add( m_listCtrl, 1, wxALL|wxEXPAND, 5 );
-    m_imageList = new wxImageList( 105, 148 );
+    m_imageList = new wxImageList( 63, 89 );
     m_listCtrl->AssignImageList( m_imageList, wxIMAGE_LIST_NORMAL );
 	
 	wxBoxSizer* bSizerBtn;
@@ -59,11 +58,17 @@
 // Event Table
 BEGIN_EVENT_TABLE( FrameDelWhite, wxFrame )
     //EVT_LIST_ITEM_SELECTED( ID_LSTCTRL, FramePreview::ChageImage )
+    EVT_CHECKBOX( ID_CHECK, FrameDelWhite::UpdateList )
     EVT_BUTTON( ID_DELETE, FrameDelWhite::DeleteImage )
-    EVT_BUTTON( ID_CANCEL,   FrameDelWhite::CloseFrame  )
+    EVT_BUTTON( ID_CANCEL, FrameDelWhite::CloseFrame  )
 END_EVENT_TABLE()
 
 // Event Handlers
+void FrameDelWhite::UpdateList(wxCommandEvent& WXUNUSED(event))
+{
+    LoadImages();
+}
+
 void FrameDelWhite::DeleteImage(wxCommandEvent& WXUNUSED(event))
 {
     return;
@@ -78,6 +83,8 @@
 // Functions
 void FrameDelWhite::LoadImages( void )
 {
+    m_listCtrl->DeleteAllItems();
+    m_imageList->RemoveAll();
     wxDir dir(m_dir);
     wxString filename;
     if ( !dir.IsOpened() ) return;
@@ -90,7 +97,7 @@
         wxString f = m_dir + wxFILE_SEP_PATH + filename;
         wxFile file( f );
         long len = file.Length();
-        if ( !m_checkBox->IsChecked() && len < 2181468 ) { 
+        if ( !m_checkBox->IsChecked() && len > 150000 ) { 
             cout = dir.GetNext( &filename );
             continue;
         }
@@ -105,7 +112,7 @@
         m_listCtrl->SetItem( item );
 
         wxImage img( f, wxBITMAP_TYPE_JPEG );
-        wxBitmap bmp( img.Scale( 105, 148, wxIMAGE_QUALITY_HIGH ) );
+        wxBitmap bmp( img.Scale( 63, 89, wxIMAGE_QUALITY_HIGH ) );
         m_imageList->Add( bmp );
         cout = dir.GetNext( &filename );
         i++;