diff --git a/upptst/GuiMtTest/main.cpp b/upptst/GuiMtTest/main.cpp index 4726f436d..977a21631 100644 --- a/upptst/GuiMtTest/main.cpp +++ b/upptst/GuiMtTest/main.cpp @@ -1,4 +1,3 @@ -<<<<<<< .mine #include using namespace Upp; @@ -25,29 +24,18 @@ void App::Work() { int q = 0; while(!Thread::IsShutdownThreads()) { - if(list.GetCount() > 500) { -#if 0 - bool result; - Call(callback1(Ask, &result)); - if(result) { - GuiLock __; - Break(); - } -#else + if(++q > 200) { if(PromptYesNo("Do you want to quit?")) { GuiLock __; Break(); } -#endif q = 0; - } - { + for(int i = 0; i < 101; i++) { GuiLock __; - list.Add((int)Random()); - GuiSleep(10); + list.Set(i, 0, (int)Random()); } - Sleep(1); + Sleep(10); } } @@ -69,73 +57,3 @@ GUI_APP_MAIN App app; app.Run(); } -======= -#include - -using namespace Upp; - -struct App : TopWindow { - Thread work; - - void Work(); - - ArrayCtrl list; - - typedef App CLASSNAME; - - App(); - ~App(); -}; - -void Ask(bool *result) -{ - *result = PromptYesNo("Do you want to quit?"); -} - -void App::Work() -{ - int q = 0; - while(!Thread::IsShutdownThreads()) { - if(++q > 200) { -#if 0 - bool result; - Call(callback1(Ask, &result)); - if(result) { - Ctrl::Lock __(*this); - Break(); - } -#else - if(PromptYesNo("Do you want to quit?")) { - Ctrl::Lock __(*this); - Break(); - } -#endif - q = 0; - } - for(int i = 0; i < 101; i++) { - Ctrl::Lock __(list); - list.Set(i, 0, (int)Random()); - } - Sleep(10); - } -} - -App::App() -{ - list.AddColumn("Test"); - Add(list.SizePos()); - work.Run(THISBACK(Work)); -} - -App::~App() -{ - Thread::ShutdownThreads(); - work.Wait(); -} - -GUI_APP_MAIN -{ - App app; - app.Run(); -} ->>>>>>> .r1219 diff --git a/upptst/XmlRpcClient/XmlRpcClient.cpp b/upptst/XmlRpcClient/XmlRpcClient.cpp deleted file mode 100644 index ead1cd07a..000000000 --- a/upptst/XmlRpcClient/XmlRpcClient.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include - -using namespace Upp; - -namespace Upp { - extern bool HttpRequest_Trace__; -} - -void Compute( double a, Upp::String arithmeticOperator, double b ); - -int main() { - Time serverTime; - SetDateFormat( "%4d-%02d-%02d" ); - XmlRpcRequest call( "127.0.0.1:1234" ); - if( call("GetServerTime") >> serverTime ) { - LOG( "Server Time = " << serverTime ); - } - else { - LOG( Upp::Format("Error: %s", call.GetError()) ); - } - - Compute( 12, "+", 12 ); - Compute( 12, "*", 12 ); - Compute( 12, "+56", 12 ); - Compute( 12, "/", 0 ); - - return 0; -} - -void Compute( double a, Upp::String arithmeticOperator, double b ) { - double result = 0; - XmlRpcRequest call( "127.0.0.1:1234" ); - if( call("Compute", a, arithmeticOperator, b) >> result ) { - LOG( Upp::Format("%f %s %f = %f", a, arithmeticOperator, b, result) ); - } - else { - LOG( Upp::Format("Error: %s", call.GetError()) ); - } -} diff --git a/upptst/XmlRpcClient/XmlRpcClient.upp b/upptst/XmlRpcClient/XmlRpcClient.upp deleted file mode 100644 index becf6e170..000000000 --- a/upptst/XmlRpcClient/XmlRpcClient.upp +++ /dev/null @@ -1,10 +0,0 @@ -uses - Core, - Core\XmlRpc; - -file - XmlRpcClient.cpp; - -mainconfig - "" = "SSE2"; - diff --git a/upptst/XmlRpcClient/init b/upptst/XmlRpcClient/init deleted file mode 100644 index a2af62db3..000000000 --- a/upptst/XmlRpcClient/init +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef _XmlRpcClient_icpp_init_stub -#define _XmlRpcClient_icpp_init_stub -#include "Core/init" -#include "Core\XmlRpc/init" -#endif diff --git a/upptst/XmlRpcServer/XmlRpcServer.cpp b/upptst/XmlRpcServer/XmlRpcServer.cpp deleted file mode 100644 index 160c5649b..000000000 --- a/upptst/XmlRpcServer/XmlRpcServer.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include -#include - -using namespace Upp; - -XMLRPC_METHOD( Compute ) { - double a, b; - Upp::String arithmeticOperator; - rpc >> a >> arithmeticOperator >> b; - LOG( Upp::Format("Request: %nf %s %nf", a, arithmeticOperator, b) ); - - if( arithmeticOperator.GetCount() == 1 ) { - switch( *arithmeticOperator ) { - case '+': { - rpc << a + b; - break; - } - case '-': { - rpc << a - b; - break; - } - case '/': { - if( b == 0 ) { - rpc << Upp::ErrorValue("division by zero"); - } - else { - rpc << a / b; - } - break; - } - case '*': { - rpc << a * b; - break; - } - } - } - else { - rpc << Upp::ErrorValue("unknown operator"); - } -} - -XMLRPC_METHOD( GetServerTime ) { - LOG( "Request: GetServerTime" ); - rpc << Upp::GetSysTime(); -} - -int main() { - TcpSocket rpc; - int port = 1234; - - if( !rpc.Listen(port,5) ) { - return false; - } - - while( true ) { - if( _kbhit() ) { - if( _getch() == 27 ){ - break; - } - } - - TcpSocket http; - http.Timeout(1000); - if( http.Accept(rpc) ) { - XmlRpcPerform(http,NULL); - } - } - - return 0; -} diff --git a/upptst/XmlRpcServer/XmlRpcServer.upp b/upptst/XmlRpcServer/XmlRpcServer.upp deleted file mode 100644 index 86f715201..000000000 --- a/upptst/XmlRpcServer/XmlRpcServer.upp +++ /dev/null @@ -1,10 +0,0 @@ -uses - Core, - XmlRpc; - -file - XmlRpcServer.cpp; - -mainconfig - "" = "SSE2"; - diff --git a/upptst/XmlRpcServer/init b/upptst/XmlRpcServer/init deleted file mode 100644 index 7ce9c7359..000000000 --- a/upptst/XmlRpcServer/init +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef _XmlRpcServer_icpp_init_stub -#define _XmlRpcServer_icpp_init_stub -#include "Core/init" -#include "XmlRpc/init" -#endif