1 // Scintilla source code edit control
2 // PlatWX.cxx - implementation of platform facilities on wxWindows
3 // Copyright 1998-1999 by Neil Hodgson <neilh@scintilla.org>
4 // Robin Dunn <robin@aldunn.com>
5 // The License.txt file describes the conditions under which this software may be distributed.
10 #include <wx/encconv.h>
15 #include "wx/stc/stc.h"
23 Point
Point::FromLong(long lpoint
) {
24 return Point(lpoint
& 0xFFFF, lpoint
>> 16);
27 wxRect
wxRectFromPRectangle(PRectangle prc
) {
28 wxRect
rc(prc
.left
, prc
.top
,
29 prc
.right
-prc
.left
, prc
.bottom
-prc
.top
);
33 PRectangle
PRectangleFromwxRect(wxRect rc
) {
34 return PRectangle(rc
.GetLeft(), rc
.GetTop(),
35 rc
.GetRight()+1, rc
.GetBottom()+1);
38 wxColour
wxColourFromCA(const ColourAllocated
& ca
) {
39 ColourDesired
cd(ca
.AsLong());
40 return wxColour(cd
.GetRed(), cd
.GetGreen(), cd
.GetBlue());
43 //----------------------------------------------------------------------
47 allowRealization
= false;
54 void Palette::Release() {
58 // This method either adds a colour to the list of wanted colours (want==true)
59 // or retrieves the allocated colour back to the ColourPair.
60 // This is one method to make it easier to keep the code for wanting and retrieving in sync.
61 void Palette::WantFind(ColourPair
&cp
, bool want
) {
63 for (int i
=0; i
< used
; i
++) {
64 if (entries
[i
].desired
== cp
.desired
)
68 if (used
< numEntries
) {
69 entries
[used
].desired
= cp
.desired
;
70 entries
[used
].allocated
.Set(cp
.desired
.AsLong());
74 for (int i
=0; i
< used
; i
++) {
75 if (entries
[i
].desired
== cp
.desired
) {
76 cp
.allocated
= entries
[i
].allocated
;
80 cp
.allocated
.Set(cp
.desired
.AsLong());
84 void Palette::Allocate(Window
&) {
85 if (allowRealization
) {
90 //----------------------------------------------------------------------
100 void Font::Create(const char *faceName
, int characterSet
, int size
, bool bold
, bool italic
) {
101 wxFontEncoding encoding
;
105 switch (characterSet
) {
107 case wxSTC_CHARSET_ANSI
:
108 case wxSTC_CHARSET_DEFAULT
:
109 encoding
= wxFONTENCODING_DEFAULT
;
112 case wxSTC_CHARSET_BALTIC
:
113 encoding
= wxFONTENCODING_ISO8859_13
;
116 case wxSTC_CHARSET_CHINESEBIG5
:
117 encoding
= wxFONTENCODING_CP950
;
120 case wxSTC_CHARSET_EASTEUROPE
:
121 encoding
= wxFONTENCODING_ISO8859_2
;
124 case wxSTC_CHARSET_GB2312
:
125 encoding
= wxFONTENCODING_CP936
;
128 case wxSTC_CHARSET_GREEK
:
129 encoding
= wxFONTENCODING_ISO8859_7
;
132 case wxSTC_CHARSET_HANGUL
:
133 encoding
= wxFONTENCODING_CP949
;
136 case wxSTC_CHARSET_MAC
:
137 encoding
= wxFONTENCODING_DEFAULT
;
140 case wxSTC_CHARSET_OEM
:
141 encoding
= wxFONTENCODING_DEFAULT
;
144 case wxSTC_CHARSET_RUSSIAN
:
145 encoding
= wxFONTENCODING_KOI8
;
148 case wxSTC_CHARSET_SHIFTJIS
:
149 encoding
= wxFONTENCODING_CP932
;
152 case wxSTC_CHARSET_SYMBOL
:
153 encoding
= wxFONTENCODING_DEFAULT
;
156 case wxSTC_CHARSET_TURKISH
:
157 encoding
= wxFONTENCODING_ISO8859_9
;
160 case wxSTC_CHARSET_JOHAB
:
161 encoding
= wxFONTENCODING_DEFAULT
;
164 case wxSTC_CHARSET_HEBREW
:
165 encoding
= wxFONTENCODING_ISO8859_8
;
168 case wxSTC_CHARSET_ARABIC
:
169 encoding
= wxFONTENCODING_ISO8859_6
;
172 case wxSTC_CHARSET_VIETNAMESE
:
173 encoding
= wxFONTENCODING_DEFAULT
;
176 case wxSTC_CHARSET_THAI
:
177 encoding
= wxFONTENCODING_ISO8859_11
;
181 wxFontEncodingArray ea
= wxEncodingConverter::GetPlatformEquivalents(encoding
);
185 id
= new wxFont(size
,
187 italic
? wxITALIC
: wxNORMAL
,
188 bold
? wxBOLD
: wxNORMAL
,
190 wxString(faceName
, wxConvUTF8
),
195 void Font::Release() {
201 //----------------------------------------------------------------------
203 class SurfaceImpl
: public Surface
{
217 void Init(SurfaceID sid
);
218 void InitPixMap(int width
, int height
, Surface
*surface_
);
222 void PenColour(ColourAllocated fore
);
224 int DeviceHeightFont(int points
);
225 void MoveTo(int x_
, int y_
);
226 void LineTo(int x_
, int y_
);
227 void Polygon(Point
*pts
, int npts
, ColourAllocated fore
, ColourAllocated back
);
228 void RectangleDraw(PRectangle rc
, ColourAllocated fore
, ColourAllocated back
);
229 void FillRectangle(PRectangle rc
, ColourAllocated back
);
230 void FillRectangle(PRectangle rc
, Surface
&surfacePattern
);
231 void RoundedRectangle(PRectangle rc
, ColourAllocated fore
, ColourAllocated back
);
232 void Ellipse(PRectangle rc
, ColourAllocated fore
, ColourAllocated back
);
233 void Copy(PRectangle rc
, Point from
, Surface
&surfaceSource
);
235 void DrawTextNoClip(PRectangle rc
, Font
&font_
, int ybase
, const char *s
, int len
, ColourAllocated fore
, ColourAllocated back
);
236 void DrawTextClipped(PRectangle rc
, Font
&font_
, int ybase
, const char *s
, int len
, ColourAllocated fore
, ColourAllocated back
);
237 void MeasureWidths(Font
&font_
, const char *s
, int len
, int *positions
);
238 int WidthText(Font
&font_
, const char *s
, int len
);
239 int WidthChar(Font
&font_
, char ch
);
240 int Ascent(Font
&font_
);
241 int Descent(Font
&font_
);
242 int InternalLeading(Font
&font_
);
243 int ExternalLeading(Font
&font_
);
244 int Height(Font
&font_
);
245 int AverageCharWidth(Font
&font_
);
247 int SetPalette(Palette
*pal
, bool inBackGround
);
248 void SetClip(PRectangle rc
);
249 void FlushCachedState();
251 void SetUnicodeMode(bool unicodeMode_
);
253 void BrushColour(ColourAllocated back
);
254 void SetFont(Font
&font_
);
259 SurfaceImpl::SurfaceImpl() :
260 hdc(0), hdcOwned(0), bitmap(0),
261 x(0), y(0), unicodeMode(0)
264 SurfaceImpl::~SurfaceImpl() {
268 void SurfaceImpl::Release() {
270 ((wxMemoryDC
*)hdc
)->SelectObject(wxNullBitmap
);
282 bool SurfaceImpl::Initialised() {
286 void SurfaceImpl::Init() {
288 hdc
= new wxMemoryDC();
292 void SurfaceImpl::Init(SurfaceID hdc_
) {
297 void SurfaceImpl::InitPixMap(int width
, int height
, Surface
*surface_
) {
299 hdc
= new wxMemoryDC();
301 if (width
< 1) width
= 1;
302 if (height
< 1) height
= 1;
303 bitmap
= new wxBitmap(width
, height
);
304 ((wxMemoryDC
*)hdc
)->SelectObject(*bitmap
);
307 void SurfaceImpl::PenColour(ColourAllocated fore
) {
308 hdc
->SetPen(wxPen(wxColourFromCA(fore
), 1, wxSOLID
));
311 void SurfaceImpl::BrushColour(ColourAllocated back
) {
312 hdc
->SetBrush(wxBrush(wxColourFromCA(back
), wxSOLID
));
315 void SurfaceImpl::SetFont(Font
&font_
) {
317 hdc
->SetFont(*((wxFont
*)font_
.GetID()));
321 int SurfaceImpl::LogPixelsY() {
322 return hdc
->GetPPI().y
;
325 int SurfaceImpl::DeviceHeightFont(int points
) {
329 void SurfaceImpl::MoveTo(int x_
, int y_
) {
334 void SurfaceImpl::LineTo(int x_
, int y_
) {
335 hdc
->DrawLine(x
,y
, x_
,y_
);
340 void SurfaceImpl::Polygon(Point
*pts
, int npts
, ColourAllocated fore
, ColourAllocated back
) {
343 hdc
->DrawPolygon(npts
, (wxPoint
*)pts
);
346 void SurfaceImpl::RectangleDraw(PRectangle rc
, ColourAllocated fore
, ColourAllocated back
) {
349 hdc
->DrawRectangle(wxRectFromPRectangle(rc
));
352 void SurfaceImpl::FillRectangle(PRectangle rc
, ColourAllocated back
) {
354 hdc
->SetPen(*wxTRANSPARENT_PEN
);
355 hdc
->DrawRectangle(wxRectFromPRectangle(rc
));
358 void SurfaceImpl::FillRectangle(PRectangle rc
, Surface
&surfacePattern
) {
360 if (((SurfaceImpl
&)surfacePattern
).bitmap
)
361 br
= wxBrush(*((SurfaceImpl
&)surfacePattern
).bitmap
);
362 else // Something is wrong so display in red
363 br
= wxBrush(*wxRED
, wxSOLID
);
364 hdc
->SetPen(*wxTRANSPARENT_PEN
);
366 hdc
->DrawRectangle(wxRectFromPRectangle(rc
));
369 void SurfaceImpl::RoundedRectangle(PRectangle rc
, ColourAllocated fore
, ColourAllocated back
) {
372 hdc
->DrawRoundedRectangle(wxRectFromPRectangle(rc
), 4);
375 void SurfaceImpl::Ellipse(PRectangle rc
, ColourAllocated fore
, ColourAllocated back
) {
378 hdc
->DrawEllipse(wxRectFromPRectangle(rc
));
381 void SurfaceImpl::Copy(PRectangle rc
, Point from
, Surface
&surfaceSource
) {
382 wxRect r
= wxRectFromPRectangle(rc
);
383 hdc
->Blit(r
.x
, r
.y
, r
.width
, r
.height
,
384 ((SurfaceImpl
&)surfaceSource
).hdc
,
385 from
.x
, from
.y
, wxCOPY
);
388 void SurfaceImpl::DrawTextNoClip(PRectangle rc
, Font
&font
, int ybase
,
389 const char *s
, int len
,
390 ColourAllocated fore
, ColourAllocated back
) {
392 hdc
->SetTextForeground(wxColourFromCA(fore
));
393 hdc
->SetTextBackground(wxColourFromCA(back
));
394 FillRectangle(rc
, back
);
396 // will convert from UTF-8 in unicode mode
397 wxString
str(s
, wxConvUTF8
, len
);
399 // ybase is where the baseline should be, but wxWin uses the upper left
400 // corner, so I need to calculate the real position for the text...
401 hdc
->DrawText(str
, rc
.left
, ybase
- font
.ascent
);
404 void SurfaceImpl::DrawTextClipped(PRectangle rc
, Font
&font
, int ybase
,
405 const char *s
, int len
,
406 ColourAllocated fore
, ColourAllocated back
) {
408 hdc
->SetTextForeground(wxColourFromCA(fore
));
409 hdc
->SetTextBackground(wxColourFromCA(back
));
410 FillRectangle(rc
, back
);
411 hdc
->SetClippingRegion(wxRectFromPRectangle(rc
));
413 // will convert from UTF-8 in unicode mode
414 wxString
str(s
, wxConvUTF8
, len
);
416 // see comments above
417 hdc
->DrawText(str
, rc
.left
, ybase
- font
.ascent
);
418 hdc
->DestroyClippingRegion();
421 int SurfaceImpl::WidthText(Font
&font
, const char *s
, int len
) {
426 // will convert from UTF-8 in unicode mode
427 wxString
str(s
, wxConvUTF8
, len
);
429 hdc
->GetTextExtent(str
, &w
, &h
);
434 void SurfaceImpl::MeasureWidths(Font
&font
, const char *s
, int len
, int *positions
) {
435 // will convert from UTF-8 in unicode mode
436 wxString
str(s
, wxConvUTF8
, len
);
439 // Calculate the position of each character based on the widths of
440 // the previous characters
441 int* tpos
= new int[len
];
444 for (i
=0; i
<str
.Length(); i
++) {
446 hdc
->GetTextExtent(str
[i
], &w
, &h
);
448 tpos
[i
] = totalWidth
;
452 // Map the widths for UCS-2 characters back to the UTF-8 input string
456 unsigned char uch
= (unsigned char)s
[i
];
457 positions
[i
++] = tpos
[ui
];
459 if (uch
< (0x80 + 0x40 + 0x20)) {
460 positions
[i
++] = tpos
[ui
];
462 positions
[i
++] = tpos
[ui
];
463 positions
[i
++] = tpos
[ui
];
470 // If not unicode then just use the widths we have
471 memcpy(positions
, tpos
, len
* sizeof(*tpos
));
478 int SurfaceImpl::WidthChar(Font
&font
, char ch
) {
482 char s
[2] = { ch
, 0 };
484 // will convert from UTF-8 in unicode mode
485 wxString
str(s
, wxConvUTF8
, 1);
486 hdc
->GetTextExtent(str
, &w
, &h
);
490 #define EXTENT_TEST wxT(" `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
492 int SurfaceImpl::Ascent(Font
&font
) {
495 hdc
->GetTextExtent(EXTENT_TEST
, &w
, &h
, &d
, &e
);
500 int SurfaceImpl::Descent(Font
&font
) {
503 hdc
->GetTextExtent(EXTENT_TEST
, &w
, &h
, &d
, &e
);
507 int SurfaceImpl::InternalLeading(Font
&font
) {
511 int SurfaceImpl::ExternalLeading(Font
&font
) {
514 hdc
->GetTextExtent(EXTENT_TEST
, &w
, &h
, &d
, &e
);
518 int SurfaceImpl::Height(Font
&font
) {
520 return hdc
->GetCharHeight();
523 int SurfaceImpl::AverageCharWidth(Font
&font
) {
525 return hdc
->GetCharWidth();
528 int SurfaceImpl::SetPalette(Palette
*pal
, bool inBackGround
) {
532 void SurfaceImpl::SetClip(PRectangle rc
) {
533 hdc
->SetClippingRegion(wxRectFromPRectangle(rc
));
536 void SurfaceImpl::FlushCachedState() {
539 void SurfaceImpl::SetUnicodeMode(bool unicodeMode_
) {
540 unicodeMode
=unicodeMode_
;
542 wxASSERT_MSG(unicodeMode
== wxUSE_UNICODE
,
543 wxT("Only unicode may be used when wxUSE_UNICODE is on."));
545 wxASSERT_MSG(unicodeMode
== wxUSE_UNICODE
,
546 wxT("Only non-unicode may be used when wxUSE_UNICODE is off."));
550 Surface
*Surface::Allocate() {
551 return new SurfaceImpl
;
555 //----------------------------------------------------------------------
558 inline wxWindow
* GETWIN(WindowID id
) { return (wxWindow
*)id
; }
563 void Window::Destroy() {
565 GETWIN(id
)->Destroy();
569 bool Window::HasFocus() {
570 return wxWindow::FindFocus() == GETWIN(id
);
573 PRectangle
Window::GetPosition() {
574 wxRect
rc(GETWIN(id
)->GetPosition(), GETWIN(id
)->GetSize());
575 return PRectangleFromwxRect(rc
);
578 void Window::SetPosition(PRectangle rc
) {
579 wxRect r
= wxRectFromPRectangle(rc
);
580 GETWIN(id
)->SetSize(r
);
583 void Window::SetPositionRelative(PRectangle rc
, Window
) {
584 SetPosition(rc
); // ????
587 PRectangle
Window::GetClientPosition() {
588 wxSize sz
= GETWIN(id
)->GetClientSize();
589 return PRectangle(0, 0, sz
.x
, sz
.y
);
592 void Window::Show(bool show
) {
593 GETWIN(id
)->Show(show
);
596 void Window::InvalidateAll() {
597 GETWIN(id
)->Refresh(false);
601 void Window::InvalidateRectangle(PRectangle rc
) {
602 wxRect r
= wxRectFromPRectangle(rc
);
603 GETWIN(id
)->Refresh(false, &r
);
607 void Window::SetFont(Font
&font
) {
608 GETWIN(id
)->SetFont(*((wxFont
*)font
.GetID()));
611 void Window::SetCursor(Cursor curs
) {
616 cursorId
= wxCURSOR_IBEAM
;
619 cursorId
= wxCURSOR_ARROW
;
622 cursorId
= wxCURSOR_ARROW
; // ** no up arrow... wxCURSOR_UPARROW;
625 cursorId
= wxCURSOR_WAIT
;
628 cursorId
= wxCURSOR_SIZEWE
;
631 cursorId
= wxCURSOR_SIZENS
;
633 case cursorReverseArrow
:
634 cursorId
= wxCURSOR_RIGHT_ARROW
;
637 cursorId
= wxCURSOR_ARROW
;
641 GETWIN(id
)->SetCursor(wxCursor(cursorId
));
645 void Window::SetTitle(const char *s
) {
646 // will convert from UTF-8 in unicode mode
647 wxString
str(s
, wxConvUTF8
);
648 GETWIN(id
)->SetTitle(str
);
652 //----------------------------------------------------------------------
653 // Helper classes for ListBox
655 // A wxListBox that gives focus back to its parent if it gets it.
656 class wxSTCListBox
: public wxListBox
{
658 wxSTCListBox(wxWindow
* parent
, wxWindowID id
)
659 : wxListBox(parent
, id
, wxDefaultPosition
, wxDefaultSize
,
660 0, NULL
, wxLB_SINGLE
| wxSIMPLE_BORDER
)
663 void OnFocus(wxFocusEvent
& event
) {
664 GetParent()->SetFocus();
669 DECLARE_EVENT_TABLE()
672 BEGIN_EVENT_TABLE(wxSTCListBox
, wxListBox
)
673 EVT_SET_FOCUS(wxSTCListBox::OnFocus
)
676 #undef wxSTC_USE_POPUP
677 #define wxSTC_USE_POPUP 0 // Leave it off for this one...
680 // A window to place the listbox upon. If wxPopupWindow is supported then
681 // that will be used so the listbox can extend beyond the client area of the
683 #if wxUSE_POPUPWIN && wxSTC_USE_POPUP
684 #include <wx/popupwin.h>
685 #define wxSTCListBoxWinBase wxPopupWindow
686 #define param2 wxBORDER_NONE // popup's 2nd param is flags
688 #define wxSTCListBoxWinBase wxWindow
689 #define param2 -1 // wxWindow's 2nd param is ID
692 class wxSTCListBoxWin
: public wxSTCListBoxWinBase
{
694 wxSTCListBoxWin(wxWindow
* parent
, wxWindowID id
)
695 : wxSTCListBoxWinBase(parent
, param2
) {
696 lb
= new wxSTCListBox(this, id
);
697 lb
->SetCursor(wxCursor(wxCURSOR_ARROW
));
700 void OnSize(wxSizeEvent
& event
) {
701 lb
->SetSize(GetSize());
703 void OnFocus(wxFocusEvent
& event
) {
704 GetParent()->SetFocus();
708 wxListBox
* GetLB() { return lb
; }
710 #if wxUSE_POPUPWIN && wxSTC_USE_POPUP
711 virtual void DoSetSize(int x
, int y
,
712 int width
, int height
,
713 int sizeFlags
= wxSIZE_AUTO
) {
715 GetParent()->ClientToScreen(&x
, NULL
);
717 GetParent()->ClientToScreen(NULL
, &y
);
718 wxSTCListBoxWinBase::DoSetSize(x
, y
, width
, height
, sizeFlags
);
724 DECLARE_EVENT_TABLE()
727 BEGIN_EVENT_TABLE(wxSTCListBoxWin
, wxSTCListBoxWinBase
)
728 EVT_SIZE (wxSTCListBoxWin::OnSize
)
729 EVT_SET_FOCUS (wxSTCListBoxWin::OnFocus
)
733 inline wxListBox
* GETLB(WindowID win
) {
734 return (((wxSTCListBoxWin
*)win
)->GetLB());
737 //----------------------------------------------------------------------
742 ListBox::~ListBox() {
745 void ListBox::Create(Window
&parent
, int ctrlID
) {
746 id
= new wxSTCListBoxWin(GETWIN(parent
.GetID()), ctrlID
);
749 void ListBox::SetVisibleRows(int rows
) {
750 desiredVisibleRows
= rows
;
753 PRectangle
ListBox::GetDesiredRect() {
754 wxSize sz
= GETLB(id
)->GetBestSize();
760 if (sz
.y
> 140) // TODO: Use desiredVisibleRows??
767 void ListBox::SetAverageCharWidth(int width
) {
768 aveCharWidth
= width
;
771 void ListBox::SetFont(Font
&font
) {
772 GETLB(id
)->SetFont(*((wxFont
*)font
.GetID()));
775 void ListBox::Clear() {
779 void ListBox::Append(char *s
) {
780 GETLB(id
)->Append(s
);
783 int ListBox::Length() {
784 return GETLB(id
)->GetCount();
787 void ListBox::Select(int n
) {
788 GETLB(id
)->SetSelection(n
);
794 GETLB(id
)->SetFirstItem(n
);
798 int ListBox::GetSelection() {
799 return GETLB(id
)->GetSelection();
802 int ListBox::Find(const char *prefix
) {
807 void ListBox::GetValue(int n
, char *value
, int len
) {
808 wxString text
= GETLB(id
)->GetString(n
);
809 strncpy(value
, text
.mb_str(wxConvUTF8
), len
);
813 void ListBox::Sort() {
816 //----------------------------------------------------------------------
818 Menu::Menu() : id(0) {
821 void Menu::CreatePopUp() {
826 void Menu::Destroy() {
832 void Menu::Show(Point pt
, Window
&w
) {
833 GETWIN(w
.GetID())->PopupMenu((wxMenu
*)id
, pt
.x
- 4, pt
.y
);
837 //----------------------------------------------------------------------
839 ColourDesired
Platform::Chrome() {
841 c
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
842 return ColourDesired(c
.Red(), c
.Green(), c
.Blue());
845 ColourDesired
Platform::ChromeHighlight() {
847 c
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT
);
848 return ColourDesired(c
.Red(), c
.Green(), c
.Blue());
851 const char *Platform::DefaultFont() {
852 static char buf
[128];
853 strcpy(buf
, wxNORMAL_FONT
->GetFaceName().mbc_str());
857 int Platform::DefaultFontSize() {
861 unsigned int Platform::DoubleClickTime() {
862 return 500; // **** ::GetDoubleClickTime();
865 void Platform::DebugDisplay(const char *s
) {
866 wxLogDebug(wxString(s
, *wxConvCurrent
));
869 bool Platform::IsKeyDown(int key
) {
870 return false; // I don't think we'll need this.
873 long Platform::SendScintilla(WindowID w
,
875 unsigned long wParam
,
878 wxStyledTextCtrl
* stc
= (wxStyledTextCtrl
*)w
;
879 return stc
->SendMsg(msg
, wParam
, lParam
);
883 // These are utility functions not really tied to a platform
885 int Platform::Minimum(int a
, int b
) {
892 int Platform::Maximum(int a
, int b
) {
901 void Platform::DebugPrintf(const char *format
, ...) {
905 va_start(pArguments
, format
);
906 vsprintf(buffer
,format
,pArguments
);
908 Platform::DebugDisplay(buffer
);
913 static bool assertionPopUps
= true;
915 bool Platform::ShowAssertionPopUps(bool assertionPopUps_
) {
916 bool ret
= assertionPopUps
;
917 assertionPopUps
= assertionPopUps_
;
921 void Platform::Assert(const char *c
, const char *file
, int line
) {
923 sprintf(buffer
, "Assertion [%s] failed at %s %d", c
, file
, line
);
924 if (assertionPopUps
) {
925 int idButton
= wxMessageBox(wxString(buffer
, *wxConvCurrent
),
926 wxT("Assertion failure"),
928 // if (idButton == IDRETRY) {
930 // } else if (idButton == IDIGNORE) {
936 strcat(buffer
, "\r\n");
937 Platform::DebugDisplay(buffer
);
943 int Platform::Clamp(int val
, int minVal
, int maxVal
) {
952 bool Platform::IsDBCSLeadByte(int codePage
, char ch
) {
958 //----------------------------------------------------------------------
960 ElapsedTime::ElapsedTime() {
964 double ElapsedTime::Duration(bool reset
) {
965 double result
= wxGetElapsedTime(reset
);
971 //----------------------------------------------------------------------