Changed files to work with wxDataFormat
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,226 +1,121 @@
|
|||||||
\section{\class{wxString}}\label{wxstring}
|
\section{\class{wxString}}\label{wxstring}
|
||||||
|
|
||||||
|
\wxheading{Derived from}
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
|
\wxheading{See also}
|
||||||
|
|
||||||
\overview{Overview}{wxstringoverview}
|
\overview{Overview}{wxstringoverview}
|
||||||
|
|
||||||
\helpref{Member functions by category}{wxstringcategories}
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||||
|
|
||||||
{\bf CAVE:} The description of the memberfunctions is very
|
|
||||||
sparse in the moment. It will be extended in the next
|
|
||||||
version of the help file. The list of memberfunctions
|
|
||||||
is complete.
|
|
||||||
|
|
||||||
\membersection{wxString::wxString}\label{wxstringconstruct}
|
\membersection{wxString::wxString}\label{wxstringconstruct}
|
||||||
|
|
||||||
\func{void}{wxString}{\param{void}{}}\\
|
\func{}{wxString}{\void}
|
||||||
\func{void}{wxString}{\param{const wxString\&}{ x}}\\
|
|
||||||
\func{void}{wxString}{\param{const wxSubString\&}{ x}}\\
|
|
||||||
\func{void}{wxString}{\param{const char*}{ t}}\\
|
|
||||||
\func{void}{wxString}{\param{const char*}{ t}, \param{int}{ len}}\\
|
|
||||||
\func{void}{wxString}{\param{char}{ c}}
|
|
||||||
|
|
||||||
Constructors.
|
Default constructor.
|
||||||
|
|
||||||
|
\func{}{wxString}{\param{const wxString\&}{ x}}
|
||||||
|
|
||||||
|
Copy constructor.
|
||||||
|
|
||||||
|
\func{}{wxString}{\param{char}{ ch}, \param{size\_t}{ n = 1}}
|
||||||
|
|
||||||
|
Constructs a string of {\it n} copies of character {\it ch}.
|
||||||
|
|
||||||
|
\func{}{wxString}{\param{const char*}{ psz}, \param{size\_t}{ nLength = STRING\_MAXLEN}}
|
||||||
|
|
||||||
|
Takes first {\it nLength} characters from the C string {\it psz}.
|
||||||
|
The default value of STRING\_MAXLEN means take all the string.
|
||||||
|
|
||||||
|
\func{}{wxString}{\param{const unsigned char*}{ psz}, \param{size\_t}{ nLength = STRING\_MAXLEN}}
|
||||||
|
|
||||||
|
For compilers using unsigned char: takes first {\it nLength} characters from the C string {\it psz}.
|
||||||
|
The default value of STRING\_MAXLEN means take all the string.
|
||||||
|
|
||||||
|
\func{}{wxString}{\param{const wchar\_t*}{ psz}}
|
||||||
|
|
||||||
|
Constructs a string from the wide (UNICODE) string.
|
||||||
|
|
||||||
\membersection{wxString::\destruct{wxString}}\label{wxstringdestruct}
|
\membersection{wxString::\destruct{wxString}}\label{wxstringdestruct}
|
||||||
|
|
||||||
\func{void}{\destruct{wxString}}{\void}
|
\func{}{\destruct{wxString}}{\void}
|
||||||
|
|
||||||
String destructor.
|
String destructor. Note that this is not virtual, so wxString must not be inherited from.
|
||||||
|
|
||||||
\membersection{wxString::Alloc}\label{wxstringAlloc}
|
\membersection{wxString::Alloc}\label{wxstringAlloc}
|
||||||
|
|
||||||
\func{void}{Alloc}{\param{int}{ newsize}}
|
\func{void}{Alloc}{\param{uint}{ newsize}}
|
||||||
|
|
||||||
Preallocate some space for wxString.
|
Preallocate some space for wxString. Only works if the data of this string is not shared.
|
||||||
|
|
||||||
\membersection{wxString::Allocation}\label{wxstringAllocation}
|
|
||||||
|
|
||||||
\func{int}{Allocation}{\param{void}{}} \param{ const}{}
|
|
||||||
|
|
||||||
Report current allocation (not length!).
|
|
||||||
|
|
||||||
\membersection{wxString::Append}\label{wxstringAppend}
|
\membersection{wxString::Append}\label{wxstringAppend}
|
||||||
|
|
||||||
\func{wxString\&}{Append}{\param{const char*}{ cs}}\\
|
\func{wxString\&}{Append}{\param{const char*}{ psz}}
|
||||||
\func{wxString\&}{Append}{\param{const wxString\&}{ s}}
|
|
||||||
|
|
||||||
Concatenation.
|
Concatenates {\it psz} to this string, returning a reference to it.
|
||||||
|
|
||||||
\func{wxString\&}{Append}{\param{char}{ c}, \param{int}{ rep = 1}}
|
\func{wxString\&}{Append}{\param{char}{ ch}, \param{int}{ count = 1}}
|
||||||
|
|
||||||
Append {\it c}, {\it rep} times
|
Concatenates character {\it ch} to this string, {\it count} times, returning a reference
|
||||||
|
to it.
|
||||||
|
|
||||||
\membersection{wxString::After}\label{wxstringAfter}
|
\membersection{wxString::After}\label{wxstringAfter}
|
||||||
|
|
||||||
\func{wxSubString}{After}{\param{int}{ pos}}\\
|
\constfunc{wxString}{After}{\param{char}{ ch}}
|
||||||
\func{wxSubString}{After}{\param{const wxString\&}{ x}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{After}{\param{const wxSubString\&}{ x}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{After}{\param{const char*}{ t}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{After}{\param{char}{ c}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{After}{\param{const wxRegex\&}{ r}, \param{int}{ startpos = 0}}
|
|
||||||
|
|
||||||
\membersection{wxString::At}\label{wxstringAt}
|
Gets all the characters after the first occurence of {\it ch}.
|
||||||
|
Returns the empty string if {\it ch} is not found.
|
||||||
\func{wxSubString}{At}{\param{int}{ pos}, \param{int}{ len}}\\
|
|
||||||
\func{wxSubString}{operator ()}{\param{int}{ pos}, \param{int}{ len}}\\
|
|
||||||
\func{wxSubString}{At}{\param{const wxString\&}{ x}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{At}{\param{const wxSubString\&}{ x}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{At}{\param{const char*}{ t}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{At}{\param{char}{ c}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{At}{\param{const wxRegex\&}{ r}, \param{int}{ startpos = 0}}
|
|
||||||
|
|
||||||
wxSubString extraction.
|
|
||||||
|
|
||||||
Note that you can't take a substring of a const wxString, since
|
|
||||||
this leaves open the possiblility of indirectly modifying the
|
|
||||||
wxString through the wxSubString.
|
|
||||||
|
|
||||||
\membersection{wxString::Before}\label{wxstringBefore}
|
\membersection{wxString::Before}\label{wxstringBefore}
|
||||||
|
|
||||||
\func{wxSubString}{Before}{\param{int}{ pos}}\\
|
\constfunc{wxString}{Before}{\param{char}{ ch}}
|
||||||
\func{wxSubString}{Before}{\param{const wxString\&}{ x}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{Before}{\param{const wxSubString\&}{ x}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{Before}{\param{const char*}{ t}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{Before}{\param{char}{ c}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxSubString}{Before}{\param{const wxRegex\&}{ r}, \param{int}{ startpos = 0}}
|
|
||||||
|
|
||||||
\membersection{wxString::Capitalize}\label{wxstringCapitalize}
|
Gets all characters before the last occurence of {\it ch}.
|
||||||
|
Returns empty string if {\it ch} is not found.
|
||||||
\func{void}{Capitalize}{\param{void}{}}\\
|
|
||||||
\func{friend wxString}{Capitalize}{\param{wxString\&}{ x}}
|
|
||||||
|
|
||||||
\membersection{wxString::Cat}\label{wxstringCat}
|
|
||||||
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxString\&}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxSubString\&}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const char*}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{char}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxSubString\&}{ a}, \param{const wxString\&}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxSubString\&}{ a}, \param{const wxSubString\&}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxSubString\&}{ a}, \param{const char*}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxSubString\&}{ a}, \param{char}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxString\&}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxSubString\&}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const char*}{ b}, \param{wxString\&}{ c}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{char}{ b}, \param{wxString\&}{ c}}
|
|
||||||
|
|
||||||
Concatenate first two arguments, store the result in the last argument.
|
|
||||||
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxString\&}{ b}, \param{const wxString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxString\&}{ b}, \param{const wxSubString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxString\&}{ b}, \param{const char*}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxString\&}{ b}, \param{char}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxSubString\&}{ b}, \param{const wxString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxSubString\&}{ b}, \param{const wxSubString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxSubString\&}{ b}, \param{const char*}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const wxSubString\&}{ b}, \param{char}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const char*}{ b}, \param{const wxString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const char*}{ b}, \param{const wxSubString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const char*}{ b}, \param{const char*}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const wxString\&}{ a}, \param{const char*}{ b}, \param{char}{ c}, \param{wxString\&}{ d}}
|
|
||||||
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxString\&}{ b}, \param{const wxString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxString\&}{ b}, \param{const wxSubString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxString\&}{ b}, \param{const char*}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxString\&}{ b}, \param{char}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxSubString\&}{ b}, \param{const wxString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxSubString\&}{ b}, \param{const wxSubString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxSubString\&}{ b}, \param{const char*}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const wxSubString\&}{ b}, \param{char}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const char*}{ b}, \param{const wxString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const char*}{ b}, \param{const wxSubString\&}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const char*}{ b}, \param{const char*}{ c}, \param{wxString\&}{ d}}\\
|
|
||||||
\func{friend void}{Cat}{\param{const char*}{ a}, \param{const char*}{ b}, \param{char}{ c}, \param{wxString\&}{ d}}
|
|
||||||
|
|
||||||
Double concatenation, by request. (Yes, there are too many versions,
|
|
||||||
but if one is supported, then the others should be too).
|
|
||||||
Concatenate the first 3 args, store the result in the last argument.
|
|
||||||
|
|
||||||
\membersection{wxString::Chars}\label{wxstringChars}
|
|
||||||
|
|
||||||
\func{const char*}{Chars}{\param{void}{}} \param{ const}{}
|
|
||||||
|
|
||||||
Conversion.
|
|
||||||
|
|
||||||
\membersection{wxString::CompareTo}\label{wxstringCompareTo}
|
\membersection{wxString::CompareTo}\label{wxstringCompareTo}
|
||||||
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
#define NO_POS ((int)(-1)) // undefined position
|
#define NO_POS ((int)(-1)) // undefined position
|
||||||
enum CaseCompare {exact, ignoreCase};
|
enum caseCompare {exact, ignoreCase};
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
\func{int}{CompareTo}{\param{const char*}{ cs}, \param{CaseCompare}{ cmp = exact}} \param{ const}{}\\
|
\constfunc{int}{CompareTo}{\param{const char*}{ psz}, \param{caseCompare}{ cmp = exact}}
|
||||||
\func{int}{CompareTo}{\param{const wxString\&}{ cs}, \param{CaseCompare}{ cmp = exact}} \param{ const}{}
|
|
||||||
|
Case-sensitive comparison. Returns 0 if equal, 1 if greater or -1 if less.
|
||||||
|
|
||||||
\membersection{wxString::Contains}\label{wxstringContains}
|
\membersection{wxString::Contains}\label{wxstringContains}
|
||||||
|
|
||||||
\func{bool}{Contains}{\param{char}{ c}} \param{ const}{}\\
|
\func{bool}{Contains}{\param{const wxString\&}{ str}}
|
||||||
\func{bool}{Contains}{\param{const wxString\&}{ y}} \param{ const}{}\\
|
|
||||||
\func{bool}{Contains}{\param{const wxSubString\&}{ y}} \param{ const}{}\\
|
|
||||||
\func{bool}{Contains}{\param{const char*}{ t}} \param{ const}{}\\
|
|
||||||
\func{bool}{Contains}{\param{const wxRegex\&}{ r}} \param{ const}{}
|
|
||||||
|
|
||||||
Return 1 if target appears anyhere in wxString; else 0.
|
Returns 1 if target appears anyhere in wxString; else 0.
|
||||||
|
|
||||||
\func{bool}{Contains}{\param{const char*}{ pat}, \param{CaseCompare}{ cmp}} \param{ const}{}\\
|
\membersection{wxString::IsEmpty}\label{wxstringisempty}
|
||||||
\func{bool}{Contains}{\param{const wxString\&}{ pat}, \param{CaseCompare}{ cmp}} \param{ const}{}
|
|
||||||
|
|
||||||
Case dependent/independent variation .
|
\constfunc{bool}{IsEmpty}{\void}
|
||||||
|
|
||||||
\func{bool}{Contains}{\param{char}{ c}, \param{int}{ pos}} \param{ const}{}\\
|
\membersection{wxString::First}\label{wxstringfirst}
|
||||||
\func{bool}{Contains}{\param{const wxString\&}{ y}, \param{int}{ pos}} \param{ const}{}\\
|
|
||||||
\func{bool}{Contains}{\param{const wxSubString\&}{ y}, \param{int}{ pos}} \param{ const}{}\\
|
|
||||||
\func{bool}{Contains}{\param{const char*}{ t}, \param{int}{ pos}} \param{ const}{}\\
|
|
||||||
\func{bool}{Contains}{\param{const wxRegex\&}{ r}, \param{int}{ pos}} \param{ const}{}
|
|
||||||
|
|
||||||
Return 1 if the target appears anywhere after position {\it pos} (or
|
\func{size\_t}{First}{\param{char}{ c}}
|
||||||
before, if {\it pos} is negative) in wxString; else 0.
|
|
||||||
|
|
||||||
\membersection{wxString::Copy}\label{wxstringCopy}
|
\constfunc{size\_t}{First}{\param{const char*}{ psz}}
|
||||||
|
|
||||||
\func{wxString}{Copy}{\param{void}{}} \param{ const}{}
|
\constfunc{size\_t}{First}{\param{const wxString\&}{ str}}
|
||||||
|
|
||||||
Duplication.
|
\constfunc{size\_t}{First}{\param{const char}{ ch}}
|
||||||
|
|
||||||
\membersection{wxString::Del}\label{wxstringDel}
|
Returns first occurrence of item.
|
||||||
|
|
||||||
\func{wxString\&}{Del}{\param{int}{ pos}, \param{int}{ len}}
|
|
||||||
|
|
||||||
Delete {\it len} characters starting at {\it pos}.
|
|
||||||
|
|
||||||
\func{wxString\&}{Del}{\param{const wxString\&}{ y}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxString\&}{Del}{\param{const wxSubString\&}{ y}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxString\&}{Del}{\param{const char*}{ t}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxString\&}{Del}{\param{char}{ c}, \param{int}{ startpos = 0}}\\
|
|
||||||
\func{wxString\&}{Del}{\param{const wxRegex\&}{ r}, \param{int}{ startpos = 0}}
|
|
||||||
|
|
||||||
Delete the first occurrence of target after {\it startpos}.
|
|
||||||
|
|
||||||
\membersection{wxString::DownCase}\label{wxstringDownCase}
|
|
||||||
|
|
||||||
\func{void}{Downcase}{\param{void}{}}\\
|
|
||||||
\func{friend wxString}{Downcase}{\param{wxString\&}{ x}}
|
|
||||||
|
|
||||||
\membersection{wxString::Elem}\label{wxstringElem}
|
|
||||||
|
|
||||||
\func{char}{Elem}{\param{int}{ i}} \param{ const}{}
|
|
||||||
|
|
||||||
Element extraction.
|
|
||||||
|
|
||||||
\membersection{wxString::Empty}\label{wxstringEmpty}
|
|
||||||
|
|
||||||
\func{int}{Empty}{\param{void}{}} \param{ const}{}
|
|
||||||
|
|
||||||
\membersection{wxString::Error}\label{wxstringError}
|
|
||||||
|
|
||||||
\func{void}{Error}{\param{const char*}{ msg}} \param{ const}{}
|
|
||||||
|
|
||||||
\membersection{wxString::First}\label{wxstringFirst}
|
|
||||||
|
|
||||||
\func{int}{First}{\param{char}{ c}} \param{ const}{}\\
|
|
||||||
\func{int}{First}{\param{const char*}{ cs}} \param{ const}{}\\
|
|
||||||
\func{int}{First}{\param{const wxString\&}{ cs}} \param{ const}{}
|
|
||||||
|
|
||||||
Return first or last occurrence of item.
|
|
||||||
|
|
||||||
\membersection{wxString::Firstchar}\label{wxstringFirstchar}
|
\membersection{wxString::Firstchar}\label{wxstringFirstchar}
|
||||||
\func{char}{Firstchar}{\param{void}{}} \param{ const}{}
|
\func{char}{Firstchar}{\param{void}{}} \param{ const}{}
|
||||||
|
@@ -48,50 +48,51 @@ class WXDLLEXPORT wxDDEClient;
|
|||||||
class WXDLLEXPORT wxDDEConnection: public wxConnectionBase
|
class WXDLLEXPORT wxDDEConnection: public wxConnectionBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxDDEConnection)
|
DECLARE_DYNAMIC_CLASS(wxDDEConnection)
|
||||||
public:
|
public:
|
||||||
char *buf_ptr;
|
|
||||||
wxString topic_name;
|
|
||||||
int buf_size;
|
|
||||||
wxDDEServer *server;
|
|
||||||
wxDDEClient *client;
|
|
||||||
|
|
||||||
WXHCONV hConv;
|
|
||||||
char *sending_data;
|
|
||||||
int data_size;
|
|
||||||
int data_type;
|
|
||||||
|
|
||||||
wxDDEConnection(char *buffer, int size);
|
wxDDEConnection(char *buffer, int size);
|
||||||
wxDDEConnection(void);
|
wxDDEConnection(void);
|
||||||
~wxDDEConnection(void);
|
~wxDDEConnection(void);
|
||||||
|
|
||||||
// Calls that CLIENT can make
|
// Calls that CLIENT can make
|
||||||
virtual bool Execute(char *data, int size = -1, int format = wxCF_TEXT);
|
virtual bool Execute(char *data, int size = -1, wxDataFormat format = wxDF_TEXT);
|
||||||
virtual bool Execute(const wxString& str) { return Execute((char *)(const char *)str, -1, wxCF_TEXT); }
|
virtual bool Execute(const wxString& str) { return Execute((char *)(const char *)str, -1, wxDF_TEXT); }
|
||||||
virtual char *Request(const wxString& item, int *size = NULL, int format = wxCF_TEXT);
|
virtual char *Request(const wxString& item, int *size = NULL, wxDataFormat format = wxDF_TEXT);
|
||||||
virtual bool Poke(const wxString& item, char *data, int size = -1, int format = wxCF_TEXT);
|
virtual bool Poke(const wxString& item, char *data, int size = -1, wxDataFormat format = wxDF_TEXT);
|
||||||
virtual bool StartAdvise(const wxString& item);
|
virtual bool StartAdvise(const wxString& item);
|
||||||
virtual bool StopAdvise(const wxString& item);
|
virtual bool StopAdvise(const wxString& item);
|
||||||
|
|
||||||
// Calls that SERVER can make
|
// Calls that SERVER can make
|
||||||
virtual bool Advise(const wxString& item, char *data, int size = -1, int format = wxCF_TEXT);
|
virtual bool Advise(const wxString& item, char *data, int size = -1, wxDataFormat format = wxDF_TEXT);
|
||||||
|
|
||||||
// Calls that both can make
|
// Calls that both can make
|
||||||
virtual bool Disconnect(void);
|
virtual bool Disconnect(void);
|
||||||
|
|
||||||
// Callbacks to SERVER - override at will
|
// Callbacks to SERVER - override at will
|
||||||
virtual bool OnExecute(const wxString& topic, char *data, int size, int format) { return FALSE; };
|
virtual bool OnExecute(const wxString& topic, char *data, int size, wxDataFormat format) { return FALSE; };
|
||||||
virtual char *OnRequest(const wxString& topic, const wxString& item, int *size, int format) { return NULL; };
|
virtual char *OnRequest(const wxString& topic, const wxString& item, int *size, wxDataFormat format) { return NULL; };
|
||||||
virtual bool OnPoke(const wxString& topic, const wxString& item, char *data, int size, int format) { return FALSE; };
|
virtual bool OnPoke(const wxString& topic, const wxString& item, char *data, int size, wxDataFormat format) { return FALSE; };
|
||||||
virtual bool OnStartAdvise(const wxString& topic, const wxString& item) { return FALSE; };
|
virtual bool OnStartAdvise(const wxString& topic, const wxString& item) { return FALSE; };
|
||||||
virtual bool OnStopAdvise(const wxString& topic, const wxString& item) { return FALSE; };
|
virtual bool OnStopAdvise(const wxString& topic, const wxString& item) { return FALSE; };
|
||||||
|
|
||||||
// Callbacks to CLIENT - override at will
|
// Callbacks to CLIENT - override at will
|
||||||
virtual bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, int format) { return FALSE; };
|
virtual bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxDataFormat format) { return FALSE; };
|
||||||
|
|
||||||
// Callbacks to BOTH
|
// Callbacks to BOTH
|
||||||
|
|
||||||
// Default behaviour is to delete connection and return TRUE
|
// Default behaviour is to delete connection and return TRUE
|
||||||
virtual bool OnDisconnect(void);
|
virtual bool OnDisconnect(void);
|
||||||
|
|
||||||
|
public:
|
||||||
|
char* m_bufPtr;
|
||||||
|
wxString m_topicName;
|
||||||
|
int m_bufSize;
|
||||||
|
wxDDEServer* m_server;
|
||||||
|
wxDDEClient* m_client;
|
||||||
|
|
||||||
|
WXHCONV m_hConv;
|
||||||
|
char* m_sendingData;
|
||||||
|
int m_dataSize;
|
||||||
|
wxDataFormat m_dataType;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxDDEServer: public wxServerBase
|
class WXDLLEXPORT wxDDEServer: public wxServerBase
|
||||||
@@ -111,13 +112,13 @@ class WXDLLEXPORT wxDDEServer: public wxServerBase
|
|||||||
// Find/delete wxDDEConnection corresponding to the HCONV
|
// Find/delete wxDDEConnection corresponding to the HCONV
|
||||||
wxDDEConnection *FindConnection(WXHCONV conv);
|
wxDDEConnection *FindConnection(WXHCONV conv);
|
||||||
bool DeleteConnection(WXHCONV conv);
|
bool DeleteConnection(WXHCONV conv);
|
||||||
inline wxString& GetServiceName(void) const { return (wxString&) service_name; }
|
inline wxString& GetServiceName(void) const { return (wxString&) m_serviceName; }
|
||||||
inline wxList& GetConnections(void) const { return (wxList&) connections; }
|
inline wxList& GetConnections(void) const { return (wxList&) m_connections; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int lastError;
|
int m_lastError;
|
||||||
wxString service_name;
|
wxString m_serviceName;
|
||||||
wxList connections;
|
wxList m_connections;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxDDEClient: public wxClientBase
|
class WXDLLEXPORT wxDDEClient: public wxClientBase
|
||||||
@@ -138,11 +139,11 @@ class WXDLLEXPORT wxDDEClient: public wxClientBase
|
|||||||
// Find/delete wxDDEConnection corresponding to the HCONV
|
// Find/delete wxDDEConnection corresponding to the HCONV
|
||||||
wxDDEConnection *FindConnection(WXHCONV conv);
|
wxDDEConnection *FindConnection(WXHCONV conv);
|
||||||
bool DeleteConnection(WXHCONV conv);
|
bool DeleteConnection(WXHCONV conv);
|
||||||
inline wxList& GetConnections(void) const { return (wxList&) connections; }
|
inline wxList& GetConnections(void) const { return (wxList&) m_connections; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int lastError;
|
int m_lastError;
|
||||||
wxList connections;
|
wxList m_connections;
|
||||||
};
|
};
|
||||||
|
|
||||||
void WXDLLEXPORT wxDDEInitialize();
|
void WXDLLEXPORT wxDDEInitialize();
|
||||||
|
@@ -90,7 +90,7 @@ public:
|
|||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
virtual wxDataFormat GetPreferredFormat() const
|
virtual wxDataFormat GetPreferredFormat() const
|
||||||
{ return wxDataObject::Text; }
|
{ return (wxDataFormat) wxDataObject::Text; }
|
||||||
virtual bool IsSupportedFormat(wxDataFormat format) const
|
virtual bool IsSupportedFormat(wxDataFormat format) const
|
||||||
{ return format == wxDataObject::Text || format == wxDataObject::Locale; }
|
{ return format == wxDataObject::Text || format == wxDataObject::Locale; }
|
||||||
virtual uint GetDataSize() const
|
virtual uint GetDataSize() const
|
||||||
|
@@ -86,7 +86,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
|
|||||||
{
|
{
|
||||||
switch (dataFormat)
|
switch (dataFormat)
|
||||||
{
|
{
|
||||||
case wxCF_BITMAP:
|
case wxDF_BITMAP:
|
||||||
{
|
{
|
||||||
wxBitmap *wxBM = (wxBitmap *)obj;
|
wxBitmap *wxBM = (wxBitmap *)obj;
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
|
|||||||
return success;
|
return success;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxCF_DIB:
|
case wxDF_DIB:
|
||||||
{
|
{
|
||||||
#if USE_IMAGE_LOADING_IN_MSW
|
#if USE_IMAGE_LOADING_IN_MSW
|
||||||
HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP();
|
HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP();
|
||||||
@@ -132,7 +132,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if USE_METAFILE
|
#if USE_METAFILE
|
||||||
case wxCF_METAFILE:
|
case wxDF_METAFILE:
|
||||||
{
|
{
|
||||||
wxMetaFile *wxMF = (wxMetaFile *)obj;
|
wxMetaFile *wxMF = (wxMetaFile *)obj;
|
||||||
HANDLE data = GlobalAlloc(GHND, sizeof(METAFILEPICT) + 1);
|
HANDLE data = GlobalAlloc(GHND, sizeof(METAFILEPICT) + 1);
|
||||||
@@ -161,9 +161,9 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxCF_OEMTEXT:
|
case wxDF_OEMTEXT:
|
||||||
dataFormat = wxCF_TEXT;
|
dataFormat = wxDF_TEXT;
|
||||||
case wxCF_TEXT:
|
case wxDF_TEXT:
|
||||||
width = strlen((char *)obj) + 1;
|
width = strlen((char *)obj) + 1;
|
||||||
height = 1;
|
height = 1;
|
||||||
default:
|
default:
|
||||||
@@ -203,7 +203,7 @@ wxObject *wxGetClipboardData(int dataFormat, long *len)
|
|||||||
{
|
{
|
||||||
switch (dataFormat)
|
switch (dataFormat)
|
||||||
{
|
{
|
||||||
case wxCF_BITMAP:
|
case wxDF_BITMAP:
|
||||||
{
|
{
|
||||||
BITMAP bm;
|
BITMAP bm;
|
||||||
HBITMAP hBitmap = (HBITMAP) GetClipboardData(CF_BITMAP);
|
HBITMAP hBitmap = (HBITMAP) GetClipboardData(CF_BITMAP);
|
||||||
@@ -248,19 +248,19 @@ wxObject *wxGetClipboardData(int dataFormat, long *len)
|
|||||||
return (wxObject *)wxBM;
|
return (wxObject *)wxBM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxCF_METAFILE:
|
case wxDF_METAFILE:
|
||||||
case CF_SYLK:
|
case CF_SYLK:
|
||||||
case CF_DIF:
|
case CF_DIF:
|
||||||
case CF_TIFF:
|
case CF_TIFF:
|
||||||
case CF_PALETTE:
|
case CF_PALETTE:
|
||||||
case wxCF_DIB:
|
case wxDF_DIB:
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxCF_OEMTEXT:
|
case wxDF_OEMTEXT:
|
||||||
dataFormat = wxCF_TEXT;
|
dataFormat = wxDF_TEXT;
|
||||||
case wxCF_TEXT:
|
case wxDF_TEXT:
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
HANDLE hGlobalMemory = GetClipboardData(dataFormat);
|
HANDLE hGlobalMemory = GetClipboardData(dataFormat);
|
||||||
@@ -342,7 +342,7 @@ wxClipboard::~wxClipboard()
|
|||||||
static int FormatStringToID(char *str)
|
static int FormatStringToID(char *str)
|
||||||
{
|
{
|
||||||
if (!strcmp(str, "TEXT"))
|
if (!strcmp(str, "TEXT"))
|
||||||
return wxCF_TEXT;
|
return wxDF_TEXT;
|
||||||
|
|
||||||
return wxRegisterClipboardFormat(str);
|
return wxRegisterClipboardFormat(str);
|
||||||
}
|
}
|
||||||
@@ -407,7 +407,7 @@ void wxClipboard::SetClipboardString(char *str, long time)
|
|||||||
cbString = str;
|
cbString = str;
|
||||||
|
|
||||||
if (wxOpenClipboard()) {
|
if (wxOpenClipboard()) {
|
||||||
if (!wxSetClipboardData(wxCF_TEXT, (wxObject *)str))
|
if (!wxSetClipboardData(wxDF_TEXT, (wxObject *)str))
|
||||||
got_selection = FALSE;
|
got_selection = FALSE;
|
||||||
else
|
else
|
||||||
got_selection = wxCloseClipboard();
|
got_selection = wxCloseClipboard();
|
||||||
|
@@ -263,7 +263,7 @@ void wxComboBox::Replace(long from, long to, const wxString& value)
|
|||||||
SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0);
|
SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0);
|
||||||
|
|
||||||
// Now replace with 'value', by pasting.
|
// Now replace with 'value', by pasting.
|
||||||
wxSetClipboardData(wxCF_TEXT, (wxObject *)(const char *)value, 0, 0);
|
wxSetClipboardData(wxDF_TEXT, (wxObject *)(const char *)value, 0, 0);
|
||||||
|
|
||||||
// Paste into edit control
|
// Paste into edit control
|
||||||
SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L);
|
SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L);
|
||||||
|
146
src/msw/dde.cpp
146
src/msw/dde.cpp
@@ -188,13 +188,13 @@ static wxDDEServer *DDEFindServer(const wxString& s)
|
|||||||
|
|
||||||
wxDDEServer::wxDDEServer(void)
|
wxDDEServer::wxDDEServer(void)
|
||||||
{
|
{
|
||||||
service_name = "";
|
m_serviceName = "";
|
||||||
wxDDEServerObjects.Append(this);
|
wxDDEServerObjects.Append(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDDEServer::Create(const wxString& server_name)
|
bool wxDDEServer::Create(const wxString& server_name)
|
||||||
{
|
{
|
||||||
service_name = server_name;
|
m_serviceName = server_name;
|
||||||
HSZ serviceName = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)server_name, CP_WINANSI);
|
HSZ serviceName = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)server_name, CP_WINANSI);
|
||||||
|
|
||||||
if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_REGISTER) == 0)
|
if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_REGISTER) == 0)
|
||||||
@@ -207,9 +207,9 @@ bool wxDDEServer::Create(const wxString& server_name)
|
|||||||
|
|
||||||
wxDDEServer::~wxDDEServer(void)
|
wxDDEServer::~wxDDEServer(void)
|
||||||
{
|
{
|
||||||
if (service_name != "")
|
if (m_serviceName != "")
|
||||||
{
|
{
|
||||||
HSZ serviceName = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)service_name, CP_WINANSI);
|
HSZ serviceName = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)m_serviceName, CP_WINANSI);
|
||||||
if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_UNREGISTER) == 0)
|
if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_UNREGISTER) == 0)
|
||||||
{
|
{
|
||||||
DDEPrintError();
|
DDEPrintError();
|
||||||
@@ -217,7 +217,7 @@ wxDDEServer::~wxDDEServer(void)
|
|||||||
}
|
}
|
||||||
wxDDEServerObjects.DeleteObject(this);
|
wxDDEServerObjects.DeleteObject(this);
|
||||||
|
|
||||||
wxNode *node = connections.First();
|
wxNode *node = m_connections.First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
||||||
@@ -227,7 +227,7 @@ wxDDEServer::~wxDDEServer(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If any left after this, delete them
|
// If any left after this, delete them
|
||||||
node = connections.First();
|
node = m_connections.First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
||||||
@@ -244,12 +244,12 @@ wxConnectionBase *wxDDEServer::OnAcceptConnection(const wxString& /* topic */)
|
|||||||
|
|
||||||
wxDDEConnection *wxDDEServer::FindConnection(WXHCONV conv)
|
wxDDEConnection *wxDDEServer::FindConnection(WXHCONV conv)
|
||||||
{
|
{
|
||||||
wxNode *node = connections.First();
|
wxNode *node = m_connections.First();
|
||||||
wxDDEConnection *found = NULL;
|
wxDDEConnection *found = NULL;
|
||||||
while (node && !found)
|
while (node && !found)
|
||||||
{
|
{
|
||||||
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
||||||
if (connection->hConv == conv)
|
if (connection->m_hConv == conv)
|
||||||
found = connection;
|
found = connection;
|
||||||
else node = node->Next();
|
else node = node->Next();
|
||||||
}
|
}
|
||||||
@@ -259,12 +259,12 @@ wxDDEConnection *wxDDEServer::FindConnection(WXHCONV conv)
|
|||||||
// Only delete the entry in the map, not the actual connection
|
// Only delete the entry in the map, not the actual connection
|
||||||
bool wxDDEServer::DeleteConnection(WXHCONV conv)
|
bool wxDDEServer::DeleteConnection(WXHCONV conv)
|
||||||
{
|
{
|
||||||
wxNode *node = connections.First();
|
wxNode *node = m_connections.First();
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
while (node && !found)
|
while (node && !found)
|
||||||
{
|
{
|
||||||
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
||||||
if (connection->hConv == conv)
|
if (connection->m_hConv == conv)
|
||||||
{
|
{
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
delete node;
|
delete node;
|
||||||
@@ -289,12 +289,12 @@ wxDDEClient::wxDDEClient(void)
|
|||||||
wxDDEClient::~wxDDEClient(void)
|
wxDDEClient::~wxDDEClient(void)
|
||||||
{
|
{
|
||||||
wxDDEClientObjects.DeleteObject(this);
|
wxDDEClientObjects.DeleteObject(this);
|
||||||
wxNode *node = connections.First();
|
wxNode *node = m_connections.First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
||||||
delete connection; // Deletes the node implicitly (see ~wxDDEConnection)
|
delete connection; // Deletes the node implicitly (see ~wxDDEConnection)
|
||||||
node = connections.First();
|
node = m_connections.First();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,10 +316,10 @@ wxConnectionBase *wxDDEClient::MakeConnection(const wxString& /* host */, const
|
|||||||
wxDDEConnection *connection = (wxDDEConnection*) OnMakeConnection();
|
wxDDEConnection *connection = (wxDDEConnection*) OnMakeConnection();
|
||||||
if (connection)
|
if (connection)
|
||||||
{
|
{
|
||||||
connection->hConv = (WXHCONV) hConv;
|
connection->m_hConv = (WXHCONV) hConv;
|
||||||
connection->topic_name = topic;
|
connection->m_topicName = topic;
|
||||||
connection->client = this;
|
connection->m_client = this;
|
||||||
connections.Append(connection);
|
m_connections.Append(connection);
|
||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
else return NULL;
|
else return NULL;
|
||||||
@@ -333,12 +333,12 @@ wxConnectionBase *wxDDEClient::OnMakeConnection(void)
|
|||||||
|
|
||||||
wxDDEConnection *wxDDEClient::FindConnection(WXHCONV conv)
|
wxDDEConnection *wxDDEClient::FindConnection(WXHCONV conv)
|
||||||
{
|
{
|
||||||
wxNode *node = connections.First();
|
wxNode *node = m_connections.First();
|
||||||
wxDDEConnection *found = NULL;
|
wxDDEConnection *found = NULL;
|
||||||
while (node && !found)
|
while (node && !found)
|
||||||
{
|
{
|
||||||
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
||||||
if (connection->hConv == conv)
|
if (connection->m_hConv == conv)
|
||||||
found = connection;
|
found = connection;
|
||||||
else node = node->Next();
|
else node = node->Next();
|
||||||
}
|
}
|
||||||
@@ -348,12 +348,12 @@ wxDDEConnection *wxDDEClient::FindConnection(WXHCONV conv)
|
|||||||
// Only delete the entry in the map, not the actual connection
|
// Only delete the entry in the map, not the actual connection
|
||||||
bool wxDDEClient::DeleteConnection(WXHCONV conv)
|
bool wxDDEClient::DeleteConnection(WXHCONV conv)
|
||||||
{
|
{
|
||||||
wxNode *node = connections.First();
|
wxNode *node = m_connections.First();
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
while (node && !found)
|
while (node && !found)
|
||||||
{
|
{
|
||||||
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
wxDDEConnection *connection = (wxDDEConnection *)node->Data();
|
||||||
if (connection->hConv == conv)
|
if (connection->m_hConv == conv)
|
||||||
{
|
{
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
delete node;
|
delete node;
|
||||||
@@ -373,54 +373,54 @@ wxDDEConnection::wxDDEConnection(char *buffer, int size)
|
|||||||
{
|
{
|
||||||
if (DDEDefaultIPCBuffer == NULL)
|
if (DDEDefaultIPCBuffer == NULL)
|
||||||
DDEDefaultIPCBuffer = new char[DDEDefaultIPCBufferSize];
|
DDEDefaultIPCBuffer = new char[DDEDefaultIPCBufferSize];
|
||||||
buf_ptr = DDEDefaultIPCBuffer;
|
m_bufPtr = DDEDefaultIPCBuffer;
|
||||||
buf_size = DDEDefaultIPCBufferSize;
|
m_bufSize = DDEDefaultIPCBufferSize;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf_ptr = buffer;
|
m_bufPtr = buffer;
|
||||||
buf_size = size;
|
m_bufSize = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
topic_name = "";
|
m_topicName = "";
|
||||||
|
|
||||||
client = NULL;
|
m_client = NULL;
|
||||||
server = NULL;
|
m_server = NULL;
|
||||||
|
|
||||||
hConv = 0;
|
m_hConv = 0;
|
||||||
sending_data = NULL;
|
m_sendingData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDDEConnection::wxDDEConnection(void)
|
wxDDEConnection::wxDDEConnection(void)
|
||||||
{
|
{
|
||||||
hConv = 0;
|
m_hConv = 0;
|
||||||
sending_data = NULL;
|
m_sendingData = NULL;
|
||||||
server = NULL;
|
m_server = NULL;
|
||||||
client = NULL;
|
m_client = NULL;
|
||||||
if (DDEDefaultIPCBuffer == NULL)
|
if (DDEDefaultIPCBuffer == NULL)
|
||||||
DDEDefaultIPCBuffer = new char[DDEDefaultIPCBufferSize];
|
DDEDefaultIPCBuffer = new char[DDEDefaultIPCBufferSize];
|
||||||
|
|
||||||
buf_ptr = DDEDefaultIPCBuffer;
|
m_bufPtr = DDEDefaultIPCBuffer;
|
||||||
buf_size = DDEDefaultIPCBufferSize;
|
m_bufSize = DDEDefaultIPCBufferSize;
|
||||||
topic_name = "";
|
m_topicName = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDDEConnection::~wxDDEConnection(void)
|
wxDDEConnection::~wxDDEConnection(void)
|
||||||
{
|
{
|
||||||
if (server)
|
if (m_server)
|
||||||
server->GetConnections().DeleteObject(this);
|
m_server->GetConnections().DeleteObject(this);
|
||||||
else
|
else
|
||||||
client->GetConnections().DeleteObject(this);
|
m_client->GetConnections().DeleteObject(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calls that CLIENT can make
|
// Calls that CLIENT can make
|
||||||
bool wxDDEConnection::Disconnect(void)
|
bool wxDDEConnection::Disconnect(void)
|
||||||
{
|
{
|
||||||
DDEDeleteConnection((HCONV) hConv);
|
DDEDeleteConnection((HCONV) m_hConv);
|
||||||
return (DdeDisconnect((HCONV) hConv) != 0);
|
return (DdeDisconnect((HCONV) m_hConv) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDDEConnection::Execute(char *data, int size, int format)
|
bool wxDDEConnection::Execute(char *data, int size, wxDataFormat format)
|
||||||
{
|
{
|
||||||
DWORD result;
|
DWORD result;
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
@@ -428,31 +428,31 @@ bool wxDDEConnection::Execute(char *data, int size, int format)
|
|||||||
|
|
||||||
size ++;
|
size ++;
|
||||||
|
|
||||||
return (DdeClientTransaction((LPBYTE)data, size, (HCONV) hConv,
|
return (DdeClientTransaction((LPBYTE)data, size, (HCONV) m_hConv,
|
||||||
NULL, format, XTYP_EXECUTE, 5000, &result) ? TRUE : FALSE);
|
NULL, format, XTYP_EXECUTE, 5000, &result) ? TRUE : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *wxDDEConnection::Request(const wxString& item, int *size, int format)
|
char *wxDDEConnection::Request(const wxString& item, int *size, wxDataFormat format)
|
||||||
{
|
{
|
||||||
DWORD result;
|
DWORD result;
|
||||||
HSZ atom = DDEGetAtom(item);
|
HSZ atom = DDEGetAtom(item);
|
||||||
|
|
||||||
HDDEDATA returned_data = DdeClientTransaction(NULL, 0, (HCONV) hConv,
|
HDDEDATA returned_data = DdeClientTransaction(NULL, 0, (HCONV) m_hConv,
|
||||||
atom, format, XTYP_REQUEST, 5000, &result);
|
atom, format, XTYP_REQUEST, 5000, &result);
|
||||||
|
|
||||||
DWORD len = DdeGetData(returned_data, (LPBYTE)(buf_ptr), buf_size, 0);
|
DWORD len = DdeGetData(returned_data, (LPBYTE)(m_bufPtr), m_bufSize, 0);
|
||||||
|
|
||||||
DdeFreeDataHandle(returned_data);
|
DdeFreeDataHandle(returned_data);
|
||||||
|
|
||||||
if (size) *size = (int)len;
|
if (size) *size = (int)len;
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
return buf_ptr;
|
return m_bufPtr;
|
||||||
}
|
}
|
||||||
else return NULL;
|
else return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDDEConnection::Poke(const wxString& item, char *data, int size, int format)
|
bool wxDDEConnection::Poke(const wxString& item, char *data, int size, wxDataFormat format)
|
||||||
{
|
{
|
||||||
DWORD result;
|
DWORD result;
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
@@ -461,7 +461,7 @@ bool wxDDEConnection::Poke(const wxString& item, char *data, int size, int forma
|
|||||||
size ++;
|
size ++;
|
||||||
|
|
||||||
HSZ item_atom = DDEGetAtom(item);
|
HSZ item_atom = DDEGetAtom(item);
|
||||||
return (DdeClientTransaction((LPBYTE)data, size, (HCONV) hConv,
|
return (DdeClientTransaction((LPBYTE)data, size, (HCONV) m_hConv,
|
||||||
item_atom, format, XTYP_POKE, 5000, &result) ? TRUE : FALSE);
|
item_atom, format, XTYP_POKE, 5000, &result) ? TRUE : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ bool wxDDEConnection::StartAdvise(const wxString& item)
|
|||||||
DWORD result;
|
DWORD result;
|
||||||
HSZ atom = DDEGetAtom(item);
|
HSZ atom = DDEGetAtom(item);
|
||||||
|
|
||||||
return (DdeClientTransaction(NULL, 0, (HCONV) hConv,
|
return (DdeClientTransaction(NULL, 0, (HCONV) m_hConv,
|
||||||
atom, CF_TEXT, XTYP_ADVSTART, 5000, &result) ? TRUE : FALSE);
|
atom, CF_TEXT, XTYP_ADVSTART, 5000, &result) ? TRUE : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,12 +479,12 @@ bool wxDDEConnection::StopAdvise(const wxString& item)
|
|||||||
DWORD result;
|
DWORD result;
|
||||||
HSZ atom = DDEGetAtom(item);
|
HSZ atom = DDEGetAtom(item);
|
||||||
|
|
||||||
return (DdeClientTransaction(NULL, 0, (HCONV) hConv,
|
return (DdeClientTransaction(NULL, 0, (HCONV) m_hConv,
|
||||||
atom, CF_TEXT, XTYP_ADVSTOP, 5000, &result) ? TRUE : FALSE);
|
atom, CF_TEXT, XTYP_ADVSTOP, 5000, &result) ? TRUE : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calls that SERVER can make
|
// Calls that SERVER can make
|
||||||
bool wxDDEConnection::Advise(const wxString& item, char *data, int size, int format)
|
bool wxDDEConnection::Advise(const wxString& item, char *data, int size, wxDataFormat format)
|
||||||
{
|
{
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
size = strlen(data);
|
size = strlen(data);
|
||||||
@@ -492,10 +492,10 @@ bool wxDDEConnection::Advise(const wxString& item, char *data, int size, int for
|
|||||||
size ++;
|
size ++;
|
||||||
|
|
||||||
HSZ item_atom = DDEGetAtom(item);
|
HSZ item_atom = DDEGetAtom(item);
|
||||||
HSZ topic_atom = DDEGetAtom(topic_name);
|
HSZ topic_atom = DDEGetAtom(m_topicName);
|
||||||
sending_data = data;
|
m_sendingData = data;
|
||||||
data_size = size;
|
m_dataSize = size;
|
||||||
data_type = format;
|
m_dataType = format;
|
||||||
return (DdePostAdvise(DDEIdInst, topic_atom, item_atom) != 0);
|
return (DdePostAdvise(DDEIdInst, topic_atom, item_atom) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,10 +535,10 @@ DWORD /* lData2 */)
|
|||||||
(wxDDEConnection*) server->OnAcceptConnection(wxString(topic_buf));
|
(wxDDEConnection*) server->OnAcceptConnection(wxString(topic_buf));
|
||||||
if (connection)
|
if (connection)
|
||||||
{
|
{
|
||||||
connection->server = server;
|
connection->m_server = server;
|
||||||
server->GetConnections().Append(connection);
|
server->GetConnections().Append(connection);
|
||||||
connection->hConv = 0;
|
connection->m_hConv = 0;
|
||||||
connection->topic_name = topic_buf;
|
connection->m_topicName = topic_buf;
|
||||||
DDECurrentlyConnecting = connection;
|
DDECurrentlyConnecting = connection;
|
||||||
return (DDERETURN)TRUE;
|
return (DDERETURN)TRUE;
|
||||||
}
|
}
|
||||||
@@ -551,7 +551,7 @@ DWORD /* lData2 */)
|
|||||||
{
|
{
|
||||||
if (DDECurrentlyConnecting)
|
if (DDECurrentlyConnecting)
|
||||||
{
|
{
|
||||||
DDECurrentlyConnecting->hConv = (WXHCONV) hConv;
|
DDECurrentlyConnecting->m_hConv = (WXHCONV) hConv;
|
||||||
DDECurrentlyConnecting = NULL;
|
DDECurrentlyConnecting = NULL;
|
||||||
return (DDERETURN)TRUE;
|
return (DDERETURN)TRUE;
|
||||||
}
|
}
|
||||||
@@ -577,9 +577,9 @@ DWORD /* lData2 */)
|
|||||||
|
|
||||||
if (connection)
|
if (connection)
|
||||||
{
|
{
|
||||||
DWORD len = DdeGetData(hData, (LPBYTE)(connection->buf_ptr), connection->buf_size, 0);
|
DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0);
|
||||||
DdeFreeDataHandle(hData);
|
DdeFreeDataHandle(hData);
|
||||||
if (connection->OnExecute(connection->topic_name, connection->buf_ptr, (int)len, wFmt))
|
if (connection->OnExecute(connection->m_topicName, connection->m_bufPtr, (int)len, (wxDataFormat) wFmt))
|
||||||
return (DDERETURN)DDE_FACK;
|
return (DDERETURN)DDE_FACK;
|
||||||
else
|
else
|
||||||
return (DDERETURN)DDE_FNOTPROCESSED;
|
return (DDERETURN)DDE_FNOTPROCESSED;
|
||||||
@@ -598,7 +598,7 @@ DWORD /* lData2 */)
|
|||||||
CP_WINANSI);
|
CP_WINANSI);
|
||||||
|
|
||||||
int user_size = -1;
|
int user_size = -1;
|
||||||
char *data = connection->OnRequest(connection->topic_name, wxString(item_name), &user_size, wFmt);
|
char *data = connection->OnRequest(connection->m_topicName, wxString(item_name), &user_size, (wxDataFormat) wFmt);
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
if (user_size < 0) user_size = strlen(data);
|
if (user_size < 0) user_size = strlen(data);
|
||||||
@@ -620,9 +620,9 @@ DWORD /* lData2 */)
|
|||||||
char item_name[200];
|
char item_name[200];
|
||||||
DdeQueryString(DDEIdInst, hsz2, (LPSTR)item_name, sizeof(item_name),
|
DdeQueryString(DDEIdInst, hsz2, (LPSTR)item_name, sizeof(item_name),
|
||||||
CP_WINANSI);
|
CP_WINANSI);
|
||||||
DWORD len = DdeGetData(hData, (LPBYTE)(connection->buf_ptr), connection->buf_size, 0);
|
DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0);
|
||||||
DdeFreeDataHandle(hData);
|
DdeFreeDataHandle(hData);
|
||||||
connection->OnPoke(connection->topic_name, wxString(item_name), connection->buf_ptr, (int)len, wFmt);
|
connection->OnPoke(connection->m_topicName, wxString(item_name), connection->m_bufPtr, (int)len, (wxDataFormat) wFmt);
|
||||||
return (DDERETURN)DDE_FACK;
|
return (DDERETURN)DDE_FACK;
|
||||||
} else return (DDERETURN)DDE_FNOTPROCESSED;
|
} else return (DDERETURN)DDE_FNOTPROCESSED;
|
||||||
break;
|
break;
|
||||||
@@ -638,7 +638,7 @@ DWORD /* lData2 */)
|
|||||||
DdeQueryString(DDEIdInst, hsz2, (LPSTR)item_name, sizeof(item_name),
|
DdeQueryString(DDEIdInst, hsz2, (LPSTR)item_name, sizeof(item_name),
|
||||||
CP_WINANSI);
|
CP_WINANSI);
|
||||||
|
|
||||||
return (DDERETURN)connection->OnStartAdvise(connection->topic_name, wxString(item_name));
|
return (DDERETURN)connection->OnStartAdvise(connection->m_topicName, wxString(item_name));
|
||||||
} else return (DDERETURN)0;
|
} else return (DDERETURN)0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -652,7 +652,7 @@ DWORD /* lData2 */)
|
|||||||
char item_name[200];
|
char item_name[200];
|
||||||
DdeQueryString(DDEIdInst, hsz2, (LPSTR)item_name, sizeof(item_name),
|
DdeQueryString(DDEIdInst, hsz2, (LPSTR)item_name, sizeof(item_name),
|
||||||
CP_WINANSI);
|
CP_WINANSI);
|
||||||
return (DDERETURN)connection->OnStopAdvise(connection->topic_name, wxString(item_name));
|
return (DDERETURN)connection->OnStopAdvise(connection->m_topicName, wxString(item_name));
|
||||||
} else return (DDERETURN)0;
|
} else return (DDERETURN)0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -661,12 +661,12 @@ DWORD /* lData2 */)
|
|||||||
{
|
{
|
||||||
wxDDEConnection *connection = DDEFindConnection(hConv);
|
wxDDEConnection *connection = DDEFindConnection(hConv);
|
||||||
|
|
||||||
if (connection && connection->sending_data)
|
if (connection && connection->m_sendingData)
|
||||||
{
|
{
|
||||||
HDDEDATA data = DdeCreateDataHandle(DDEIdInst,
|
HDDEDATA data = DdeCreateDataHandle(DDEIdInst,
|
||||||
(LPBYTE)connection->sending_data,
|
(LPBYTE)connection->m_sendingData,
|
||||||
connection->data_size, 0, hsz2, connection->data_type, 0);
|
connection->m_dataSize, 0, hsz2, connection->m_dataType, 0);
|
||||||
connection->sending_data = NULL;
|
connection->m_sendingData = NULL;
|
||||||
return (DDERETURN)data;
|
return (DDERETURN)data;
|
||||||
} else return (DDERETURN)NULL;
|
} else return (DDERETURN)NULL;
|
||||||
break;
|
break;
|
||||||
@@ -682,9 +682,9 @@ DWORD /* lData2 */)
|
|||||||
DdeQueryString(DDEIdInst, hsz2, (LPSTR)item_name, sizeof(item_name),
|
DdeQueryString(DDEIdInst, hsz2, (LPSTR)item_name, sizeof(item_name),
|
||||||
CP_WINANSI);
|
CP_WINANSI);
|
||||||
|
|
||||||
DWORD len = DdeGetData(hData, (LPBYTE)(connection->buf_ptr), connection->buf_size, 0);
|
DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0);
|
||||||
DdeFreeDataHandle(hData);
|
DdeFreeDataHandle(hData);
|
||||||
if (connection->OnAdvise(connection->topic_name, wxString(item_name), connection->buf_ptr, (int)len, wFmt))
|
if (connection->OnAdvise(connection->m_topicName, wxString(item_name), connection->m_bufPtr, (int)len, (wxDataFormat) wFmt))
|
||||||
return (DDERETURN)DDE_FACK;
|
return (DDERETURN)DDE_FACK;
|
||||||
else
|
else
|
||||||
return (DDERETURN)DDE_FNOTPROCESSED;
|
return (DDERETURN)DDE_FNOTPROCESSED;
|
||||||
|
@@ -73,7 +73,7 @@ bool wxMetaFile::SetClipboard(int width, int height)
|
|||||||
wxOpenClipboard();
|
wxOpenClipboard();
|
||||||
if (!wxEmptyClipboard()) return FALSE;
|
if (!wxEmptyClipboard()) return FALSE;
|
||||||
}
|
}
|
||||||
bool success = wxSetClipboardData(wxCF_METAFILE,this, width,height);
|
bool success = wxSetClipboardData(wxDF_METAFILE,this, width,height);
|
||||||
if (!alreadyOpen) wxCloseClipboard();
|
if (!alreadyOpen) wxCloseClipboard();
|
||||||
return (bool) success;
|
return (bool) success;
|
||||||
}
|
}
|
||||||
|
@@ -280,14 +280,14 @@ STDMETHODIMP wxIDataObject::QueryGetData(FORMATETC *pformatetc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// and now check the type of data requested
|
// and now check the type of data requested
|
||||||
if ( m_pDataObject->IsSupportedFormat(pformatetc->cfFormat) ) {
|
if ( m_pDataObject->IsSupportedFormat((wxDataFormat) pformatetc->cfFormat) ) {
|
||||||
wxLogTrace("wxIDataObject::QueryGetData: %s ok",
|
wxLogTrace("wxIDataObject::QueryGetData: %s ok",
|
||||||
wxDataObject::GetFormatName(pformatetc->cfFormat));
|
wxDataObject::GetFormatName((wxDataFormat) pformatetc->cfFormat));
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
wxLogTrace("wxIDataObject::QueryGetData: %s unsupported",
|
wxLogTrace("wxIDataObject::QueryGetData: %s unsupported",
|
||||||
wxDataObject::GetFormatName(pformatetc->cfFormat));
|
wxDataObject::GetFormatName((wxDataFormat) pformatetc->cfFormat));
|
||||||
return DV_E_FORMATETC;
|
return DV_E_FORMATETC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -108,7 +108,7 @@ wxIDropTarget::wxIDropTarget(wxDropTarget *pTarget)
|
|||||||
{
|
{
|
||||||
m_cRef = 0;
|
m_cRef = 0;
|
||||||
m_pTarget = pTarget;
|
m_pTarget = pTarget;
|
||||||
m_cfFormat = 0;
|
m_cfFormat = (wxDataFormat) 0;
|
||||||
m_pIDataObject = NULL;
|
m_pIDataObject = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ bool wxDropTarget::IsAcceptedData(IDataObject *pIDataSource) const
|
|||||||
// means) for file drag and drop
|
// means) for file drag and drop
|
||||||
if ( pIDataSource->QueryGetData(&s_fmtMemory) == S_OK ) {
|
if ( pIDataSource->QueryGetData(&s_fmtMemory) == S_OK ) {
|
||||||
// remember this format: we'll later ask for data in it
|
// remember this format: we'll later ask for data in it
|
||||||
m_pIDropTarget->SetSupportedFormat(s_fmtMemory.cfFormat);
|
m_pIDropTarget->SetSupportedFormat((wxDataFormat) s_fmtMemory.cfFormat);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -354,7 +354,7 @@ size_t wxTextDropTarget::GetFormatCount() const
|
|||||||
|
|
||||||
wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
||||||
{
|
{
|
||||||
return CF_TEXT;
|
return wxDF_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -409,10 +409,10 @@ size_t wxFileDropTarget::GetFormatCount() const
|
|||||||
wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
||||||
{
|
{
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
return CF_HDROP;
|
return wxDF_FILENAME;
|
||||||
#else
|
#else
|
||||||
// TODO: how to implement this in WIN16?
|
// TODO: how to implement this in WIN16?
|
||||||
return CF_TEXT;
|
return wxDF_TEXT;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -455,7 +455,7 @@ void wxTextCtrl::Replace(long from, long to, const wxString& value)
|
|||||||
SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0);
|
SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0);
|
||||||
|
|
||||||
// Now replace with 'value', by pasting.
|
// Now replace with 'value', by pasting.
|
||||||
wxSetClipboardData(wxCF_TEXT, (wxObject *) (const char *)value, 0, 0);
|
wxSetClipboardData(wxDF_TEXT, (wxObject *) (const char *)value, 0, 0);
|
||||||
|
|
||||||
// Paste into edit control
|
// Paste into edit control
|
||||||
SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L);
|
SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L);
|
||||||
|
@@ -29,6 +29,7 @@ LIBTARGET=$(PROPDIR)\lib\wxprop.lib
|
|||||||
|
|
||||||
all: $(LIBTARGET)
|
all: $(LIBTARGET)
|
||||||
|
|
||||||
|
|
||||||
$(PROGRAM): $(PROGRAM).exe
|
$(PROGRAM): $(PROGRAM).exe
|
||||||
|
|
||||||
wx:
|
wx:
|
||||||
|
Reference in New Issue
Block a user