[7297] Fixed profession spells sorting in trainer spell list at client.
[getmangos.git] / dep / ACE_wrappers / ace / CE_Screen_Output.cpp
blobdfd3d717a1f14fe96f39c8467d624b7527de86cd
1 // $Id: CE_Screen_Output.cpp 80826 2008-03-04 14:51:23Z wotte $
3 #include "ace/CE_Screen_Output.h"
4 #if defined (ACE_HAS_WINCE)
6 #include "ace/Log_Msg.h"
8 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
10 ACE_CE_Screen_Output::ACE_CE_Screen_Output(HWND hEdit)
11 : handler_(hEdit)
12 , pFile_(0)
16 ACE_CE_Screen_Output::ACE_CE_Screen_Output()
17 : handler_(0)
18 , pFile_(0)
22 ACE_CE_Screen_Output::~ACE_CE_Screen_Output()
24 if (pFile_ != 0) {
25 fclose(pFile_);
29 void ACE_CE_Screen_Output::log(ACE_Log_Record &log_record)
31 ACE_TCHAR verbose_msg[ACE_Log_Record::MAXVERBOSELOGMSGLEN];
32 int result = log_record.format_msg (ACE_TEXT("WindozeCE"), // host name
33 0, // verbose flag
34 verbose_msg);
36 if (result == 0)
38 verbose_msg[ ACE_OS::strlen(verbose_msg) - 1 ] = 0; // CE does not like '\n' by itself.
39 *this << verbose_msg << endl;
43 void ACE_CE_Screen_Output::SetOutputWindow(HWND hEdit)
45 handler_ = hEdit;
48 void ACE_CE_Screen_Output::clear()
50 SetWindowText(handler_, 0);
53 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (ACE_TCHAR* output)
55 int length = GetWindowTextLength(handler_);
56 SendMessage(handler_, EM_SETSEL, length, length);
57 SendMessage(handler_, EM_REPLACESEL, 0, (LPARAM)output);
59 if (pFile_ != 0)
61 fwprintf(pFile_, L"%s", output);
64 return *this;
67 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (const ACE_TCHAR* output)
69 ACE_TCHAR* buffer = ACE_OS::strdup(output);
70 if (buffer != 0)
72 *this << buffer;
73 delete buffer;
75 return *this;
78 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (ACE_ANTI_TCHAR* output)
80 *this << ACE_TEXT_CHAR_TO_TCHAR(output);
81 return *this;
84 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (const ACE_ANTI_TCHAR* output)
86 *this << ACE_TEXT_CHAR_TO_TCHAR(output);
87 return *this;
90 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (char output)
92 *this << (int)output;
93 return *this;
96 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (unsigned char output)
98 *this << (int)output;
99 return *this;
102 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (unsigned short output)
104 ACE_TCHAR buffer[20];
105 wsprintf(buffer, ACE_TEXT("%u"), output);
106 *this << buffer;
107 return *this;
110 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (int output)
112 ACE_TCHAR buffer[20];
113 wsprintf(buffer, ACE_TEXT("%d"), output);
114 *this << buffer;
115 return *this;
118 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (unsigned int output)
120 ACE_TCHAR buffer[20];
121 wsprintf(buffer, ACE_TEXT("%du"), output);
122 *this << buffer;
123 return *this;
126 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (float output)
128 ACE_TCHAR buffer[20];
129 swprintf(buffer, ACE_TEXT("%f"), output);
130 *this << buffer;
131 return *this;
134 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (long output)
136 ACE_TCHAR buffer[20];
137 wsprintf(buffer, ACE_TEXT("%l"), output);
138 *this << buffer;
139 return *this;
142 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (unsigned long output)
144 ACE_TCHAR buffer[20];
145 wsprintf(buffer, ACE_TEXT("%lu"), output);
146 *this << buffer;
147 return *this;
150 ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (FILE* pFile)
152 pFile_ = pFile;
153 return *this;
156 ACE_END_VERSIONED_NAMESPACE_DECL
158 #endif // ACE_HAS_WINCE