Initial checkin new wx dialog

This commit is contained in:
Jorgen Bodde 2005-06-30 15:54:14 -04:00
parent 099587c4ee
commit 8c28e4e9f0
30 changed files with 9282 additions and 0 deletions

View File

@ -0,0 +1,276 @@
/* XPM */
static char *CMakeIcon_xpm[] = {
"16 16 256 3",
"000 c black",
"001 c #003F00",
"002 c #003F3F",
"003 c #3F0000",
"004 c #3F003F",
"005 c #3F3F00",
"006 c gray19",
"007 c #00007F",
"008 c #007F00",
"009 c #306F30",
"010 c #7F0000",
"011 c #606060",
"012 c #0000BF",
"013 c blue",
"014 c #00BF00",
"015 c green",
"016 c #BF0000",
"017 c red",
"018 c #909090",
"019 c #C0C0C0",
"020 c none",
"021 c black",
"022 c black",
"023 c black",
"024 c black",
"025 c black",
"026 c black",
"027 c black",
"028 c black",
"029 c black",
"030 c black",
"031 c black",
"032 c black",
"033 c black",
"034 c black",
"035 c black",
"036 c black",
"037 c black",
"038 c black",
"039 c black",
"040 c black",
"041 c black",
"042 c black",
"043 c black",
"044 c black",
"045 c black",
"046 c black",
"047 c black",
"048 c black",
"049 c black",
"050 c black",
"051 c black",
"052 c black",
"053 c black",
"054 c black",
"055 c black",
"056 c black",
"057 c black",
"058 c black",
"059 c black",
"060 c black",
"061 c black",
"062 c black",
"063 c black",
"064 c black",
"065 c black",
"066 c black",
"067 c black",
"068 c black",
"069 c black",
"070 c black",
"071 c black",
"072 c black",
"073 c black",
"074 c black",
"075 c black",
"076 c black",
"077 c black",
"078 c black",
"079 c black",
"080 c black",
"081 c black",
"082 c black",
"083 c black",
"084 c black",
"085 c black",
"086 c black",
"087 c black",
"088 c black",
"089 c black",
"090 c black",
"091 c black",
"092 c black",
"093 c black",
"094 c black",
"095 c black",
"096 c black",
"097 c black",
"098 c black",
"099 c black",
"100 c black",
"101 c black",
"102 c black",
"103 c black",
"104 c black",
"105 c black",
"106 c black",
"107 c black",
"108 c black",
"109 c black",
"110 c black",
"111 c black",
"112 c black",
"113 c black",
"114 c black",
"115 c black",
"116 c black",
"117 c black",
"118 c black",
"119 c black",
"120 c black",
"121 c black",
"122 c black",
"123 c black",
"124 c black",
"125 c black",
"126 c black",
"127 c black",
"128 c black",
"129 c black",
"130 c black",
"131 c black",
"132 c black",
"133 c black",
"134 c black",
"135 c black",
"136 c black",
"137 c black",
"138 c black",
"139 c black",
"140 c black",
"141 c black",
"142 c black",
"143 c black",
"144 c black",
"145 c black",
"146 c black",
"147 c black",
"148 c black",
"149 c black",
"150 c black",
"151 c black",
"152 c black",
"153 c black",
"154 c black",
"155 c black",
"156 c black",
"157 c black",
"158 c black",
"159 c black",
"160 c black",
"161 c black",
"162 c black",
"163 c black",
"164 c black",
"165 c black",
"166 c black",
"167 c black",
"168 c black",
"169 c black",
"170 c black",
"171 c black",
"172 c black",
"173 c black",
"174 c black",
"175 c black",
"176 c black",
"177 c black",
"178 c black",
"179 c black",
"180 c black",
"181 c black",
"182 c black",
"183 c black",
"184 c black",
"185 c black",
"186 c black",
"187 c black",
"188 c black",
"189 c black",
"190 c black",
"191 c black",
"192 c black",
"193 c black",
"194 c black",
"195 c black",
"196 c black",
"197 c black",
"198 c black",
"199 c black",
"200 c black",
"201 c black",
"202 c black",
"203 c black",
"204 c black",
"205 c black",
"206 c black",
"207 c black",
"208 c black",
"209 c black",
"210 c black",
"211 c black",
"212 c black",
"213 c black",
"214 c black",
"215 c black",
"216 c black",
"217 c black",
"218 c black",
"219 c black",
"220 c black",
"221 c black",
"222 c black",
"223 c black",
"224 c black",
"225 c black",
"226 c black",
"227 c black",
"228 c black",
"229 c black",
"230 c black",
"231 c black",
"232 c black",
"233 c black",
"234 c black",
"235 c black",
"236 c black",
"237 c black",
"238 c black",
"239 c black",
"240 c black",
"241 c black",
"242 c black",
"243 c black",
"244 c black",
"245 c black",
"246 c black",
"247 c black",
"248 c black",
"249 c black",
"250 c black",
"251 c black",
"252 c black",
"253 c black",
"254 c black",
"255 c black",
"020020020020020020020020020020020020020020020020",
"020020020020020020020000000020020020020020020020",
"020020020020020020020000003020020020020020020020",
"020020020020020020000012010000020020020020020020",
"020020020020020020007013010003020020020020020020",
"020020020020020000013013010016000020020020020020",
"020020020020020007013013004017003020020020020020",
"020020020020000013013013007017016000020020020020",
"020020020020007013013012006017017003020020020020",
"020020020000012013012018011017017016000020020020",
"020020020007013012009018019010017017003020020020",
"020020000013012014015014009010017017016000020020",
"020020007007014015015015015008005016017003020020",
"020000002015015015015015015015015014005010000020",
"020000008008008008008008008008008008008001000020",
"020020020020020020020020020020020020020020020020"
};

View File

@ -0,0 +1,93 @@
##---------------------------------------------------------------------------
## $RCSfile$
## $Source$
## $Revision$
## $Date$
##---------------------------------------------------------------------------
## Author: Jorgen Bodde
## Copyright: (c) Jorgen Bodde
## License: wxWidgets License
##---------------------------------------------------------------------------
#wxWidgets build related stuff
SET(WXW_USE_DEBUG OFF)
SET(WXW_USE_UNICODE OFF)
SET(WXW_USE_SHARED OFF)
SET(WXW_USE_UNIV OFF)
SET(WXW_USE_MONO OFF)
SET(WXW_FILE_VERSION "26")
SET(WXW_VERSION "2.6")
#CMake Options
SET(CMAKE_VERBOSE_MAKEFILE TRUE)
IF(WIN32)
INCLUDE (${CMAKE_SOURCE_DIR}/Source/WXDialog/bin/FindwxW.cmake)
ELSE(WIN32)
INCLUDE (${CMAKE_SOURCE_DIR}/Source/WXDialog/bin/FindwxWin.cmake)
# sync flags
SET(WXWIDGETS_FOUND ${WXWINDOWS_FOUND})
SET(WXWIDGETS_INCLUDE_DIR ${WXWINDOWS_INCLUDE_DIR})
SET(WXWIDGETS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES})
SET(WXWIDGETS_LIBRARIES ${WXWINDOWS_LIBRARIES})
ENDIF(WIN32)
# Old find script
## Start using wx stuff when it is fully found and set
IF(WXWIDGETS_FOUND)
SET (CMAKE_SRCS
CMakeSetupFrame.cpp
CMakeSetup.cpp
CMakeSetupFrame.h
CMakeSetup.h
PropertyList.cpp
PropertyList.h
app_resources.cpp
app_resources.h
progressdlg.cpp
progressdlg.h
aboutdlg.cpp
aboutdlg.h
optionsdlg.cpp
optionsdlg.h
config.h
CommandLineInfo.cpp
CommandLineInfo.h )
# include .rc when windows
IF(WIN32)
SET ( CMAKE_SRCS
${CMAKE_SRCS}
CMakeSetup.rc )
ENDIF(WIN32)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/Source/WXDialog
${WXWIDGETS_INCLUDE_DIR})
LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} ${CMake_BINARY_DIR}/Source ${CMake_BINARY_DIR}/Source/kwsys )
ADD_EXECUTABLE(WXDialog WIN32 ${CMAKE_SRCS})
SET(CMAKE_CXX_FLAGS "${CMAKE_WX_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D__WXDEBUG__ -DWXDEBUG=1")
IF(LINUX)
ADD_DEFINITIONS( -DLINUX=1 )
ENDIF(LINUX)
# if the checkbox view functionality is not desired,
# exclude this part from the sample
TARGET_LINK_LIBRARIES(WXDialog ${WXWIDGETS_LIBRARIES} cmsys CMakeLib)
# if UPX is found, make a target
#INCLUDE (${CMAKE_SOURCE_DIR}/Source/WXDialog/bin/FindUPX.cmake)
#IF(UPX_FOUND)
#END(UPX_FOUND)
ENDIF(WXWIDGETS_FOUND)

View File

@ -0,0 +1,120 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "CMakeSetup.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include <wx/filename.h>
#include "cmSystemTools.h"
#include "CommandLineInfo.h"
#include "CMakeSetup.h"
#include "CMakeSetupFrame.h"
////@begin XPM images
////@end XPM images
/*!
* Application instance implementation
*/
////@begin implement app
IMPLEMENT_APP( CMakeSetupApp )
////@end implement app
/*!
* CMakeSetupApp type definition
*/
IMPLEMENT_CLASS( CMakeSetupApp, wxApp )
/*!
* CMakeSetupApp event table definition
*/
BEGIN_EVENT_TABLE( CMakeSetupApp, wxApp )
////@begin CMakeSetupApp event table entries
////@end CMakeSetupApp event table entries
END_EVENT_TABLE()
/*!
* Constructor for CMakeSetupApp
*/
CMakeSetupApp::CMakeSetupApp()
{
////@begin CMakeSetupApp member initialisation
////@end CMakeSetupApp member initialisation
}
/*!
* Initialisation for CMakeSetupApp
*/
bool CMakeSetupApp::OnInit()
{
cmSystemTools::DisableRunCommandOutput();
// parse command line params
cmCommandLineInfo cm;
cm.SetValidArguments("ABGHQ");
cm.ParseCommandLine(wxApp::argc, wxApp::argv);
// set vendor name and app for config
SetVendorName("Kitware");
SetAppName("CMakeSetup");
CMakeSetupFrm *MyFrame = new CMakeSetupFrm(NULL);
// alternative app path way, somehow otherwise it does not work
wxFileName fname(argv[0]);
MyFrame->DoInitFrame(cm, fname.GetPath(wxPATH_GET_SEPARATOR | wxPATH_GET_VOLUME));
MyFrame->Show(TRUE);
return true;
}
/*!
* Cleanup for CMakeSetupApp
*/
int CMakeSetupApp::OnExit()
{
////@begin CMakeSetupApp cleanup
return wxApp::OnExit();
////@end CMakeSetupApp cleanup
}

View File

@ -0,0 +1,92 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _CMAKESETUP_H_
#define _CMAKESETUP_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "CMakeSetup.cpp"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/image.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
////@end control identifiers
/*!
* CMakeSetupApp class declaration
*/
class CMakeSetupApp: public wxApp
{
DECLARE_CLASS( CMakeSetupApp )
DECLARE_EVENT_TABLE()
public:
/// Constructor
CMakeSetupApp();
/// Initialises the application
virtual bool OnInit();
/// Called on exit
virtual int OnExit();
////@begin CMakeSetupApp event handler declarations
////@end CMakeSetupApp event handler declarations
////@begin CMakeSetupApp member function declarations
////@end CMakeSetupApp member function declarations
////@begin CMakeSetupApp member variables
////@end CMakeSetupApp member variables
private:
wxString m_AppPath;
};
/*!
* Application instance declaration
*/
////@begin declare app
DECLARE_APP(CMakeSetupApp)
////@end declare app
#endif
// _CMAKESETUP_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
#ifndef APSTUDIO_INVOKED
#include "wx/msw/wx.rc"
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
DID_AAAAAAA ICON "NGDialog.ico"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,360 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _CMAKESETUPFRAME_H_
#define _CMAKESETUPFRAME_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "CMakeSetupFrame.cpp"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/frame.h"
#include "wx/splitter.h"
#include "wx/grid.h"
#include "wx/statline.h"
#include "wx/statusbr.h"
////@end includes
#include <wx/config.h>
#include <wx/dataobj.h>
#include <wx/dnd.h>
#include "../cmake.h"
#include "progressdlg.h"
#include "optionsdlg.h"
#include "CommandLineInfo.h"
#include "config.h"
// this ID should be taken as base to make sure they are unique
// NOTE: DialogBlocks starts at 10100 so 10000 to 10099 are free
#define CM_NEXT_USABLEID CM_RECENT_BUILD_ITEM + CM_MAX_RECENT_PATHS
/*!
* Forward declarations
*/
////@begin forward declarations
class wxSplitterWindow;
class wxPropertyList;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_FRAME 10100
#define SYMBOL_CMAKESETUPFRM_STYLE wxDEFAULT_FRAME_STYLE|wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX|wxSUNKEN_BORDER
#define SYMBOL_CMAKESETUPFRM_TITLE _("CMake Setup v2.0.x")
#define SYMBOL_CMAKESETUPFRM_IDNAME ID_FRAME
#define SYMBOL_CMAKESETUPFRM_SIZE wxSize(600, 550)
#define SYMBOL_CMAKESETUPFRM_POSITION wxDefaultPosition
#define ID_SPLITTERWINDOW 10101
#define ID_MAINPANEL 10102
#define ID_PROJECT_PATH 10103
#define ID_BROWSE_PROJECT 10104
#define ID_SOURCE_BUILD_PATH 10105
#define ID_BROWSE_BUILD 10106
#define ID_CHOOSE_GENERATOR 10107
#define ID_SEARCHQUERY 10109
#define ID_SHOW_ADVANCED 10108
#define ID_OPTIONS 10110
#define ID_LOGPANEL 10111
#define ID_LOG_AREA 10112
#define ID_DESCRIPTION 10113
#define ID_DO_CONFIGURE 10114
#define ID_DO_OK 10115
#define ID_DO_CANCEL 10116
#define ID_DO_DELETE_CACHE 10117
#define ID_CLEAR_LOG 10118
#define ID_BROWSE_GRID 10119
#define ID_STATUSBAR 10120
#define ID_MENU_RELOAD_CACHE 10122
#define ID_MENU_DELETE_CACHE 10123
#define ID_MENU_QUIT 10125
#define ID_MENU_CONFIGURE 10126
#define ID_MENU_EXITGENERATE 10127
#define ID_MENU_TOGGLE_ADVANCED 10128
#define ID_CMAKE_OPTIONS 10124
#define ID_ABOUTDLG 10121
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
#ifndef wxFIXED_MINSIZE
#define wxFIXED_MINSIZE 0
#endif
class DnDFile : public wxFileDropTarget
{
public:
DnDFile(wxTextCtrl *pOwner)
: m_pOwner(pOwner)
{
};
virtual bool OnDropFiles(wxCoord x, wxCoord y,
const wxArrayString& filenames);
private:
wxTextCtrl *m_pOwner;
};
/*!
* CMakeSetupFrm class declaration
*/
class CMakeSetupFrm: public wxFrame
{
DECLARE_CLASS( CMakeSetupFrm )
DECLARE_EVENT_TABLE()
public:
/// Constructors
CMakeSetupFrm( );
CMakeSetupFrm( wxWindow* parent, wxWindowID id = SYMBOL_CMAKESETUPFRM_IDNAME, const wxString& caption = SYMBOL_CMAKESETUPFRM_TITLE, const wxPoint& pos = SYMBOL_CMAKESETUPFRM_POSITION, const wxSize& size = SYMBOL_CMAKESETUPFRM_SIZE, long style = SYMBOL_CMAKESETUPFRM_STYLE );
// Destructor
virtual ~CMakeSetupFrm();
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CMAKESETUPFRM_IDNAME, const wxString& caption = SYMBOL_CMAKESETUPFRM_TITLE, const wxPoint& pos = SYMBOL_CMAKESETUPFRM_POSITION, const wxSize& size = SYMBOL_CMAKESETUPFRM_SIZE, long style = SYMBOL_CMAKESETUPFRM_STYLE );
/// Creates the controls and sizers
void CreateControls();
/** Logs a message. For the kind parameter use;
1 - neutral message
0 - warning message (blue text)
-1 - error message (red text)
*/
void LogMessage(int logkind, const char *msg);
void UpdateProgress(float progress) {
if(m_progressDlg)
m_progressDlg->SetProgress(progress);
// also show in the tiny field
wxStatusBar *bar = GetStatusBar();
if(bar)
{
wxString str;
str.Printf("%2.1f %%", (progress * 100));
bar->SetStatusText(str, 1);
}
};
void IssueUpdate();
/** Initialise all crap in the frame, like listing the make generators,
selecting the best one to use, and loading the cache for the first time
when the build paths were set */
void DoInitFrame(cmCommandLineInfo &cm, const wxString &fn);
////@begin CMakeSetupFrm event handler declarations
/// wxEVT_CLOSE_WINDOW event handler for ID_FRAME
void OnCloseWindow( wxCloseEvent& event );
/// wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING event handler for ID_SPLITTERWINDOW
void OnSplitterPosChanging( wxSplitterEvent& event );
/// wxEVT_COMMAND_SPLITTER_DOUBLECLICKED event handler for ID_SPLITTERWINDOW
void OnSplitterwindowSashDClick( wxSplitterEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BROWSE_PROJECT
void OnButtonBrowseProject( wxCommandEvent& event );
/// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_SOURCE_BUILD_PATH
void OnSourceBuildPathUpdated( wxCommandEvent& event );
/// wxEVT_COMMAND_TEXT_ENTER event handler for ID_SOURCE_BUILD_PATH
void OnSourceBuildPathEnter( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BROWSE_BUILD
void OnButtonBrowseBuild( wxCommandEvent& event );
/// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_SEARCHQUERY
void OnSearchquerySelected( wxCommandEvent& event );
/// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_SEARCHQUERY
void OnSearchqueryUpdated( wxCommandEvent& event );
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_SHOW_ADVANCED
void OnShowAdvancedValues( wxCommandEvent& event );
/// wxEVT_GRID_CELL_CHANGE event handler for ID_OPTIONS
void OnCellChange( wxGridEvent& event );
/// wxEVT_GRID_SELECT_CELL event handler for ID_OPTIONS
void OnGridSelectCell( wxGridEvent& event );
/// wxEVT_MOTION event handler for ID_OPTIONS
void OnPropertyMotion( wxMouseEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DO_CONFIGURE
void OnButtonConfigure( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DO_OK
void OnButtonOk( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DO_CANCEL
void OnButtonCancel( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DO_DELETE_CACHE
void OnButtonDeleteCache( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_LOG
void OnClearLogClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BROWSE_GRID
void OnBrowseGridClick( wxCommandEvent& event );
/// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU_RELOAD_CACHE
void OnMenuReloadCacheClick( wxCommandEvent& event );
/// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU_DELETE_CACHE
void OnMenuDeleteCacheClick( wxCommandEvent& event );
/// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU_QUIT
void OnMenuQuitClick( wxCommandEvent& event );
/// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU_CONFIGURE
void OnMenuConfigureClick( wxCommandEvent& event );
/// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU_EXITGENERATE
void OnMenuGenerateClick( wxCommandEvent& event );
/// wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU_TOGGLE_ADVANCED
void OnMenuToggleAdvancedClick( wxCommandEvent& event );
/// wxEVT_COMMAND_MENU_SELECTED event handler for ID_CMAKE_OPTIONS
void OnOptionsClick( wxCommandEvent& event );
/// wxEVT_COMMAND_MENU_SELECTED event handler for ID_ABOUTDLG
void OnAboutClick( wxCommandEvent& event );
////@end CMakeSetupFrm event handler declarations
void OnRecentFileMenu( wxCommandEvent &event );
void OnAddQuery ( wxCommandEvent &event );
////@begin CMakeSetupFrm member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end CMakeSetupFrm member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
/** Load cache for the CMakeLists to the GUI */
void LoadCacheFromDiskToGUI();
/** Display the grid with the loaded cache. */
void FillCacheGUIFromCacheManager();
int RunCMake(bool generateProjectFiles);
/** Save cache to disk from the GUI */
void SaveCacheFromGUI();
void FillCacheManagerFromCacheGUI();
/** Update the cache and mark all the new items as old */
bool PerformCacheRun();
/** Shows the property matched by the row in the description area
or nothing when the row is not correct */
void ShowPropertyDescription(int row);
/** Disable or enable controls based upon the internal state of the
program */
void UpdateWindowState();
void AppendPathToRecentList(const wxString &p);
/** Used to synchonise any options that have immediate effect on the GUI
form, like clearing a search list, resetting a spitter perhaps, etc */
void SyncFormOptions(CMOptionsDlg *dlg);
void DoCancelButton();
void DoReloadCache();
void DoDeleteCache();
void DoConfigure();
void DoGenerate();
void OnExitTimer(wxTimerEvent &event);
////@begin CMakeSetupFrm member variables
wxSplitterWindow* m_splitter;
wxTextCtrl* m_cmProjectPath;
wxButton* m_BrowseProjectPathButton;
wxTextCtrl* m_cmBuildPath;
wxButton* m_BrowseSourcePathButton;
wxComboBox* m_cmGeneratorChoice;
wxComboBox* m_cmSearchQuery;
wxCheckBox* m_cmShowAdvanced;
wxPropertyList* m_cmOptions;
wxTextCtrl* m_cmLog;
wxTextCtrl* m_cmDescription;
wxButton* m_ConfigureButton;
wxButton* m_OkButton;
wxButton* m_CancelButton;
wxButton* m_DeleteCacheButton;
wxButton* m_ClearLogButton;
wxButton* m_cmBrowseCell;
////@end CMakeSetupFrm member variables
// this is the cmake instance with which we will communicate
// to generate our stuff, and get the info from.
cmake *m_cmake;
// the config class for project build dir and source path
wxTimer *m_ExitTimer;
wxConfig *m_config;
wxString m_PathToExecutable;
wxArrayString m_recentPaths;
CMProgressDialog *m_progressDlg;
bool m_RunningConfigure;
bool m_noRefresh;
bool m_quitAfterGenerating;
};
#endif
// _CMAKESETUPFRAME_H_

View File

@ -0,0 +1,136 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "CommandLineInfo.h"
#include "cmSystemTools.h"
///////////////////////////////////////////////////////////////
// cmCommandLineInfo
cmCommandLineInfo::cmCommandLineInfo()
{
this->m_WhereSource = "";
this->m_WhereBuild = "";
this->m_AdvancedValues = false;
this->m_GeneratorChoiceString = "";
this->m_LastUnknownParameter = "";
this->m_ValidArguments = "";
this->m_ExitAfterLoad = false;
}
///////////////////////////////////////////////////////////////
cmCommandLineInfo::~cmCommandLineInfo()
{
}
///////////////////////////////////////////////////////////////
void cmCommandLineInfo::ParseCommandLine(int argc, char* argv[])
{
int cc;
for ( cc = 1; cc < argc; cc ++ )
{
if ( strlen(argv[cc]) < 1 )
{
continue;
}
bool valid = true;
std::string argument = argv[cc];
if ( argument.size() > 1 &&
this->m_ValidArguments.find(argument[1]) == std::string::npos )
{
valid = false;
}
this->ParseParam(argument, valid, (cc + 1 == argc));
}
this->m_ExecutablePath = cmSystemTools::GetFilenamePath(argv[0]);
}
///////////////////////////////////////////////////////////////
int cmCommandLineInfo::GetBoolValue(const std::string& v) {
std::string value = cmSystemTools::LowerCase(v);
if (value == "1" ||
value == "on" ||
value == "true" ||
value == "yes")
{
return 1;
}
else if (value == "0" ||
value == "off" ||
value == "false" ||
value == "no")
{
return -1;
}
return 0;
}
///////////////////////////////////////////////////////////////
// Parse param
void cmCommandLineInfo::ParseParam(const std::string& parameter,
bool know_about, bool /*last*/)
{
if(!know_about)
{
this->m_LastUnknownParameter = parameter;
}
else
{
std::string sParam(parameter.c_str(), 1, parameter.npos);
// Single letter valued flag like /B=value or /B:value
std::string value;
if (sParam[1] == '=' || sParam[1] == ':')
{
value = std::string(parameter.c_str()+3);
}
else
{
value = std::string(parameter.c_str()+2);
}
int res;
switch (sParam[0])
{
case 'A':
res = cmCommandLineInfo::GetBoolValue(value);
if (res == 1)
{
this->m_AdvancedValues = true;
}
else if (res == -1)
{
this->m_AdvancedValues = false;
}
break;
case 'B':
this->m_WhereBuild = value;
break;
case 'G':
this->m_GeneratorChoiceString = value;
break;
case 'Q':
this->m_ExitAfterLoad = true;
break;
case 'H':
this->m_WhereSource = value;
break;
}
}
}

View File

@ -0,0 +1,66 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if !defined(CMAKECOMMANDLINEINFO_H)
#define CMAKECOMMANDLINEINFO_H
#include "cmStandardIncludes.h"
///////////////////////////////////////////////////////////////
// cmCommandLineInfo:
// See cmCommandLineInfo.cxx for the implementation of this class
//
class cmCommandLineInfo
{
// Construction
public:
cmCommandLineInfo();
virtual ~cmCommandLineInfo();
// Parse the command line
void ParseCommandLine(int argc, char* argv[]);
// Set the valid arguments
void SetValidArguments(const std::string& va) { this->m_ValidArguments = va; }
// Retrieve the path of executable
std::string GetPathToExecutable() { return this->m_ExecutablePath; }
// Attributes
public:
std::string m_WhereSource;
std::string m_WhereBuild;
bool m_AdvancedValues;
std::string m_GeneratorChoiceString;
std::string m_LastUnknownParameter;
std::string m_ExecutablePath;
bool m_ExitAfterLoad;
protected:
// Parse one argument
void ParseParam(const std::string& parameter, bool know_about, bool last);
// Return boolean value of the string
static int GetBoolValue(const std::string&);
std::string m_ValidArguments;
};
#endif // !defined(CMAKECOMMANDLINEINFO_H)

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="NGDialog.exe"/>
<description>CMake Next Generation Dialog</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,856 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
/* for compilers that support precompilation
includes "wx/wx.h" */
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "PropertyList.h"
#include "app_resources.h"
#include "../cmCacheManager.h"
#include "../cmSystemTools.h"
#include "../cmake.h"
BEGIN_EVENT_TABLE( wxPropertyList, wxGrid )
EVT_GRID_CELL_LEFT_CLICK( wxPropertyList::OnSelectCell )
EVT_GRID_CELL_CHANGE( wxPropertyList::OnCellChange )
EVT_GRID_CMD_CELL_RIGHT_CLICK( wxID_ANY, wxPropertyList::OnCellPopup )
EVT_MENU ( ID_CACHE_DELETE, wxPropertyList::OnDeleteCache )
EVT_MENU ( ID_CACHE_IGNORE, wxPropertyList::OnIgnoreCache )
EVT_MENU ( ID_CACHE_BROWSE, wxPropertyList::OnBrowseItem )
EVT_SIZE ( wxPropertyList::OnSizeGrid )
EVT_CHAR ( wxPropertyList::OnKeyPressed )
END_EVENT_TABLE()
#if 0
// ----------------------------------------------------------------------------
// wxGridCellPathEditor
// ----------------------------------------------------------------------------
wxGridCellPathEditor::wxGridCellPathEditor()
{
m_maxChars = 0;
}
void wxGridCellPathEditor::Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler)
{
m_control = new wxTextCtrl(parent, id, wxEmptyString,
wxDefaultPosition, wxDefaultSize
#if defined(__WXMSW__)
, wxTE_PROCESS_TAB | wxTE_AUTO_SCROLL
#endif
);
//
// m_button = new wxButton(parent, id+1, _("..."),
// wxDefaultPosition, wxDefaultSize);
//
// set max length allowed in the textctrl, if the parameter was set
if (m_maxChars != 0)
{
((wxTextCtrl*)m_control)->SetMaxLength(m_maxChars);
}
wxGridCellEditor::Create(parent, id, evtHandler);
}
void wxGridCellPathEditor::PaintBackground(const wxRect& WXUNUSED(rectCell),
wxGridCellAttr * WXUNUSED(attr))
{
// as we fill the entire client area, don't do anything here to minimize
// flicker
}
void wxGridCellPathEditor::SetSize(const wxRect& rectOrig)
{
wxRect rect(rectOrig);
// Make the edit control large enough to allow for internal
// margins
//
// TODO: remove this if the text ctrl sizing is improved esp. for
// unix
//
#if defined(__WXGTK__)
if (rect.x != 0)
{
rect.x += 1;
rect.y += 1;
rect.width -= 1;
rect.height -= 1;
}
#else // !GTK
int extra_x = ( rect.x > 2 )? 2 : 1;
// MB: treat MSW separately here otherwise the caret doesn't show
// when the editor is in the first row.
#if defined(__WXMSW__)
int extra_y = 2;
#else
int extra_y = ( rect.y > 2 )? 2 : 1;
#endif // MSW
#if defined(__WXMOTIF__)
extra_x *= 2;
extra_y *= 2;
#endif
rect.SetLeft( wxMax(0, rect.x - extra_x) );
rect.SetTop( wxMax(0, rect.y - extra_y) );
rect.SetRight( rect.GetRight() + 2*extra_x );
rect.SetBottom( rect.GetBottom() + 2*extra_y );
#endif // GTK/!GTK
wxGridCellEditor::SetSize(rect);
}
void wxGridCellPathEditor::BeginEdit(int row, int col, wxGrid* grid)
{
wxASSERT_MSG(m_control,
wxT("The wxGridCellEditor must be Created first!"));
m_startValue = grid->GetTable()->GetValue(row, col);
DoBeginEdit(m_startValue);
}
void wxGridCellPathEditor::DoBeginEdit(const wxString& startValue)
{
Text()->SetValue(startValue);
Text()->SetInsertionPointEnd();
Text()->SetSelection(-1,-1);
Text()->SetFocus();
}
bool wxGridCellPathEditor::EndEdit(int row, int col,
wxGrid* grid)
{
wxASSERT_MSG(m_control,
wxT("The wxGridCellEditor must be Created first!"));
bool changed = false;
wxString value = Text()->GetValue();
if (value != m_startValue)
changed = true;
if (changed)
grid->GetTable()->SetValue(row, col, value);
m_startValue = wxEmptyString;
// No point in setting the text of the hidden control
//Text()->SetValue(m_startValue);
return changed;
}
void wxGridCellPathEditor::Reset()
{
wxASSERT_MSG(m_control,
wxT("The wxGridCellEditor must be Created first!"));
DoReset(m_startValue);
}
void wxGridCellPathEditor::DoReset(const wxString& startValue)
{
Text()->SetValue(startValue);
Text()->SetInsertionPointEnd();
}
bool wxGridCellPathEditor::IsAcceptedKey(wxKeyEvent& event)
{
return wxGridCellEditor::IsAcceptedKey(event);
}
void wxGridCellPathEditor::StartingKey(wxKeyEvent& event)
{
// Since this is now happening in the EVT_CHAR event EmulateKeyPress is no
// longer an appropriate way to get the character into the text control.
// Do it ourselves instead. We know that if we get this far that we have
// a valid character, so not a whole lot of testing needs to be done.
wxTextCtrl* tc = Text();
wxChar ch;
long pos;
#if wxUSE_UNICODE
ch = event.GetUnicodeKey();
if (ch <= 127)
ch = (wxChar)event.GetKeyCode();
#else
ch = (wxChar)event.GetKeyCode();
#endif
switch (ch)
{
case WXK_DELETE:
// delete the character at the cursor
pos = tc->GetInsertionPoint();
if (pos < tc->GetLastPosition())
tc->Remove(pos, pos+1);
break;
case WXK_BACK:
// delete the character before the cursor
pos = tc->GetInsertionPoint();
if (pos > 0)
tc->Remove(pos-1, pos);
break;
default:
tc->WriteText(ch);
break;
}
}
void wxGridCellPathEditor::HandleReturn( wxKeyEvent &event )
{
#if defined(__WXMOTIF__) || defined(__WXGTK__)
// wxMotif needs a little extra help...
size_t pos = (size_t)( Text()->GetInsertionPoint() );
wxString s( Text()->GetValue() );
s = s.Left(pos) + wxT("\n") + s.Mid(pos);
Text()->SetValue(s);
Text()->SetInsertionPoint( pos );
#else
// the other ports can handle a Return key press
//
event.Skip();
#endif
}
void wxGridCellPathEditor::SetParameters(const wxString& params)
{
if ( !params )
{
// reset to default
m_maxChars = 0;
}
else
{
long tmp;
if ( !params.ToLong(&tmp) )
{
wxLogDebug(_T("Invalid wxGridCellPathEditor parameter string '%s' ignored"), params.c_str());
}
else
{
m_maxChars = (size_t)tmp;
}
}
}
// return the value in the text control
wxString wxGridCellPathEditor::GetValue() const
{
return Text()->GetValue();
}
#endif
/////////////////////////////////////////////////////////////////////////////
// wxPropertyItem
// returns true when this property item is a filepath
bool wxPropertyItem::IsFilePath()
{
return m_nItemType == wxPropertyList::FILE;
}
// returns true when this property item is a dir path
bool wxPropertyItem::IsDirPath()
{
return m_nItemType == wxPropertyList::PATH;
}
/////////////////////////////////////////////////////////////////////////////
// wxPropertyList
wxPropertyList::~wxPropertyList()
{
WX_CLEAR_ARRAY(m_PropertyItems);
}
int wxPropertyList::AddItem(const wxString &txt)
{
// TODO: Add the item to the grid!
//int nIndex = AddString(txt);
//return nIndex;
return 0;
}
// order = 0 sorted (not supported yet)
// order = 1 add to top
// order = 2 add to bottom
int wxPropertyList::AddPropItem(wxPropertyItem* pItem, int order)
{
m_PropertyItems.Add(pItem);
if(pItem->GetAdvanced() && ! m_ShowAdvanced)
return 0;
// disable in progress editing
HideControls();
return AddPropertyToGrid(pItem, order);
}
int wxPropertyList::AddPropertyToGrid(wxPropertyItem *pItem, int order)
{
int row = 0;
if(order == 1)
InsertRows(0,1);
else
{
AppendRows(1);
row = GetNumberRows() - 1;
}
// initialise the type of renderer
if(pItem->GetItemType() == wxPropertyList::CHECKBOX)
{
SetCellRenderer(row, 1, new wxGridCellBoolRenderer);
SetCellEditor(row, 1, new wxGridCellBoolEditor);
}
#ifdef __LINUX__
// fix to make sure scrollbars are drawn properly
wxGrid::AdjustScrollbars();
#endif
// the property display is read only
UpdatePropertyItem(pItem, row);
return row;
}
void wxPropertyList::AddProperty(const char* name, const char* value, const char* helpString,
int type, const char* comboItems, bool reverseOrder, bool advanced)
{
wxPropertyItem* pItem = 0;
// add or update the property item
for(size_t i = 0; i < m_PropertyItems.Count(); i++)
{
if(m_PropertyItems[i]->GetPropName().IsSameAs(name))
{
pItem = m_PropertyItems[i];
if(!pItem->GetCurValue().IsSameAs(value))
{
pItem->SetCurValue(value);
pItem->SetHelpString(helpString);
pItem->SetAdvanced(advanced);
// update the property item
int row = FindProperty(pItem);
if(row != -1)
UpdatePropertyItem(pItem, row);
}
return;
}
}
// if it is not found, then create a new one
if(!pItem)
{
pItem = new wxPropertyItem(name, value, helpString, type, comboItems);
pItem->SetAdvanced(advanced);
AddPropItem(pItem, 1);
}
}
void wxPropertyList::UpdateGridView()
{
// make sure all items are shown, remove items that should not be shown
bool keepItem;
int row;
for(size_t i = 0; i < m_PropertyItems.Count(); i++)
{
// to begin with, does this item fit the query?
keepItem = m_strQuery.IsEmpty() || (m_PropertyItems[i]->GetPropName().Find(m_strQuery) != -1);
if(keepItem)
{
// when advanced items are allowed to be shown, keep when ok
if(!m_ShowAdvanced)
keepItem = !m_PropertyItems[i]->GetAdvanced();
}
// find the item, if not present but keep is true, add, if
// present but keep is false, remove
row = -1;
for(size_t j = 0; j < (size_t)GetNumberRows(); j++)
{
if(m_PropertyItems[i]->GetPropName().IsSameAs(GetCellValue(j, 0)))
{
row = j;
break;
}
}
if(row == -1 && keepItem)
AddPropertyToGrid(m_PropertyItems[i], (m_ShowAdvanced ? 2 : 0));
else if(row != -1 && !keepItem)
DeleteRows(row, 1);
}
#ifdef __LINUX__
// fix to make sure scrollbars are drawn properly
wxGrid::AdjustScrollbars();
#endif
}
void wxPropertyList::HideControls()
{
DisableCellEditControl();
}
void wxPropertyList::RemoveProperty(wxPropertyItem *pItem)
{
HideControls();
// look for property in grid, delete it when present
for(size_t j = 0; j < (size_t)GetNumberRows(); j++)
{
if(pItem->GetPropName().IsSameAs(GetCellValue(j, 0), false))
{
DeleteRows(j, 1);
#ifdef __LINUX__
// fix to make sure scrollbars are drawn properly
wxGrid::AdjustScrollbars();
#endif
break;
}
}
// delete the item from the list
m_PropertyItems.Remove(pItem);
delete pItem;
}
wxPropertyItem *wxPropertyList::FindPropertyByName(const wxString &name)
{
for(size_t i = 0; i < m_PropertyItems.Count(); i++)
{
// we have an advanced item, go through table and if not present, show it
if(m_PropertyItems[i]->GetPropName().IsSameAs(name, true))
return m_PropertyItems[i];
}
return 0;
}
/**
void wxPropertyList::OnIgnore()
{
if(m_curSel == -1 || this->GetCount() <= 0)
{
return;
}
wxPropertyItem* pItem = (wxPropertyItem*) GetItemDataPtr(m_curSel);
pItem->m_curValue = "IGNORE";
InvalidateList();
}
*/
/**
void wxPropertyList::OnDelete()
{
if(m_curSel == -1 || this->GetCount() <= 0)
{
return;
}
wxPropertyItem* pItem = (wxPropertyItem*) GetItemDataPtr(m_curSel);
m_CMakeSetupDialog->GetCMakeInstance()->GetCacheManager()->RemoveCacheEntry(pItem->m_propName);
m_PropertyItems.erase(pItem);
delete pItem;
this->DeleteString(m_curSel);
this->HideControls();
this->SetTopIndex(0);
InvalidateList();
}
*/
/**
void wxPropertyList::OnHelp()
{
if(m_curSel == -1 || this->GetCount() <= 0)
{
return;
}
wxPropertyItem* pItem = (wxPropertyItem*) GetItemDataPtr(m_curSel);
MessageBox(pItem->m_HelpString, pItem->m_propName, MB_OK|MB_ICONINFORMATION);
}
*/
void wxPropertyList::RemoveAll()
{
WX_CLEAR_ARRAY(m_PropertyItems);
m_generatedProjects = false;
if(GetNumberRows() > 0)
DeleteRows(0, GetNumberRows());
m_strQuery.Empty();
#ifdef __LINUX__
// fix to make sure scrollbars are drawn properly
wxGrid::AdjustScrollbars();
#endif
}
void wxPropertyList::ShowAdvanced()
{
// set flag in the control
m_ShowAdvanced = true;
UpdateGridView();
}
void wxPropertyList::HideAdvanced()
{
// set flag in the control
m_ShowAdvanced = false;
UpdateGridView();
}
int wxPropertyList::FindProperty(wxPropertyItem *pItem)
{
if(GetNumberRows() > 0 && pItem != 0)
{
// find the property the traditional way
for(size_t j = 0; j < (size_t)GetNumberRows(); j++)
{
if(pItem->GetPropName().IsSameAs(GetCellValue(j, 0)))
return j;
}
}
return -1;
}
wxPropertyItem *wxPropertyList::GetPropertyItemFromRow(int row)
{
if(row < GetNumberRows() && row >= 0)
{
wxString str = GetCellValue(row, 0);
// find the property the traditional way
for(size_t i = 0; i < (size_t)m_PropertyItems.Count(); i++)
{
if(m_PropertyItems[i]->GetPropName().IsSameAs(str))
return m_PropertyItems[i];
}
}
return 0;
}
bool wxPropertyList::UpdatePropertyItem(wxPropertyItem *pItem, int row)
{
wxCHECK(row < GetNumberRows(), false);
// reflect the property's state to match the grid row
SetReadOnly(row, 0);
// TODO: Make this a UpdatePropItem where ADVANCED, and new edit values are reflected
SetCellValue(row,0, pItem->GetPropName());
// boolean renderer
if(pItem->GetItemType() == wxPropertyList::CHECKBOX)
{
// translate ON or TRUE (case insensitive to a checkbox)
if(pItem->GetCurValue().IsSameAs(wxT("ON"), false) ||
pItem->GetCurValue().IsSameAs(wxT("TRUE"), false))
SetCellValue(row, 1, wxT("1"));
else
SetCellValue(row, 1, wxT("0"));
}
else
{
// for normal path values, give bold in cell when
// the NOTFOUND is present, for emphasis
wxString str = pItem->GetPropName() + wxT("-NOTFOUND");
if(pItem->GetCurValue().IsSameAs(str))
{
wxFont fnt = GetCellFont(row, 0);
fnt.SetWeight(wxFONTWEIGHT_BOLD);
SetCellFont(row, 1, fnt);
}
else
SetCellFont(row, 1, GetCellFont(row, 0));
SetCellValue(row,1, pItem->GetCurValue());
}
if(pItem->GetCurValue().IsSameAs("IGNORE"))
{
// ignored cell is completely dimmed
wxColour col(192,192,192);
SetCellTextColour(row, 1, col);
}
else
{
// we colour paths blue, filenames green, all else black
wxColour col;
if(pItem->IsDirPath())
col.Set(0,0,255);
else if(pItem->IsFilePath())
col.Set(0,128,0);
else
col = GetCellTextColour(row, 0);
SetCellTextColour(row, 1, col);
}
if(pItem->GetNewValue())
{
// new cell is red
wxColour col(255,100,100);
SetCellBackgroundColour(row, 0, col);
}
else
{
// old cell is grey
wxColour col(192, 192, 192);
SetCellBackgroundColour(row, 0, col);
}
return true;
}
void wxPropertyList::OnSelectCell( wxGridEvent& event )
{
this->SetFocus();
event.Skip();
}
void wxPropertyList::OnCellChange( wxGridEvent& event )
{
int row = event.GetRow();
wxPropertyItem *pItem = GetPropertyItemFromRow(row);
if(pItem && row != wxNOT_FOUND)
{
// write propery back, and set as new
pItem->SetNewValue(true);
// write back bool
if(pItem->GetItemType() == CHECKBOX)
{
if(GetCellValue(row, 1).IsSameAs("1"))
pItem->SetCurValue("ON");
else
pItem->SetCurValue("OFF");
}
else
pItem->SetCurValue(GetCellValue(row, 1));
UpdatePropertyItem(pItem, row);
event.Skip();
}
}
void wxPropertyList::OnCellPopup( wxGridEvent& event )
{
wxPoint pt;
int row = event.GetRow();
//pt = ::wxGetMousePosition();
//ScreenToClient(pt);
//row = YToRow(pt.y);
if(row != wxNOT_FOUND)
{
wxPropertyItem *pItem = GetPropertyItemFromRow(row);
if(pItem)
{
// select the row first if already in selection, don't
// this will clear the previous selection
if(!IsInSelection(row, 0))
SelectRow(row);
// show popup menu
wxMenu *menu = AppResources::CreatePopupMenu();
// enable when it is browsable, and selected one only
wxMenuItem *item = menu->FindItem(ID_CACHE_BROWSE);
if(item)
item->Enable(IsSelectedItemBrowsable());
PopupMenu(menu);
delete menu;
}
}
}
void wxPropertyList::OnIgnoreCache( wxCommandEvent& event )
{
HideControls();
// ignore all selected items
for(size_t i = 0; i < (size_t)GetNumberRows(); i++)
{
if(IsInSelection(i, 0))
{
wxPropertyItem *pItem = GetPropertyItemFromRow(i);
if(pItem)
{
pItem->SetCurValue("IGNORE");
UpdatePropertyItem(pItem, i);
}
}
}
}
void wxPropertyList::OnDeleteCache( wxCommandEvent& event )
{
HideControls();
// convert selections to prop items
wxArrayPtrVoid items;
for(size_t i = 0; i < (size_t)GetNumberRows(); i++)
{
// if selected, query for removal
if(IsInSelection(i, 0))
{
wxPropertyItem *pItem = GetPropertyItemFromRow(i);
if(pItem)
items.Add((void *)pItem);
}
}
// now delete all prop items in cells
for(size_t i = 0; i < items.Count(); i++)
RemoveProperty((wxPropertyItem *)items[i]);
}
void wxPropertyList::OnBrowseItem( wxCommandEvent& event )
{
BrowseSelectedItem();
}
bool wxPropertyList::IsSelectedItemBrowsable(int row)
{
// when there is only one selection, and our current item
// is browsable, make sure it can be selected.
wxPropertyItem *pItem = 0;
size_t count = 0;
for(size_t i = 0; i < (size_t)GetNumberRows() && (count < 2); i++)
{
if(IsInSelection(i, 0))
{
if(!pItem)
pItem = GetPropertyItemFromRow(i);
count ++;
}
}
// if we found nothing, take row (because the event EVT_GRID_CELL_SELECTED
// deselects the cells first before selecting the new one again
if(row != -1 && !pItem)
{
pItem = GetPropertyItemFromRow(row);
count ++; // needed because of next loop
}
// only one item allowed to select
if(pItem && count == 1)
{
if(pItem)
return pItem->IsDirPath() || pItem->IsFilePath();
}
return false;
}
void wxPropertyList::BrowseSelectedItem()
{
HideControls();
for(size_t i = 0; i < (size_t)GetNumberRows(); i++)
{
if(IsInSelection(i, 0))
{
// browse for file or directory
wxPropertyItem *pItem = GetPropertyItemFromRow(i);
if(pItem)
{
wxString title;
wxString str = pItem->GetPropName() + _("-NOTFOUND");
if(pItem->GetCurValue().IsSameAs(str, true))
str.Empty();
else
str = pItem->GetCurValue();
// browse the directory path
if(pItem->IsDirPath())
{
title = _("Select path for ") + pItem->GetPropName();
str = ::wxDirSelector(title, str, 0, wxDefaultPosition, this);
}
else if(pItem->IsFilePath())
{
title = _("Select file for ") + pItem->GetPropName();
str = ::wxFileSelector(title, str, _(""), _(""), _(MC_DEFAULT_WILDCARD), wxFILE_MUST_EXIST, this);
}
else
str.Empty();
if(!str.IsEmpty())
{
pItem->SetCurValue(str.c_str());
UpdatePropertyItem(pItem, i);
}
}
// only allow one item to browse
break;
}
}
}
void wxPropertyList::OnSizeGrid( wxSizeEvent &event )
{
int width, height;
// make sure the grid's cells are equally adjusted
GetClientSize(&width, &height);
SetDefaultColSize(width / 2, true);
wxGrid::AdjustScrollbars();
}
void wxPropertyList::OnKeyPressed( wxKeyEvent &event )
{
event.Skip();
}

View File

@ -0,0 +1,339 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __WXPROPERTYLIST_H
#define __WXPROPERTYLIST_H
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include <wx/dynarray.h>
#include <wx/grid.h>
#include "../cmStandardIncludes.h"
#ifdef __LINUX__
#define MC_DEFAULT_WILDCARD "*"
#else
#define MC_DEFAULT_WILDCARD "*.*"
#endif
#if 0
// the editor for string/text data
class wxGridCellPathEditor : public wxGridCellEditor
{
public:
wxGridCellPathEditor();
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler);
virtual void SetSize(const wxRect& rect);
virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
virtual bool IsAcceptedKey(wxKeyEvent& event);
virtual void BeginEdit(int row, int col, wxGrid* grid);
virtual bool EndEdit(int row, int col, wxGrid* grid);
virtual void Reset();
virtual void StartingKey(wxKeyEvent& event);
virtual void HandleReturn(wxKeyEvent& event);
// parameters string format is "max_width"
virtual void SetParameters(const wxString& params);
virtual wxGridCellEditor *Clone() const
{ return new wxGridCellPathEditor; }
// DJC MAPTEK
// added GetValue so we can get the value which is in the control
virtual wxString GetValue() const;
protected:
wxTextCtrl *Text() const { return (wxTextCtrl *)m_control; }
// parts of our virtual functions reused by the derived classes
void DoBeginEdit(const wxString& startValue);
void DoReset(const wxString& startValue);
private:
size_t m_maxChars; // max number of chars allowed
wxString m_startValue;
DECLARE_NO_COPY_CLASS(wxGridCellPathEditor)
};
#endif
/////////////////////////////////////////////////////////////////////////////
//wxPropertyItem Items
class wxPropertyItem
{
public:
wxPropertyItem(const wxString &propName, const wxString &curValue,
const wxString &helpString, int nItemType, const wxString &cmbItems)
: m_NewValue(true)
, m_HelpString(helpString)
, m_Removed(false)
, m_propName(propName)
, m_curValue(curValue)
, m_nItemType(nItemType)
, m_cmbItems(cmbItems)
, m_Advanced(false)
{
//m_NewValue = true;
//m_HelpString = helpString;
//m_Removed = false;
//m_propName = propName;
//m_curValue = curValue;
//m_nItemType = nItemType;
//m_cmbItems = cmbItems;
//m_Advanced = false;
}
const wxString &GetCurValue() const {
return m_curValue;
};
const wxString &GetPropName() const {
return m_propName;
};
void SetCurValue(const char *str) {
m_curValue = str;
};
void SetPropName(const char *str) {
m_propName = str;
};
void SetAdvanced(bool value) {
m_Advanced = value;
};
void SetHelpString(const char *str) {
m_HelpString = str;
};
bool GetAdvanced() const {
return m_Advanced;
};
void SetNewValue(bool value) {
m_NewValue = value;
};
bool GetNewValue() const {
return m_NewValue;
};
int GetItemType() const {
return m_nItemType;
};
const wxString &GetHelpString() const {
return m_HelpString;
};
// returns true when this property item is a filepath
bool IsFilePath();
// returns true when this property item is a dir path
bool IsDirPath();
private:
wxString m_HelpString;
wxString m_propName;
wxString m_curValue;
int m_nItemType;
wxString m_cmbItems;
bool m_NewValue;
bool m_Removed;
bool m_Advanced;
};
WX_DEFINE_ARRAY(wxPropertyItem *, wxPropertyItems);
/////////////////////////////////////////////////////////////////////////////
// wxPropertyList Grid
class wxPropertyList : public wxGrid
{
// Construction
public:
wxPropertyList(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxWANTS_CHARS,
const wxString& name = wxPanelNameStr)
: wxGrid(parent, id, pos, size, style, name)
{
};
enum ItemType
{
COMBO = 0,
EDIT,
COLOR,
FONT,
FILE,
CHECKBOX,
PATH
};
virtual ~wxPropertyList();
public:
bool GetShowAdvanced() const {
return m_ShowAdvanced;
};
void SetProjectGenerated(bool value) {
m_generatedProjects = value;
};
bool IsGenerated() {
return m_generatedProjects;
};
int AddItem(const wxString &txt);
void AddProperty(const char* name, const char* value, const char* helpString, int type,
const char* comboItems, bool reverseOrder, bool advanced);
void RemoveProperty(wxPropertyItem *pItem);
void HideControls();
void ShowAdvanced();
void HideAdvanced();
void RemoveAll();
wxPropertyItem* GetItem(size_t index) {
wxCHECK(index < GetCount(), 0);
return m_PropertyItems[index];
};
size_t GetCount() const {
return m_PropertyItems.Count();
};
const wxPropertyItems &GetItems() {
return m_PropertyItems;
};
void SetShowAdvanced(bool value) {
m_ShowAdvanced = value;
};
bool UpdatePropertyItem(wxPropertyItem *pItem, int row);
/** Returns the row of the grid on which the item is found. -1 is returned when not found */
int FindProperty(wxPropertyItem *pItem);
/** Returns true when the cache is still dirty, which means
after a configuration run, there are still new items */
bool IsCacheDirty() {
// check if we have items that are new
for(size_t i = 0; i < m_PropertyItems.Count(); i++)
{
//if((m_PropertyItems[i]->GetNewValue() && m_ShowAdvanced && m_PropertyItems[i]->GetAdvanced()) ||
// (m_PropertyItems[i]->GetNewValue() && !m_ShowAdvanced))
if(m_PropertyItems[i]->GetNewValue())
return true;
}
// return flag if generated cache or not
return false;
};
/** Returns the property item from the current row. 0 if no property item found */
wxPropertyItem *GetPropertyItemFromRow(int row);
/** Finds the property by name and returns the property item */
wxPropertyItem *FindPropertyByName(const wxString &name);
/** Sets the search filter. Making sure that the items currently displayed
match this substring query */
void SetQuery(const wxString &query) {
m_strQuery = query;
UpdateGridView();
};
/** Returns the last used query. */
const wxString &GetQuery() {
return m_strQuery;
};
/** Function that tries to browse for the item that is selected */
void BrowseSelectedItem();
/** Returns true when the item is browsable (file or path) and only one item is
selected */
bool IsSelectedItemBrowsable(int row = -1);
private:
// order = 0 sorted
// order = 1 add to top
// order = 2 add to bottom
int AddPropItem(wxPropertyItem* pItem, int order);
/** Adds the property item to the grid. */
int AddPropertyToGrid(wxPropertyItem *pItem, int order) ;
/** Adds / removes all the items that are currently (not) matching the
query filter */
void UpdateGridView();
void OnSelectCell( wxGridEvent& event );
void OnCellChange( wxGridEvent& event );
void OnCellPopup( wxGridEvent& event );
void OnIgnoreCache( wxCommandEvent& event );
void OnDeleteCache( wxCommandEvent& event );
void OnSizeGrid( wxSizeEvent &event );
void OnBrowseItem( wxCommandEvent& event );
void OnKeyPressed( wxKeyEvent &event );
int m_curSel;
int m_prevSel;
int m_nDivider;
int m_nDivTop;
int m_nDivBtm;
int m_nOldDivX;
int m_nLastBox;
bool m_bTracking;
bool m_bDivIsSet;
bool m_ShowAdvanced;
// flag to indicate the last cache load has resulted
// in generating a valid project
bool m_generatedProjects;
wxString m_strQuery;
wxPropertyItems m_PropertyItems;
DECLARE_EVENT_TABLE()
};
#endif

View File

@ -0,0 +1,21 @@
<html>
<head>
<title>CMake - CMakeSetup GUI Build System</title>
</head>
<body>
<font color="#000080" size="+2"><em><strong>CMake - CMakeSetup GUI Build System</strong></em></font>
<p><font size="+1" face="Arial, Helvetica, sans-serif">Welcome to CMake! The cross-platform, open-source make system.
<b>CMake</b> is used to control the software compilation process using simple platform and compiler independent configuration files.
<b>CMake</b> generates native makefiles and workspaces that can be used in the compiler environment of your choice.
Please go to <i><b>http://www.cmake.org</b></i> to learn more about CMake.<br><br>
CMakeSetup.exe is enhanced and ported to wxWidgets 2.6.0 by Jorgen Bodde (jorgb@xs4all.nl).<br>
Current CMakeSetup version is: @V@<br>
Current CMake build system is: @B@<br><br>
Current generators are supported:<br>
@G@
</font>
</p>
</body>
</html>

View File

@ -0,0 +1,210 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "aboutdlg.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "cmake_logo.xpm"
#include "aboutdlg.h"
////@begin XPM images
////@end XPM images
/*!
* CMAboutDlg type definition
*/
IMPLEMENT_DYNAMIC_CLASS( CMAboutDlg, wxDialog )
/*!
* CMAboutDlg event table definition
*/
BEGIN_EVENT_TABLE( CMAboutDlg, wxDialog )
////@begin CMAboutDlg event table entries
EVT_BUTTON( ID_ABOUT_DLG_OK, CMAboutDlg::OnAboutDlgClick )
////@end CMAboutDlg event table entries
END_EVENT_TABLE()
/*!
* CMAboutDlg constructors
*/
CMAboutDlg::CMAboutDlg( )
{
}
CMAboutDlg::CMAboutDlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Create(parent, id, caption, pos, size, style);
}
/*!
* CMAboutDlg creator
*/
bool CMAboutDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin CMAboutDlg member initialisation
m_cmIcon = NULL;
m_html = NULL;
////@end CMAboutDlg member initialisation
////@begin CMAboutDlg creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();
////@end CMAboutDlg creation
// set logo on the dialog
wxBitmap bmp(cmake_logo);
m_cmIcon->SetBitmap(bmp);
return TRUE;
}
/*!
* Control creation for CMAboutDlg
*/
void CMAboutDlg::CreateControls()
{
////@begin CMAboutDlg content construction
CMAboutDlg* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxFlexGridSizer* itemFlexGridSizer3 = new wxFlexGridSizer(1, 2, 0, 0);
itemFlexGridSizer3->AddGrowableRow(0);
itemFlexGridSizer3->AddGrowableCol(1);
itemBoxSizer2->Add(itemFlexGridSizer3, 1, wxGROW|wxALL, 5);
wxBitmap m_cmIconBitmap(wxNullBitmap);
m_cmIcon = new wxStaticBitmap( itemDialog1, wxID_STATIC, m_cmIconBitmap, wxDefaultPosition, wxSize(32, 32), 0 );
itemFlexGridSizer3->Add(m_cmIcon, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP|wxLEFT|wxRIGHT|wxTOP, 5);
m_html = new wxHtmlWindow( itemDialog1, ID_HTMLWINDOW, wxDefaultPosition, wxSize(500, 300), wxHW_SCROLLBAR_AUTO|wxNO_BORDER|wxHSCROLL|wxVSCROLL );
itemFlexGridSizer3->Add(m_html, 1, wxGROW|wxGROW|wxRIGHT|wxTOP|wxBOTTOM, 5);
wxButton* itemButton6 = new wxButton( itemDialog1, ID_ABOUT_DLG_OK, _("&Ok"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemButton6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
////@end CMAboutDlg content construction
}
/*!
* Should we show tooltips?
*/
bool CMAboutDlg::ShowToolTips()
{
return TRUE;
}
void CMAboutDlg::SetAboutText(const wxString &cmversion, const wxString &cmsversion, const wxArrayString &generators)
{
// set HTML text in window
wxString text = _("<html><head><title>CMakeSetup - GUI Build System for CMake</title></head>"
"<body><font color=\"#000080\" size=\"+1\"><em><strong>CMakeSetup - GUI Build System for CMake</strong></em></font>"
"<p><font face=\"Arial, Helvetica, sans-serif\">Welcome to <b>CMake</b>! The cross-platform, open-source make system."
"<b>CMake</b> is used to control the software compilation process using simple platform and compiler independent configuration files. "
"<b>CMake</b> generates native makefiles and workspaces that can be used in the compiler environment of your choice. "
"Please go to <i><b>http://www.cmake.org</b></i> to learn more about CMake.<br><br>"
"CMakeSetup.exe is enhanced and ported by Jorgen Bodde using <i>@WXV@</i>. The original CMakeSetup.exe is "
"written by Bill Hoffman, Ken Martin, Brad King and Andy Cedilnik.<br><br>"
"Current CMakeSetup version is: <b>@B@</b><br>"
"Current CMake build system is: <b>@V@</b><br><br>"
"Current generators are supported:<br>"
"@G@</font></p></body></html>");
// compile list of generators in a bulleted list
wxString gens = _("<ul>");
for(size_t i = 0; i < generators.Count(); i++)
gens << "<li><u>" << generators[i] << "</u></li>";
gens << _("</ul>");
// replace stuff
text.Replace(_("@V@"), cmversion, true);
text.Replace(_("@B@"), cmsversion, true);
text.Replace(_("@G@"), gens, true);
text.Replace(_("@WXV@"), wxVERSION_STRING, true);
m_html->SetPage(text);
// set color of HTML window to bg window
m_html->SetBackgroundColour(GetBackgroundColour());
}
/*!
* Get bitmap resources
*/
wxBitmap CMAboutDlg::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin CMAboutDlg bitmap retrieval
return wxNullBitmap;
////@end CMAboutDlg bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon CMAboutDlg::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin CMAboutDlg icon retrieval
return wxNullIcon;
////@end CMAboutDlg icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ABOUT_DLG_OK
*/
void CMAboutDlg::OnAboutDlgClick( wxCommandEvent& event )
{
Close();
}

117
Source/WXDialog/aboutdlg.h Normal file
View File

@ -0,0 +1,117 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _ABOUTDLG_H_
#define _ABOUTDLG_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "aboutdlg.cpp"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/html/htmlwin.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxHtmlWindow;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_SOME_ABOUTDLG 10003
#define SYMBOL_CMABOUTDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_CMABOUTDLG_TITLE _("About ...")
#define SYMBOL_CMABOUTDLG_IDNAME ID_SOME_ABOUTDLG
#define SYMBOL_CMABOUTDLG_SIZE wxSize(400, 300)
#define SYMBOL_CMABOUTDLG_POSITION wxDefaultPosition
#define ID_HTMLWINDOW 10000
#define ID_ABOUT_DLG_OK 10005
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
#ifndef wxFIXED_MINSIZE
#define wxFIXED_MINSIZE 0
#endif
/*!
* CMAboutDlg class declaration
*/
class CMAboutDlg: public wxDialog
{
DECLARE_DYNAMIC_CLASS( CMAboutDlg )
DECLARE_EVENT_TABLE()
public:
/// Constructors
CMAboutDlg( );
CMAboutDlg( wxWindow* parent, wxWindowID id = SYMBOL_CMABOUTDLG_IDNAME, const wxString& caption = SYMBOL_CMABOUTDLG_TITLE, const wxPoint& pos = SYMBOL_CMABOUTDLG_POSITION, const wxSize& size = SYMBOL_CMABOUTDLG_SIZE, long style = SYMBOL_CMABOUTDLG_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CMABOUTDLG_IDNAME, const wxString& caption = SYMBOL_CMABOUTDLG_TITLE, const wxPoint& pos = SYMBOL_CMABOUTDLG_POSITION, const wxSize& size = SYMBOL_CMABOUTDLG_SIZE, long style = SYMBOL_CMABOUTDLG_STYLE );
/// Creates the controls and sizers
void CreateControls();
void SetAboutText(const wxString &cmversion, const wxString &cmsversion, const wxArrayString &generators);
////@begin CMAboutDlg event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ABOUT_DLG_OK
void OnAboutDlgClick( wxCommandEvent& event );
////@end CMAboutDlg event handler declarations
////@begin CMAboutDlg member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end CMAboutDlg member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin CMAboutDlg member variables
wxStaticBitmap* m_cmIcon;
wxHtmlWindow* m_html;
////@end CMAboutDlg member variables
};
#endif
// _ABOUTDLG_H_

View File

@ -0,0 +1,86 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "app_resources.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "app_resources.h"
////@begin XPM images
////@end XPM images
/*!
* Resource functions
*/
////@begin AppResources resource functions
/*!
* Menu creation function for ID_MENU
*/
wxMenu* AppResources::CreatePopupMenu()
{
wxMenu* itemMenu1 = new wxMenu;
itemMenu1->Append(ID_CACHE_IGNORE, _("&Ignore cache entry"), _("Ignores the value of the current cache entry"), wxITEM_NORMAL);
itemMenu1->Append(ID_CACHE_DELETE, _("&Delete cache entry"), _("Deletes the current cache entry (reverts on next configure)"), wxITEM_NORMAL);
itemMenu1->AppendSeparator();
itemMenu1->Append(ID_CACHE_BROWSE, _("&Browse ..."), _T(""), wxITEM_NORMAL);
return itemMenu1;
}
////@end AppResources resource functions
/*!
* Get bitmap resources
*/
wxBitmap AppResources::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin AppResources bitmap retrieval
return wxNullBitmap;
////@end AppResources bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon AppResources::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin AppResources icon retrieval
return wxNullIcon;
////@end AppResources icon retrieval
}

View File

@ -0,0 +1,60 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _APP_RESOURCES_H_
#define _APP_RESOURCES_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "app_resources.cpp"
#endif
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_CACHE_IGNORE 10051
#define ID_CACHE_DELETE 10052
#define ID_CACHE_BROWSE 10053
////@end control identifiers
class AppResources
{
public:
AppResources() {}
/*!
* Resource functions
*/
////@begin AppResources resource functions
/// Menu creation function for ID_MENU
static wxMenu* CreatePopupMenu();
/// Retrieves bitmap resources
static wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
static wxIcon GetIconResource( const wxString& name );
////@end AppResources resource functions
};
#endif
// _APP_RESOURCES_H_

View File

@ -0,0 +1,22 @@
Changes for new CMakeSetup dialog (v0.9)
- Cancel button on progress dialog now cancels the process
- Generator cannot be chosen anymore after there are cache items (this is pointless anyway)
- Drop target on grid (a folder) will load this in the build path and load up the cache
- Deletion of cache before something is generated, will ask the user if this is what he/she wants
- Reloading of cache added, after deleting cache items (and it was a mistake, a reload can bring it back to previous state)
- Added a search query. Typing a substring will narrow the search. When ENTER is pressed the substring is stored in the search query history for easy lookup
- Added a message display window, that will show all messages for easy copy-pasting and reference. This also obsoleted the "stop reporting errors" option
- A status percentage is shown in the task bar (when configuring, next to the configure window)
- Added menu bar with most common options (reload cache, delete cache, options, about etc)
- Added browse option in context menu on grid. Blue and green items are browsable (paths and files)
- Added about dialog
- Added options dialog (for future options)
- OPTION cache items are now implemented as checkboxes instead of comboboxes. Easier to double click instead of figuring out if you want to go up or down for YES or NO
- Added XP look to window (XP manifest)
- Added progress dialog that shows configuration progress
- Closing of dialog can be postponed by SHIFT (when option "close after generation is done" is selected)
- Window position X, Y and size is remembered between sessions
- Added most recent used list, with 5 last used build directories for easy lookup
- Cache options for paths are colored blue, cache options for files are green, and the rest is black
- NOTFOUND entries are made bold for easy recognition
- The selected item is described in a seperate text box for easy reading instead of in the statusbar

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

View File

@ -0,0 +1,276 @@
/* XPM */
static char *Pixmap[] = {
"16 16 256 3",
"000 c black",
"001 c #003F00",
"002 c #003F3F",
"003 c #3F0000",
"004 c #3F003F",
"005 c #3F3F00",
"006 c gray19",
"007 c #00007F",
"008 c #007F00",
"009 c #306F30",
"010 c #7F0000",
"011 c #606060",
"012 c #0000BF",
"013 c blue",
"014 c #00BF00",
"015 c green",
"016 c #BF0000",
"017 c red",
"018 c #909090",
"019 c #C0C0C0",
"020 c none",
"021 c black",
"022 c black",
"023 c black",
"024 c black",
"025 c black",
"026 c black",
"027 c black",
"028 c black",
"029 c black",
"030 c black",
"031 c black",
"032 c black",
"033 c black",
"034 c black",
"035 c black",
"036 c black",
"037 c black",
"038 c black",
"039 c black",
"040 c black",
"041 c black",
"042 c black",
"043 c black",
"044 c black",
"045 c black",
"046 c black",
"047 c black",
"048 c black",
"049 c black",
"050 c black",
"051 c black",
"052 c black",
"053 c black",
"054 c black",
"055 c black",
"056 c black",
"057 c black",
"058 c black",
"059 c black",
"060 c black",
"061 c black",
"062 c black",
"063 c black",
"064 c black",
"065 c black",
"066 c black",
"067 c black",
"068 c black",
"069 c black",
"070 c black",
"071 c black",
"072 c black",
"073 c black",
"074 c black",
"075 c black",
"076 c black",
"077 c black",
"078 c black",
"079 c black",
"080 c black",
"081 c black",
"082 c black",
"083 c black",
"084 c black",
"085 c black",
"086 c black",
"087 c black",
"088 c black",
"089 c black",
"090 c black",
"091 c black",
"092 c black",
"093 c black",
"094 c black",
"095 c black",
"096 c black",
"097 c black",
"098 c black",
"099 c black",
"100 c black",
"101 c black",
"102 c black",
"103 c black",
"104 c black",
"105 c black",
"106 c black",
"107 c black",
"108 c black",
"109 c black",
"110 c black",
"111 c black",
"112 c black",
"113 c black",
"114 c black",
"115 c black",
"116 c black",
"117 c black",
"118 c black",
"119 c black",
"120 c black",
"121 c black",
"122 c black",
"123 c black",
"124 c black",
"125 c black",
"126 c black",
"127 c black",
"128 c black",
"129 c black",
"130 c black",
"131 c black",
"132 c black",
"133 c black",
"134 c black",
"135 c black",
"136 c black",
"137 c black",
"138 c black",
"139 c black",
"140 c black",
"141 c black",
"142 c black",
"143 c black",
"144 c black",
"145 c black",
"146 c black",
"147 c black",
"148 c black",
"149 c black",
"150 c black",
"151 c black",
"152 c black",
"153 c black",
"154 c black",
"155 c black",
"156 c black",
"157 c black",
"158 c black",
"159 c black",
"160 c black",
"161 c black",
"162 c black",
"163 c black",
"164 c black",
"165 c black",
"166 c black",
"167 c black",
"168 c black",
"169 c black",
"170 c black",
"171 c black",
"172 c black",
"173 c black",
"174 c black",
"175 c black",
"176 c black",
"177 c black",
"178 c black",
"179 c black",
"180 c black",
"181 c black",
"182 c black",
"183 c black",
"184 c black",
"185 c black",
"186 c black",
"187 c black",
"188 c black",
"189 c black",
"190 c black",
"191 c black",
"192 c black",
"193 c black",
"194 c black",
"195 c black",
"196 c black",
"197 c black",
"198 c black",
"199 c black",
"200 c black",
"201 c black",
"202 c black",
"203 c black",
"204 c black",
"205 c black",
"206 c black",
"207 c black",
"208 c black",
"209 c black",
"210 c black",
"211 c black",
"212 c black",
"213 c black",
"214 c black",
"215 c black",
"216 c black",
"217 c black",
"218 c black",
"219 c black",
"220 c black",
"221 c black",
"222 c black",
"223 c black",
"224 c black",
"225 c black",
"226 c black",
"227 c black",
"228 c black",
"229 c black",
"230 c black",
"231 c black",
"232 c black",
"233 c black",
"234 c black",
"235 c black",
"236 c black",
"237 c black",
"238 c black",
"239 c black",
"240 c black",
"241 c black",
"242 c black",
"243 c black",
"244 c black",
"245 c black",
"246 c black",
"247 c black",
"248 c black",
"249 c black",
"250 c black",
"251 c black",
"252 c black",
"253 c black",
"254 c black",
"255 c black",
"020020020020020020020020020020020020020020020020",
"020020020020020020020000000020020020020020020020",
"020020020020020020020000003020020020020020020020",
"020020020020020020000012010000020020020020020020",
"020020020020020020007013010003020020020020020020",
"020020020020020000013013010016000020020020020020",
"020020020020020007013013004017003020020020020020",
"020020020020000013013013007017016000020020020020",
"020020020020007013013012006017017003020020020020",
"020020020000012013012018011017017016000020020020",
"020020020007013012009018019010017017003020020020",
"020020000013012014015014009010017017016000020020",
"020020007007014015015015015008005016017003020020",
"020000002015015015015015015015015014005010000020",
"020000008008008008008008008008008008008001000020",
"020020020020020020020020020020020020020020020020"
};

View File

@ -0,0 +1,50 @@
/* XPM */
static char *cmake_logo[] = {
"32 30 16 2",
"00 c #00CC00",
"01 c #3333CC",
"02 c gray60",
"03 c #99CC99",
"04 c gray80",
"05 c red",
"06 c none",
"07 c black",
"08 c black",
"09 c black",
"10 c black",
"11 c black",
"12 c black",
"13 c black",
"14 c black",
"15 c black",
"0606060606060606060606060606060601060606060606060606060606060606",
"0606060606060606060606060606060601060606060606060606060606060606",
"0606060606060606060606060606060101050606060606060606060606060606",
"0606060606060606060606060606060101050606060606060606060606060606",
"0606060606060606060606060606010101050506060606060606060606060606",
"0606060606060606060606060606010101050506060606060606060606060606",
"0606060606060606060606060601010101050505060606060606060606060606",
"0606060606060606060606060601010101050505060606060606060606060606",
"0606060606060606060606060101010101050505050606060606060606060606",
"0606060606060606060606060101010101050505050606060606060606060606",
"0606060606060606060606010101010101050505050506060606060606060606",
"0606060606060606060606010101010101010505050506060606060606060606",
"0606060606060606060601010101010101010505050505060606060606060606",
"0606060606060606060601010101010101010505050505060606060606060606",
"0606060606060606060101010101010101010505050505050606060606060606",
"0606060606060606060101010101010101010505050505050606060606060606",
"0606060606060606010101010101010101040505050505050506060606060606",
"0606060606060606010101010101010104040505050505050506060606060606",
"0606060606060601010101010101010404040505050505050505060606060606",
"0606060606060601010101010101040404040505050505050505060606060606",
"0606060606060101010101010404040404040505050505050505050606060606",
"0606060606060101010101010404040404040505050505050505050606060606",
"0606060606010101010100000003040404040405050505050505050506060606",
"0606060606010101010000000000000004040405050505050505050506060606",
"0606060601010101000000000000000000000305050505050505050505060606",
"0606060601010100000000000000000000000000000505050505050505060606",
"0606060101000000000000000000000000000000000000050505050505050606",
"0606060100000000000000000000000000000000000000000000050505050606",
"0606010000000000000000000000000000000000000000000000000005050506",
"0606000000000000000000000000000000000000000000000000000000000006"
};

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="windows-1252"?><TODOLIST FILEFORMAT="6" PROJECTNAME="CMakeSetup GUI project (archive)" NEXTUNIQUEID="103" FILEVERSION="4" ARCHIVE="1" LASTMODIFIED="2005-05-31"><TASK PRIORITYCOLOR="15732480" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38479.90427083" TEXTCOLOR="0" TITLE="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="1" HIGHESTPRIORITY="8" PERCENTDONE="0" POS="1"><TASK PRIORITYCOLOR="15732480" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38479.90503472" TEXTCOLOR="0" TITLE="Window position X, Y and size is remembered between sessions" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="4" PERCENTDONE="0" POS="16"/><TASK PRIORITYCOLOR="15388928" TEXTWEBCOLOR="#000000" PRIORITY="3" LASTMOD="38480.57586806" TEXTCOLOR="0" TITLE="Drop target on grid (a folder) will load this in the build path and load up the cache" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#00D1EA" ID="10" PERCENTDONE="0" POS="1"/><TASK PRIORITYCOLOR="13435129" TEXTWEBCOLOR="#000000" PRIORITY="8" LASTMOD="38480.57606481" TEXTCOLOR="0" TITLE="Added most recent used list, with 5 last used build directories for easy lookup" CATEGORY="v0.9b" COMMENTS="When typing or browsing, update cache" PRIORITYWEBCOLOR="#F900CD" ID="11" PERCENTDONE="0" POS="19"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/10/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38482.89157407" TEXTCOLOR="0" TITLE="Cancel button on progress dialog now cancels the process" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="35" PERCENTDONE="0" STARTDATE="38482.00000000" POS="2"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/12/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38484.89186343" TEXTCOLOR="0" TITLE="Closing of dialog can be postponed by SHIFT (when option &quot;close after generation is done&quot; is selected)" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="37" PERCENTDONE="0" STARTDATE="38484.00000000" POS="15"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/15/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38487.50008102" TEXTCOLOR="0" TITLE="Added progress dialog that shows configuration progress" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="42" PERCENTDONE="0" STARTDATE="38487.00000000" POS="14"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/16/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38488.55358796" TEXTCOLOR="0" TITLE="Added XP look to window (XP manifest)" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="47" PERCENTDONE="0" STARTDATE="38488.00000000" POS="13"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/22/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38494.84318287" TEXTCOLOR="0" TITLE="The selected item is described in a seperate text box for easy reading instead of in the statusbar" CATEGORY="v0.9b" COMMENTS="The queries should be shown in the dropdown when the user presses enter, and saved to disk (last 5 or so)" PRIORITYWEBCOLOR="#000FF0" ID="59" PERCENTDONE="0" STARTDATE="38494.00000000" POS="17"/><TASK PRIORITYCOLOR="13435129" STARTDATESTRING="5/23/2005" TEXTWEBCOLOR="#000000" PRIORITY="8" LASTMOD="38495.92488426" TEXTCOLOR="0" TITLE="NOTFOUND entries are made bold for easy recognition" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#F900CD" ID="61" PERCENTDONE="0" STARTDATE="38495.00000000" POS="20"/><TASK PRIORITYCOLOR="16122042" STARTDATESTRING="5/23/2005" TEXTWEBCOLOR="#000000" PRIORITY="7" LASTMOD="38495.93262731" TEXTCOLOR="0" TITLE="Cache options for paths are colored blue, cache options for files are green, and the rest is black" CATEGORY="v0.9b" COMMENTS="Make a path property text blue, and maybe a file property dark green or some other colour" PRIORITYWEBCOLOR="#BA00F6" ID="68" PERCENTDONE="0" STARTDATE="38495.00000000" POS="18"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/25/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38498.88041667" TEXTCOLOR="0" TITLE="Added menu bar with most common options (reload cache, delete cache, options, about etc)" CATEGORY="v0.9b" COMMENTS="User needs to confirm that dirty cache can be reloaded (items can get lost)
Cache is reloaded again (handy for mis-deleted items)" PRIORITYWEBCOLOR="#000FF0" ID="71" PERCENTDONE="0" STARTDATE="38497.00000000" POS="9"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/27/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38499.87121528" TEXTCOLOR="0" TITLE="Added browse option in context menu on grid. Blue and green items are browsable (paths and files)" CATEGORY="v0.9b" COMMENTS="When no cache, browse is clickable" PRIORITYWEBCOLOR="#000FF0" ID="73" PERCENTDONE="0" STARTDATE="38499.00000000" POS="10"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/27/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38499.96678241" TEXTCOLOR="0" TITLE="A status percentage is shown in the task bar (when configuring, next to the configure window)" CATEGORY="v0.9b" COMMENTS="In case the users want to get rid of the status dialog" PRIORITYWEBCOLOR="#000FF0" ID="76" PERCENTDONE="0" STARTDATE="38499.00000000" POS="8"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/27/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38499.98921296" TEXTCOLOR="0" TITLE="Added about dialog" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="78" PERCENTDONE="0" STARTDATE="38499.00000000" POS="11"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/28/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38500.39842593" TEXTCOLOR="0" TITLE="Added a message display window, that will show all messages for easy copy-pasting and reference. This also obsoleted the &quot;stop reporting errors&quot; option" CATEGORY="v0.9b" COMMENTS="Bold messages, red errors etc" PRIORITYWEBCOLOR="#000FF0" ID="88" PERCENTDONE="0" STARTDATE="38500.00000000" POS="7"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/28/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38500.51690972" TEXTCOLOR="0" TITLE="Added a search query. Typing a substring will narrow the search. When ENTER is pressed the substring is stored in the search query history for easy lookup" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="89" PERCENTDONE="0" STARTDATE="38500.00000000" POS="6"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38502.85292824" TEXTCOLOR="0" TITLE="Generator cannot be chosen anymore after there are cache items (this is pointless anyway)" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="96" PERCENTDONE="0" STARTDATE="38502.00000000" POS="3"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38502.85346065" TEXTCOLOR="0" TITLE="Deletion of cache before something is generated, will ask the user if this is what he/she wants" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="97" PERCENTDONE="0" STARTDATE="38502.00000000" POS="4"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38502.85377315" TEXTCOLOR="0" TITLE="Reloading of cache added, after deleting cache items (and it was a mistake, a reload can bring it back to previous state)" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="99" PERCENTDONE="0" STARTDATE="38502.00000000" POS="5"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38502.85420139" TEXTCOLOR="0" TITLE="Added options dialog (for future options)" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="100" PERCENTDONE="0" STARTDATE="38502.00000000" POS="12"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38503.53450231" TEXTCOLOR="0" TITLE="Added menu items and keyboard shortcuts to the GUI (Ctrl+N - configure and Ctrl+G is generate)" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="101" PERCENTDONE="0" STARTDATE="38502.00000000" POS="21"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38503.60827546" TEXTCOLOR="0" TITLE="Added toggle advanced menu item (Ctrl+A)" CATEGORY="v0.9b" PRIORITYWEBCOLOR="#000FF0" ID="102" PERCENTDONE="0" STARTDATE="38502.00000000" POS="22"/></TASK></TODOLIST>

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="windows-1252"?><TODOLIST FILEFORMAT="6" PROJECTNAME="CMakeSetup GUI project" NEXTUNIQUEID="110" FILEVERSION="123" LASTMODIFIED="2005-06-30"><TASK PRIORITYCOLOR="15732480" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38479.90427083" TEXTCOLOR="0" TITLE="v1.0b" PRIORITYWEBCOLOR="#000FF0" ID="1" HIGHESTPRIORITY="8" PERCENTDONE="0" POS="2"><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38502.62243056" TEXTCOLOR="0" TITLE="Interpret directory from dropped shortcut" COMMENTS="In DoInitFrame()
{
m_cmShowAdvanced-&gt;SetValue(false);
// TODO: Interpret directory from dropped shortcut
//this-&gt;ChangeDirectoriesFromFile(cmdInfo-&gt;m_LastUnknownParameter.c_str());
}" PRIORITYWEBCOLOR="#000FF0" ID="94" PERCENTDONE="0" STARTDATE="38502.00000000" POS="2"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" ALLOCATEDBY="Andy" LASTMOD="38502.94655093" TEXTCOLOR="0" TITLE="Make sources consistent with formatting" COMMENTS="The second thing has to do with your coding standard. The indentation
would be ok (even though it is different), as long as it would be
consistent. Looks like you are using tabs sometimes, spaces some other
times, so depending on what editor you use, the code looks
different. As you notice, in CMake we always use two spaces indentation.
Also, related to this is that your code has DOS new-lines on some lines
but not on other. Inconsistent DOS new-lines sometimes confuse certain
compilers." PRIORITYWEBCOLOR="#000FF0" ID="97" PERCENTDONE="100" STARTDATE="38502.00000000" DONEDATESTRING="6/2/2005" DONEDATE="38505.00000000" POS="7"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" ALLOCATEDBY="Andy" LASTMOD="38502.94726852" TEXTCOLOR="0" TITLE="A different popup window that also has an exit button" CATEGORY="Pending" COMMENTS="Oh, and another feature request, once you run generate, there is a
popup
that says generation complete. Could you put a exit button there too?" PRIORITYWEBCOLOR="#000FF0" ID="99" PERCENTDONE="0" STARTDATE="38502.00000000" POS="4"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" ALLOCATEDBY="Andy" LASTMOD="38502.94839120" TEXTCOLOR="0" TITLE="Add keyboard shortcuts to the GUI" COMMENTS="And, how difficult it is to add keyboard shortcuts to the gui? Could
you
duplicate ccmake's keyboard shortcuts in NG gui?
C - configure
G - generate &amp; exit
/ - search
up/down - change currently selected entry
enter - edit currently selected entry
esc - exit currently selected entrty edit
h - help
t - toggle advanced mode" PRIORITYWEBCOLOR="#000FF0" ID="100" PERCENTDONE="100" STARTDATE="38502.00000000" DONEDATESTRING="6/2/2005" DONEDATE="38505.00000000" POS="8"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="6/12/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38515.47285880" TEXTCOLOR="0" TITLE="Parse command line to automate test and configure" COMMENTS="&gt; I know you are probably getting tired of this, but I have another
&gt; feature request. I would like to have a way to test the dialog from
That's allright ;-)
&gt; command line. I would like to do something like:
&gt;
&gt; CMakeSetup --source /foo/bar/src --build /foo/bar/bin
&gt; --run-configure-and-generate" PRIORITYWEBCOLOR="#000FF0" ID="103" PERCENTDONE="0" STARTDATE="38515.00000000" POS="3"/><TASK PRIORITYCOLOR="13435129" STARTDATESTRING="6/12/2005" TEXTWEBCOLOR="#000000" PRIORITY="8" LASTMOD="38515.47834491" TEXTCOLOR="0" TITLE="Add Licence header for every source" COMMENTS="Please just copy the header comment from another header like
cmVersion.h
and put it at the top of all your sources. If you want to add those
extra CVS $$ tokens please do so in a comment under this block so that
the copyright/license part stays consistent with the rest of the
source." PRIORITYWEBCOLOR="#F900CD" ID="106" PERCENTDONE="100" STARTDATE="38515.00000000" DONEDATESTRING="6/30/2005" DONEDATE="38533.00000000" POS="5"/><TASK PRIORITYCOLOR="13435129" STARTDATESTRING="6/24/2005" TEXTWEBCOLOR="#000000" PRIORITY="8" LASTMOD="38527.95186343" TEXTCOLOR="0" TITLE="Implement command line options" COMMENTS="andy@andoria $ cmake
--help ~
cmake version 2.1-20050621
Usage
cmake [options] &lt;path-to-source&gt;
cmake [options] &lt;path-to-existing-build&gt;
Command-Line Options
-C&lt;initial-cache&gt; = Pre-load cmake cache from given file.
-D&lt;var&gt;:&lt;type&gt;=&lt;value&gt; = Create a cmake cache entry.
-G&lt;generator-name&gt; = Specify a makefile generator.
-E = CMake command mode.
-i = Run in wizard mode.
-L[A][H] = List non-advanced cached variables.
-N = View mode only.
--help-command cmd [file] = Print help for a single command and exit.
--help-command-list [file] = List available listfile commands and exit.
--copyright [file] = Print the CMake copyright and exit.
--help = Print usage information and exit.
--help-full [file] = Print full help and exit.
--help-html [file] = Print full help in HTML format.
--help-man [file] = Print a UNIX man page and exit.
--version [file] = Show program name/version banner and exit.
I would add:
cmake [options] &lt;path to cmake cache&gt;
Andy" PRIORITYWEBCOLOR="#F900CD" ID="108" PERCENTDONE="0" STARTDATE="38527.00000000" POS="6"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="6/24/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38527.95687500" TEXTCOLOR="0" TITLE="Commit source to CVS" PRIORITYWEBCOLOR="#000FF0" ID="109" PERCENTDONE="0" STARTDATE="38527.00000000" POS="1"/></TASK><TASK PRIORITYCOLOR="15732480" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38479.90443287" TEXTCOLOR="0" TITLE="Next releases" PRIORITYWEBCOLOR="#000FF0" ID="2" HIGHESTPRIORITY="7" PERCENTDONE="0" POS="1"><TASK PRIORITYCOLOR="15732480" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38479.90533565" TEXTCOLOR="0" TITLE="Adjust build path to project path when selected, and append (build) when present" PRIORITYWEBCOLOR="#000FF0" ID="5" PERCENTDONE="0" POS="2"/><TASK PRIORITYCOLOR="15732480" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38480.40458333" TEXTCOLOR="0" TITLE="Most recent used file menu" PRIORITYWEBCOLOR="#000FF0" ID="7" PERCENTDONE="0" POS="9"/><TASK PRIORITYCOLOR="15732480" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38482.70638889" TEXTCOLOR="0" TITLE="New project based management for user options" COMMENTS="This can contain overridden options and extra injected options for e.g.
SOME_PROJECT_VERSION = 1.06
WX_USE_TREEVIEW = ON
Also the build path can be static, or linked to a date or build increment" PRIORITYWEBCOLOR="#000FF0" ID="29" PERCENTDONE="0" POS="8"/><TASK PRIORITYCOLOR="15732480" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38482.70771991" TEXTCOLOR="0" TITLE="Write down log for exvery action performed" COMMENTS="When user selects something log this so the last known config can be traced back" PRIORITYWEBCOLOR="#000FF0" ID="31" PERCENTDONE="0" POS="6"/><TASK PRIORITYCOLOR="16122042" STARTDATESTRING="5/12/2005" TEXTWEBCOLOR="#000000" PRIORITY="7" LASTMOD="38486.63013889" TEXTCOLOR="0" TITLE="AUTOFILL option. For users frequently configuring, where some paths may be located, the user can create vars for it" COMMENTS="DART_TEST_PATH when e.g. specified in the AUTOFILL options, it will be filled with the proper paths automatically" PRIORITYWEBCOLOR="#BA00F6" ID="41" PERCENTDONE="0" STARTDATE="38484.00000000" POS="13"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/19/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38492.77642361" TEXTCOLOR="0" TITLE="Use a thread for configuring" COMMENTS="Is it possible to get the window to respond to events quickly during the configuration? This has always plagued the old GUI. Fixing it would require the window interface to run in a separate thread. Does wxWidgets make this easy?" PRIORITYWEBCOLOR="#000FF0" ID="50" PERCENTDONE="0" STARTDATE="38491.00000000" POS="5"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/19/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38492.93082176" TEXTCOLOR="0" TITLE="Add a way to search the data properties" COMMENTS="Add a way to search the entries. CCMake does it the VI style, you
&gt; press / and the string and it will find the variable with that name
That sounds good. I like how Thunderbird does it. You have a little
magnifying glass icon with a pulldown, where you can pick Subject,
Sender, or any other field you want to search. In CMake's case, that
would be &quot;Variable name&quot;, &quot;Variable value&quot;, &quot;Both&quot;. Then, once you type
some text, the gui would eliminate all entries that do not match the
search string." PRIORITYWEBCOLOR="#000FF0" ID="52" PERCENTDONE="0" STARTDATE="38491.00000000" POS="3"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/22/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38494.81545139" TEXTCOLOR="0" TITLE="Find search query with toggable uppercase and lowercase" PRIORITYWEBCOLOR="#000FF0" ID="58" PERCENTDONE="0" STARTDATE="38494.00000000" POS="7"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/23/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38495.92858796" TEXTCOLOR="0" TITLE="Show all NOT-FOUND items" COMMENTS="In the search query, have the following menu layout;
Search in name
Seach in value
Search in both
---
Only show NOTFOUND" PRIORITYWEBCOLOR="#000FF0" ID="62" PERCENTDONE="0" STARTDATE="38495.00000000" POS="10"/><TASK PRIORITYCOLOR="10544896" STARTDATESTRING="5/23/2005" TEXTWEBCOLOR="#000000" PRIORITY="2" LASTMOD="38495.93019676" TEXTCOLOR="0" TITLE="Make flags parser" COMMENTS="Make a parser that can parse all the flags that are given in the various CMAKE_??_FLAGS entries, and determine based on the compiler that is selected what the compiler options are." PRIORITYWEBCOLOR="#00E7A0" ID="63" PERCENTDONE="0" STARTDATE="38495.00000000" POS="1"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="5/28/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38500.54894676" TEXTCOLOR="0" TITLE="Grid enhancements" PRIORITYWEBCOLOR="#000FF0" ID="90" HIGHESTPRIORITY="6" PERCENTDONE="0" STARTDATE="38500.00000000" POS="11"><TASK PRIORITYCOLOR="15925332" TEXTWEBCOLOR="#000000" PRIORITY="6" LASTMOD="38482.46628472" TEXTCOLOR="0" TITLE="Implement sorting of grid items when adding with AddPropItem" PRIORITYWEBCOLOR="#5400F3" ID="25" PERCENTDONE="0" POS="1"/><TASK PRIORITYCOLOR="15925332" TEXTWEBCOLOR="#000000" PRIORITY="6" LASTMOD="38482.58564815" TEXTCOLOR="0" TITLE="Implement wxGridTableBase for property grid, to better relate client data to wxPropertyItem" PRIORITYWEBCOLOR="#5400F3" ID="27" PERCENTDONE="0" POS="2"/></TASK><TASK PRIORITYCOLOR="16122042" STARTDATESTRING="5/30/2005" TEXTWEBCOLOR="#000000" PRIORITY="7" LASTMOD="38502.88064815" TEXTCOLOR="0" TITLE="Remove most recent changed list and replace it with wxFileHistory!!!" PRIORITYWEBCOLOR="#BA00F6" ID="96" PERCENTDONE="0" STARTDATE="38502.00000000" POS="12"/><TASK PRIORITYCOLOR="15732480" STARTDATESTRING="6/12/2005" TEXTWEBCOLOR="#000000" PRIORITY="5" LASTMOD="38515.47637731" TEXTCOLOR="0" TITLE="Use commandline info to set WXWIDGETS values / CMAKE values" COMMENTS="&gt; This would run configure followed by generate and exit. By doing
&gt; that we
&gt; would get some coverage of it. If you feel ambitious, then you could
&gt; even try to set widget values etc.
Nice idea :-) I will add it to the todo list to see what I can do." PRIORITYWEBCOLOR="#000FF0" ID="105" PERCENTDONE="0" STARTDATE="38515.00000000" POS="4"/></TASK></TODOLIST>

43
Source/WXDialog/config.h Normal file
View File

@ -0,0 +1,43 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __CMAKE_CONFIG_H__
#define __CMAKE_CONFIG_H__
#define CM_LASTPROJECT_PATH "LastProjectPath" // last project path for CMakeLists.txt in edit box
#define CM_LASTBUILD_PATH "LastBuildPath" // last build path for cache in edit box
#define CM_MAX_RECENT_PATHS 5 // max amount most recent used paths in menu
#define CM_MAX_SEARCH_QUERIES 10 // max amount of entries in search query window
#define CM_RECENT_BUILD_PATH "LastRecentPath" // will be enumerated like LastRecentPath0 LastRecentPath1 etc
#define CM_SEARCH_QUERY "SearchQuery" // will be enumerated like SearchQuery0 SearchQuery1 etc
#define CM_XSIZE "CMakeXSize" // x size of window
#define CM_YSIZE "CMakeYSize" // y size of window
#define CM_XPOS "CMakeXPos" // x pos of window
#define CM_YPOS "CMakeYPos" // y pos of window
#define CM_SPLITTERPOS "CMakeSplitterPos" // position of splitter window
#define CM_CLOSEAFTERGEN "CMakeCloseAfterGenerate" // close CMake after succesful generation (old behaviour)
#define CM_CLOSEAFTERGEN_DEF false // inherit default false when not present
#define CM_RECENT_BUILD_ITEM 10000 // ID of menu item for recent builds
#define CMAKEGUI_MAJORVER 0 // major build
#define CMAKEGUI_MINORVER 9 // minor build
#define CMAKEGUI_ADDVER "b" // postfix (beta, alpha, none)
#endif

View File

@ -0,0 +1,199 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "optionsdlg.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "optionsdlg.h"
////@begin XPM images
////@end XPM images
/*!
* CMOptionsDlg type definition
*/
IMPLEMENT_DYNAMIC_CLASS( CMOptionsDlg, wxDialog )
/*!
* CMOptionsDlg event table definition
*/
BEGIN_EVENT_TABLE( CMOptionsDlg, wxDialog )
////@begin CMOptionsDlg event table entries
EVT_CHECKBOX( ID_CHECKBOX_CLOSECMAKE, CMOptionsDlg::OnButtonOK )
////@end CMOptionsDlg event table entries
END_EVENT_TABLE()
/*!
* CMOptionsDlg constructors
*/
CMOptionsDlg::CMOptionsDlg( )
{
}
CMOptionsDlg::CMOptionsDlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Create(parent, id, caption, pos, size, style);
}
/*!
* CMOptionsDlg creator
*/
bool CMOptionsDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin CMOptionsDlg member initialisation
m_closeAfterGenerate = NULL;
////@end CMOptionsDlg member initialisation
////@begin CMOptionsDlg creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
Centre();
////@end CMOptionsDlg creation
return TRUE;
}
/*!
* Control creation for CMOptionsDlg
*/
void CMOptionsDlg::CreateControls()
{
////@begin CMOptionsDlg content construction
CMOptionsDlg* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxNotebook* itemNotebook3 = new wxNotebook( itemDialog1, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxNB_TOP );
wxPanel* itemPanel4 = new wxPanel( itemNotebook3, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
itemPanel4->SetSizer(itemBoxSizer5);
itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_closeAfterGenerate = new wxCheckBox( itemPanel4, ID_CHECKBOX_CLOSECMAKE, _("Close down CMakeSetup after generation of project"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_closeAfterGenerate->SetValue(FALSE);
itemBoxSizer5->Add(m_closeAfterGenerate, 0, wxALIGN_LEFT|wxALL, 5);
itemNotebook3->AddPage(itemPanel4, _("General"));
itemBoxSizer2->Add(itemNotebook3, 1, wxGROW|wxALL|wxFIXED_MINSIZE, 5);
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxButton* itemButton9 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer8->Add(itemButton9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton10 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer8->Add(itemButton10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
////@end CMOptionsDlg content construction
}
/*!
* Should we show tooltips?
*/
bool CMOptionsDlg::ShowToolTips()
{
return TRUE;
}
/*!
* Get bitmap resources
*/
wxBitmap CMOptionsDlg::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin CMOptionsDlg bitmap retrieval
return wxNullBitmap;
////@end CMOptionsDlg bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon CMOptionsDlg::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin CMOptionsDlg icon retrieval
return wxNullIcon;
////@end CMOptionsDlg icon retrieval
}
void CMOptionsDlg::SetConfig(wxConfig *cfg)
{
bool boolval;
// close after generation
cfg->Read(CM_CLOSEAFTERGEN, &boolval, CM_CLOSEAFTERGEN_DEF);
m_closeAfterGenerate->SetValue(boolval);
}
void CMOptionsDlg::GetConfig(wxConfig *cfg)
{
// close after generation
cfg->Write(CM_CLOSEAFTERGEN, m_closeAfterGenerate->GetValue());
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_CLOSECMAKE
*/
void CMOptionsDlg::OnButtonOK( wxCommandEvent& event )
{
////@begin wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_CLOSECMAKE in CMOptionsDlg.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_CLOSECMAKE in CMOptionsDlg.
}

View File

@ -0,0 +1,125 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _OPTIONSDLG_H_
#define _OPTIONSDLG_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "optionsdlg.cpp"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/notebook.h"
////@end includes
#include <wx/config.h>
#include "config.h"
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10004
#define SYMBOL_CMOPTIONSDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_CMOPTIONSDLG_TITLE _("CMakeSetup Options ...")
#define SYMBOL_CMOPTIONSDLG_IDNAME ID_DIALOG
#define SYMBOL_CMOPTIONSDLG_SIZE wxSize(400, 300)
#define SYMBOL_CMOPTIONSDLG_POSITION wxDefaultPosition
#define ID_NOTEBOOK 10006
#define ID_PANEL 10007
#define ID_CHECKBOX_CLOSECMAKE 10008
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
#ifndef wxFIXED_MINSIZE
#define wxFIXED_MINSIZE 0
#endif
/*!
* CMOptionsDlg class declaration
*/
class CMOptionsDlg: public wxDialog
{
DECLARE_DYNAMIC_CLASS( CMOptionsDlg )
DECLARE_EVENT_TABLE()
public:
/// Constructors
CMOptionsDlg( );
CMOptionsDlg( wxWindow* parent, wxWindowID id = SYMBOL_CMOPTIONSDLG_IDNAME, const wxString& caption = SYMBOL_CMOPTIONSDLG_TITLE, const wxPoint& pos = SYMBOL_CMOPTIONSDLG_POSITION, const wxSize& size = SYMBOL_CMOPTIONSDLG_SIZE, long style = SYMBOL_CMOPTIONSDLG_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CMOPTIONSDLG_IDNAME, const wxString& caption = SYMBOL_CMOPTIONSDLG_TITLE, const wxPoint& pos = SYMBOL_CMOPTIONSDLG_POSITION, const wxSize& size = SYMBOL_CMOPTIONSDLG_SIZE, long style = SYMBOL_CMOPTIONSDLG_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin CMOptionsDlg event handler declarations
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_CLOSECMAKE
void OnButtonOK( wxCommandEvent& event );
////@end CMOptionsDlg event handler declarations
////@begin CMOptionsDlg member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end CMOptionsDlg member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
// write values from config to GUI controls
void SetConfig(wxConfig *cfg);
// write GUI controls back to config
void GetConfig(wxConfig *cfg);
private:
////@begin CMOptionsDlg member variables
wxCheckBox* m_closeAfterGenerate;
////@end CMOptionsDlg member variables
};
#endif
// _OPTIONSDLG_H_

View File

@ -0,0 +1,177 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "progressdlg.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "progressdlg.h"
////@begin XPM images
////@end XPM images
/*!
* CMProgressDialog type definition
*/
IMPLEMENT_DYNAMIC_CLASS( CMProgressDialog, wxDialog )
/*!
* CMProgressDialog event table definition
*/
BEGIN_EVENT_TABLE( CMProgressDialog, wxDialog )
////@begin CMProgressDialog event table entries
EVT_BUTTON( ID_CMAKE_BUTTON, CMProgressDialog::OnCmakeCancelClick )
////@end CMProgressDialog event table entries
END_EVENT_TABLE()
/*!
* CMProgressDialog constructors
*/
CMProgressDialog::CMProgressDialog( )
{
}
CMProgressDialog::CMProgressDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Create(parent, id, caption, pos, size, style);
}
/*!
* CMProgressDialog creator
*/
bool CMProgressDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin CMProgressDialog member initialisation
m_textMessage = NULL;
m_progress = NULL;
////@end CMProgressDialog member initialisation
////@begin CMProgressDialog creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();
////@end CMProgressDialog creation
m_cancelPressed = false;
m_cancelling = false;
return TRUE;
}
/*!
* Control creation for CMProgressDialog
*/
void CMProgressDialog::CreateControls()
{
////@begin CMProgressDialog content construction
CMProgressDialog* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
itemBoxSizer2->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_textMessage = new wxStaticText( itemDialog1, wxID_STATIC, _("Please wait while CMake configures ..."), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(m_textMessage, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_progress = new wxGauge( itemDialog1, ID_CMAKE_PROGRESS, 100, wxDefaultPosition, wxSize(250, 20), wxGA_HORIZONTAL );
m_progress->SetValue(0);
itemBoxSizer5->Add(m_progress, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton7 = new wxButton( itemDialog1, ID_CMAKE_BUTTON, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer2->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);
////@end CMProgressDialog content construction
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CMAKE_BUTTON
*/
void CMProgressDialog::OnCmakeCancelClick( wxCommandEvent& event )
{
m_cancelPressed = true;
}
/*!
* Should we show tooltips?
*/
bool CMProgressDialog::ShowToolTips()
{
return TRUE;
}
/*!
* Get bitmap resources
*/
wxBitmap CMProgressDialog::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin CMProgressDialog bitmap retrieval
return wxNullBitmap;
////@end CMProgressDialog bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon CMProgressDialog::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin CMProgressDialog icon retrieval
return wxNullIcon;
////@end CMProgressDialog icon retrieval
}

View File

@ -0,0 +1,139 @@
/*=========================================================================
Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Author: Jorgen Bodde
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _PROGRESSDLG_H_
#define _PROGRESSDLG_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "progressdlg.cpp"
#endif
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_PROGRESSDLG 10000
#define SYMBOL_CMPROGRESSDIALOG_STYLE wxRAISED_BORDER
#define SYMBOL_CMPROGRESSDIALOG_TITLE _("Progress Dialog")
#define SYMBOL_CMPROGRESSDIALOG_IDNAME ID_PROGRESSDLG
#define SYMBOL_CMPROGRESSDIALOG_SIZE wxSize(400, 300)
#define SYMBOL_CMPROGRESSDIALOG_POSITION wxDefaultPosition
#define ID_CMAKE_PROGRESS 10001
#define ID_CMAKE_BUTTON 10002
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
#ifndef wxFIXED_MINSIZE
#define wxFIXED_MINSIZE 0
#endif
/*!
* CMProgressDialog class declaration
*/
class CMProgressDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS( CMProgressDialog )
DECLARE_EVENT_TABLE()
public:
/// Constructors
CMProgressDialog( );
CMProgressDialog( wxWindow* parent, wxWindowID id = SYMBOL_CMPROGRESSDIALOG_IDNAME, const wxString& caption = SYMBOL_CMPROGRESSDIALOG_TITLE, const wxPoint& pos = SYMBOL_CMPROGRESSDIALOG_POSITION, const wxSize& size = SYMBOL_CMPROGRESSDIALOG_SIZE, long style = SYMBOL_CMPROGRESSDIALOG_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CMPROGRESSDIALOG_IDNAME, const wxString& caption = SYMBOL_CMPROGRESSDIALOG_TITLE, const wxPoint& pos = SYMBOL_CMPROGRESSDIALOG_POSITION, const wxSize& size = SYMBOL_CMPROGRESSDIALOG_SIZE, long style = SYMBOL_CMPROGRESSDIALOG_STYLE );
/// Creates the controls and sizers
void CreateControls();
void SetProgress(float progress) {
m_progress->SetValue((int)(progress * 100));
};
////@begin CMProgressDialog event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CMAKE_BUTTON
void OnCmakeCancelClick( wxCommandEvent& event );
////@end CMProgressDialog event handler declarations
////@begin CMProgressDialog member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end CMProgressDialog member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
bool CancelPressed() const {
return m_cancelPressed;
};
void CancelAcknowledged() {
m_cancelling = true;
};
bool IsCancelling() const {
return m_cancelling;
};
void ResetCancel() {
m_cancelling = false;
m_cancelPressed = false;
};
////@begin CMProgressDialog member variables
wxStaticText* m_textMessage;
wxGauge* m_progress;
////@end CMProgressDialog member variables
private:
bool m_cancelPressed;
bool m_cancelling;
};
#endif
// _PROGRESSDLG_H_