From: <arn...@us...> - 2008-04-14 20:20:51
|
Revision: 1152 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1152&view=rev Author: arnetheduck Date: 2008-04-14 13:19:59 -0700 (Mon, 14 Apr 2008) Log Message: ----------- Attach text/comboboxes as we should, tighten protection of some methods Modified Paths: -------------- dcplusplus/trunk/dwt/include/dwt/Policies.h dcplusplus/trunk/dwt/include/dwt/Widget.h dcplusplus/trunk/dwt/include/dwt/WidgetCreator.h dcplusplus/trunk/dwt/include/dwt/aspects/AspectVisible.h dcplusplus/trunk/dwt/include/dwt/widgets/Composite.h dcplusplus/trunk/dwt/include/dwt/widgets/Control.h dcplusplus/trunk/dwt/src/Widget.cpp dcplusplus/trunk/dwt/src/widgets/MDIChild.cpp dcplusplus/trunk/win32/ADLSProperties.cpp dcplusplus/trunk/win32/AboutDlg.cpp dcplusplus/trunk/win32/Advanced3Page.cpp dcplusplus/trunk/win32/Appearance2Page.cpp dcplusplus/trunk/win32/AppearancePage.cpp dcplusplus/trunk/win32/CertificatesPage.cpp dcplusplus/trunk/win32/ComboBox.h dcplusplus/trunk/win32/CommandDlg.cpp dcplusplus/trunk/win32/DownloadPage.cpp dcplusplus/trunk/win32/FavHubProperties.cpp dcplusplus/trunk/win32/GeneralPage.cpp dcplusplus/trunk/win32/HubListsDlg.cpp dcplusplus/trunk/win32/LineDlg.cpp dcplusplus/trunk/win32/LogPage.cpp dcplusplus/trunk/win32/MagnetDlg.cpp dcplusplus/trunk/win32/NetworkPage.cpp dcplusplus/trunk/win32/QueuePage.cpp dcplusplus/trunk/win32/SplashWindow.cpp dcplusplus/trunk/win32/StatsFrame.cpp dcplusplus/trunk/win32/TextBox.h dcplusplus/trunk/win32/UploadPage.cpp dcplusplus/trunk/win32/WidgetFactory.h Property Changed: ---------------- dcplusplus/trunk/ Property changes on: dcplusplus/trunk ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-04-09 23:50:55.905999899 +0200 committer: poy <po...@12...> properties: branch-nick: bzr + timestamp: 2008-04-10 12:24:47.999000072 +0200 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus 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 + 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 Modified: dcplusplus/trunk/dwt/include/dwt/Policies.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/Policies.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/dwt/include/dwt/Policies.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -40,9 +40,13 @@ namespace dwt { +namespace Policies { +class Subclassed; +} + template<typename Policy> class MessageMap : public Policy { -public: +protected: typedef MessageMap<Policy> PolicyType; MessageMap(Widget* parent) : Policy(parent) { } @@ -75,12 +79,12 @@ return Policy::returnHandled(res, hwnd, uMsg, wParam, lParam); } } - Policy* p; + PolicyType* p; if(handler != hwnd) { - p = hwnd_cast<Policy*>(hwnd); + p = hwnd_cast<PolicyType*>(hwnd); } else { - p = dynamic_cast<Policy*>(w); + p = dynamic_cast<PolicyType*>(w); } if(!p) { @@ -90,7 +94,8 @@ return p->returnUnhandled(hwnd, uMsg, wParam, lParam); } private: - + friend class Policies::Subclassed; + static HWND getHandler(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { HWND handler; // Check who should handle the message - parent or child @@ -129,7 +134,7 @@ class ModelessDialog : public Widget { -public: +protected: ModelessDialog(Widget* parent) : Widget(parent) { } static LRESULT returnDestroyed(HWND hWnd, UINT msg, WPARAM wPar, LPARAM lPar) { @@ -166,7 +171,7 @@ { // extracting the this pointer and stuffing it into the Window with SetProp ModelessDialog* This = reinterpret_cast<ModelessDialog*>(lParam); - This->attach( hwnd ); + This->setHandle( hwnd ); } } }; @@ -175,7 +180,7 @@ class ModalDialog : public ModelessDialog { -public: +protected: ModalDialog(Widget* parent) : ModelessDialog(parent) { } virtual void kill() { @@ -191,7 +196,7 @@ class Normal : public Widget { -public: +protected: Normal(Widget* parent) : Widget(parent) { } static LRESULT returnDestroyed(HWND hWnd, UINT msg, WPARAM wPar, LPARAM lPar) { @@ -217,13 +222,13 @@ // extracting the this pointer and stuffing it into the Window with SetProp CREATESTRUCT * cs = reinterpret_cast< CREATESTRUCT * >( lParam ); Normal* This = reinterpret_cast<Normal*>( cs->lpCreateParams ); - This->attach( hWnd ); + This->setHandle( hWnd ); } } }; class Subclassed : public Normal { -public: +protected: Subclassed(Widget* parent) : Normal(parent), oldProc(0) { } LRESULT returnUnhandled(HWND hWnd, UINT msg, WPARAM wPar, LPARAM lPar) { @@ -233,14 +238,14 @@ return Normal::returnUnhandled(hWnd, msg, wPar, lPar); } - virtual HWND create(const Widget::Seed& seed) { - HWND hWnd = Widget::create(seed); - attach(hWnd); + HWND create(const Normal::Seed& seed) { + HWND hWnd = Normal::create(seed); + setHandle(hWnd); return hWnd; } - virtual void attach(HWND hWnd) { - Normal::attach(hWnd); + virtual void setHandle(HWND hWnd) { + Normal::setHandle(hWnd); oldProc = reinterpret_cast< WNDPROC >( ::SetWindowLongPtr( hWnd, GWL_WNDPROC, ( LONG_PTR ) &MessageMap<Subclassed>::wndProc ) ); } using Widget::attach; @@ -256,7 +261,7 @@ class MDIChild : public Widget { -public: +protected: MDIChild(Widget* parent) : Widget(parent) { } static LRESULT returnDestroyed(HWND hWnd, UINT msg, WPARAM wPar, LPARAM lPar) { @@ -296,14 +301,14 @@ MDICREATESTRUCT * mcs = reinterpret_cast< MDICREATESTRUCT*>(cs->lpCreateParams); MDIChild* This = reinterpret_cast<MDIChild*>(mcs->lParam); - This->attach(hWnd); + This->setHandle(hWnd); } } }; template<typename WidgetType> class MDIFrame : public Normal { -public: +protected: MDIFrame(Widget* parent) : Normal(parent) { } LRESULT returnUnhandled( HWND hWnd, UINT msg, WPARAM wPar, LPARAM lPar ) Modified: dcplusplus/trunk/dwt/include/dwt/Widget.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/Widget.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/dwt/include/dwt/Widget.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -94,16 +94,6 @@ */ Widget* getParent() const; - /// Repaints the whole window - /** Invalidate the window and repaints it. - */ - void updateWidget(); - - /// Add this widget to the update area. - /** Same as updateWidget except that this does not force an immediate redraw. - */ - void invalidateWidget(); - /// Use this function to add or remove windows styles. /** The first parameter is the type of style you wish to add/remove. <br> * The second argument is a boolean indicating if you wish to add or remove the @@ -185,8 +175,6 @@ {} }; - - Widget(Widget * parent); virtual ~Widget(); @@ -195,7 +183,7 @@ // derived class - otherwise the wrong seed will be used HWND create(const Seed & cs); - virtual void attach(HWND wnd); + virtual void setHandle(HWND wnd); private: friend class Application; Modified: dcplusplus/trunk/dwt/include/dwt/WidgetCreator.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/WidgetCreator.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/dwt/include/dwt/WidgetCreator.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -91,7 +91,7 @@ static typename WidgetType::ObjectType attach( Widget * parent, HWND hwnd ) { typename WidgetType::ObjectType retVal(new WidgetType( parent )); - retVal->attach( hwnd ); + retVal->setHandle( hwnd ); return retVal; } Modified: dcplusplus/trunk/dwt/include/dwt/aspects/AspectVisible.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/aspects/AspectVisible.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/dwt/include/dwt/aspects/AspectVisible.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -37,6 +37,7 @@ #define DWT_AspectVisible_h #include "../Dispatchers.h" +#include "../Rectangle.h" namespace dwt { @@ -68,7 +69,7 @@ /** Changes the visibility property of the Widget. <br> * Use this function to change the visibility property of the Widget */ - void setVisible( bool visible ); + void setVisible(bool visible); /// Retrieves the visible property of the Widget /** Use this function to check if the Widget is visible or not. <br> @@ -88,6 +89,13 @@ W().addCallback(Message( WM_SHOWWINDOW ), Dispatcher(f)); } + /// Repaints the whole window + /** Invalidate the window and repaints it. + */ + void redraw(bool now = false); + + void redraw(const Rectangle& r, bool now = false); + protected: virtual ~AspectVisible() {} @@ -108,6 +116,17 @@ return ::IsWindowVisible( H() ) != 0; } +template<class WidgetType> +void AspectVisible<WidgetType>::redraw(bool now) { + ::RedrawWindow(H(), NULL, NULL, RDW_ERASE | RDW_INVALIDATE | (now ? RDW_UPDATENOW : 0)); } +template<class WidgetType> +void AspectVisible<WidgetType>::redraw(const Rectangle& r, bool now) { + RECT rc = r; + ::RedrawWindow(H(), &rc, NULL, RDW_ERASE | RDW_INVALIDATE | (now ? RDW_UPDATENOW : 0)); +} + +} + #endif Modified: dcplusplus/trunk/dwt/include/dwt/widgets/Composite.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/widgets/Composite.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/dwt/include/dwt/widgets/Composite.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -63,13 +63,13 @@ public AspectPainting< Composite< Policy > >, public AspectText< Composite< Policy > > { + typedef Control<Policy> BaseType; + public: typedef Composite<Policy> ThisType; typedef ThisType* ObjectType; - typedef Control<Policy> BaseType; - // TODO Maybe move this to a separate class? // This brings these classes into the namespace of classes that inherit from Composite // Note; only child windows should be here... @@ -129,7 +129,7 @@ return WidgetCreator<typename SeedType::WidgetType>::create(this, seed); } - virtual void create(const Seed& cs); + void create(const Seed& cs); protected: friend class WidgetCreator<Composite<Policy> >; Modified: dcplusplus/trunk/dwt/include/dwt/widgets/Control.h =================================================================== --- dcplusplus/trunk/dwt/include/dwt/widgets/Control.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/dwt/include/dwt/widgets/Control.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -65,8 +65,8 @@ public AspectTimer<Control<Policy> >, public AspectVisible<Control<Policy> > { + typedef MessageMap<Policy> BaseType; public: - typedef MessageMap<Policy> BaseType; protected: struct Seed : public BaseType::Seed { Modified: dcplusplus/trunk/dwt/src/Widget.cpp =================================================================== --- dcplusplus/trunk/dwt/src/Widget.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/dwt/src/Widget.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -64,19 +64,9 @@ HWND hWnd = ::GetDlgItem( itsParent->handle(), id ); if ( !hWnd ) throw xCeption( _T( "GetDlgItem failed." ) ); - attach(hWnd); + setHandle(hWnd); } -void Widget::updateWidget() -{ - ::InvalidateRect( itsHandle, 0, TRUE ); - ::UpdateWindow( itsHandle ); -} - -void Widget::invalidateWidget() { - ::InvalidateRect( itsHandle, 0, TRUE ); -} - void Widget::kill() { delete this; } @@ -99,7 +89,7 @@ return hWnd; } -void Widget::attach(HWND hwnd) { +void Widget::setHandle(HWND hwnd) { if(itsHandle) { throw xCeption(_T("You may not attach to a widget that's already attached")); } Modified: dcplusplus/trunk/dwt/src/widgets/MDIChild.cpp =================================================================== --- dcplusplus/trunk/dwt/src/widgets/MDIChild.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/dwt/src/widgets/MDIChild.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -59,7 +59,7 @@ } getParent()->sendMessage(WM_SETREDRAW, TRUE); - invalidateWidget(); + redraw(); if ( !wnd ) { xCeption x( _T( "CreateWindowEx in MDIChild::createMDIChild fizzled..." ) ); Modified: dcplusplus/trunk/win32/ADLSProperties.cpp =================================================================== --- dcplusplus/trunk/win32/ADLSProperties.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/ADLSProperties.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -79,30 +79,30 @@ setItemText(IDC_ADLSP_UNITS, T_("Size Type")); setItemText(IDC_ADLSP_DESTINATION, T_("Destination Directory")); - searchString = attachTextBox(IDC_SEARCH_STRING); + searchString = attachChild<TextBox>(IDC_SEARCH_STRING); searchString->setText(Text::toT(search->searchString)); searchString->setFocus(); - searchType = attachComboBox(IDC_SOURCE_TYPE); + searchType = attachChild<ComboBox>(IDC_SOURCE_TYPE); searchType->addValue(T_("Filename")); searchType->addValue(T_("Directory")); searchType->addValue(T_("Full Path")); searchType->setSelected(search->sourceType); - minSize = attachTextBox(IDC_MIN_FILE_SIZE); + minSize = attachChild<TextBox>(IDC_MIN_FILE_SIZE); minSize->setText((search->minFileSize > 0) ? Text::toT(Util::toString(search->minFileSize)) : Util::emptyStringT); - maxSize = attachTextBox(IDC_MAX_FILE_SIZE); + maxSize = attachChild<TextBox>(IDC_MAX_FILE_SIZE); maxSize->setText((search->maxFileSize > 0) ? Text::toT(Util::toString(search->maxFileSize)) : Util::emptyStringT); - sizeType = attachComboBox(IDC_SIZE_TYPE); + sizeType = attachChild<ComboBox>(IDC_SIZE_TYPE); sizeType->addValue(T_("B")); sizeType->addValue(T_("KiB")); sizeType->addValue(T_("MiB")); sizeType->addValue(T_("GiB")); sizeType->setSelected(search->typeFileSize); - destDir = attachTextBox(IDC_DEST_DIR); + destDir = attachChild<TextBox>(IDC_DEST_DIR); destDir->setText(Text::toT(search->destDir)); active = attachChild<CheckBox>(IDC_IS_ACTIVE); Modified: dcplusplus/trunk/win32/AboutDlg.cpp =================================================================== --- dcplusplus/trunk/win32/AboutDlg.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/AboutDlg.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -56,8 +56,8 @@ setText(T_("About DC++")); setItemText(IDC_VERSION, Text::toT(APPNAME " " VERSIONSTRING) + T_("\n(c) Copyright 2001-2008 Jacek Sieka\nEx-codeveloper: Per Lind\303\251n\nGraphics: Martin Skogevall et al.\nDC++ is licenced under GPL\nhttp://dcplusplus.sourceforge.net/")); - attachTextBox(IDC_TTH)->setText(WinUtil::tth); - attachTextBox(IDC_THANKS)->setText(Text::toT(thanks)); + attachChild<TextBox>(IDC_TTH)->setText(WinUtil::tth); + attachChild<TextBox>(IDC_THANKS)->setText(Text::toT(thanks)); setItemText(IDC_UPDOWN, str(TF_("Upload: %1%, Download: %2%") % Text::toT(Util::formatBytes(SETTING(TOTAL_UPLOAD))) % Text::toT(Util::formatBytes(SETTING(TOTAL_DOWNLOAD))))); setItemText(IDC_GREETZ, T_("Greetz and Contributors")); setItemText(IDC_TOTALS, T_("Totals")); Modified: dcplusplus/trunk/win32/Advanced3Page.cpp =================================================================== --- dcplusplus/trunk/win32/Advanced3Page.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/Advanced3Page.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -122,20 +122,20 @@ SpinnerPtr spinner = attachChild<Spinner>(IDC_SEARCH_HISTORY_SPIN); spinner->setRange(0, 100); - attachTextBox(IDC_ROLLBACK); - attachTextBox(IDC_MAX_HASH_SPEED); - attachTextBox(IDC_SHOW_LAST_LINES_LOG); - attachTextBox(IDC_SET_MINISLOT_SIZE); - attachTextBox(IDC_MAX_FILELIST_SIZE); - attachTextBox(IDC_PRIVATE_ID); - attachTextBox(IDC_AUTO_REFRESH_TIME); - attachTextBox(IDC_BUFFERSIZE); - attachTextBox(IDC_AUTO_SEARCH_LIMIT); - attachTextBox(IDC_SEARCH_HISTORY); - attachTextBox(IDC_BIND_ADDRESS); - attachTextBox(IDC_SOCKET_IN_BUFFER); - attachTextBox(IDC_SOCKET_OUT_BUFFER); - attachTextBox(IDC_MIN_SEGMENT_SIZE); + attachChild<TextBox>(IDC_ROLLBACK); + attachChild<TextBox>(IDC_MAX_HASH_SPEED); + attachChild<TextBox>(IDC_SHOW_LAST_LINES_LOG); + attachChild<TextBox>(IDC_SET_MINISLOT_SIZE); + attachChild<TextBox>(IDC_MAX_FILELIST_SIZE); + attachChild<TextBox>(IDC_PRIVATE_ID); + attachChild<TextBox>(IDC_AUTO_REFRESH_TIME); + attachChild<TextBox>(IDC_BUFFERSIZE); + attachChild<TextBox>(IDC_AUTO_SEARCH_LIMIT); + attachChild<TextBox>(IDC_SEARCH_HISTORY); + attachChild<TextBox>(IDC_BIND_ADDRESS); + attachChild<TextBox>(IDC_SOCKET_IN_BUFFER); + attachChild<TextBox>(IDC_SOCKET_OUT_BUFFER); + attachChild<TextBox>(IDC_MIN_SEGMENT_SIZE); } Advanced3Page::~Advanced3Page() { Modified: dcplusplus/trunk/win32/Appearance2Page.cpp =================================================================== --- dcplusplus/trunk/win32/Appearance2Page.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/Appearance2Page.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -97,7 +97,7 @@ button = attachChild<Button>(IDC_BROWSE); button->onClicked(std::tr1::bind(&Appearance2Page::handleBrowseClicked, this)); - attachTextBox(IDC_BEEPFILE); + attachChild<TextBox>(IDC_BEEPFILE); } Appearance2Page::~Appearance2Page() { @@ -120,7 +120,7 @@ if(createColorDialog().open(colorParams)) { bg = colorParams.getColor(); example->setColor(fg, bg); - example->invalidateWidget(); + example->redraw(); } } @@ -133,7 +133,7 @@ font = dwt::FontPtr(new dwt::Font(::CreateFontIndirect(&logFont), true)); example->setColor(fg, bg); example->setFont(font); - example->invalidateWidget(); + example->redraw(); } } Modified: dcplusplus/trunk/win32/AppearancePage.cpp =================================================================== --- dcplusplus/trunk/win32/AppearancePage.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/AppearancePage.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -76,7 +76,7 @@ PropPage::translate(handle(), texts); PropPage::read(handle(), items, listItems, ::GetDlgItem(handle(), IDC_APPEARANCE_BOOLEANS)); - languages = attachComboBox(IDC_LANGUAGE); + languages = attachChild<ComboBox>(IDC_LANGUAGE); StringList dirs = File::findFiles(Util::getLocalePath(), "*"); @@ -110,8 +110,8 @@ languages->setSelected(selected); - attachTextBox(IDC_DEFAULT_AWAY_MESSAGE); - attachTextBox(IDC_TIME_STAMPS_FORMAT); + attachChild<TextBox>(IDC_DEFAULT_AWAY_MESSAGE); + attachChild<TextBox>(IDC_TIME_STAMPS_FORMAT); } AppearancePage::~AppearancePage() { Modified: dcplusplus/trunk/win32/CertificatesPage.cpp =================================================================== --- dcplusplus/trunk/win32/CertificatesPage.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/CertificatesPage.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -69,13 +69,13 @@ PropPage::translate(handle(), texts); PropPage::read(handle(), items, listItems, ::GetDlgItem(handle(), IDC_TLS_OPTIONS)); - privateKeyFile = attachTextBox(IDC_TLS_PRIVATE_KEY_FILE); + privateKeyFile = attachChild<TextBox>(IDC_TLS_PRIVATE_KEY_FILE); attachChild<Button>(IDC_BROWSE_PRIVATE_KEY)->onClicked(std::tr1::bind(&CertificatesPage::handleBrowsePrivateKeyClicked, this)); - certificateFile = attachTextBox(IDC_TLS_CERTIFICATE_FILE); + certificateFile = attachChild<TextBox>(IDC_TLS_CERTIFICATE_FILE); attachChild<Button>(IDC_BROWSE_CERTIFICATE)->onClicked(std::tr1::bind(&CertificatesPage::handleBrowseCertificateClicked, this)); - trustedCertificatesPath = attachTextBox(IDC_TLS_TRUSTED_CERTIFICATES_PATH); + trustedCertificatesPath = attachChild<TextBox>(IDC_TLS_TRUSTED_CERTIFICATES_PATH); attachChild<Button>(IDC_BROWSE_TRUSTED_PATH)->onClicked(std::tr1::bind(&CertificatesPage::handleBrowseTrustedPathClicked, this)); attachChild<Button>(IDC_GENERATE_CERTS)->onClicked(std::tr1::bind(&CertificatesPage::handleGenerateCertsClicked, this)); Modified: dcplusplus/trunk/win32/ComboBox.h =================================================================== --- dcplusplus/trunk/win32/ComboBox.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/ComboBox.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -23,7 +23,7 @@ class ComboBox : public dwt::ComboBox { typedef dwt::ComboBox BaseType; - + friend class dwt::WidgetCreator<ComboBox>; public: typedef ComboBox ThisType; Modified: dcplusplus/trunk/win32/CommandDlg.cpp =================================================================== --- dcplusplus/trunk/win32/CommandDlg.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/CommandDlg.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -127,20 +127,20 @@ fileListMenu = attachChild<CheckBox>(IDC_SETTINGS_FILELIST_MENU); fileListMenu->setText(T_( "Filelist Menu")); - nameBox = attachTextBox(IDC_NAME); + nameBox = attachChild<TextBox>(IDC_NAME); - commandBox = attachTextBox(IDC_COMMAND); + commandBox = attachChild<TextBox>(IDC_COMMAND); commandBox->onTextChanged(std::tr1::bind(&CommandDlg::updateCommand, this)); - hubBox = attachTextBox(IDC_HUB); + hubBox = attachChild<TextBox>(IDC_HUB); - nick = attachTextBox(IDC_NICK); + nick = attachChild<TextBox>(IDC_NICK); nick->onTextChanged(std::tr1::bind(&CommandDlg::updateCommand, this)); once = attachChild<CheckBox>(IDC_SETTINGS_ONCE); once->setText(T_("Send once per nick")); - result = attachTextBox(IDC_RESULT); + result = attachChild<TextBox>(IDC_RESULT); openHelp = attachChild<CheckBox>(IDC_USER_CMD_OPEN_HELP); openHelp->setText(T_("Always open help file with this dialog")); Modified: dcplusplus/trunk/win32/DownloadPage.cpp =================================================================== --- dcplusplus/trunk/win32/DownloadPage.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/DownloadPage.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -94,11 +94,11 @@ attachChild(spinner, IDC_SPEEDSPIN); spinner->setRange(0, 10000); - attachTextBox(IDC_DOWNLOADDIR); - attachTextBox(IDC_TEMP_DOWNLOAD_DIRECTORY); - attachTextBox(IDC_DOWNLOADS); - attachTextBox(IDC_MAXSPEED); - attachTextBox(IDC_PROXY); + attachChild<TextBox>(IDC_DOWNLOADDIR); + attachChild<TextBox>(IDC_TEMP_DOWNLOAD_DIRECTORY); + attachChild<TextBox>(IDC_DOWNLOADS); + attachChild<TextBox>(IDC_MAXSPEED); + attachChild<TextBox>(IDC_PROXY); } DownloadPage::~DownloadPage() { Modified: dcplusplus/trunk/win32/FavHubProperties.cpp =================================================================== --- dcplusplus/trunk/win32/FavHubProperties.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/FavHubProperties.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -77,28 +77,28 @@ setItemText(IDC_FH_PASSWORD, T_("Password")); setItemText(IDC_FH_USER_DESC, T_("Description")); - name = attachTextBox(IDC_HUBNAME); + name = attachChild<TextBox>(IDC_HUBNAME); name->setText(Text::toT(entry->getName())); name->setFocus(); name->setSelection(); - address = attachTextBox(IDC_HUBADDR); + address = attachChild<TextBox>(IDC_HUBADDR); address->setText(Text::toT(entry->getServer())); - description = attachTextBox(IDC_HUBDESCR); + description = attachChild<TextBox>(IDC_HUBDESCR); description->setText(Text::toT(entry->getDescription())); - nick = attachTextBox(IDC_HUBNICK); + nick = attachChild<TextBox>(IDC_HUBNICK); nick->setTextLimit(35); nick->setText(Text::toT(entry->getNick(false))); nick->onTextChanged(std::tr1::bind(&FavHubProperties::handleTextChanged, this, nick)); - password = attachTextBox(IDC_HUBPASS); + password = attachChild<TextBox>(IDC_HUBPASS); password->setPassword(); password->setText(Text::toT(entry->getPassword())); password->onTextChanged(std::tr1::bind(&FavHubProperties::handleTextChanged, this, password)); - userDescription = attachTextBox(IDC_HUBUSERDESCR); + userDescription = attachChild<TextBox>(IDC_HUBUSERDESCR); userDescription->setTextLimit(35); userDescription->setText(Text::toT(entry->getUserDescription())); Modified: dcplusplus/trunk/win32/GeneralPage.cpp =================================================================== --- dcplusplus/trunk/win32/GeneralPage.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/GeneralPage.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -65,7 +65,7 @@ PropPage::translate(handle(), texts); PropPage::read(handle(), items); - ComboBoxPtr connections = attachComboBox(IDC_CONNECTION); + ComboBoxPtr connections = attachChild<ComboBox>(IDC_CONNECTION); int selected = 0, j = 0; for(StringIter i = SettingsManager::connectionSpeeds.begin(); i != SettingsManager::connectionSpeeds.end(); ++i, ++j) { @@ -77,13 +77,13 @@ connections->setSelected(selected); - nick = attachTextBox(IDC_NICK); + nick = attachChild<TextBox>(IDC_NICK); nick->setTextLimit(35); nick->onTextChanged(std::tr1::bind(&GeneralPage::handleNickTextChanged, this)); - attachTextBox(IDC_EMAIL); + attachChild<TextBox>(IDC_EMAIL); - attachTextBox(IDC_DESCRIPTION)->setTextLimit(35); + attachChild<TextBox>(IDC_DESCRIPTION)->setTextLimit(35); } GeneralPage::~GeneralPage() { Modified: dcplusplus/trunk/win32/HubListsDlg.cpp =================================================================== --- dcplusplus/trunk/win32/HubListsDlg.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/HubListsDlg.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -60,7 +60,7 @@ setText(T_("Configured Public Hub Lists")); - editBox = attachTextBox(IDC_LIST_EDIT_BOX); + editBox = attachChild<TextBox>(IDC_LIST_EDIT_BOX); attachChild(hubLists, IDC_LIST_LIST); hubLists->setTableStyle(LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT); Modified: dcplusplus/trunk/win32/LineDlg.cpp =================================================================== --- dcplusplus/trunk/win32/LineDlg.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/LineDlg.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -36,7 +36,7 @@ attachChild<Button>(IDCANCEL)->onClicked(std::tr1::bind(&LineDlg::cancelClicked, this)); attachChild<Label>(IDC_DESCRIPTION)->setText(desc); - line = attachTextBox(IDC_LINE); + line = attachChild<TextBox>(IDC_LINE); line->setFocus(); line->setText(initial); line->setSelection(); Modified: dcplusplus/trunk/win32/LogPage.cpp =================================================================== --- dcplusplus/trunk/win32/LogPage.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/LogPage.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -74,17 +74,17 @@ options.push_back(pair); } - attachTextBox(IDC_LOG_DIRECTORY); + attachChild<TextBox>(IDC_LOG_DIRECTORY); attachChild<Button>(IDC_BROWSE_LOG)->onClicked(std::tr1::bind(&LogPage::handleBrowseClicked, this)); attachChild(dataGrid, IDC_LOG_OPTIONS); dataGrid->onRaw(std::tr1::bind(&LogPage::handleItemChanged, this), dwt::Message(WM_NOTIFY, LVN_ITEMCHANGED)); - logFormat = attachTextBox(IDC_LOG_FORMAT); + logFormat = attachChild<TextBox>(IDC_LOG_FORMAT); logFormat->setEnabled(false); - logFile = attachTextBox(IDC_LOG_FILE); + logFile = attachChild<TextBox>(IDC_LOG_FILE); logFile->setEnabled(false); oldSelection = -1; Modified: dcplusplus/trunk/win32/MagnetDlg.cpp =================================================================== --- dcplusplus/trunk/win32/MagnetDlg.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/MagnetDlg.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -44,9 +44,9 @@ setText(T_("MAGNET Link detected")); setItemText(IDC_MAGNET_TEXT, T_("DC++ has detected a MAGNET link with a file hash that can be searched for on the Direct Connect network. What would you like to do?")); setItemText(IDC_MAGNET_HASH, T_("File Hash:")); - attachTextBox(IDC_MAGNET_DISP_HASH)->setText(mHash.c_str()); + attachChild<TextBox>(IDC_MAGNET_DISP_HASH)->setText(mHash.c_str()); setItemText(IDC_MAGNET_NAME, T_("Filename:")); - attachTextBox(IDC_MAGNET_DISP_NAME)->setText(mFileName); + attachChild<TextBox>(IDC_MAGNET_DISP_NAME)->setText(mFileName); //queue = attachRadioButton(IDC_MAGNET_1_QUEUE); //queue->setText(T_("Add this file to your download queue")); Modified: dcplusplus/trunk/win32/NetworkPage.cpp =================================================================== --- dcplusplus/trunk/win32/NetworkPage.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/NetworkPage.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -130,17 +130,17 @@ RADIO_ATTACH(IDC_SOCKS5); #undef RADIO_ATTACH -#define TEXTBOX_LIMIT(id) attachTextBox(id)->setTextLimit(250) +#define TEXTBOX_LIMIT(id) attachChild<TextBox>(id)->setTextLimit(250) TEXTBOX_LIMIT(IDC_SOCKS_SERVER); TEXTBOX_LIMIT(IDC_SOCKS_PORT); TEXTBOX_LIMIT(IDC_SOCKS_USER); TEXTBOX_LIMIT(IDC_SOCKS_PASSWORD); #undef TEXTBOX_LIMIT - attachTextBox(IDC_PORT_TCP); - attachTextBox(IDC_PORT_UDP); - attachTextBox(IDC_PORT_TLS); - attachTextBox(IDC_EXTERNAL_IP); + attachChild<TextBox>(IDC_PORT_TCP); + attachChild<TextBox>(IDC_PORT_UDP); + attachChild<TextBox>(IDC_PORT_TLS); + attachChild<TextBox>(IDC_EXTERNAL_IP); } NetworkPage::~NetworkPage() { Modified: dcplusplus/trunk/win32/QueuePage.cpp =================================================================== --- dcplusplus/trunk/win32/QueuePage.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/QueuePage.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -123,16 +123,16 @@ PropPage::read(handle(), items, 0, 0); PropPage::read(handle(), items, optionItems, ::GetDlgItem(handle(), IDC_OTHER_QUEUE_OPTIONS)); - attachTextBox(IDC_PRIO_HIGHEST_SIZE); - attachTextBox(IDC_PRIO_NORMAL_SIZE); - attachTextBox(IDC_PRIO_HIGH_SIZE); - attachTextBox(IDC_PRIO_LOW_SIZE); - attachTextBox(IDC_AUTODROP_SPEED); - attachTextBox(IDC_AUTODROP_ELAPSED); - attachTextBox(IDC_AUTODROP_MINSOURCES); - attachTextBox(IDC_AUTODROP_INTERVAL); - attachTextBox(IDC_AUTODROP_INACTIVITY); - attachTextBox(IDC_AUTODROP_FILESIZE); + attachChild<TextBox>(IDC_PRIO_HIGHEST_SIZE); + attachChild<TextBox>(IDC_PRIO_NORMAL_SIZE); + attachChild<TextBox>(IDC_PRIO_HIGH_SIZE); + attachChild<TextBox>(IDC_PRIO_LOW_SIZE); + attachChild<TextBox>(IDC_AUTODROP_SPEED); + attachChild<TextBox>(IDC_AUTODROP_ELAPSED); + attachChild<TextBox>(IDC_AUTODROP_MINSOURCES); + attachChild<TextBox>(IDC_AUTODROP_INTERVAL); + attachChild<TextBox>(IDC_AUTODROP_INACTIVITY); + attachChild<TextBox>(IDC_AUTODROP_FILESIZE); } QueuePage::~QueuePage() { Modified: dcplusplus/trunk/win32/SplashWindow.cpp =================================================================== --- dcplusplus/trunk/win32/SplashWindow.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/SplashWindow.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -66,7 +66,7 @@ ::HideCaret(text->handle()); text->setVisible(true); text->bringToFront(); - text->updateWidget(); + text->redraw(true); } SplashWindow::~SplashWindow() { @@ -75,5 +75,5 @@ void SplashWindow::operator()(const string& status) { text->setText(str(TF_("Loading DC++, please wait... (%1%)") % Text::toT(status) )); - text->updateWidget(); + text->redraw(true); } Modified: dcplusplus/trunk/win32/StatsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/StatsFrame.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/StatsFrame.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -125,7 +125,7 @@ width = r.width(); height = r.size.y - 1; - invalidateWidget(); + redraw(); } bool StatsFrame::eachSecond() { @@ -166,7 +166,7 @@ } if(mspeed > max || ((max * 3 / 4) > mspeed) ) { max = mspeed; - invalidateWidget(); + redraw(); } lastTick = tick; Modified: dcplusplus/trunk/win32/TextBox.h =================================================================== --- dcplusplus/trunk/win32/TextBox.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/TextBox.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -22,7 +22,7 @@ /** Our own flavour of text boxes that handle double clicks and have fancy menus */ class TextBox : public dwt::TextBox { typedef dwt::TextBox BaseType; - + friend class dwt::WidgetCreator<TextBox>; public: typedef TextBox ThisType; Modified: dcplusplus/trunk/win32/UploadPage.cpp =================================================================== --- dcplusplus/trunk/win32/UploadPage.cpp 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/UploadPage.cpp 2008-04-14 20:19:59 UTC (rev 1152) @@ -129,8 +129,8 @@ attachChild(spinner, IDC_MIN_UPLOAD_SPIN); spinner->setRange(0, UD_MAXVAL); - attachTextBox(IDC_MIN_UPLOAD_SPEED); - attachTextBox(IDC_SLOTS); + attachChild<TextBox>(IDC_MIN_UPLOAD_SPEED); + attachChild<TextBox>(IDC_SLOTS); } UploadPage::~UploadPage() { Modified: dcplusplus/trunk/win32/WidgetFactory.h =================================================================== --- dcplusplus/trunk/win32/WidgetFactory.h 2008-04-14 20:17:43 UTC (rev 1151) +++ dcplusplus/trunk/win32/WidgetFactory.h 2008-04-14 20:19:59 UTC (rev 1152) @@ -37,28 +37,12 @@ /// TextBox object type. typedef typename TextBox::ObjectType TextBoxPtr; - TextBoxPtr createTextBox( const TextBox::Seed & cs = TextBox::Seed() ) { - return dwt::WidgetCreator< TextBox >::create( this, cs ); - } - - TextBoxPtr attachTextBox( unsigned id ) { - return dwt::WidgetCreator< TextBox >::attach( this, id ); - } - /// ComboBox class type. typedef ::ComboBox ComboBox; /// ComboBox object type. typedef typename ComboBox::ObjectType ComboBoxPtr; - ComboBoxPtr createComboBox( const ComboBox::Seed & cs = ComboBox::Seed() ) { - return dwt::WidgetCreator< ComboBox >::create( this, cs ); - } - - ComboBoxPtr attachComboBox( unsigned id ) { - return dwt::WidgetCreator< ComboBox >::attach( this, id ); - } - /// VPaned class type. typedef WidgetPaned< false > WidgetVPaned; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |