diff src/main.cpp @ 19:3bb803d8c1d7

Implement Mini-mode.
author pyon@macmini
date Sun, 07 Dec 2014 20:48:05 +0900
parents c066fde99517
children 92188f60323d
line wrap: on
line diff
--- a/src/main.cpp	Sat Nov 29 11:02:35 2014 +0900
+++ b/src/main.cpp	Sun Dec 07 20:48:05 2014 +0900
@@ -1,8 +1,10 @@
 // Filename   : main.cpp
-// Last Change: 23-Aug-2013.
+// Last Change: 04-Dec-2014.
 //
 #include "main.h"
 #include "myframe.h"
+#include "miniframe.h"
+#include "wx/cmdline.h"
 
 IMPLEMENT_APP(MyApp)
 
@@ -25,9 +27,15 @@
     InitLog();
     InitSetting();
 
-    MyFrame *mainframe = new MyFrame( NULL, ID_MAIN, wxT("Searcher 03"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE );
-    mainframe->SetSize( rect );
-    mainframe->Show(true);
+    if ( mode == 1 ) {
+        MiniFrame *miniframe = new MiniFrame( NULL, ID_MAIN, wxT("Mini Searcher"), wxDefaultPosition, wxSize( 100, 45 ), wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCAPTION|wxCLOSE_BOX|wxCLIP_CHILDREN );
+        miniframe->Show( true );
+    }
+    else {
+        MyFrame *mainframe = new MyFrame( NULL, ID_MAIN, wxT("Searcher 03"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE );
+        mainframe->SetSize( rect );
+        mainframe->Show( true );
+    }
 
     return true;
 }
@@ -44,6 +52,7 @@
     config = new wxFileConfig( wxT("MyApp"), wxT("T.Mutoh"), conf_file, wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
 
     config->SetPath( wxT("/Geometry") );
+    config->Read( wxT("mode"), &mode );
     config->Read( wxT("x"), &rect.x );
     config->Read( wxT("y"), &rect.y );
     config->Read( wxT("w"), &rect.width );