deleted old wx-dialog

This commit is contained in:
Jorgen Bodde 2005-06-30 15:52:04 -04:00
parent ba3b7c1588
commit 099587c4ee
13 changed files with 0 additions and 2870 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

View File

@ -1,45 +0,0 @@
/* XPM */
static char *CMakeIcon_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 7 1",
" c opaque",
". c blue",
"X c green",
"o c red",
"O c #c0c0c0",
"+ c white",
"@ c None",
/* pixels */
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@ o @@@@@@@@@@@@@@",
"@@@@@@@@@@@@@ . o @@@@@@@@@@@@@@",
"@@@@@@@@@@@@@ .. o @@@@@@@@@@@@@",
"@@@@@@@@@@@@ ... o @@@@@@@@@@@@@",
"@@@@@@@@@@@@ ... oo @@@@@@@@@@@@",
"@@@@@@@@@@@ .... oo @@@@@@@@@@@@",
"@@@@@@@@@@@ .... ooo @@@@@@@@@@@",
"@@@@@@@@@@ ..... ooo @@@@@@@@@@@",
"@@@@@@@@@@ ...... ooo @@@@@@@@@@",
"@@@@@@@@@ ....... ooo @@@@@@@@@@",
"@@@@@@@@@ ....... oooo @@@@@@@@@",
"@@@@@@@@ ....... oooo @@@@@@@@@",
"@@@@@@@@ ...... O ooooo @@@@@@@@",
"@@@@@@@ ..... OO ooooo @@@@@@@@",
"@@@@@@@ ..... OOO oooooo @@@@@@@",
"@@@@@@ ..... OOOOO ooooo @@@@@@@",
"@@@@@@ .... X OOO oooooo @@@@@@",
"@@@@@ .... XXXX O oooooo @@@@@@",
"@@@@@ ... XXXXXXX ooooooo @@@@@",
"@@@@ ... XXXXXXXXX ooooo @@@@@",
"@@@@ . XXXXXXXXXXXXX oooo @@@@",
"@@@ . XXXXXXXXXXXXXXXXX oo @@@@",
"@@@ XXXXXXXXXXXXXXXXXXXX o @@@",
"@@ XXXXXXXXXXXXXXXXXXXXXXX @@@",
"@@ @@",
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
};

View File

@ -1,79 +0,0 @@
INCLUDE (${CMAKE_ROOT}/Modules/FindwxWindows.cmake)
IF ( CMAKE_WX_CAN_COMPILE )
SET( WX_SRCS
cmWXCacheProperty.cxx
cmWXCommandLineInfo.cxx
cmWXMainFrame.cxx
wxCMakeSetup.cxx
)
IF(WXWINDOWS_INCLUDE_PATH)
INCLUDE_DIRECTORIES(${WXWINDOWS_INCLUDE_PATH})
ENDIF(WXWINDOWS_INCLUDE_PATH)
IF(CMAKE_WX_CXX_FLAGS)
SET(CMAKE_CXX_FLAGS "${CMAKE_WX_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
ENDIF(CMAKE_WX_CXX_FLAGS)
INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source)
IF(WIN32)
SET(WIN32_EXECUTABLE WIN32)
ENDIF(WIN32)
ADD_EXECUTABLE(wxCMakeSetup ${WIN32_EXECUTABLE} ${WX_SRCS})
TARGET_LINK_LIBRARIES(wxCMakeSetup ${WXWINDOWS_LIBRARY})
TARGET_LINK_LIBRARIES(wxCMakeSetup CMakeLib)
IF(APPLE)
SET(APPLE_GUI_EXECUTABLE wxCMakeSetup)
SET(APPLE_GUI_INFO_STRING "CMake version ${CMake_VERSION_MAJOR}, (c) 2003 Kitware Inc.")
SET(APPLE_GUI_IDENTIFIER "com.kitware.wxCMakeSetup")
SET(APPLE_GUI_LONG_VERSION_STRING "${CMake_VERSION_MAJOR}, (c) 2003 Kitware Inc.")
SET(APPLE_GUI_BUNDLE_NAME "CMake")
SET(APPLE_GUI_SHORT_VERSION_STRING "${CMake_VERSION_MAJOR}")
SET(APPLE_GUI_BUNDLE_VERSION "${CMake_VERSION_MAJOR}")
SET(APPLE_GUI_ICON "CMakeIcon.icns")
SET(APPLE_GUI_COPYRIGHT "Copyright 2002 Kitware Inc.")
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Templates/AppleInfo.plist
${EXECUTABLE_OUTPUT_PATH}/CMake.app/Contents/Info.plist)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Source/WXDialog/CMakeIcon.icns
${EXECUTABLE_OUTPUT_PATH}/CMake.app/Contents/Resources/CMakeIcon.icns COPYONLY)
MAKE_DIRECTORY(${EXECUTABLE_OUTPUT_PATH}/CMake.app/Contents/MacOS)
#WRITE_FILE(${EXECUTABLE_OUTPUT_PATH}/CMake.app/Contents/PkgInfo "APPL????")
ADD_EXECUTABLE(CMake.app/Contents/MacOS/wxCMakeSetup ${WIN32_EXECUTABLE} ${WX_SRCS})
TARGET_LINK_LIBRARIES(CMake.app/Contents/MacOS/wxCMakeSetup ${WXWINDOWS_LIBRARY})
TARGET_LINK_LIBRARIES(CMake.app/Contents/MacOS/wxCMakeSetup CMakeLib)
# Support building by both CMake 1.6 and 1.8.
IF(NOT CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
IF(CMAKE_WX_CONFIG)
SET(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE ${CMAKE_WX_CONFIG})
ENDIF(CMAKE_WX_CONFIG)
ENDIF(NOT CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
ADD_CUSTOM_COMMAND(
SOURCE CMake.app/Contents/MacOS/wxCMakeSetup
COMMAND ${CMAKE_COMMAND}
ARGS -E chdir "\"${EXECUTABLE_OUTPUT_PATH}/CMake.app/Contents/MacOS\""
`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --rezflags`
"\"${EXECUTABLE_OUTPUT_PATH}/CMake.app/Contents/MacOS/wxCMakeSetup\""
TARGET CMake.app/Contents/MacOS/wxCMakeSetup
)
ENDIF(APPLE)
INSTALL_TARGETS(/bin wxCMakeSetup)
IF(BUILD_TESTING)
ADD_TEST(wxCMakeSetupRunTest
${EXECUTABLE_OUTPUT_PATH}/wxCMakeSetup
-Q -A:ON -B:${CMake_BINARY_DIR}/Tests/Simple
-H:${CMake_SOURCE_DIR}/Tests/Simple)
ENDIF(BUILD_TESTING)
ELSE ( CMAKE_WX_CAN_COMPILE )
MESSAGE("Cannot find wxWindows libraries and/or header files")
ENDIF ( CMAKE_WX_CAN_COMPILE )

View File

@ -1,71 +0,0 @@
Hi All,
So, here is a short description on how I got installation package on mac osx.
1. Build package.
2. Copy package and related files to the following directory structure:
./Package_Root/Applications/MyApp.app/Contents/Info.plist
./Package_Root/Applications/MyApp.app/Contents/MacOS
./Package_Root/Applications/MyApp.app/Contents/MacOS/MyAppExec
./Package_Root/Applications/MyApp.app/Contents/PkgInfo
./Package_Root/Applications/MyApp.app/Contents/Resources/MyAppIcon.icns
./Package_Root/Applications/MyApp.app/Contents/Resources/MyAppResources.rsrc
./Package_Root/usr/share/somedata
./Package_Root/usr/bin/some_utility
./Resources/License.txt
./Resources/ReadMe.txt
./Resources/Welcome.txt
The file PkgInfo contains "APPL????" The file Info.plist contains
package instructions. I would suggest looking at Info.plist.in in
wxWindows and modify it by putting your info in. MyAppIcon.icns is an
icon created by IconComposer in /Developmer/Applications.
MyAppResources.rsrc is a compiled resources file. I used the one from
wxWindows and it seems to be working fine. Some mac person could
explain this. Make sure that Info.plist contains:
<key>CFBundleIconFile</key>
<string>MyAppIcon.icns</string>
This will tell it which icon to use.
The ./Package_Root/usr/share/somedata and
./Package_Root/usr/bin/some_utility are some extra data that your
application is using. For example they can be a command line version
of the application and some common files.
The ./Resources directory contains resources used during
installation. The names of files describe what should go in. They can
be rtf, txt...
3. Create package using PackageMaker.
Fire up PackageMaker from /Developmer/Applications. Fill all the
entries. Most of them are straight forward. Package root is
./Package_Root. Resources directory is ./Resources. If your
application needs to write to /usr (or to some other place beside
/Applications, then make sure to enable authentication. After you fill
all the entries, create package. This will create a directory on your
disk containing a whole lot of junk. Now you need to package this
directory.
4. Create a disk image.
Run Disk Copy from /Applications/Utilities. The easiest way of
creating disk image is to first create empty folder, copy all the
files in and then tell Disk Copy to create disk image from folder. So,
create folder MyApp, copy in MyApp.pkg and create package.
Now you are done. This will create one file, which you can copy around.
So, what is missing is how to make application icon show in the
finder. I can make it show when running application, but not when I am
looking at application. Even if I ask for preview.
I guess somebody else will have to answer this.
Good luck.
Andy

View File

@ -1,358 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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.
=========================================================================*/
// cmCacheProperty.cxx : implementation file
//
#include "cmWXCacheProperty.h"
#include "cmSystemTools.h"
#include "cmWXMainFrame.h"
static int GetClientHeight(wxWindow* w)
{
wxSize size = w->GetSize();
return size.GetHeight();
}
#define cmMAX(x, y) (((x)>(y))?(x):(y))
cmCacheProperty::cmCacheProperty(cmMainFrame* mf, const std::string& name) : m_Name(name)
{
this->m_HelpString = "";
this->m_Value = "";
this->m_NewValue = true;
this->m_Removed = false;
this->m_ItemType = cmCacheProperty::NOTHING;
this->m_MainFrame = mf;
this->m_Advanced = false;
this->m_KeyWindow = 0;
this->m_ValueWindow = 0;
this->m_TextControl = 0;
}
cmCacheProperty::~cmCacheProperty()
{
}
int cmCacheProperty::Display(wxSizer* s, wxPanel* win)
{
int maxheight = 0;
this->m_TextControl = 0;
wxPanel* panel = new wxPanel(win, -1);
wxPanel* panel1 = new wxPanel(panel, -1);
wxBoxSizer* sizer = 0;
wxColor bgcolor = panel->GetBackgroundColour();
sizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizer1 = new wxBoxSizer(wxHORIZONTAL);
wxStaticText* name = new wxStaticText(panel1, -1, this->m_Name.c_str());
this->SetupMenu(name);
this->SetupMenu(panel1);
sizer1->Add(name, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
maxheight = cmMAX(maxheight, ::GetClientHeight(panel1));
sizer->Add(5, 5, 0);
sizer->Add(panel1, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
panel1->SetAutoLayout( TRUE );
panel1->SetSizer(sizer1);
sizer1->Fit(panel1);
sizer1->SetSizeHints(panel1);
sizer1->Layout();
panel->SetAutoLayout( TRUE );
panel->SetSizer(sizer);
sizer->Fit(panel);
sizer->SetSizeHints(panel);
sizer->Layout();
wxControl* value = 0;
if ( this->m_NewValue )
{
wxColor brightred = wxColor(252, 102, 100);
panel->SetBackgroundColour(brightred);
panel1->SetBackgroundColour(brightred);
name->SetBackgroundColour(brightred);
}
else
{
panel->SetBackgroundColour(*wxWHITE);
panel1->SetBackgroundColour(*wxWHITE);
name->SetBackgroundColour(*wxWHITE);
}
this->m_KeyWindow = panel;
panel = new wxPanel(win, -1);
sizer = new wxBoxSizer(wxHORIZONTAL);
panel->SetBackgroundColour(*wxWHITE);
//panel->SetBackgroundColour(*wxGREEN)
#ifdef __APPLE__
wxColor buttoncolor = *wxWHITE;
#else // __APPLE__
wxColor buttoncolor = bgcolor;
#endif // __APPLE__
switch ( this->m_ItemType )
{
case cmCacheProperty::CHECKBOX:
sizer->Add(5, 5, 0);
value = new wxCheckBox(panel, -1, "");
this->ConnectEvent(value, wxEVT_COMMAND_CHECKBOX_CLICKED,
(wxObjectEventFunction) &cmMainFrame::OnPropertyChanged);
this->SetupMenu(value);
if ( strcmp(this->GetValue().c_str(), "ON") == 0 )
{
static_cast<wxCheckBox*>(value)->SetValue(true);
}
break;
case cmCacheProperty::EDIT:
value = new wxTextCtrl(panel, -1, this->m_Value.c_str());
maxheight = cmMAX(maxheight, ::GetClientHeight(value));
this->ConnectEvent(value, wxEVT_COMMAND_TEXT_UPDATED,
(wxObjectEventFunction) &cmMainFrame::OnPropertyChanged);
this->SetupMenu(value);
break;
case cmCacheProperty::FILE:
sizer->Add(5, 5, 0);
value = new wxStaticText(panel, -1, this->m_Value.c_str());
maxheight = cmMAX(maxheight, ::GetClientHeight(value));
sizer->Add(value, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
this->m_TextControl = value;
this->SetupMenu(value);
value = new wxButton(panel, -1, "...", wxDefaultPosition,
wxSize(20, maxheight - 4));
maxheight = cmMAX(maxheight, ::GetClientHeight(value));
value->SetBackgroundColour(buttoncolor);
sizer->Add(value, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
this->ConnectEvent(value, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &cmMainFrame::OnPropertyChanged);
this->SetupMenu(value);
value = 0;
break;
case cmCacheProperty::PATH:
sizer->Add(5, 5, 0);
value = new wxStaticText(panel, -1, this->m_Value.c_str());
maxheight = cmMAX(maxheight, ::GetClientHeight(value));
sizer->Add(value, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
this->m_TextControl = value;
this->SetupMenu(value);
value = new wxButton(panel, -1, "...", wxDefaultPosition,
wxSize(20, maxheight - 4));
maxheight = cmMAX(maxheight, ::GetClientHeight(value));
value->SetBackgroundColour(buttoncolor);
sizer->Add(value, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
this->ConnectEvent(value, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &cmMainFrame::OnPropertyChanged);
this->SetupMenu(value);
value = 0;
break;
default:
value = new wxStaticText(panel, -1, this->m_Value.c_str());
maxheight = cmMAX(maxheight, ::GetClientHeight(value));
this->m_TextControl = value;
break;
}
//panel->Fit();
this->m_ValueWindow = panel;
//panel->Fit();
//win->Fit();
if ( value )
{
sizer->Add(value, 1, wxALIGN_LEFT | wxGROW | wxALL | wxALIGN_CENTER_VERTICAL);
}
//s->Layout();
panel->SetAutoLayout( TRUE );
panel->SetSizer(sizer);
sizer->Fit(panel);
sizer->SetSizeHints(panel);
sizer->Layout();
if ( this->m_NewValue )
{
s->Prepend(this->m_ValueWindow, 1, wxGROW | wxLEFT | wxRIGHT );
s->Prepend(this->m_KeyWindow, 1, wxGROW | wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL );
}
else
{
s->Add(this->m_KeyWindow, 1, wxGROW | wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL );
s->Add(this->m_ValueWindow, 1, wxGROW | wxLEFT | wxRIGHT );
}
this->SetupMenu(this->m_KeyWindow);
this->SetupMenu(this->m_ValueWindow);
int x1, x2, xm, s1, s2, sm;
win->GetSize(&xm, &sm);
this->m_KeyWindow->GetSize(&x1, &s1);
this->m_ValueWindow->GetSize(&x2, &s2);
int m = s1;
if ( s2 > m )
{
m = s2;
}
this->m_KeyWindow->SetSize(x1, m);
this->m_ValueWindow->SetSize(x2, m);
//std::cout << "Size of panels: " << sm << "," << s1 << ", " << s2 << " max: " << maxheight<< std::endl;
return maxheight;
}
void cmCacheProperty::Remove(wxSizer* sizer, wxPanel*)
{
if ( this->m_KeyWindow )
{
sizer->Remove(this->m_KeyWindow);
this->m_KeyWindow->Destroy();
}
if ( this->m_ValueWindow )
{
sizer->Remove(this->m_ValueWindow);
this->m_ValueWindow->Destroy();
}
this->m_KeyWindow = 0;
this->m_ValueWindow = 0;
//sizer->Layout();
//win->Fit();
}
void cmCacheProperty::ConnectEvent(wxWindow* win, wxEventType et, wxObjectEventFunction func)
{
if ( !this->m_MainFrame )
{
return;
}
win->SetClientData(this);
this->m_MainFrame->Connect(win->GetId(), et, func);
}
void cmCacheProperty::ConnectEventTo(wxWindow* win, wxEventType et,
wxObjectEventFunction func)
{
if ( !this->m_MainFrame )
{
return;
}
win->SetClientData(this);
this->m_MainFrame->ConnectEventTo(win, et, func);
}
void cmCacheProperty::OnPropertyChanged(wxEvent& event)
{
if ( event.GetEventType() == wxEVT_RIGHT_DOWN )
{
}
else
{
switch ( this->m_ItemType )
{
case cmCacheProperty::EDIT: this->OnEntryChanged(event); break;
case cmCacheProperty::FILE: this->OnFileBrowseButton(event); break;
case cmCacheProperty::CHECKBOX: this->OnCheckboxButton(event); break;
case cmCacheProperty::PATH: this->OnPathBrowseButton(event); break;
}
}
}
void cmCacheProperty::OnFileBrowseButton(wxEvent&)
{
std::string path = cmSystemTools::GetFilenamePath(this->m_Value);
std::string file = cmSystemTools::GetFilenameName(this->m_Value);
if ( path == "NOTFOUND" )
{
path = this->m_MainFrame->GetBuildDir();
}
wxFileDialog dialog (
this->m_MainFrame,
_T("Select file"),
path.c_str(),
file.c_str(),
_T("All files|*.*")
);
if (dialog.ShowModal() == wxID_OK)
{
std::string str = "";
if ( this->m_TextControl )
{
str += dialog.GetPath().c_str();
static_cast<wxStaticText*>(this->m_TextControl)->SetLabel(str.c_str());
}
this->SetValue(str.c_str());
}
}
void cmCacheProperty::OnPathBrowseButton(wxEvent&)
{
std::string path = this->m_Value;
if ( path == "NOTFOUND" )
{
path = this->m_MainFrame->GetBuildDir();
}
wxDirDialog dialog ( this->m_MainFrame, _T("Select directory"), path.c_str() );
if (dialog.ShowModal() == wxID_OK)
{
if ( this->m_TextControl )
{
static_cast<wxStaticText*>(this->m_TextControl)->SetLabel(dialog.GetPath());
}
this->SetValue(dialog.GetPath().c_str());
}
}
void cmCacheProperty::OnCheckboxButton(wxEvent& event)
{
wxCheckBox* widget = static_cast<wxCheckBox*>( event.GetEventObject() );
if ( !widget )
{
return;
}
int val = widget->GetValue();
if ( val )
{
this->SetValue("ON");
}
else
{
this->SetValue("OFF");
}
}
void cmCacheProperty::OnEntryChanged(wxEvent& event)
{
wxTextCtrl* widget = static_cast<wxTextCtrl*>( event.GetEventObject() );
if ( !widget )
{
return;
}
this->SetValue(static_cast<const char*>(widget->GetValue()));
}
void cmCacheProperty::SetupMenu(wxWindow* win)
{
this->ConnectEventTo(win, wxEVT_RIGHT_DOWN,
(wxObjectEventFunction) &cmMainFrame::OnPopupMenu);
this->ConnectEventTo(win, wxEVT_MOTION,
(wxObjectEventFunction) &cmMainFrame::OnCacheStatusBar);
}

View File

@ -1,130 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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 CMCACHEPROPERTY_H
#define CMCACHEPROPERTY_H
#include "cmStandardIncludes.h"
#include "wxincludes.h"
class cmMainFrame;
class wxControl;
class wxPanel;
class wxSizer;
class wxWindow;
/** \class cmCacheProperty
* \brief GUI Control class for cmake's cache property
*
* Stores cache property as displayed on GUI, caches its value, colors
* red when new.
*
*/
class cmCacheProperty
{
public:
cmCacheProperty(cmMainFrame*, const std::string& name);
~cmCacheProperty();
const std::string& GetName() { return this->m_Name; }
//! Get and set the value
const std::string& GetValue() { return this->m_Value; }
void SetValue(const std::string& s) { this->m_Value = s; }
//! Get and set the help value
void SetHelp(const std::string& s) { this->m_HelpString = s; }
const std::string& GetHelp() { return this->m_HelpString; }
//! Display the property in the window. Return the maximum height.
int Display(wxSizer*, wxPanel*);
//! Remove the property from the window
void Remove(wxSizer*, wxPanel*);
//! This method is called when property is changed
void OnPropertyChanged(wxEvent& event);
//! Mark cache entry as being removed.
void MarkRemoved() { this->m_Removed = true; }
//! Check if the entry was removed
bool IsRemoved() { return this->m_Removed; }
//! Get and set the new flag.
void SetNewFlag(bool f) { this->m_NewValue = f; }
bool GetNewFlag() { return this->m_NewValue; }
//! Mark cache entry as being removed.
void MarkAdvanced() { this->m_Advanced = true; }
//! Check if the entry was removed
bool IsAdvanced() { return this->m_Advanced; }
//! Set item type
void SetItemType(int t) { this->m_ItemType = t; }
//! Get the main frame asociated with the cache property
cmMainFrame* GetMainFrame() { return this->m_MainFrame; }
enum ItemType
{
NOTHING = 0,
EDIT,
FILE,
CHECKBOX,
PATH
};
enum
{
Menu_Popup_Ignore = 200,
Menu_Popup_Delete,
Menu_Popup_Help
};
protected:
bool m_NewValue;
bool m_Advanced;
int m_ItemType;
wxWindow* m_KeyWindow;
wxWindow* m_ValueWindow;
std::string m_Name;
std::string m_Value;
std::string m_HelpString;
bool m_Removed;
//! The following methods set the events handling of widgets for the
// cache property.
void ConnectEvent(wxWindow* win, wxEventType et, wxObjectEventFunction func);
void ConnectEventTo(wxWindow* win, wxEventType et, wxObjectEventFunction func);
void SetupMenu(wxWindow* win);
//! This are event callbacks for different events.
void OnFileBrowseButton(wxEvent& event);
void OnPathBrowseButton(wxEvent& event);
void OnCheckboxButton(wxEvent& event);
void OnEntryChanged(wxEvent& event);
private:
cmMainFrame* m_MainFrame;
wxControl* m_TextControl;
};
#endif

View File

@ -1,137 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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.
=========================================================================*/
// cmCommandLineInfo.cpp : command line arguments
//
#include "cmWXCommandLineInfo.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

@ -1,66 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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.
=========================================================================*/
// cmCommandLineInfo.h : main header file for the command line arguments
//
#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)

File diff suppressed because it is too large Load Diff

View File

@ -1,243 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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 __cmMainFrame__h__
#define __cmMainFrame__h__
#include "cmStandardIncludes.h"
#include "wxincludes.h"
class cmCacheProperty;
class cmCommandLineInfo;
class cmake;
class wxButton;
class wxCheckBox;
class wxComboBox;
class wxMenu;
class wxPanel;
class wxScrolledWindow;
class wxSizer;
class wxStaticBox;
class wxStaticText;
class wxApp;
/** \class cmMainFrame
* \brief GUI for CMake with wxWindows toolkit
*
* The main dialog for the CMake
*
*/
class cmMainFrame : public wxFrame
{
public:
cmMainFrame(const wxString& title, const wxSize& size);
~cmMainFrame();
//! Initialize the paths and read the cache.
void Initialize(cmCommandLineInfo*);
//! Different callbacks for events
void OnOk(wxCommandEvent& event);
void OnConfigure(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
void OnHelp(wxCommandEvent& event);
void OnBrowseSource(wxCommandEvent& event);
void OnSourceSelected(wxCommandEvent& event);
void OnSourceUpdated(wxCommandEvent& event);
void OnBrowseBinary(wxCommandEvent& event);
void OnBinarySelected(wxCommandEvent& event);
void OnBinaryUpdated(wxCommandEvent& event);
void OnBinaryAccepted(wxCommandEvent& event);
void OnShowAdvancedValues(wxCommandEvent& event);
void OnResize(wxSizeEvent& event);
void OnPropertyChanged(wxEvent& event);
void OnRandomEvent(wxEvent& event);
void OnGeneratorSelected(wxEvent& event);
void OnPopupMenu(wxMouseEvent& event);
void OnCacheStatusBar(wxEvent& event);
void OnStatusBar(wxEvent& event);
void OnExitTimer(wxEvent& event);
//! Callbacks for menu events
void OnPopupMenuIgnore(wxEvent& event);
void OnPopupMenuDelete(wxEvent& event);
void OnPopupMenuHelp(wxEvent& event);
void OnPopupMenuEntry(wxEvent& event, int idx);
// Connect widget and event with method.
void ConnectEvent(wxWindow*, wxEventType, wxObjectEventFunction);
void ConnectEventTo(wxWindow*, wxEventType, wxObjectEventFunction);
//! Callback for the error message.
static void MessageCallback(const char* m, const char* title,
bool& nomore, void* cd);
static void ProgressCallback(const char* m, float prog, void* clientData);
void DisplayMessage(const char* m, const char* title, bool& nomore);
//! Retrieve the current build directory.
const std::string& GetBuildDir() { return this->m_WhereBuild; }
//! Set the application for progress
void SetApplication(wxApp* app) { m_Application = app; }
private:
//! Load cache file from m_WhereBuild and display in GUI editor
void LoadCacheFromDiskToGUI();
//! Save GUI values to cmCacheManager and then save to disk.
void SaveCacheFromGUI();
// copy from the cache manager to the cache edit list box
void FillCacheGUIFromCacheManager();
// copy from the list box to the cache manager
void FillCacheManagerFromCacheGUI();
// set the current generator
void SetGenerator(const char* generator);
// Set the status bar binding.
void SetupStatusBarBinding(wxWindow*);
// set the current source and binary dir
bool SetSourceDir(const char* dir);
std::string GetSourceDir();
bool SetBinaryDir(const char* dir);
std::string GetBinaryDir();
void ChangeDirectoriesFromFile(const char* buffer);
// update source and binary menus.
void UpdateSourceBuildMenus();
// Check wether cache is dirty.
bool IsDirty() { return !this->m_Clean; }
void SetDirty() { this->m_Clean = false; }
void ClearDirty() { this->m_Clean = true; }
// Run the CMake
void RunCMake(bool generateProjectFiles);
void RemoveAdvancedValues();
void UpdateCacheValuesDisplay();
// Change the build directory.
void ChangeWhereSource();
void ChangeWhereBuild();
bool SourceDirectoryChanged();
bool BuildDirectoryChanged();
// Clear the Cache
void ClearCache();
void RemoveCacheEntry(cmCacheProperty*);
void IgnoreCacheEntry(const char* key);
void HelpCacheEntry(const char* key, const char* help);
void LoadFromRegistry();
void SaveToRegistry();
virtual void SetStatusText(const wxString& text, int number = 0);
void ResizeInternal();
//! Change the type of mouse cursor. Set argument to true to store
// the type.
void CursorBusy(bool s=false);
void CursorNormal(bool s=false);
// Main panel
wxPanel* m_MainPanel;
wxSizer* m_TopMostSizer;
// Main sizer
wxSizer* m_MainSizer;
// Top row of main sizer
wxSizer* m_TopGrid;
// Top line:
wxStaticText* m_TextSource;
wxComboBox* m_PathSource;
wxButton* m_BrowseSource;
// Top line end frame:
wxSizer* m_GeneratorFrame;
wxStaticText* m_BuildFor;
wxComboBox* m_GeneratorMenu;
// Bottom line:
wxStaticText* m_TextBinary;
wxComboBox* m_PathBinary;
wxButton* m_BrowseBinary;
wxCheckBox* m_ShowAdvancedValues;
// Cache values:
wxStaticBox* m_CacheValuesBox;
wxSizer* m_CacheValuesFrame;
wxScrolledWindow* m_CacheValuesScroll;
wxPanel* m_CacheValuesPanel;
wxSizer* m_CacheValuesSizer;
// Help text:
wxStaticText* m_HelpText;
// Buttons:
wxSizer* m_BottomButtonsFrame;
wxStaticText* m_VersionText;
wxButton* m_ConfigureButton;
wxButton* m_OKButton;
wxButton* m_CancelButton;
wxButton* m_HelpButton;
// This is set when the cache has to be updated.
bool m_Update;
// This is to detect when cache is not valid such as when cache
// entry is removed or when some new entries are present. You have
// to rerun cmake to set valid to true.
bool m_Valid;
// This is needed for mac, because on mac dialog has to be redrawn
// after the menu is removed.
bool m_EntryRemoved;
std::string m_WhereSource;
std::string m_WhereBuild;
std::string m_PathToExecutable;
bool m_Clean;
bool m_BuildPathChanged;
bool m_CursorChanged;
typedef std::map<std::string, cmCacheProperty*> CacheMapType;
CacheMapType* m_CacheEntries;
cmake* m_CMakeInstance;
wxTimer* m_ExitTimer;
wxApp* m_Application;
enum Events {
ID_MainFrame,
ID_Resize,
ID_OKButton,
ID_ConfigureButton,
ID_CancelButton,
ID_HelpButton,
ID_AdvancedValues
};
};
#endif // __cmMainFrame__h__

View File

@ -1,175 +0,0 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
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.
=========================================================================*/
// wxCMakeSetup.cxx : implementation file
//
#include "cmSystemTools.h"
#include "cmWXCommandLineInfo.h"
#include "cmWXMainFrame.h"
class wxCMakeSetup : public wxApp
{
public:
virtual bool OnInit();
virtual int OnExit();
};
class testFrame : public wxFrame
{
public:
testFrame(const wxString& title, const wxSize& size)
: wxFrame((wxFrame*)NULL, 0, title, wxDefaultPosition, size)
{
wxPanel *panel = new wxPanel(this, -1);
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
wxWindow *value = new wxStaticText(panel, -1, "Some label");
sizer->Add(value, 1, wxALIGN_CENTER_VERTICAL );
value = new wxButton(panel, -1, "Button", wxDefaultPosition, wxSize(25, 0));
sizer->Add(value, 0, wxALIGN_RIGHT);
panel->SetAutoLayout( TRUE );
panel->SetSizer(sizer);
sizer->Fit(panel);
sizer->SetSizeHints(panel);
sizer->Layout();
}
};
class testFrame1 : public wxFrame
{
public:
testFrame1(const wxString& title, const wxSize& size)
: wxFrame((wxFrame*)NULL, 0, title, wxDefaultPosition, size)
{
wxPanel *panel = new wxPanel(this, -1);
panel->SetBackgroundColour(*wxRED);
wxSizer *sizer = new wxFlexGridSizer(2, 5, 5);
wxWindow *value = 0;
int cc;
for ( cc = 0; cc < 4; cc ++ )
{
char buffer[200];
sprintf(buffer, "Long, Long Label; this label should be "
"bigger than button %d",cc);
value = new wxStaticText(panel, -1, buffer);
sizer->Add(value, 1, wxGROW | wxALL );
sprintf(buffer, "Button %d", cc);
value = new wxButton(panel, -1, buffer);
sizer->Add(value, 1, wxGROW | wxALL );
}
panel->SetAutoLayout( TRUE );
panel->SetSizer(sizer);
sizer->Fit(panel);
sizer->SetSizeHints(panel);
sizer->Layout();
}
};
class testFrame2 : public wxFrame
{
public:
testFrame2(const wxString& title, const wxSize& size)
: wxFrame((wxFrame*)NULL, 0, title, wxDefaultPosition, size)
{
wxPanel *panel = new wxPanel(this, -1);
panel->SetBackgroundColour(*wxRED);
new wxTextCtrl(panel, -1, "Test", wxPoint(40, 5));
new wxButton(panel, -1, "Test", wxPoint(-1, 5));
}
};
class testFrame3 : public wxFrame
{
public:
testFrame3(const wxString& title, const wxSize& size)
: wxFrame((wxFrame*)NULL, 0, title, wxDefaultPosition, size)
{
this->CreateStatusBar();
this->SetSizeHints(300, 300);
wxPanel *panel = new wxPanel(this, -1);
wxSizer *sizer = new wxFlexGridSizer(2, 5, 5);
wxWindow *value = 0;
int cc;
for ( cc = 0; cc < 10; cc ++ )
{
char buffer[200];
sprintf(buffer, "Label %d",cc);
value = new wxStaticText(panel, -1, buffer);
sizer->Add(value, 1, wxGROW | wxALL );
sprintf(buffer, "Button %d", cc);
value = new wxButton(panel, -1, buffer);
sizer->Add(value, 1, wxGROW | wxALL );
value->SetClientData(this);
value->Connect(-1, wxEVT_MOTION,
(wxObjectEventFunction) &testFrame3::OnStatusBar);
}
panel->SetAutoLayout( TRUE );
panel->SetSizer(sizer);
sizer->Fit(panel);
sizer->SetSizeHints(panel);
sizer->Layout();
}
void OnStatusBar(wxEvent& event)
{
wxControl* eobject = static_cast<wxControl*>(event.GetEventObject());
testFrame3* self = static_cast<testFrame3*>(eobject->GetClientData());
wxString str;
const char* chars = "|-\\/jg@_^";
char ch = chars[((int)eobject)/1024 % strlen(chars)];
int cc;
for ( cc = 0; cc < 10; cc ++ )
{
str += ch;
}
self->SetStatusText(str);
}
};
bool wxCMakeSetup::OnInit()
{
cmSystemTools::DisableRunCommandOutput();
cmCommandLineInfo cm;
cm.SetValidArguments("ABGHQ");
cm.ParseCommandLine(wxApp::argc, wxApp::argv);
this->SetVendorName("Kitware");
this->SetAppName("CMakeSetup");
cmMainFrame *frame = new cmMainFrame("CMake", wxSize(200, 100));
frame->SetApplication(this);
frame->Initialize(&cm);
//wxFrame *frame = new testFrame("CMake", wxSize(200, 100));
//wxFrame *frame = new testFrame1("Frame", wxSize(200, 100));
//wxFrame *frame = new testFrame2("Frame", wxSize(200, 100));
//wxFrame *frame = new testFrame3("Frame", wxSize(200, 100));
frame->Show(TRUE);
this->SetTopWindow(frame);
return TRUE;
}
int wxCMakeSetup::OnExit()
{
// clean up: Set() returns the active config object as Get() does, but unlike
// Get() it doesn't try to create one if there is none (definitely not what
// we want here!)
//delete wxConfigBase::Set((wxConfigBase *) NULL);
return 0;
}
IMPLEMENT_APP(wxCMakeSetup)

View File

@ -1,77 +0,0 @@
#ifdef WIN32
#ifndef __WIN32
# define __WIN32
#endif
#ifndef _WINDOWS
# define _WINDOWS
#endif
#ifndef __WINDOWS__
# define __WINDOWS__
#endif
#ifndef __WXMSW__
# define __WXMSW__
#endif
#ifndef __WIN32__
# define __WIN32__
#endif
#ifndef WINVER
# define WINVER 0x0400
#endif
#ifndef STRICT
# define STRICT
#endif
#include "wx/defs.h"
#include "wx/app.h"
#include "wx/button.h"
#include "wx/checkbox.h"
#include "wx/combobox.h"
#include "wx/config.h"
#include "wx/control.h"
#include "wx/dirdlg.h"
#include "wx/filedlg.h"
#include "wx/menu.h"
#include "wx/msgdlg.h"
#include "wx/scrolwin.h"
#include "wx/sizer.h"
#include "wx/statbox.h"
#include "wx/stattext.h"
#include "wx/textctrl.h"
#include "wx/timer.h"
#pragma hdrstop("wxincludes.pch")
#else
#include "wx/defs.h"
#include "wx/app.h"
#include "wx/button.h"
#include "wx/checkbox.h"
#include "wx/combobox.h"
#include "wx/config.h"
#include "wx/control.h"
#include "wx/dirdlg.h"
#include "wx/filedlg.h"
#include "wx/menu.h"
#include "wx/msgdlg.h"
#include "wx/scrolwin.h"
#include "wx/sizer.h"
#include "wx/statbox.h"
#include "wx/stattext.h"
#include "wx/textctrl.h"
#include "wx/timer.h"
#endif
#undef FileExists