From: <arn...@us...> - 2008-04-14 20:24:43
|
Revision: 1154 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1154&view=rev Author: arnetheduck Date: 2008-04-14 13:24:38 -0700 (Mon, 14 Apr 2008) Log Message: ----------- Only offer a single type of status bar Modified Paths: -------------- dcplusplus/trunk/dwt/include/dwt/GCCHeaders.h dcplusplus/trunk/dwt/include/dwt/VCDesktopHeaders.h dcplusplus/trunk/dwt/include/dwt/WidgetFactory.h dcplusplus/trunk/dwt/include/dwt/WindowsHeaders.h dcplusplus/trunk/dwt/include/dwt/dwt.hpp dcplusplus/trunk/dwt/include/dwt/forward.h dcplusplus/trunk/dwt/include/dwt/widgets/Composite.h dcplusplus/trunk/dwt/include/dwt/widgets/StatusBar.h dcplusplus/trunk/dwt/include/dwt/widgets/TextBox.h dcplusplus/trunk/win32/AspectStatus.h Added Paths: ----------- dcplusplus/trunk/dwt/src/widgets/StatusBar.cpp Property Changed: ---------------- dcplusplus/trunk/ Property changes on: dcplusplus/trunk ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-04-10 23:41:18.571000099 +0200 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus + timestamp: 2008-04-11 09:47:30.551000118 +0200 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus Name: bzr:file-ids - + dwt/src/widgets/StatusBar.cpp statusbar.cpp-20080411074555-dsjf6pam1593f02o-1 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 1059 arn...@gm...-20080329055630-braiir1dskv7a4qm 1060 arn...@gm...-20080329061558-rck8dz60wpj3c5ja 1061 arn...@gm...-20080329081253-if6o5jn329mbzfpl 1062 arn...@gm...-20080329081619-cb4x930j8sp55cs0 1063 arn...@gm...-20080329103216-hgjzo7ra2zixbztd 1064 arn...@gm...-20080329124042-q3aw4iodmo5kafyp 1065 arn...@gm...-20080329124926-2je1z18p0272zpua 1066 arn...@gm...-20080329150901-ehj9t32en7eps2dp 1067 zouzou123gen-20080329153653-36xlvpik2ns9r84r 1068 zouzou123gen-20080329162703-51xr8hg073pg7wq5 1069 zouzou123gen-20080329234706-8ddipdqu0xeudkql 1070 arn...@gm...-20080330081232-ubqr1171ewalrd4q 1071 zouzou123gen-20080330131607-yppbs3mgyjef1cux 1072 zouzou123gen-20080330134835-yv1nogy77ib1uehd 1073 zouzou123gen-20080331124549-alyw7vugdn30piqy 1074 zouzou123gen-20080331135108-q8frtqsin5bosfzm 1075 zouzou123gen-20080331140757-u94q52yccl5lsifk 1076 zouzou123gen-20080331152513-ue1x5qhigcw51348 1077 arn...@gm...-20080331184436-a8g6chibmg8nswls 1078 arn...@gm...-20080331220648-81485k28qmwruwz6 1079 zouzou123gen-20080401081001-2yjn07cf8s5sxr3a 1080 zouzou123gen-20080401081247-f3p4hdjojnd460jw 1081 zouzou123gen-20080401084117-24a454g8o0x656kg 1082 zouzou123gen-20080401133146-jabb5i8870fg6f66 1083 zouzou123gen-20080401154610-mxdqoo5bksru93e6 1084 arn...@gm...-20080401185530-lqj4tflt5ldmx46f 1085 arn...@gm...-20080401212616-ffl7m0xm8gt15knk 1086 arn...@gm...-20080402084515-ofmnwihzv159jton 1087 arn...@gm...-20080402133105-y70soi38owzl76i9 1088 arn...@gm...-20080402142417-rn2dbkx19wfz3vae 1089 arn...@gm...-20080402144459-u3z3hqvl8aqjc4a0 1090 zouzou123gen-20080402145051-zi8tmvy8u3r2mzu8 1091 arn...@gm...-20080402152137-f397uz1yp9qjvfwh 1092 zouzou123gen-20080402170355-29wda40wk3cy7lu5 1093 arn...@gm...-20080402180628-ipos9li0c4bsmq1h 1094 arn...@gm...-20080402181235-s2a6f4ww4lzayl46 1095 arn...@gm...-20080402193851-6mu64vgep6tijith 1096 arn...@gm...-20080402203810-86zpxsx69q83zf3r 1097 arn...@gm...-20080402204331-so2e8n892o23pejr 1098 poy-20080402224153-225qylr2cfwhqrg7 1099 mrmikejj-20080403125112-o8polh8rkn62umyh 1100 arn...@gm...-20080403125139-8xub76j1xazhfxna 1101 po...@12...-20080403140544-13kockkjho883nb4 1102 po...@12...-20080403143012-bxghtoodiolugpbs 1103 arn...@gm...-20080403190809-bbi4bz5rfcvjnt20 1104 arn...@gm...-20080403205410-czxru1vcg1s4wcws 1105 arn...@gm...-20080403213124-54spdrwszgyimd90 1106 po...@12...-20080404002406-aj74x5tngi6mmmj1 1107 arn...@gm...-20080404122415-mjy07qzbaxyhagra 1108 po...@12...-20080404145445-84lyk5tyy3b3br14 1109 po...@12...-20080404231417-v4v8x7u3f0hm0ejc 1110 po...@12...-20080405001107-14d1ojjof8xhvcj8 1111 arn...@gm...-20080405071929-jmnrul21sxx04kky 1112 arn...@gm...-20080405080105-9qbda7be0pi7y1ai 1113 po...@12...-20080405154555-yuj2n5kyndfjlpsf 1114 po...@12...-20080405220250-8y09d0samsj8ja94 1115 po...@12...-20080406134101-4860ytb61sbu3yhg 1116 po...@12...-20080406155849-2wzxzuzs5m8zpk0g 1117 po...@12...-20080406164835-bv5dydhm3qqydsty 1118 arn...@gm...-20080406210237-c7tyfgiz2sjgv044 1119 po...@12...-20080407114423-4yajg1rffidq76bj 1120 arn...@gm...-20080407194826-c42t4bjzw4vflejn 1121 po...@12...-20080407214303-o7ul1bvcn6gvaoc9 1122 po...@12...-20080407220647-r7f3em92til5j67s 1123 po...@12...-20080408212439-54t3bqlhvw1nu4xc 1124 arn...@gm...-20080409193708-y6erfzwrcb1seet3 1125 arn...@gm...-20080409195827-ub6t2s3wdf28nfpz 1126 po...@12...-20080409215055-1zmqhhm2859878c1 1127 arn...@gm...-20080410102447-l4es4cbukkqwcnpc 1128 arn...@gm...-20080410214118-b70g50tl27cq9q29 + 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 1060 arn...@gm...-20080329061558-rck8dz60wpj3c5ja 1061 arn...@gm...-20080329081253-if6o5jn329mbzfpl 1062 arn...@gm...-20080329081619-cb4x930j8sp55cs0 1063 arn...@gm...-20080329103216-hgjzo7ra2zixbztd 1064 arn...@gm...-20080329124042-q3aw4iodmo5kafyp 1065 arn...@gm...-20080329124926-2je1z18p0272zpua 1066 arn...@gm...-20080329150901-ehj9t32en7eps2dp 1067 zouzou123gen-20080329153653-36xlvpik2ns9r84r 1068 zouzou123gen-20080329162703-51xr8hg073pg7wq5 1069 zouzou123gen-20080329234706-8ddipdqu0xeudkql 1070 arn...@gm...-20080330081232-ubqr1171ewalrd4q 1071 zouzou123gen-20080330131607-yppbs3mgyjef1cux 1072 zouzou123gen-20080330134835-yv1nogy77ib1uehd 1073 zouzou123gen-20080331124549-alyw7vugdn30piqy 1074 zouzou123gen-20080331135108-q8frtqsin5bosfzm 1075 zouzou123gen-20080331140757-u94q52yccl5lsifk 1076 zouzou123gen-20080331152513-ue1x5qhigcw51348 1077 arn...@gm...-20080331184436-a8g6chibmg8nswls 1078 arn...@gm...-20080331220648-81485k28qmwruwz6 1079 zouzou123gen-20080401081001-2yjn07cf8s5sxr3a 1080 zouzou123gen-20080401081247-f3p4hdjojnd460jw 1081 zouzou123gen-20080401084117-24a454g8o0x656kg 1082 zouzou123gen-20080401133146-jabb5i8870fg6f66 1083 zouzou123gen-20080401154610-mxdqoo5bksru93e6 1084 arn...@gm...-20080401185530-lqj4tflt5ldmx46f 1085 arn...@gm...-20080401212616-ffl7m0xm8gt15knk 1086 arn...@gm...-20080402084515-ofmnwihzv159jton 1087 arn...@gm...-20080402133105-y70soi38owzl76i9 1088 arn...@gm...-20080402142417-rn2dbkx19wfz3vae 1089 arn...@gm...-20080402144459-u3z3hqvl8aqjc4a0 1090 zouzou123gen-20080402145051-zi8tmvy8u3r2mzu8 1091 arn...@gm...-20080402152137-f397uz1yp9qjvfwh 1092 zouzou123gen-20080402170355-29wda40wk3cy7lu5 1093 arn...@gm...-20080402180628-ipos9li0c4bsmq1h 1094 arn...@gm...-20080402181235-s2a6f4ww4lzayl46 1095 arn...@gm...-20080402193851-6mu64vgep6tijith 1096 arn...@gm...-20080402203810-86zpxsx69q83zf3r 1097 arn...@gm...-20080402204331-so2e8n892o23pejr 1098 poy-20080402224153-225qylr2cfwhqrg7 1099 mrmikejj-20080403125112-o8polh8rkn62umyh 1100 arn...@gm...-20080403125139-8xub76j1xazhfxna 1101 po...@12...-20080403140544-13kockkjho883nb4 1102 po...@12...-20080403143012-bxghtoodiolugpbs 1103 arn...@gm...-20080403190809-bbi4bz5rfcvjnt20 1104 arn...@gm...-20080403205410-czxru1vcg1s4wcws 1105 arn...@gm...-20080403213124-54spdrwszgyimd90 1106 po...@12...-20080404002406-aj74x5tngi6mmmj1 1107 arn...@gm...-20080404122415-mjy07qzbaxyhagra 1108 po...@12...-20080404145445-84lyk5tyy3b3br14 1109 po...@12...-20080404231417-v4v8x7u3f0hm0ejc 1110 po...@12...-20080405001107-14d1ojjof8xhvcj8 1111 arn...@gm...-20080405071929-jmnrul21sxx04kky 1112 arn...@gm...-20080405080105-9qbda7be0pi7y1ai 1113 po...@12...-20080405154555-yuj2n5kyndfjlpsf 1114 po...@12...-20080405220250-8y09d0samsj8ja94 1115 po...@12...-20080406134101-4860ytb61sbu3yhg 1116 po...@12...-20080406155849-2wzxzuzs5m8zpk0g 1117 po...@12...-20080406164835-bv5dydhm3qqydsty 1118 arn...@gm...-20080406210237-c7tyfgiz2sjgv044 1119 po...@12...-20080407114423-4yajg1rffidq76bj 1120 arn...@gm...-20080407194826-c42t4bjzw4vflejn 1121 po...@12...-20080407214303-o7ul1bvcn6gvaoc9 1122 po...@12...-20080407220647-r7f3em92til5j67s 1123 po...@12...-20080408212439-54t3bqlhvw1nu4xc 1124 arn...@gm...-20080409193708-y6erfzwrcb1seet3 1125 arn...@gm...-20080409195827-ub6t2s3wdf28nfpz 1126 po...@12...-20080409215055-1zmqhhm2859878c1 1127 arn...@gm...-20080410102447-l4es4cbukkqwcnpc 1128 arn...@gm...-20080410214118-b70g50tl27cq9q29 1129 arn...@gm...-20080411074730-w1pu78qigtx87lx3 Modified: dcplusplus/trunk/dwt/include/dwt/GCCHeaders.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/GCCHeaders.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/GCCHeaders.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -38,20 +38,6 @@ #ifdef __GNUC__ - // Need to tell gcc which version of Windows we're targeting! -#ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x0501 -#endif -#ifndef _WIN32_IE - #define _WIN32_IE 0x0501 -#endif -#ifndef WINVER - #define WINVER 0x501 -#endif - // Removing windows.h max and min macro - #undef NOMINMAX - #define NOMINMAX - static const dwt::Platform CurrentPlatform = dwt::dwtDesktop; #define SMARTWIN_WNDCLASSEX WNDCLASSEX Modified: dcplusplus/trunk/dwt/include/dwt/VCDesktopHeaders.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/VCDesktopHeaders.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/VCDesktopHeaders.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -39,16 +39,19 @@ #ifndef __GNUC__ #ifndef WINCE - // Need to tell msvc which version of Windows we're targeting! -#ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x0501 + +#ifdef _MSC_VER +// We don't want the stupid "pointer trunctation" to 64 bit architecture warning. +// The warnings aren't justified anyway since they are basically a bug in 7.1 +// release... E.g. the SetWindowLongPtr is defined as SetWindowLong in 32 bits mode +// but will in 64 bits mode be defined as the 64 bits equivalent version, therefore +// it will give you a 64 bit compile warning when this file is compiled with +// warning level 4 (MSVC) +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4312 ) +#pragma warning( disable : 4311 ) + #endif -#ifndef _WIN32_IE - #define _WIN32_IE 0x0501 -#endif -#ifndef WINVER - #define WINVER 0x501 -#endif static const dwt::Platform CurrentPlatform = dwt::dwtDesktop; Modified: dcplusplus/trunk/dwt/include/dwt/WidgetFactory.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/WidgetFactory.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/WidgetFactory.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -41,9 +41,7 @@ #include "widgets/MessageBox.h" #include "widgets/LoadDialog.h" #include "widgets/SaveDialog.h" -#include "widgets/StatusBar.h" #include "WidgetFactoryPlatformImplementation.h" -#include "WidgetCreator.h" namespace dwt { @@ -85,18 +83,6 @@ /// MessageBox class and object type. typedef dwt::MessageBox MessageBox; - /// StatusBar class type. - typedef dwt::StatusBar< > StatusBar; - - /// StatusBar object type. - typedef typename StatusBar::ObjectType StatusBarPtr; - - /// StatusBarSections class type. - typedef dwt::StatusBar< Section > StatusBarSections; - - /// StatusBarSections object type. - typedef typename StatusBarSections::ObjectType StatusBarSectionsPtr; - /// LoadFileDialog class type. typedef dwt::LoadDialog LoadDialog; @@ -138,17 +124,6 @@ */ MessageBox createMessageBox(); - // TODO: Is there any point in attaching a status bar ? ! ? - /// Creates a Status Bar and returns a pointer to it. - /** DON'T delete the returned pointer!!! - */ - StatusBarPtr createStatusBar( const typename StatusBar::Seed & cs = StatusBar::Seed() ); - - /// Creates a Status Bar and returns a pointer to it. - /** DON'T delete the returned pointer!!! - */ - StatusBarSectionsPtr createStatusBarSections( const typename StatusBarSections::Seed & cs = StatusBarSections::Seed() ); - protected: // Protected to try to avoid stack creation... virtual ~WidgetFactory() @@ -199,20 +174,6 @@ return MessageBox( this ); } -template<typename ContainerWidgetType> -typename WidgetFactory< ContainerWidgetType >::StatusBarPtr -WidgetFactory< ContainerWidgetType >::createStatusBar( const typename StatusBar::Seed & cs ) -{ - return WidgetCreator< StatusBar >::create( this, cs ); } -template<typename ContainerWidgetType> -typename WidgetFactory< ContainerWidgetType >::StatusBarSectionsPtr -WidgetFactory< ContainerWidgetType >::createStatusBarSections( const typename StatusBarSections::Seed & cs ) -{ - return WidgetCreator< StatusBarSections >::create( this, cs ); -} - -} - #endif Modified: dcplusplus/trunk/dwt/include/dwt/WindowsHeaders.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/WindowsHeaders.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/WindowsHeaders.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -50,6 +50,20 @@ } +#ifndef _WIN32_WINNT + #define _WIN32_WINNT 0x0501 +#endif +#ifndef _WIN32_IE + #define _WIN32_IE 0x0501 +#endif +#ifndef WINVER + #define WINVER 0x501 +#endif + +// Removing windows.h max and min macro +#undef NOMINMAX +#define NOMINMAX + // Including special GCC Stuff #ifdef __GNUC__ #include "GCCHeaders.h" Modified: dcplusplus/trunk/dwt/include/dwt/dwt.hpp =================================================================== --- dcplusplus/trunk/dwt/include/dwt/dwt.hpp 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/dwt.hpp 2008-04-14 20:24:38 UTC (rev 1154) @@ -36,19 +36,6 @@ #ifndef DWT_SmartWin_h #define DWT_SmartWin_h -#ifdef _MSC_VER -// We don't want the stupid "pointer trunctation" to 64 bit architecture warning. -// The warnings aren't justified anyway since they are basically a bug in 7.1 -// release... E.g. the SetWindowLongPtr is defined as SetWindowLong in 32 bits mode -// but will in 64 bits mode be defined as the 64 bits equivalent version, therefore -// it will give you a 64 bit compile warning when this file is compiled with -// warning level 4 (MSVC) -#pragma warning( disable : 4244 ) -#pragma warning( disable : 4312 ) -#pragma warning( disable : 4311 ) - -#endif - #include "WindowsHeaders.h" #include "Anchors.h" @@ -89,6 +76,7 @@ #include "widgets/RichTextBox.h" #include "widgets/Slider.h" #include "widgets/Spinner.h" +#include "widgets/StatusBar.h" #include "widgets/Table.h" #include "widgets/TabSheet.h" #include "widgets/TabView.h" Modified: dcplusplus/trunk/dwt/include/dwt/forward.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/forward.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/forward.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -79,11 +79,14 @@ class RichTextBox; typedef RichTextBox* RichTextBoxPtr; +class Slider; +typedef Slider* SliderPtr; + class Spinner; typedef Spinner* SpinnerPtr; -class Slider; -typedef Slider* SliderPtr; +class StatusBar; +typedef StatusBar* StatusBarPtr; class Table; typedef Table* TablePtr; Modified: dcplusplus/trunk/dwt/include/dwt/widgets/Composite.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/widgets/Composite.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/widgets/Composite.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -93,8 +93,12 @@ typedef dwt::ProgressBarPtr ProgressBarPtr; typedef dwt::RadioButton RadioButton; typedef dwt::RadioButtonPtr RadioButtonPtr; + typedef dwt::Slider Slider; + typedef dwt::SliderPtr SliderPtr; typedef dwt::Spinner Spinner; typedef dwt::SpinnerPtr SpinnerPtr; + typedef dwt::StatusBar StatusBar; + typedef dwt::StatusBarPtr StatusBarPtr; typedef dwt::Table Table; typedef dwt::TablePtr TablePtr; typedef dwt::TabSheet TabSheet; Modified: dcplusplus/trunk/dwt/include/dwt/widgets/StatusBar.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/widgets/StatusBar.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/widgets/StatusBar.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -40,48 +40,12 @@ #include "../aspects/AspectDblClickable.h" #include "../aspects/AspectFont.h" #include "../aspects/AspectPainting.h" -#include "../aspects/AspectText.h" #include "Control.h" +#include <vector> + namespace dwt { -/// Policy class for StatusBar with sections instead of one large area where -/// you can add information -/** A Status Bar with sections is a normal statusbar except instead of one large area - * where you can add text there are several smaller sections which divides the - * status bar into smaller areas where you can separate information. - */ -class Section -{ -public: - /// Initializes the sections of the StatusBar - /** Use this one to set the number of sections and the width of them - */ - void setSections( const std::vector< unsigned > & width ); - - /// Sets the text of the given section number - /** Use this one to set the text of a specific section of the StatusBar - */ - void setText( const SmartUtil::tstring & newText, unsigned partNo ); -}; - -// Forward declaration -template< class TypeOfStatusBar > -class StatusBar; - -// Note, this Aspect class indirectly brings in AspectText while the Section one DOES NOT! -/// Policy class for a StatusBar with no sections. -/** Policy class for a StatusBar with no sections or rather with _one big_ - * section which will hold all the text of the Status Bar Control within the same - * area! <br> - * Use the setText member ( which is included by inheritance to AspectText ) to set - * the text of the Status Bar Control! - */ -class NoSection : - public AspectText< StatusBar<NoSection> > -{ -}; - /// StatusBar class /** \ingroup WidgetControls * \WidgetUsageInfo @@ -96,30 +60,28 @@ * instance the security settings of the current page and how far in the download * process you are currently etc... <br> * Note that there are TWO DIFFERENT status bar controls though, one which does have - * "sections" which sub divides the status bar into several smaller sections which + * "sections" which sub divide< TypeOfStatusBar >s the status bar into several smaller sections which * are independant of eachother and another type which is a "flat strip" containing * only one large portion of text. <br> * The default one is the flat one, use Section as the last template parameter to * use the one with sections! */ -template< class TypeOfStatusBar = NoSection > class StatusBar : - public TypeOfStatusBar, public CommonControl, // Aspects - public AspectClickable< StatusBar< TypeOfStatusBar > >, - public AspectDblClickable< StatusBar< TypeOfStatusBar > >, - public AspectFont< StatusBar< TypeOfStatusBar > >, - public AspectPainting< StatusBar< TypeOfStatusBar > > + public AspectClickable< StatusBar >, + public AspectDblClickable< StatusBar >, + public AspectFont< StatusBar >, + public AspectPainting< StatusBar > { typedef CommonControl BaseType; friend class WidgetCreator< StatusBar >; - friend class AspectClickable< StatusBar< TypeOfStatusBar > >; - friend class AspectDblClickable< StatusBar< TypeOfStatusBar > >; + friend class AspectClickable< StatusBar>; + friend class AspectDblClickable< StatusBar >; public: /// Class type - typedef StatusBar<TypeOfStatusBar> ThisType; + typedef StatusBar ThisType; /// Object type typedef ThisType* ObjectType; @@ -148,6 +110,16 @@ */ void refresh(); + /// Initializes the sections of the StatusBar + /** Use this one to set the number of sections and the width of them + */ + void setSections( const std::vector< unsigned > & width ); + + /// Sets the text of the given section number + /** Use this one to set the text of a specific section of the StatusBar + */ + void setText( const SmartUtil::tstring & newText, unsigned partNo = 0); + /// Actually creates the StatusBar /** You should call WidgetFactory::createStatusBar if you instantiate class * directly. <br> @@ -175,43 +147,17 @@ // Implementation of class /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -template< class TypeOfStatusBar > -StatusBar< TypeOfStatusBar >::Seed::Seed(bool sizeGrip) : BaseType::Seed(STATUSCLASSNAME, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS) { +inline StatusBar::Seed::Seed(bool sizeGrip) : BaseType::Seed(STATUSCLASSNAME, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS) { if(sizeGrip) { style |= SBARS_SIZEGRIP; } } -inline void Section::setSections( const std::vector< unsigned > & width ) -{ - StatusBar< Section > * This - = static_cast< StatusBar < Section > * >( this ); - - std::vector< unsigned > newVec( width ); - std::vector< unsigned >::const_iterator origIdx = width.begin(); - unsigned offset = 0; - for ( std::vector< unsigned >::iterator idx = newVec.begin(); - idx < newVec.end(); - ++idx, ++origIdx ) - { - * idx = ( * origIdx ) + offset; - offset += * origIdx; - } - const unsigned * intArr = & newVec[0]; - const size_t size = newVec.size(); - ::SendMessage( This->handle(), SB_SETPARTS, static_cast< WPARAM >( size ), reinterpret_cast< LPARAM >( intArr ) ); +inline void StatusBar::setText( const SmartUtil::tstring & newText, unsigned partNo ) { + sendMessage(SB_SETTEXT, static_cast< WPARAM >( partNo ), reinterpret_cast< LPARAM >( newText.c_str() ) ); } -inline void Section::setText( const SmartUtil::tstring & newText, unsigned partNo ) -{ - StatusBar< Section > * This - = static_cast< StatusBar < Section > * >( this ); - ::SendMessage( This->handle(), SB_SETTEXT, static_cast< WPARAM >( partNo ), reinterpret_cast< LPARAM >( newText.c_str() ) ); -} - -template< class TypeOfStatusBar > -void StatusBar< TypeOfStatusBar >::refresh() -{ +inline void StatusBar::refresh() { // A status bar can't really be resized since its size is controlled by the // parent window. But to not let the status bar "hang" we need to refresh its // size after the main window is being resized. @@ -224,27 +170,20 @@ } } -template< class TypeOfStatusBar > -Message StatusBar< TypeOfStatusBar >::getClickMessage() -{ +inline Message StatusBar::getClickMessage() { return Message( WM_NOTIFY, NM_CLICK ); } -template< class TypeOfStatusBar > -Message StatusBar< TypeOfStatusBar >::getDblClickMessage() -{ +inline Message StatusBar::getDblClickMessage() { return Message( WM_NOTIFY, NM_DBLCLK ); } -template< class TypeOfStatusBar > -StatusBar< TypeOfStatusBar >::StatusBar( dwt::Widget * parent ) +inline StatusBar::StatusBar( Widget * parent ) : BaseType( parent ) { } -template< class TypeOfStatusBar > -void StatusBar< TypeOfStatusBar >::create( const Seed & cs ) -{ +inline void StatusBar::create( const Seed & cs ) { BaseType::create(cs); if(cs.font) setFont( cs.font ); Modified: dcplusplus/trunk/dwt/include/dwt/widgets/TextBox.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/widgets/TextBox.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/dwt/include/dwt/widgets/TextBox.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -81,8 +81,6 @@ typedef Dispatchers::VoidVoid<> Dispatcher; -protected: - public: /// Sets the current selection of the Edit Control /** Start means the offset of where the current selection shall start, if it is @@ -90,7 +88,7 @@ * end means where it shall end, if it is omitted it defaults to - 1 or "the * rest from start". */ - void setSelection( long start = 0, long end = - 1 ); + void setSelection( int start = 0, int end = - 1 ); /// Returns the current selected text from the text box /** The selected text of the text box is the return value from this. @@ -111,12 +109,11 @@ */ void replaceSelection( const SmartUtil::tstring & txt, bool canUndo = true ); - // TODO: Case sensitivity /// Finds the given text in the text field and returns true if successfully - long findText( const SmartUtil::tstring & txt, unsigned offset = 0 ) const; + int findText( const SmartUtil::tstring & txt, unsigned offset = 0 ) const; /// Returns the position of the caret - long getCaretPos(); + int getCaretPos(); /// Call this function to scroll the caret into view /** If the caret is not visible within the currently scrolled in area, the Text @@ -158,12 +155,12 @@ /// Set the maximum number of characters that can be entered. /** Although this prevents user from entering more maxChars, Paste can overrun the limit. */ - void setTextLimit( DWORD maxChars ); + void setTextLimit( int maxChars ); /// Returns the maximum number of characters that can be entered. /** Note that the maxChars returned will vary by OS if left unset. */ - DWORD getTextLimit() const ; + int getTextLimit() const ; void onTextChanged( const Dispatcher::F& f ); @@ -188,7 +185,6 @@ // Contract needed by AspectUpdate Aspect class static Message getUpdateMessage(); - }; class TextBox : @@ -286,7 +282,7 @@ return Message( WM_COMMAND, MAKEWPARAM(0, EN_UPDATE) ); } -inline void TextBoxBase::setSelection( long start, long end ) +inline void TextBoxBase::setSelection( int start, int end ) { this->sendMessage(EM_SETSEL, start, end ); } @@ -298,23 +294,23 @@ inline void TextBoxBase::addText( const SmartUtil::tstring & addtxt ) { - setSelection( ( long ) this->getText().size() ); + setSelection( length() ); replaceSelection( addtxt ); } -inline long TextBoxBase::findText( const SmartUtil::tstring & txt, unsigned offset ) const +inline int TextBoxBase::findText( const SmartUtil::tstring & txt, unsigned offset ) const { SmartUtil::tstring txtOfBox = this->getText(); size_t position = txtOfBox.find( txt, offset ); if ( position == std::string::npos ) - return - 1; - return static_cast< long >( position ); + return -1; + return static_cast< int >( position ); } -inline long TextBoxBase::getCaretPos() { +inline int TextBoxBase::getCaretPos() { DWORD start, end; this->sendMessage(EM_GETSEL, reinterpret_cast< WPARAM >( & start ), reinterpret_cast< LPARAM >( & end ) ); - return static_cast< long >( end ); + return static_cast< int >( end ); } inline void TextBoxBase::showCaret() { @@ -341,12 +337,12 @@ this->Widget::addRemoveStyle( WS_BORDER, value ); } -inline void TextBoxBase::setTextLimit( DWORD maxChars ) { +inline void TextBoxBase::setTextLimit( int maxChars ) { this->sendMessage(EM_LIMITTEXT, static_cast< WPARAM >(maxChars) ); } -inline DWORD TextBoxBase::getTextLimit() const { - return static_cast< DWORD >( this->sendMessage(EM_GETLIMITTEXT) ); +inline int TextBoxBase::getTextLimit() const { + return static_cast< int >( this->sendMessage(EM_GETLIMITTEXT) ); } inline void TextBoxBase::onTextChanged( const Dispatcher::F& f ) { Added: dcplusplus/trunk/dwt/src/widgets/StatusBar.cpp =================================================================== --- dcplusplus/trunk/dwt/src/widgets/StatusBar.cpp (rev 0) +++ dcplusplus/trunk/dwt/src/widgets/StatusBar.cpp 2008-04-14 20:24:38 UTC (rev 1154) @@ -0,0 +1,49 @@ +/* + DC++ Widget Toolkit + + Copyright (c) 2007-2008, Jacek Sieka + + 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 DWT 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. +*/ + +#include <dwt/widgets/StatusBar.h> + +namespace dwt { + +void StatusBar::setSections( const std::vector< unsigned > & width ) { + std::vector< unsigned > newVec( width ); + std::vector< unsigned >::const_iterator origIdx = width.begin(); + unsigned offset = 0; + for ( std::vector< unsigned >::iterator idx = newVec.begin(); idx != newVec.end(); ++idx, ++origIdx ) { + * idx = ( * origIdx ) + offset; + offset += * origIdx; + } + const unsigned * intArr = & newVec[0]; + const size_t size = newVec.size(); + sendMessage(SB_SETPARTS, static_cast< WPARAM >( size ), reinterpret_cast< LPARAM >( intArr ) ); +} + +} Modified: dcplusplus/trunk/win32/AspectStatus.h =================================================================== --- dcplusplus/trunk/win32/AspectStatus.h 2008-04-14 20:23:20 UTC (rev 1153) +++ dcplusplus/trunk/win32/AspectStatus.h 2008-04-14 20:24:38 UTC (rev 1154) @@ -19,14 +19,13 @@ #ifndef DCPLUSPLUS_WIN32_ASPECTSTATUS_H_ #define DCPLUSPLUS_WIN32_ASPECTSTATUS_H_ +#include <dwt/widgets/StatusBar.h> #include "WinUtil.h" template<class WidgetType> class AspectStatus { typedef AspectStatus<WidgetType> ThisType; protected: - typedef dwt::StatusBar<dwt::Section>::ThisType StatusBarSections; - typedef StatusBarSections::ObjectType StatusBarSectionsPtr; AspectStatus() : status(0) { statusSizes.resize(WidgetType::STATUS_LAST); @@ -38,7 +37,7 @@ } void initStatus(bool sizeGrip = false) { - StatusBarSections::Seed cs(sizeGrip); + dwt::StatusBar::Seed cs(sizeGrip); cs.font = WinUtil::font; status = static_cast<WidgetType*>(this)->addChild(cs); @@ -86,7 +85,7 @@ ::MoveWindow(widget->handle(), p[0].x, p[0].y, p[1].x - p[0].x, p[1].y - p[0].y, TRUE); } - StatusBarSectionsPtr status; + dwt::StatusBarPtr status; std::vector<unsigned> statusSizes; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |