From: <arn...@us...> - 2008-03-29 08:10:19
|
Revision: 1084 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1084&view=rev Author: arnetheduck Date: 2008-03-29 01:10:17 -0700 (Sat, 29 Mar 2008) Log Message: ----------- add local commits Modified Paths: -------------- dcplusplus/trunk/smartwin/SmartUtil/StringConversion.h dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectFileFilter.h dcplusplus/trunk/smartwin/include/smartwin/widgets/ComboBox.h dcplusplus/trunk/smartwin/include/smartwin/widgets/Table.h dcplusplus/trunk/smartwin/source/Application.cpp dcplusplus/trunk/smartwin/source/widgets/Table.cpp dcplusplus/trunk/win32/DirectoryListingFrame.h dcplusplus/trunk/win32/PropPage.cpp dcplusplus/trunk/win32/QueueFrame.h dcplusplus/trunk/win32/SearchFrame.cpp Added Paths: ----------- dcplusplus/trunk/smartwin/include/smartwin/widgets/LoadDialog.h dcplusplus/trunk/smartwin/include/smartwin/widgets/SaveDialog.h dcplusplus/trunk/win32/ComboBox.cpp dcplusplus/trunk/win32/ComboBox.h dcplusplus/trunk/win32/TextBox.cpp dcplusplus/trunk/win32/TextBox.h dcplusplus/trunk/win32/TypedTable.h dcplusplus/trunk/win32/TypedTree.h Removed Paths: ------------- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetLoadFile.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSaveFile.h dcplusplus/trunk/win32/TypedListView.h dcplusplus/trunk/win32/TypedTreeView.h dcplusplus/trunk/win32/WidgetComboBox.cpp dcplusplus/trunk/win32/WidgetComboBox.h dcplusplus/trunk/win32/WidgetTextBox.cpp dcplusplus/trunk/win32/WidgetTextBox.h Property Changed: ---------------- dcplusplus/trunk/ Property changes on: dcplusplus/trunk ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-03-28 22:03:47.832000017 +0100 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus + timestamp: 2008-03-29 06:56:30.651999950 +0100 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus Name: bzr:file-ids - smartwin/include/smartwin/widgets/CheckBox.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetCheckBox.h smartwin/include/smartwin/widgets/ComboBox.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetComboBox.h smartwin/include/smartwin/widgets/CoolBar.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetCoolbar.h smartwin/include/smartwin/widgets/DateTime.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetDateTimePicker.h smartwin/include/smartwin/widgets/GroupBox.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetGroupBox.h smartwin/include/smartwin/widgets/Label.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetStatic.h smartwin/include/smartwin/widgets/MDIChild.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetMDIChild.h smartwin/include/smartwin/widgets/MDIFrame.h 779@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetMDIFrame.h smartwin/include/smartwin/widgets/MDIParent.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetMDIParent.h smartwin/include/smartwin/widgets/MessageBox.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetMessageBox.h smartwin/include/smartwin/widgets/ProgressBar.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetProgressBar.h smartwin/include/smartwin/widgets/RadioButton.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetRadioButton.h smartwin/include/smartwin/widgets/RichTextBox.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetRichTextBox.h smartwin/include/smartwin/widgets/Slider.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetSlider.h smartwin/include/smartwin/widgets/Spinner.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetSpinner.h smartwin/include/smartwin/widgets/StatusBar.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetStatusBar.h smartwin/include/smartwin/widgets/TabSheet.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetTabSheet.h smartwin/include/smartwin/widgets/Table.h 876@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetListView.h smartwin/include/smartwin/widgets/TextBox.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetTextBox.h smartwin/include/smartwin/widgets/ToolBar.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetToolbar.h smartwin/include/smartwin/widgets/ToolTip.h 809@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetToolTip.h smartwin/include/smartwin/widgets/Tree.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetTreeView.h smartwin/source/widgets/CheckBox.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetCheckBox.cpp smartwin/source/widgets/ComboBox.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetComboBox.cpp smartwin/source/widgets/CoolBar.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetCoolbar.cpp smartwin/source/widgets/DateTime.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetDateTimePicker.cpp smartwin/source/widgets/GroupBox.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetGroupBox.cpp smartwin/source/widgets/Label.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetStatic.cpp smartwin/source/widgets/MDIChild.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetMDIChild.cpp smartwin/source/widgets/MDIFrame.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetMDIFrame.cpp smartwin/source/widgets/MDIParent.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetMDIParent.cpp smartwin/source/widgets/ProgressBar.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetProgressBar.cpp smartwin/source/widgets/RadioButton.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetRadioButton.cpp smartwin/source/widgets/RichTextBox.cpp 821@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetRichTextBox.cpp smartwin/source/widgets/Slider.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetSlider.cpp smartwin/source/widgets/Spinner.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetSpinner.cpp smartwin/source/widgets/TabSheet.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetTabSheet.cpp smartwin/source/widgets/Table.cpp 876@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetListView.cpp smartwin/source/widgets/TextBox.cpp 821@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetTextBox.cpp smartwin/source/widgets/ToolBar.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetToolbar.cpp smartwin/source/widgets/ToolTip.cpp 810@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetToolTip.cpp smartwin/source/widgets/Tree.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetTreeView.cpp + smartwin/include/smartwin/widgets/LoadDialog.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetLoadFile.h smartwin/include/smartwin/widgets/SaveDialog.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Fwidgets%2FWidgetSaveFile.h win32/ComboBox.cpp 1023@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:win32%2FWidgetComboBox.cpp win32/ComboBox.h 1023@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:win32%2FWidgetComboBox.h win32/TextBox.cpp 1023@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:win32%2FWidgetTextBox.cpp win32/TextBox.h 753@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:win32%2FWidgetTextBox.h win32/TypedTable.h 846@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:win32%2FTypedListView.h win32/TypedTree.h 743@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:win32%2FTypedTreeView.h Name: bzr:revision-id:v3-trunk1 - 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 1032 arn...@gm...-20080324153706-siidja05n84i00b1 1033 arn...@gm...-20080324153823-lhn3awurnu77riln 1034 arn...@gm...-20080324165650-zapppziji67yf5a2 1035 zouzou123gen-20080324175936-4mqc2kh0lo5wtdu2 1036 zouzou123gen-20080325004602-6wdsoym95mjuhwd3 1037 arn...@gm...-20080325100659-8fqy6q65itmghlep 1038 zouzou123gen-20080325175216-s297sdiucukfvijh 1039 arn...@gm...-20080325210137-3dfqyoi8ykosy087 1040 arn...@gm...-20080325211747-nwwy1eb33r071sca 1041 arn...@gm...-20080326084110-qbselrjckku275xi 1042 zouzou123gen-20080326123631-35642mgbk2i4ty32 1043 zouzou123gen-20080326124345-f4xwn2d3ty8ubd6r 1044 arn...@gm...-20080326162031-il0nyms30w0mky43 1045 arn...@gm...-20080326164801-8dru8mjc06xgzjpv 1046 arn...@gm...-20080326170438-uzl2rx8fqnohak7g 1047 zouzou123gen-20080326172821-d6uqcbmfb0c6rwlv 1048 arn...@gm...-20080326213257-qlgdh7m2712p2l0q 1049 arn...@gm...-20080326214313-ktnoekgk3s0wmatz 1050 arn...@gm...-20080326215256-0j1iqrf286b9g7zf 1051 arn...@gm...-20080327082121-hoi22wh1gwjdfbyd 1052 arn...@gm...-20080327120639-um3tukdt374rwvgm 1053 zouzou123gen-20080327130703-6vtek6uxy3vua543 1054 arn...@gm...-20080327215831-dmg5mkufskabwkro 1055 arn...@gm...-20080327231459-cdztcv25alsuyqmf 1056 arn...@gm...-20080328085925-gceybsr53oml1p24 1057 arn...@gm...-20080328200512-1sjuu6bcnl2dyd2a 1058 arn...@gm...-20080328210347-bussqjrm5mfswh7o + 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 1032 arn...@gm...-20080324153706-siidja05n84i00b1 1033 arn...@gm...-20080324153823-lhn3awurnu77riln 1034 arn...@gm...-20080324165650-zapppziji67yf5a2 1035 zouzou123gen-20080324175936-4mqc2kh0lo5wtdu2 1036 zouzou123gen-20080325004602-6wdsoym95mjuhwd3 1037 arn...@gm...-20080325100659-8fqy6q65itmghlep 1038 zouzou123gen-20080325175216-s297sdiucukfvijh 1039 arn...@gm...-20080325210137-3dfqyoi8ykosy087 1040 arn...@gm...-20080325211747-nwwy1eb33r071sca 1041 arn...@gm...-20080326084110-qbselrjckku275xi 1042 zouzou123gen-20080326123631-35642mgbk2i4ty32 1043 zouzou123gen-20080326124345-f4xwn2d3ty8ubd6r 1044 arn...@gm...-20080326162031-il0nyms30w0mky43 1045 arn...@gm...-20080326164801-8dru8mjc06xgzjpv 1046 arn...@gm...-20080326170438-uzl2rx8fqnohak7g 1047 zouzou123gen-20080326172821-d6uqcbmfb0c6rwlv 1048 arn...@gm...-20080326213257-qlgdh7m2712p2l0q 1049 arn...@gm...-20080326214313-ktnoekgk3s0wmatz 1050 arn...@gm...-20080326215256-0j1iqrf286b9g7zf 1051 arn...@gm...-20080327082121-hoi22wh1gwjdfbyd 1052 arn...@gm...-20080327120639-um3tukdt374rwvgm 1053 zouzou123gen-20080327130703-6vtek6uxy3vua543 1054 arn...@gm...-20080327215831-dmg5mkufskabwkro 1055 arn...@gm...-20080327231459-cdztcv25alsuyqmf 1056 arn...@gm...-20080328085925-gceybsr53oml1p24 1057 arn...@gm...-20080328200512-1sjuu6bcnl2dyd2a 1058 arn...@gm...-20080328210347-bussqjrm5mfswh7o 1059 arn...@gm...-20080329055630-braiir1dskv7a4qm Name: bzr:ancestry:v3-trunk1 + arn...@gm...-20080329054606-ubefm4h98xjgvif9 Modified: dcplusplus/trunk/smartwin/SmartUtil/StringConversion.h =================================================================== --- dcplusplus/trunk/smartwin/SmartUtil/StringConversion.h 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/SmartUtil/StringConversion.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -66,7 +66,7 @@ /// Specialized version of UnicodeConverter class for converting FROM UNICODE or wchar_t TO char (std::string) /** It can in many scenarios be useful to be able to convert from wchar_t to char, one good example is when you have a * a filepath and you want to construct a std::fstream object.<br> - * Often you would for instance use a WidgetLoadFile or a WidgetSaveFile Widget to retrieve a path from the user.<br> + * Often you would for instance use a LoadDialog or a SaveDialog Widget to retrieve a path from the user.<br> * These classes returns their file paths in UNICODE format ifi UNICODE is defined.<br> * But the std::fstream constructors cannot take any string types other than char * types for a file path.<br> * Then you can use this class to convert from wchar_t string to char strings. <br> Modified: dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -39,13 +39,13 @@ #include "widgets/DateTime.h" #include "widgets/WidgetDialog.h" #include "widgets/GroupBox.h" -#include "widgets/WidgetLoadFile.h" +#include "widgets/LoadDialog.h" #include "widgets/MDIChild.h" #include "widgets/MDIFrame.h" #include "widgets/MDIParent.h" #include "widgets/ProgressBar.h" #include "widgets/RadioButton.h" -#include "widgets/WidgetSaveFile.h" +#include "widgets/SaveDialog.h" #include "widgets/Slider.h" #include "widgets/Spinner.h" #include "widgets/Label.h" @@ -179,10 +179,10 @@ typedef typename RadioButton::ObjectType RadioButtonPtr; /// LoadFileDialog class type. - typedef SmartWin::WidgetLoadFile WidgetLoadFile; + typedef SmartWin::LoadDialog LoadDialog; /// SaveFileDialog class and object type. - typedef SmartWin::WidgetSaveFile WidgetSaveFile; + typedef SmartWin::SaveDialog SaveDialog; /// ColorDialog class and object type. typedef SmartWin::ColorDialog ColorDialog; @@ -254,12 +254,12 @@ /// Creates a LoadFileDialog and returns a pointer to it. /** Use this one to construct a ( stack object ) to show a Load File Dialog */ - WidgetLoadFile createLoadFile(); + LoadDialog createLoadFile(); /// Creates a SaveFileDialog and returns a pointer to it. /** Use this one to construct a ( stack object ) to show a Save File Dialog */ - WidgetSaveFile createSaveFile(); + SaveDialog createSaveFile(); /// Creates a ColorDialog and returns it. /** Usable to let user choose font from the system installed fonts. @@ -485,17 +485,17 @@ } template<typename ContainerWidgetType> -typename WidgetFactory< ContainerWidgetType >::WidgetLoadFile +typename WidgetFactory< ContainerWidgetType >::LoadDialog WidgetFactory< ContainerWidgetType >::createLoadFile() { - return WidgetLoadFile ( this ); + return LoadDialog ( this ); } template<typename ContainerWidgetType> -typename WidgetFactory< ContainerWidgetType >::WidgetSaveFile +typename WidgetFactory< ContainerWidgetType >::SaveDialog WidgetFactory< ContainerWidgetType >::createSaveFile() { - return WidgetSaveFile ( this ); + return SaveDialog ( this ); } template<typename ContainerWidgetType> Modified: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectFileFilter.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectFileFilter.h 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectFileFilter.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -37,11 +37,11 @@ { // begin namespace SmartWin -/// Class for adding a filter to e.g. a WidgetLoadFile dialog. +/// Class for adding a filter to e.g. a LoadDialog dialog. /** \ingroup AspectClasses * Class is an Aspect class which should be realized into classes that needs it. * <br> - * Help the WidgetLoadFile and the WidgetSaveFile to add up filters on which file + * Help the LoadDialog and the SaveDialog to add up filters on which file * types to look for! */ class AspectFileFilter @@ -84,7 +84,7 @@ return itsActiveFilter + 1; } - /// Sets the starting directory of the WidgetLoadFile or WidgetSaveFile Widget + /// Sets the starting directory of the LoadDialog or SaveDialog Widget /** If given your dialog will try to start in the given directory, otherwise it * will use the working directory of the process. */ @@ -94,7 +94,7 @@ } /// Ensure filename meets OS expectations for path separators. - /** We want WidgetSaveFile and WidgetLoadFile to always return a pathname that + /** We want SaveDialog and LoadDialog to always return a pathname that * meets the OS expectations. <br> * Windows wants: C:\dir\dir\file.ext <br> * and UnixLinux: /dir/dir/file.ext <br> @@ -128,30 +128,26 @@ protected: - AspectFileFilter() - : itsActiveFilter( 0 ) + Widget * itsParent; + HWND getParentHandle() { return itsParent ? itsParent->handle() : NULL; } + + AspectFileFilter(Widget* parent) + : itsParent(parent), itsActiveFilter( 0 ) {} static const int PATH_BUFFER_SIZE = 32768; //really arbitrary, but 32K sounds reasonable. size in number of TCHARS! // Fills out the common members of the OPENFILENAME struct. - // This is called for both WidgetLoadFile and for WidgetSaveFile Widgets - void fillOutCommonStructure( OPENFILENAME & ofn, HWND parent, int flags ) + // This is called for both LoadDialog and for SaveDialog Widgets + void fillOFN( OPENFILENAME & ofn, HWND parent, int flags ) { - // Initialize OPENFILENAME - ZeroMemory( & ofn, sizeof( ofn ) ); - ofn.lStructSize = sizeof( OPENFILENAME ); - ofn.hwndOwner = parent; - ofn.hInstance = ::GetModuleHandle( 0 ); ofn.nMaxFile = PATH_BUFFER_SIZE; ofn.lpstrFilter = itsFilter.c_str(); ofn.nFilterIndex = this->getActiveFilter(); - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 259; ofn.lpstrInitialDir = itsStartDir.c_str(); - ofn.Flags = flags; // OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + ofn.Flags = flags; } Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/ComboBox.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/ComboBox.h 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/ComboBox.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -190,7 +190,7 @@ { int txtLength = ::GetWindowTextLength( handle() ); SmartUtil::tstring retVal(txtLength, '\0'); - ::GetWindowText( handle(), &txt[0], txtLength ); + ::GetWindowText( handle(), &retVal[0], txtLength ); return retVal; } Copied: dcplusplus/trunk/smartwin/include/smartwin/widgets/LoadDialog.h (from rev 1083, dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetLoadFile.h) =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/LoadDialog.h (rev 0) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/LoadDialog.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -0,0 +1,162 @@ +/* + Copyright (c) 2005, Thomas Hansen + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the SmartWin++ nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef LoadDialog_h +#define LoadDialog_h + +#include "../Widget.h" +#include "../../SmartUtil.h" +#include "../aspects/AspectFileFilter.h" +#include <vector> + +namespace SmartWin +{ +// begin namespace SmartWin + +/// LoadFileDialog class +/** \ingroup WidgetControls + * \image html loadfile.PNG + * Class for showing a LoadFileDialog box. <br> + * \sa SaveDialog + * \sa AspectFileFilter + */ +class LoadDialog + : public AspectFileFilter +{ +public: + /// Class type + typedef LoadDialog ThisType; + + /// Object type + /** Note, not a pointer!!!! + */ + typedef ThisType ObjectType; + + /// Shows the dialog + /** Returns string() or "empty string" if user press cancel. <br> + * Returns a "file path" if user presses ok. <br> + * Use the inherited functions AspectFileFilter::addFilter and + * AspectFileFilter::activeFilter <br> + * before calling this function, if you wish the dialog to show only certain + * types of files. + */ + SmartUtil::tstring showDialog(); + + /// Shows the dialog + /** Returns an empty vector if user press cancel. <br> + * Returns a vector of "file paths" if user presses ok. <br> + * Use the inherited functions AspectFileFilter::addFilter and + * AspectFileFilter::activeFilter <br> + * before calling this function, if you wish the dialog to show only certain + * types of files. + */ + std::vector<SmartUtil::tstring> showDialogMultiSelect(); + + // Constructor Taking pointer to parent + explicit LoadDialog( Widget * parent = 0 ); + +<<<<<<< TREE +<<<<<<< TREE + ~LoadDialog() { } +======= + virtual ~WidgetLoadFile() { } +>>>>>>> MERGE-SOURCE +======= + virtual ~LoadDialog() { } +>>>>>>> MERGE-SOURCE +private: +}; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Implementation of class +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +inline SmartUtil::tstring LoadDialog::showDialog() +{ + TCHAR szFile[PATH_BUFFER_SIZE]; // buffer for file name + szFile[0] = '\0'; + + OPENFILENAME ofn = { sizeof(OPENFILENAME) }; // common dialog box structure + fillOFN( ofn, getParentHandle(), OFN_FILEMUSTEXIST ); + ofn.lpstrFile = szFile; + ofn.Flags |= OFN_FILEMUSTEXIST; + + SmartUtil::tstring retVal; + if ( ::GetOpenFileName( & ofn ) ) + { + retVal = ofn.lpstrFile; + backslashToForwardSlashForUnix( retVal ); + } + return retVal; +} + +inline std::vector<SmartUtil::tstring> LoadDialog::showDialogMultiSelect() +{ + TCHAR szFile[PATH_BUFFER_SIZE]; // buffer for file name + szFile[0] = '\0'; + + OPENFILENAME ofn = { sizeof(OPENFILENAME) }; // common dialog box structure + fillOFN( ofn, getParentHandle(), OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_EXPLORER ); + ofn.lpstrFile = szFile; + std::vector<SmartUtil::tstring> retVal; + if( ::GetOpenFileName(&ofn) ) + { + // If a single file is selected, the lpstrFile string is just the path terminated by TWO null bytes + // If multiple files are selected, the format of the string returned is: + // DIRECTORY_PATH + '\0' + FILE_NAME_1 + '\0' + FILE_NAME_2 + '\0' + ... + FILE_NAME_N + '\0' + '\0' + // (Note the last file name is terminated by two null bytes) + + SmartUtil::tstring fileName; + SmartUtil::tstring filePath; + SmartUtil::tstring directory; + directory = ofn.lpstrFile; // tstring ends at first null + TCHAR *array_p = ofn.lpstrFile + directory.length() + 1; // set pointer to one position past null + fileName = array_p; // fileName is substring from array_p to next null + if (fileName.length() == 0) // only one file was selected + retVal.push_back(directory); // string 'directory' contains full path + else + { + while (fileName.length() > 0) + { + filePath = directory + _T("\\") + fileName; + backslashToForwardSlashForUnix(filePath); + retVal.push_back(filePath); + array_p = array_p + fileName.length() + 1; // set pointer one position past null + fileName = array_p; // fileName is substring from array_p to next null + } + } + } + return retVal; +} + +inline LoadDialog::LoadDialog( Widget * parent ) + : AspectFileFilter( parent ) +{} + +// end namespace SmartWin +} + +#endif Copied: dcplusplus/trunk/smartwin/include/smartwin/widgets/SaveDialog.h (from rev 1083, dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSaveFile.h) =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/SaveDialog.h (rev 0) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/SaveDialog.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -0,0 +1,102 @@ +/* + Copyright (c) 2005, Thomas Hansen + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the SmartWin++ nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef SaveDialog_h +#define SaveDialog_h + +#include "../Widget.h" +#include "../../SmartUtil.h" +#include "../aspects/AspectFileFilter.h" + +namespace SmartWin +{ +// begin namespace SmartWin + +/// SaveFileDialog class +/** \ingroup WidgetControls + * \image html savefile.PNG + * Class for showing a Save File Dialog. + * \sa LoadDialog + * \sa AspectFileFilter + */ +class SaveDialog + : public AspectFileFilter +{ +public: + /// Class type + typedef SaveDialog ThisType; + + /// Object type + /** Note, not a pointer!!!! + */ + typedef ThisType ObjectType; + + /// Shows the dialog + /** Returns string() or "empty string" if user press cancel. <br> + * Returns a "file path" if user presses ok. + */ + bool open(SmartUtil::tstring& target); + + /// Constructor Taking pointer to parent + explicit SaveDialog( Widget * parent = 0 ); + + virtual ~SaveDialog() + {} + +private: +}; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Implementation of class +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +inline bool SaveDialog::open(SmartUtil::tstring& target) +{ + TCHAR szFile[PATH_BUFFER_SIZE + 1]; // buffer for file name + szFile[0] = '\0'; + + OPENFILENAME ofn = { sizeof(OPENFILENAME) }; // common dialog box structure + fillOFN( ofn, getParentHandle(), 0 ); + ofn.lpstrFile = szFile; + + if ( ::GetSaveFileName( & ofn ) ) + { + target = ofn.lpstrFile; + backslashToForwardSlashForUnix( target ); + return true; + } + return false; +} + +inline SaveDialog::SaveDialog( Widget * parent ) + : AspectFileFilter( parent ) +{ +} + +// end namespace SmartWin +} + +#endif Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/Table.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/Table.h 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/Table.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -25,8 +25,8 @@ OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef Table_h -#define Table_h +#ifndef ListView_h +#define ListView_h #include "../Widget.h" #include "../Point.h" @@ -42,7 +42,7 @@ #include "../aspects/AspectScrollable.h" #include "../aspects/AspectSelection.h" #include "Control.h" -#include "TableEditBox.h" +#include "WidgetListViewEditBox.h" #include <vector> @@ -86,7 +86,7 @@ HeaderDispatcher(const F& f_) : f(f_) { } bool operator()(const MSG& msg, LRESULT& ret) { - LPNMTable p = (LPNMTable) msg.lParam; + LPNMLISTVIEW p = (LPNMLISTVIEW) msg.lParam; f(p->iSubItem); return true; } @@ -472,10 +472,10 @@ virtual ~Table() { } - // Returns the rect for the item per code (wraps Table_GetItemRect) + // Returns the rect for the item per code (wraps ListView_GetItemRect) Rectangle getRect( int item, int code ); - // Returns the rect for the subitem item per code (wraps Table_GetSubItemRect) + // Returns the rect for the subitem item per code (wraps ListView_GetSubItemRect) Rectangle getRect( int item, int subitem, int code ); private: @@ -644,10 +644,10 @@ inline void Table::resort() { if(sortColumn != -1) { if(sortType == SORT_CALLBACK) { - Table_SortItems(this->handle(), &Table::compareFuncCallback, reinterpret_cast<LPARAM>(this)); + ListView_SortItems(this->handle(), &Table::compareFuncCallback, reinterpret_cast<LPARAM>(this)); } else { // Wine 0.9.48 doesn't support this - Table_SortItemsEx(this->handle(), &Table::compareFunc, reinterpret_cast< LPARAM >(this)); + ListView_SortItemsEx(this->handle(), &Table::compareFunc, reinterpret_cast< LPARAM >(this)); } } } @@ -657,11 +657,11 @@ } inline size_t Table::countSelectedImpl() const { - return static_cast<size_t>(Table_GetSelectedCount( this->handle() )); + return static_cast<size_t>(ListView_GetSelectedCount( this->handle() )); } inline void Table::setText( unsigned row, unsigned column, const SmartUtil::tstring & newVal ) { - Table_SetItemText( this->handle(), row, column, const_cast < TCHAR * >( newVal.c_str() ) ); + ListView_SetItemText( this->handle(), row, column, const_cast < TCHAR * >( newVal.c_str() ) ); } inline bool Table::getReadOnly() { @@ -681,16 +681,16 @@ colInfo.mask = LVCF_TEXT; colInfo.cchTextMax = BUFFER_MAX; colInfo.pszText = buffer; - Table_GetColumn( this->handle(), col, & colInfo ); + ListView_GetColumn( this->handle(), col, & colInfo ); return colInfo.pszText; } inline bool Table::isChecked( unsigned row ) { - return Table_GetCheckState( this->handle(), row ) == TRUE; + return ListView_GetCheckState( this->handle(), row ) == TRUE; } inline void Table::setChecked( unsigned row, bool value ) { - Table_SetCheckState( this->handle(), row, value ); + ListView_SetCheckState( this->handle(), row, value ); } inline void Table::setFullRowSelect( bool value ) { @@ -698,7 +698,7 @@ } inline void Table::resize( unsigned size ) { - Table_SetItemCount( this->handle(), size ); + ListView_SetItemCount( this->handle(), size ); } inline void Table::setCheckBoxes( bool value ) { @@ -734,11 +734,11 @@ inline void Table::eraseColumn( unsigned columnNo ) { xAssert( columnNo != 0, _T( "Can't delete the leftmost column" ) ); - Table_DeleteColumn( this->handle(), columnNo ); + ListView_DeleteColumn( this->handle(), columnNo ); } inline void Table::setColumnWidth( unsigned columnNo, int width ) { - if ( Table_SetColumnWidth( this->handle(), columnNo, width ) == FALSE ) + if ( ListView_SetColumnWidth( this->handle(), columnNo, width ) == FALSE ) { xCeption x( _T( "Couldn't resize columns of Table" ) ); throw x; @@ -746,15 +746,15 @@ } inline void Table::clearImpl() { - Table_DeleteAllItems( this->handle() ); + ListView_DeleteAllItems( this->handle() ); } inline void Table::eraseImpl( int row ) { - Table_DeleteItem( this->handle(), row ); + ListView_DeleteItem( this->handle(), row ); } inline size_t Table::sizeImpl() const { - return Table_GetItemCount( this->handle() ); + return ListView_GetItemCount( this->handle() ); } #ifdef PORT_ME @@ -769,14 +769,14 @@ inline Rectangle Table::getRect( int item, int code ) { RECT r; - Table_GetItemRect( this->handle(), item, &r, code ); + ListView_GetItemRect( this->handle(), item, &r, code ); return r; } inline Rectangle Table::getRect( int item, int subitem, int code ) { RECT r; - Table_GetSubItemRect( this->handle(), item, subitem, code, &r ); + ListView_GetSubItemRect( this->handle(), item, subitem, code, &r ); return r; } @@ -797,35 +797,35 @@ } inline void Table::setTableStyle(int style) { - Table_SetExtendedTableStyle(this->handle(), style); + ListView_SetExtendedListViewStyle(this->handle(), style); } inline int Table::getNext(int i, int type) const { - return Table_GetNextItem(this->handle(), i, type); + return ListView_GetNextItem(this->handle(), i, type); } inline int Table::find(const SmartUtil::tstring& b, int start, bool aPartial) { LVFINDINFO fi = { aPartial ? LVFI_PARTIAL : LVFI_STRING, b.c_str() }; - return Table_FindItem(this->handle(), start, &fi); + return ListView_FindItem(this->handle(), start, &fi); } inline int Table::findDataImpl(LPARAM data, int start) { LVFINDINFO fi = { LVFI_PARAM, NULL, data }; - return Table_FindItem(this->handle(), start, &fi); + return ListView_FindItem(this->handle(), start, &fi); } inline void Table::select(int i) { - Table_SetItemState(this->handle(), i, LVIS_SELECTED, LVIS_SELECTED); + ListView_SetItemState(this->handle(), i, LVIS_SELECTED, LVIS_SELECTED); } inline void Table::ensureVisible(int i, bool partial) { - Table_EnsureVisible(this->handle(), i, false); + ListView_EnsureVisible(this->handle(), i, false); } inline void Table::setColorImpl(COLORREF text, COLORREF background) { - Table_SetTextColor(this->handle(), text); - Table_SetTextBkColor(this->handle(), background); - Table_SetBkColor(this->handle(), background); + ListView_SetTextColor(this->handle(), text); + ListView_SetTextBkColor(this->handle(), background); + ListView_SetBkColor(this->handle(), background); } #ifdef PORT_ME @@ -886,7 +886,7 @@ if ( xOffset + r.left < 0 || xOffset + r.left > cr.right ) { int x = xOffset - r.left; - Table_Scroll( this->handle(), x, 0 ); + ListView_Scroll( this->handle(), x, 0 ); r.left -= x; } // Get column alignment @@ -894,7 +894,7 @@ {0 }; lv.mask = LVCF_FMT; - Table_GetColumn( this->handle(), logicalColumn, & lv ); + ListView_GetColumn( this->handle(), logicalColumn, & lv ); DWORD dwStyle; if ( ( lv.fmt & LVCFMT_JUSTIFYMASK ) == LVCFMT_LEFT ) dwStyle = ES_LEFT; @@ -903,14 +903,14 @@ else dwStyle = ES_CENTER; r.left += xOffset + 4; - r.right = r.left + ( Table_GetColumnWidth( this->handle(), itsEditColumn ) - 3 ); + r.right = r.left + ( ListView_GetColumnWidth( this->handle(), itsEditColumn ) - 3 ); if ( r.right > cr.right ) r.right = cr.right; dwStyle |= WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL; #endif // Creating text Widget and placing it above cell - HWND editControl = Table_GetEditControl( this->handle() ); + HWND editControl = ListView_GetEditControl( this->handle() ); if ( editControl == 0 ) { xCeption err( _T( "Couldn't attach to List View editcontrol" ) ); @@ -931,7 +931,7 @@ // Getting text of cell and inserting into text Widget const int BUFFER_MAX = 260; // List view cells have a maximum of 260 characters TCHAR buffer[BUFFER_MAX]; - Table_GetItemText( this->handle(), itsEditRow, itsEditColumn, buffer, BUFFER_MAX ); + ListView_GetItemText( this->handle(), itsEditRow, itsEditColumn, buffer, BUFFER_MAX ); text->setText( buffer ); // Select all end give focus @@ -963,14 +963,14 @@ LVHITTESTINFO info; info.pt.x = itsXMousePosition; info.pt.y = itsYMousePosition; - Table_SubItemHitTest( this->handle(), & info ); + ListView_SubItemHitTest( this->handle(), & info ); // User has clicked the Table if ( info.iItem != - 1 ) { // User has clicked an ITEM in Table if ( info.iSubItem >= 0 ) { - UINT state = Table_GetItemState( this->handle(), info.iItem, LVIS_FOCUSED ); + UINT state = ListView_GetItemState( this->handle(), info.iItem, LVIS_FOCUSED ); if ( ! ( state & LVIS_FOCUSED ) ) { //SetFocus( itsHandle ); // TODO: This was catched by devcpp ... what was intended? @@ -982,7 +982,7 @@ { itsEditRow = info.iItem; itsEditColumn = info.iSubItem; - Table_EditLabel( this->handle(), info.iItem ); + ListView_EditLabel( this->handle(), info.iItem ); return 0; // Processed } } Deleted: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetLoadFile.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetLoadFile.h 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetLoadFile.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -1,175 +0,0 @@ -/* - Copyright (c) 2005, Thomas Hansen - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the SmartWin++ nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef WidgetLoadFile_h -#define WidgetLoadFile_h - -#include "../Widget.h" -#include "../../SmartUtil.h" -#include "../aspects/AspectFileFilter.h" -#include <vector> - -namespace SmartWin -{ -// begin namespace SmartWin - -/// LoadFileDialog class -/** \ingroup WidgetControls - * \image html loadfile.PNG - * Class for showing a LoadFileDialog box. <br> - * Either derive from it or call WidgetFactory::createLoadFile. <br> - * Related classes - * <ul> - * <li>WidgetSaveFile</li> - * <li>AspectFileFilter</li> - * <li>WidgetFileCommon</li> - * </ul> - * Note! <br> - * If you wish to use this class with Parent classes other than those from SmartWin - * you need to expose a public function called "parent" taking no arguments returning - * and HWND in the Parent template parameter. <br> - * the complete signature of the function will then be "HWND parent()" - */ -class WidgetLoadFile - : public AspectFileFilter -{ -public: - /// Class type - typedef WidgetLoadFile ThisType; - - /// Object type - /** Note, not a pointer!!!! - */ - typedef ThisType ObjectType; - - /// Shows the dialog - /** Returns string() or "empty string" if user press cancel. <br> - * Returns a "file path" if user presses ok. <br> - * Use the inherited functions AspectFileFilter::addFilter and - * AspectFileFilter::activeFilter <br> - * before calling this function, if you wish the dialog to show only certain - * types of files. - */ - SmartUtil::tstring showDialog(); - - /// Shows the dialog - /** Returns an empty vector if user press cancel. <br> - * Returns a vector of "file paths" if user presses ok. <br> - * Use the inherited functions AspectFileFilter::addFilter and - * AspectFileFilter::activeFilter <br> - * before calling this function, if you wish the dialog to show only certain - * types of files. - */ - std::vector<SmartUtil::tstring> showDialogMultiSelect(); - - // Constructor Taking pointer to parent - explicit WidgetLoadFile( Widget * parent = 0 ); - - virtual ~WidgetLoadFile() { } -private: - Widget * itsParent; - HWND getParentHandle() { return itsParent ? itsParent->handle() : NULL; } -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Implementation of class -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -inline SmartUtil::tstring WidgetLoadFile::showDialog() -{ - TCHAR szFile[PATH_BUFFER_SIZE]; // buffer for file name - szFile[0] = '\0'; - - OPENFILENAME ofn; // common dialog box structure - // Note! - // If this one fizzles you have NOT supplied a parent with a "handle()" - // function... You MUST supply a parent with a function "handle()" which - // returns a HWND! All the Widgetxxx classes (except LoadFile, SaveFile and - // MessageBox) have the "handle()" function... - fillOutCommonStructure( ofn, getParentHandle(), OFN_FILEMUSTEXIST ); - ofn.lpstrFile = szFile; - ofn.Flags |= OFN_FILEMUSTEXIST; - - SmartUtil::tstring retVal; - if ( ::GetOpenFileName( & ofn ) ) - { - retVal = ofn.lpstrFile; - backslashToForwardSlashForUnix( retVal ); - } - return retVal; -} - -inline std::vector<SmartUtil::tstring> WidgetLoadFile::showDialogMultiSelect() -{ - TCHAR szFile[PATH_BUFFER_SIZE]; // buffer for file name - szFile[0] = '\0'; - - OPENFILENAME ofn; // common dialog box structure - // Note! - // If this one fizzles you have NOT supplied a parent with a "handle()" function... - // You MUST supply a parent with a function "handle()" which returns a HWND! - // All the Widgetxxx classes (except LoadFile, SaveFile and MessageBox) have the "handle()" function... - fillOutCommonStructure( ofn, getParentHandle(), OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_EXPLORER ); - ofn.lpstrFile = szFile; - std::vector<SmartUtil::tstring> retVal; - if( ::GetOpenFileName(&ofn) ) - { - // If a single file is selected, the lpstrFile string is just the path terminated by TWO null bytes - // If multiple files are selected, the format of the string returned is: - // DIRECTORY_PATH + '\0' + FILE_NAME_1 + '\0' + FILE_NAME_2 + '\0' + ... + FILE_NAME_N + '\0' + '\0' - // (Note the last file name is terminated by two null bytes) - - SmartUtil::tstring fileName; - SmartUtil::tstring filePath; - SmartUtil::tstring directory; - directory = ofn.lpstrFile; // tstring ends at first null - TCHAR *array_p = ofn.lpstrFile + directory.length() + 1; // set pointer to one position past null - fileName = array_p; // fileName is substring from array_p to next null - if (fileName.length() == 0) // only one file was selected - retVal.push_back(directory); // string 'directory' contains full path - else - { - while (fileName.length() > 0) - { - filePath = directory + _T("\\") + fileName; - backslashToForwardSlashForUnix(filePath); - retVal.push_back(filePath); - array_p = array_p + fileName.length() + 1; // set pointer one position past null - fileName = array_p; // fileName is substring from array_p to next null - } - } - } - return retVal; -} - -inline WidgetLoadFile::WidgetLoadFile( Widget * parent ) - : itsParent( parent ) -{} - -// end namespace SmartWin -} - -#endif Deleted: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSaveFile.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSaveFile.h 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSaveFile.h 2008-03-29 08:10:17 UTC (rev 1084) @@ -1,119 +0,0 @@ -/* - Copyright (c) 2005, Thomas Hansen - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the SmartWin++ nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef WidgetSaveFile_h -#define WidgetSaveFile_h - -#include "../Widget.h" -#include "../../SmartUtil.h" -#include "../aspects/AspectFileFilter.h" - -namespace SmartWin -{ -// begin namespace SmartWin - -/// SaveFileDialog class -/** \ingroup WidgetControls - * \image html savefile.PNG - * Class for showing a Save File Dialog. <br> - * Either derive from it or call WidgetFactory::createSaveFile. <br> - * Related classes - * <ul> - * <li>WidgetLoadFile</li> - * <li>AspectFileFilter</li> - * <li>WidgetFileCommon</li> - * </ul> - * Note!<br> - * If you wish to use this class with Parent classes other than those from - * SmartWin++ you need to expose a public function called "parent" taking no - * arguments returning an HWND. <br> - * the complete signature of the function will then be "HWND parent();" - */ -class WidgetSaveFile - : public AspectFileFilter -{ -public: - /// Class type - typedef WidgetSaveFile ThisType; - - /// Object type - /** Note, not a pointer!!!! - */ - typedef ThisType ObjectType; - - /// Shows the dialog - /** Returns string() or "empty string" if user press cancel. <br> - * Returns a "file path" if user presses ok. - */ - SmartUtil::tstring showDialog(); - - /// Constructor Taking pointer to parent - explicit WidgetSaveFile( Widget * parent = 0 ); - - virtual ~WidgetSaveFile() - {} - -private: - Widget * itsParent; - HWND getParentHandle() { return itsParent ? itsParent->handle() : NULL; } -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Implementation of class -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -inline SmartUtil::tstring WidgetSaveFile::showDialog() -{ - TCHAR szFile[MAX_PATH + 1]; // buffer for file name - szFile[0] = '\0'; - - OPENFILENAME ofn; // common dialog box structure - // Note! - // If this one fizzles you have NOT supplied a parent with a "handle()" - // function... You MUST supply a parent with a function "handle()" which - // returns a HWND! All the Widgetxxx classes (except LoadFile, SaveFile and - // MessageBox) have the "handle()" function... - fillOutCommonStructure( ofn, getParentHandle(), 0 ); // OFN_PATHMUSTEXIST ? - ofn.lpstrFile = szFile; - - SmartUtil::tstring retVal; - if ( ::GetSaveFileName( & ofn ) ) - { - retVal = ofn.lpstrFile; - backslashToForwardSlashForUnix( retVal ); - } - return retVal; -} - -inline WidgetSaveFile::WidgetSaveFile( Widget * parent ) - : itsParent( parent ) -{ -} - -// end namespace SmartWin -} - -#endif Modified: dcplusplus/trunk/smartwin/source/Application.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/Application.cpp 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/source/Application.cpp 2008-03-29 08:10:17 UTC (rev 1084) @@ -105,9 +105,8 @@ #endif // Initializing Common Controls... - INITCOMMONCONTROLSEX init; - init.dwSize = sizeof( INITCOMMONCONTROLSEX ); - init.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_Table_CLASSES | ICC_DATE_CLASSES | ICC_PROGRESS_CLASS; + INITCOMMONCONTROLSEX init = { sizeof( INITCOMMONCONTROLSEX ) }; + init.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES | ICC_DATE_CLASSES | ICC_PROGRESS_CLASS | ICC_TREEVIEW_CLASSES; ::InitCommonControlsEx( & init ); #ifdef _MSC_VER Modified: dcplusplus/trunk/smartwin/source/widgets/Table.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/Table.cpp 2008-03-29 08:09:17 UTC (rev 1083) +++ dcplusplus/trunk/smartwin/source/widgets/Table.cpp 2008-03-29 08:10:17 UTC (rev 1084) @@ -11,7 +11,7 @@ bool Table::ComCtl6 = false; Table::Seed::Seed() : - Widget::Seed(WC_Table, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LVS_REPORT | LVS_EDITLABELS), + Widget::Seed(WC_LISTVIEW, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LVS_REPORT | LVS_EDITLABELS), font(new Font(DefaultGuiFont)), lvStyle(0) { @@ -66,7 +66,7 @@ void Table::updateArrow() { if(ComCtl6) { int flag = isAscending() ? HDF_SORTUP : HDF_SORTDOWN; - HWND header = Table_GetHeader(this->handle()); + HWND header = ListView_GetHeader(this->handle()); int count = Header_GetItemCount(header); for (int i=0; i < count; ++i) { @@ -86,7 +86,7 @@ HBITMAP bitmap = (isAscending() ? upArrow : downArrow)->handle(); - HWND header = Table_GetHeader(this->handle()); + HWND header = ListView_GetHeader(this->handle()); int count = Header_GetItemCount(header); for (int i=0; i < count; ++i) { @@ -106,16 +106,16 @@ } void Table::setSelectedImpl(int item) { - Table_SetItemState(handle(), item, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); + ListView_SetItemState(handle(), item, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); } void Table::clearSelection() { int i = -1; while((i = getNext(i, LVNI_SELECTED)) != -1) { - Table_SetItemState(handle(), i, 0, LVIS_SELECTED | LVIS_FOCUSED); + ListView_SetItemState(handle(), i, 0, LVIS_SELECTED | LVIS_FOCUSED); } while((i = getNext(i, LVNI_FOCUSED)) != -1) { - Table_SetItemState(handle(), i, 0, LVIS_FOCUSED); + ListView_SetItemState(handle(), i, 0, LVIS_FOCUSED); } } @@ -123,7 +123,7 @@ { // Deleting all data clear(); - while ( Table_DeleteColumn( this->handle(), 0 ) == TRUE ); + while ( ListView_DeleteColumn( this->handle(), 0 ) == TRUE ); LVCOLUMN lvColumn = { LVCF_WIDTH | LVCF_TEXT }; @@ -134,7 +134,7 @@ ++idx, ++x ) { lvColumn.pszText = const_cast < TCHAR * >( idx->c_str() ); - if ( Table_InsertColumn( this->handle(), x, & lvColumn ) == - 1 ) + if ( ListView_InsertColumn( this->handle(), x, & lvColumn ) == - 1 ) { xCeption x( _T( "Error while trying to create Columns in list view" ) ); throw x; @@ -145,7 +145,7 @@ int Table::insert(const std::vector< SmartUtil::tstring > & row, LPARAM lPar, int index, int iconIndex) { if (index == - 1) { // Appending at bottom - index = Table_GetItemCount( this->handle() ); + index = ListView_GetItemCount( this->handle() ); } LVITEM lvi = { LVIF_TEXT | LVIF_PARAM }; if (itsNormalImageList || itsSmallImageList ) { @@ -156,7 +156,7 @@ lvi.pszText = const_cast < TCHAR * >(row[0].c_str() ); lvi.lParam = lPar; lvi.iItem = index; - if ( Table_InsertItem( this->handle(), & lvi ) == - 1) { + if ( ListView_InsertItem( this->handle(), & lvi ) == - 1) { xCeption x( _T( "Error while trying to insert row in Table" )); throw x; } @@ -165,7 +165,7 @@ for (std::vector< SmartUtil::tstring >::const_iterator idx = row.begin() + 1; idx != row.end(); ++idx ) { lvi.pszText = const_cast < TCHAR * >(idx->c_str() ); lvi.cchTextMax = static_cast< int >(idx->size() ); - if ( !Table_SetItem( this->handle(), & lvi )) { + if ( !ListView_SetItem( this->handle(), & lvi )) { xCeption x( _T( "Error while trying to insert row in Table" )); throw x; } @@ -182,7 +182,7 @@ item.pszText = const_cast<LPTSTR>(text); item.iImage = image; item.lParam = lparam; - return Table_InsertItem(this->handle(), &item); + return ListView_InsertItem(this->handle(), &item); } ScreenCoordinate Table::getContextMenuPos() { @@ -202,7 +202,7 @@ const int BUFFER_MAX = 2048; TCHAR buffer[BUFFER_MAX + 1]; buffer[0] = '\0'; - Table_GetItemText( this->handle(), row, column, buffer, BUFFER_MAX ); + ListView_GetItemText( this->handle(), row, column, buffer, BUFFER_MAX ); return buffer; } @@ -212,7 +212,7 @@ int tmpIdx = - 1; while ( true ) { - tmpIdx = Table_GetNextItem( this->handle(), tmpIdx, LVNI_SELECTED ); + tmpIdx = ListView_GetNextItem( this->handle(), tmpIdx, LVNI_SELECTED ); if ( tmpIdx == - 1 ) break; retVal.push_back( static_cast< unsigned >( tmpIdx ) ); @@ -221,12 +221,12 @@ } unsigned Table::getColumnCount() { - HWND header = Table_GetHeader(handle()); + HWND header = ListView_GetHeader(handle()); return Header_GetItemCount(header); } void Table::addRemoveTableExtendedStyle( DWORD addStyle, bool add ) { - DWORD newStyle = Table_GetExtendedTableStyle( this->handle() ); + DWORD newStyle = ListView_GetExtendedListViewStyle( this->handle() ); if ( add && ( newStyle & addStyle ) != addStyle ) { newStyle |= addStyle; @@ -235,7 +235,7 @@ { newStyle ^= addStyle; } - Table_SetExtendedTableStyle( this->handle(), newStyle ); + ListView_SetExtendedListViewStyle( this->handle(), newStyle ); } std::vector<int> Table::getColumnOrder() { @@ -264,7 +264,7 @@ LVITEM item = { LVIF_PARAM }; item.iItem = idx; - if(!Table_GetItem(handle(), &item)) { + if(!ListView_GetItem(handle(), &item)) { return 0; } return item.lParam; @@ -275,7 +275,7 @@ item.iItem = idx; item.lParam = data; - Table_SetItem(handle(), &item); + ListView_SetItem(handle(), &item); } void Table::setIcon( unsigned row, int newIconIndex ) { @@ -283,7 +283,7 @@ it.iItem = row; it.iImage = newIconIndex; //Set item - if(Table_SetItem( this->handle(), &it) != TRUE) { + if(ListView_SetItem( this->handle(), &it) != TRUE) { xCeption err( _T( "Something went wrong while trying to change the selected item of the Table" ) ); throw err; } @@ -291,17 +291,17 @@ void Table::setNormalImageList( ImageListPtr imageList ) { itsNormalImageList = imageList; - Table_SetImageList( this->handle(), imageList->getImageList(), LVSIL_NORMAL ); + ListView_SetImageList( this->handle(), imageList->getImageList(), LVSIL_NORMAL ); } void Table::setSmallImageList( ImageListPtr imageList ) { itsSmallImageList = imageList; - Table_SetImageList( this->handle(), imageList->getImageList(), LVSIL_SMALL ); + ListView_SetImageList( this->handle(), imageList->getImageList(), LVSIL_SMALL ); } void Table::setStateImageList( ImageListPtr imageList ) { itsStateImageList = imageList; - Table_SetImageList( this->handle(), imageList->getImageList(), LVSIL_STATE ); + ListView_SetImageList( this->handle(), imageList->getImageList(), LVSIL_STATE ); } void Table::setView( int view ) { @@ -322,7 +322,7 @@ if(lastRow == -1) { lastRow = size(); } - if( Table_RedrawItems( this->handle(), firstRow, lastRow ) == FALSE ) + if( ListView_RedrawItems( this->handle(), firstRow, lastRow ) == FALSE ) { throw xCeption( _T( "Error while redrawing items in Table" ) ); } @@ -357,8 +357,8 @@ if(type == SORT_CALLBACK) { result = p->fun(p->getData(na), p->getData(nb)); } else { - Table_GetItemText(p->handle(), na, p->sortColumn, buf, BUF_SIZE); - Table_GetItemText(p->handle(), nb, p->sortColumn, buf2, BUF_SIZE); + ListView_GetItemText(p->handle(), na, p->sortColumn, buf, BUF_SIZE); + ListView_GetItemText(p->handle(), nb, p->sortColumn, buf2, BUF_SIZE); if(type == SORT_STRING) { result = lstrcmp(buf, buf2); @@ -398,7 +398,7 @@ break; } else - xOffset += Table_GetColumnWidth( hWnd, myArrayOfCols[idx] ); + xOffset += ListView_GetColumnWidth( hWnd, myArrayOfCols[idx] ); } return xOffset; Copied: dcplusplus/trunk/win32/ComboBox.cpp (from rev 1083, dcplusplus/trunk/win32/WidgetComboBox.cpp) =================================================================== --- dcplusplus/trunk/win32/ComboBox.cpp (rev 0) +++ dcplusplus/trunk/win32/ComboBox.cpp 2008-03-29 08:10:17 UTC (rev 1084) @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2001-2008 ... [truncated message content] |