// Helper classes for ListBox
-// #undef wxSTC_USE_POPUP
-// #define wxSTC_USE_POPUP 0
+#if defined(__WXMAC__)
+class wxSTCListBoxWin : public wxListBox {
+public:
+ wxSTCListBoxWin(wxWindow* parent, wxWindowID id)
+ : wxListBox(parent, id, wxDefaultPosition, wxSize(0,0),
+ 0, NULL, wxLB_SINGLE | wxSIMPLE_BORDER) {
+ SetCursor(wxCursor(wxCURSOR_ARROW));
+ Hide();
+ }
+
+ void OnFocus(wxFocusEvent& event) {
+ GetParent()->SetFocus();
+ event.Skip();
+ }
+
+ wxListBox* GetLB() { return this; }
+
+private:
+ DECLARE_EVENT_TABLE()
+};
+
+
+BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxListBox)
+ EVT_SET_FOCUS(wxSTCListBoxWin::OnFocus)
+END_EVENT_TABLE()
+
+
+
+#else
-// A wxListBox that gives focus back to its parent if it gets it.
class wxSTCListBox : public wxListBox {
public:
wxSTCListBox(wxWindow* parent, wxWindowID id)
+// #undef wxSTC_USE_POPUP
+// #define wxSTC_USE_POPUP 0
+
// A window to place the listbox upon. If wxPopupWindow is supported then
// that will be used so the listbox can extend beyond the client area of the
// wxSTC if needed.
lb = new wxSTCListBox(this, id);
lb->SetCursor(wxCursor(wxCURSOR_ARROW));
lb->SetFocus();
- }
+ }
void OnSize(wxSizeEvent& event) {
lb->SetSize(GetSize());
BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxSTCListBoxWinBase)
EVT_SIZE(wxSTCListBoxWin::OnSize)
END_EVENT_TABLE()
-
+#endif
inline wxListBox* GETLB(WindowID win) {
return (((wxSTCListBoxWin*)win)->GetLB());
}
int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed) {
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMAC__)
// Ctrl chars (A-Z) end up with the wrong keycode on wxGTK...
if (ctrl && key >= 1 && key <= 26)
key += 'A' - 1;
const wxChar* wxSTCNameStr = wxT("stcwindow");
+#ifdef MAKELONG
+#undef MAKELONG
+#endif
+
+#define MAKELONG(a, b) ((a) | ((b) << 16))
+
+
+static long wxColourAsLong(const wxColour& co) {
+ return (((long)co.Blue() << 16) |
+ ((long)co.Green() << 8) |
+ ((long)co.Red()));
+}
+
+static wxColour wxColourFromLong(long c) {
+ wxColour clr;
+ clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
+ return clr;
+}
+
+
+static wxColour wxColourFromSpec(const wxString& spec) {
+ // spec should be "#RRGGBB"
+ long red, green, blue;
+ red = green = blue = 0;
+ spec.Mid(1,2).ToLong(&red, 16);
+ spec.Mid(3,2).ToLong(&green, 16);
+ spec.Mid(5,2).ToLong(&blue, 16);
+ return wxColour(red, green, blue);
+}
+
+//----------------------------------------------------------------------
+
DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE )
DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED )
DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED )
EVT_SCROLL (wxStyledTextCtrl::OnScroll)
EVT_SIZE (wxStyledTextCtrl::OnSize)
EVT_LEFT_DOWN (wxStyledTextCtrl::OnMouseLeftDown)
-#ifdef __WXMSW__
+#if defined(__WXMSW__) || defined(__WXMAC__)
// Let Scintilla see the double click as a second click
EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown)
#endif
EVT_MOTION (wxStyledTextCtrl::OnMouseMove)
EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp)
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMAC__)
EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp)
#else
EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu)
}
-#ifdef MAKELONG
-#undef MAKELONG
-#endif
-
-#define MAKELONG(a, b) ((a) | ((b) << 16))
-
-
-static long wxColourAsLong(const wxColour& co) {
- return (((long)co.Blue() << 16) |
- ((long)co.Green() << 8) |
- ((long)co.Red()));
-}
-
-static wxColour wxColourFromLong(long c) {
- wxColour clr;
- clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
- return clr;
-}
-
-
-static wxColour wxColourFromSpec(const wxString& spec) {
- // spec should be "#RRGGBB"
- long red, green, blue;
- red = green = blue = 0;
- spec.Mid(1,2).ToLong(&red, 16);
- spec.Mid(3,2).ToLong(&green, 16);
- spec.Mid(5,2).ToLong(&blue, 16);
- return wxColour(red, green, blue);
-}
-
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
//
void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
- wxStringTokenizer tkz(spec, ",");
+ wxStringTokenizer tkz(spec, wxT(","));
while (tkz.HasMoreTokens()) {
wxString token = tkz.GetNextToken();
wxString option = token.BeforeFirst(':');
wxString val = token.AfterFirst(':');
- if (option == "bold")
+ if (option == wxT("bold"))
StyleSetBold(styleNum, true);
- else if (option == "italic")
+ else if (option == wxT("italic"))
StyleSetItalic(styleNum, true);
- else if (option == "underline")
+ else if (option == wxT("underline"))
StyleSetUnderline(styleNum, true);
- else if (option == "eol")
+ else if (option == wxT("eol"))
StyleSetEOLFilled(styleNum, true);
- else if (option == "size") {
+ else if (option == wxT("size")) {
long points;
if (val.ToLong(&points))
StyleSetSize(styleNum, points);
}
- else if (option == "face")
+ else if (option == wxT("face"))
StyleSetFaceName(styleNum, val);
- else if (option == "fore")
+ else if (option == wxT("fore"))
StyleSetForeground(styleNum, wxColourFromSpec(val));
- else if (option == "back")
+ else if (option == wxT("back"))
StyleSetBackground(styleNum, wxColourFromSpec(val));
}
}
bool alt = evt.AltDown();
bool skip = ((ctrl || alt) && ! (ctrl && alt));
- //printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
- // key, m_lastKeyDownConsumed, ctrl, alt, skip);
+ printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
+ key, m_lastKeyDownConsumed, ctrl, alt, skip);
if (key <= WXK_START && /*key >= 32 &&*/ !m_lastKeyDownConsumed && !skip) {
m_swx->DoAddChar(key);
int processed = m_swx->DoKeyDown(key, shift, ctrl, alt, &m_lastKeyDownConsumed);
-// printf("key: %d shift: %d ctrl: %d alt: %d processed: %d consumed: %d\n",
-// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
+ printf("KeyDn key:%d shift:%d ctrl:%d alt:%d processed:%d consumed:%d\n",
+ key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
if (!processed && !m_lastKeyDownConsumed)
evt.Skip();
const wxChar* wxSTCNameStr = wxT("stcwindow");
+#ifdef MAKELONG
+#undef MAKELONG
+#endif
+
+#define MAKELONG(a, b) ((a) | ((b) << 16))
+
+
+static long wxColourAsLong(const wxColour& co) {
+ return (((long)co.Blue() << 16) |
+ ((long)co.Green() << 8) |
+ ((long)co.Red()));
+}
+
+static wxColour wxColourFromLong(long c) {
+ wxColour clr;
+ clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
+ return clr;
+}
+
+
+static wxColour wxColourFromSpec(const wxString& spec) {
+ // spec should be "#RRGGBB"
+ long red, green, blue;
+ red = green = blue = 0;
+ spec.Mid(1,2).ToLong(&red, 16);
+ spec.Mid(3,2).ToLong(&green, 16);
+ spec.Mid(5,2).ToLong(&blue, 16);
+ return wxColour(red, green, blue);
+}
+
+//----------------------------------------------------------------------
+
DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE )
DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED )
DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED )
EVT_SCROLL (wxStyledTextCtrl::OnScroll)
EVT_SIZE (wxStyledTextCtrl::OnSize)
EVT_LEFT_DOWN (wxStyledTextCtrl::OnMouseLeftDown)
-#ifdef __WXMSW__
+#if defined(__WXMSW__) || defined(__WXMAC__)
// Let Scintilla see the double click as a second click
EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown)
#endif
EVT_MOTION (wxStyledTextCtrl::OnMouseMove)
EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp)
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMAC__)
EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp)
#else
EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu)
}
-#ifdef MAKELONG
-#undef MAKELONG
-#endif
-
-#define MAKELONG(a, b) ((a) | ((b) << 16))
-
-
-static long wxColourAsLong(const wxColour& co) {
- return (((long)co.Blue() << 16) |
- ((long)co.Green() << 8) |
- ((long)co.Red()));
-}
-
-static wxColour wxColourFromLong(long c) {
- wxColour clr;
- clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
- return clr;
-}
-
-
-static wxColour wxColourFromSpec(const wxString& spec) {
- // spec should be "#RRGGBB"
- long red, green, blue;
- red = green = blue = 0;
- spec.Mid(1,2).ToLong(&red, 16);
- spec.Mid(3,2).ToLong(&green, 16);
- spec.Mid(5,2).ToLong(&blue, 16);
- return wxColour(red, green, blue);
-}
-
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
//
void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
- wxStringTokenizer tkz(spec, ",");
+ wxStringTokenizer tkz(spec, wxT(","));
while (tkz.HasMoreTokens()) {
wxString token = tkz.GetNextToken();
wxString option = token.BeforeFirst(':');
wxString val = token.AfterFirst(':');
- if (option == "bold")
+ if (option == wxT("bold"))
StyleSetBold(styleNum, true);
- else if (option == "italic")
+ else if (option == wxT("italic"))
StyleSetItalic(styleNum, true);
- else if (option == "underline")
+ else if (option == wxT("underline"))
StyleSetUnderline(styleNum, true);
- else if (option == "eol")
+ else if (option == wxT("eol"))
StyleSetEOLFilled(styleNum, true);
- else if (option == "size") {
+ else if (option == wxT("size")) {
long points;
if (val.ToLong(&points))
StyleSetSize(styleNum, points);
}
- else if (option == "face")
+ else if (option == wxT("face"))
StyleSetFaceName(styleNum, val);
- else if (option == "fore")
+ else if (option == wxT("fore"))
StyleSetForeground(styleNum, wxColourFromSpec(val));
- else if (option == "back")
+ else if (option == wxT("back"))
StyleSetBackground(styleNum, wxColourFromSpec(val));
}
}
bool alt = evt.AltDown();
bool skip = ((ctrl || alt) && ! (ctrl && alt));
- //printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
- // key, m_lastKeyDownConsumed, ctrl, alt, skip);
+// printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
+// key, m_lastKeyDownConsumed, ctrl, alt, skip);
if (key <= WXK_START && /*key >= 32 &&*/ !m_lastKeyDownConsumed && !skip) {
m_swx->DoAddChar(key);
int processed = m_swx->DoKeyDown(key, shift, ctrl, alt, &m_lastKeyDownConsumed);
-// printf("key: %%d shift: %%d ctrl: %%d alt: %%d processed: %%d consumed: %%d\n",
-// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
+// printf("KeyDn key:%%d shift:%%d ctrl:%%d alt:%%d processed:%%d consumed:%%d\n",
+// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
if (!processed && !m_lastKeyDownConsumed)
evt.Skip();
// Helper classes for ListBox
-// #undef wxSTC_USE_POPUP
-// #define wxSTC_USE_POPUP 0
+#if defined(__WXMAC__)
+class wxSTCListBoxWin : public wxListBox {
+public:
+ wxSTCListBoxWin(wxWindow* parent, wxWindowID id)
+ : wxListBox(parent, id, wxDefaultPosition, wxSize(0,0),
+ 0, NULL, wxLB_SINGLE | wxSIMPLE_BORDER) {
+ SetCursor(wxCursor(wxCURSOR_ARROW));
+ Hide();
+ }
+
+ void OnFocus(wxFocusEvent& event) {
+ GetParent()->SetFocus();
+ event.Skip();
+ }
+
+ wxListBox* GetLB() { return this; }
+
+private:
+ DECLARE_EVENT_TABLE()
+};
+
+
+BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxListBox)
+ EVT_SET_FOCUS(wxSTCListBoxWin::OnFocus)
+END_EVENT_TABLE()
+
+
+
+#else
-// A wxListBox that gives focus back to its parent if it gets it.
class wxSTCListBox : public wxListBox {
public:
wxSTCListBox(wxWindow* parent, wxWindowID id)
+// #undef wxSTC_USE_POPUP
+// #define wxSTC_USE_POPUP 0
+
// A window to place the listbox upon. If wxPopupWindow is supported then
// that will be used so the listbox can extend beyond the client area of the
// wxSTC if needed.
lb = new wxSTCListBox(this, id);
lb->SetCursor(wxCursor(wxCURSOR_ARROW));
lb->SetFocus();
- }
+ }
void OnSize(wxSizeEvent& event) {
lb->SetSize(GetSize());
BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxSTCListBoxWinBase)
EVT_SIZE(wxSTCListBoxWin::OnSize)
END_EVENT_TABLE()
-
+#endif
inline wxListBox* GETLB(WindowID win) {
return (((wxSTCListBoxWin*)win)->GetLB());
}
int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed) {
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMAC__)
// Ctrl chars (A-Z) end up with the wrong keycode on wxGTK...
if (ctrl && key >= 1 && key <= 26)
key += 'A' - 1;
const wxChar* wxSTCNameStr = wxT("stcwindow");
+#ifdef MAKELONG
+#undef MAKELONG
+#endif
+
+#define MAKELONG(a, b) ((a) | ((b) << 16))
+
+
+static long wxColourAsLong(const wxColour& co) {
+ return (((long)co.Blue() << 16) |
+ ((long)co.Green() << 8) |
+ ((long)co.Red()));
+}
+
+static wxColour wxColourFromLong(long c) {
+ wxColour clr;
+ clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
+ return clr;
+}
+
+
+static wxColour wxColourFromSpec(const wxString& spec) {
+ // spec should be "#RRGGBB"
+ long red, green, blue;
+ red = green = blue = 0;
+ spec.Mid(1,2).ToLong(&red, 16);
+ spec.Mid(3,2).ToLong(&green, 16);
+ spec.Mid(5,2).ToLong(&blue, 16);
+ return wxColour(red, green, blue);
+}
+
+//----------------------------------------------------------------------
+
DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE )
DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED )
DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED )
EVT_SCROLL (wxStyledTextCtrl::OnScroll)
EVT_SIZE (wxStyledTextCtrl::OnSize)
EVT_LEFT_DOWN (wxStyledTextCtrl::OnMouseLeftDown)
-#ifdef __WXMSW__
+#if defined(__WXMSW__) || defined(__WXMAC__)
// Let Scintilla see the double click as a second click
EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown)
#endif
EVT_MOTION (wxStyledTextCtrl::OnMouseMove)
EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp)
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMAC__)
EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp)
#else
EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu)
}
-#ifdef MAKELONG
-#undef MAKELONG
-#endif
-
-#define MAKELONG(a, b) ((a) | ((b) << 16))
-
-
-static long wxColourAsLong(const wxColour& co) {
- return (((long)co.Blue() << 16) |
- ((long)co.Green() << 8) |
- ((long)co.Red()));
-}
-
-static wxColour wxColourFromLong(long c) {
- wxColour clr;
- clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
- return clr;
-}
-
-
-static wxColour wxColourFromSpec(const wxString& spec) {
- // spec should be "#RRGGBB"
- long red, green, blue;
- red = green = blue = 0;
- spec.Mid(1,2).ToLong(&red, 16);
- spec.Mid(3,2).ToLong(&green, 16);
- spec.Mid(5,2).ToLong(&blue, 16);
- return wxColour(red, green, blue);
-}
-
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
//
void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
- wxStringTokenizer tkz(spec, ",");
+ wxStringTokenizer tkz(spec, wxT(","));
while (tkz.HasMoreTokens()) {
wxString token = tkz.GetNextToken();
wxString option = token.BeforeFirst(':');
wxString val = token.AfterFirst(':');
- if (option == "bold")
+ if (option == wxT("bold"))
StyleSetBold(styleNum, true);
- else if (option == "italic")
+ else if (option == wxT("italic"))
StyleSetItalic(styleNum, true);
- else if (option == "underline")
+ else if (option == wxT("underline"))
StyleSetUnderline(styleNum, true);
- else if (option == "eol")
+ else if (option == wxT("eol"))
StyleSetEOLFilled(styleNum, true);
- else if (option == "size") {
+ else if (option == wxT("size")) {
long points;
if (val.ToLong(&points))
StyleSetSize(styleNum, points);
}
- else if (option == "face")
+ else if (option == wxT("face"))
StyleSetFaceName(styleNum, val);
- else if (option == "fore")
+ else if (option == wxT("fore"))
StyleSetForeground(styleNum, wxColourFromSpec(val));
- else if (option == "back")
+ else if (option == wxT("back"))
StyleSetBackground(styleNum, wxColourFromSpec(val));
}
}
bool alt = evt.AltDown();
bool skip = ((ctrl || alt) && ! (ctrl && alt));
- //printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
- // key, m_lastKeyDownConsumed, ctrl, alt, skip);
+ printf("OnChar key:%d consumed:%d ctrl:%d alt:%d skip:%d\n",
+ key, m_lastKeyDownConsumed, ctrl, alt, skip);
if (key <= WXK_START && /*key >= 32 &&*/ !m_lastKeyDownConsumed && !skip) {
m_swx->DoAddChar(key);
int processed = m_swx->DoKeyDown(key, shift, ctrl, alt, &m_lastKeyDownConsumed);
-// printf("key: %d shift: %d ctrl: %d alt: %d processed: %d consumed: %d\n",
-// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
+ printf("KeyDn key:%d shift:%d ctrl:%d alt:%d processed:%d consumed:%d\n",
+ key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
if (!processed && !m_lastKeyDownConsumed)
evt.Skip();
const wxChar* wxSTCNameStr = wxT("stcwindow");
+#ifdef MAKELONG
+#undef MAKELONG
+#endif
+
+#define MAKELONG(a, b) ((a) | ((b) << 16))
+
+
+static long wxColourAsLong(const wxColour& co) {
+ return (((long)co.Blue() << 16) |
+ ((long)co.Green() << 8) |
+ ((long)co.Red()));
+}
+
+static wxColour wxColourFromLong(long c) {
+ wxColour clr;
+ clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
+ return clr;
+}
+
+
+static wxColour wxColourFromSpec(const wxString& spec) {
+ // spec should be "#RRGGBB"
+ long red, green, blue;
+ red = green = blue = 0;
+ spec.Mid(1,2).ToLong(&red, 16);
+ spec.Mid(3,2).ToLong(&green, 16);
+ spec.Mid(5,2).ToLong(&blue, 16);
+ return wxColour(red, green, blue);
+}
+
+//----------------------------------------------------------------------
+
DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE )
DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED )
DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED )
EVT_SCROLL (wxStyledTextCtrl::OnScroll)
EVT_SIZE (wxStyledTextCtrl::OnSize)
EVT_LEFT_DOWN (wxStyledTextCtrl::OnMouseLeftDown)
-#ifdef __WXMSW__
+#if defined(__WXMSW__) || defined(__WXMAC__)
// Let Scintilla see the double click as a second click
EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown)
#endif
EVT_MOTION (wxStyledTextCtrl::OnMouseMove)
EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp)
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMAC__)
EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp)
#else
EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu)
}
-#ifdef MAKELONG
-#undef MAKELONG
-#endif
-
-#define MAKELONG(a, b) ((a) | ((b) << 16))
-
-
-static long wxColourAsLong(const wxColour& co) {
- return (((long)co.Blue() << 16) |
- ((long)co.Green() << 8) |
- ((long)co.Red()));
-}
-
-static wxColour wxColourFromLong(long c) {
- wxColour clr;
- clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
- return clr;
-}
-
-
-static wxColour wxColourFromSpec(const wxString& spec) {
- // spec should be "#RRGGBB"
- long red, green, blue;
- red = green = blue = 0;
- spec.Mid(1,2).ToLong(&red, 16);
- spec.Mid(3,2).ToLong(&green, 16);
- spec.Mid(5,2).ToLong(&blue, 16);
- return wxColour(red, green, blue);
-}
-
//----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated
//
void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
- wxStringTokenizer tkz(spec, ",");
+ wxStringTokenizer tkz(spec, wxT(","));
while (tkz.HasMoreTokens()) {
wxString token = tkz.GetNextToken();
wxString option = token.BeforeFirst(':');
wxString val = token.AfterFirst(':');
- if (option == "bold")
+ if (option == wxT("bold"))
StyleSetBold(styleNum, true);
- else if (option == "italic")
+ else if (option == wxT("italic"))
StyleSetItalic(styleNum, true);
- else if (option == "underline")
+ else if (option == wxT("underline"))
StyleSetUnderline(styleNum, true);
- else if (option == "eol")
+ else if (option == wxT("eol"))
StyleSetEOLFilled(styleNum, true);
- else if (option == "size") {
+ else if (option == wxT("size")) {
long points;
if (val.ToLong(&points))
StyleSetSize(styleNum, points);
}
- else if (option == "face")
+ else if (option == wxT("face"))
StyleSetFaceName(styleNum, val);
- else if (option == "fore")
+ else if (option == wxT("fore"))
StyleSetForeground(styleNum, wxColourFromSpec(val));
- else if (option == "back")
+ else if (option == wxT("back"))
StyleSetBackground(styleNum, wxColourFromSpec(val));
}
}
bool alt = evt.AltDown();
bool skip = ((ctrl || alt) && ! (ctrl && alt));
- //printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
- // key, m_lastKeyDownConsumed, ctrl, alt, skip);
+// printf("OnChar key:%%d consumed:%%d ctrl:%%d alt:%%d skip:%%d\n",
+// key, m_lastKeyDownConsumed, ctrl, alt, skip);
if (key <= WXK_START && /*key >= 32 &&*/ !m_lastKeyDownConsumed && !skip) {
m_swx->DoAddChar(key);
int processed = m_swx->DoKeyDown(key, shift, ctrl, alt, &m_lastKeyDownConsumed);
-// printf("key: %%d shift: %%d ctrl: %%d alt: %%d processed: %%d consumed: %%d\n",
-// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
+// printf("KeyDn key:%%d shift:%%d ctrl:%%d alt:%%d processed:%%d consumed:%%d\n",
+// key, shift, ctrl, alt, processed, m_lastKeyDownConsumed);
if (!processed && !m_lastKeyDownConsumed)
evt.Skip();
static PyObject *_wrap_wxStyledTextEvent_SetDragResult(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxStyledTextEvent * _arg0;
- wxDragResult * _arg1;
+ wxDragResult _arg1;
PyObject * _argo0 = 0;
- PyObject * _argo1 = 0;
char *_kwnames[] = { "self","val", NULL };
self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextEvent_SetDragResult",_kwnames,&_argo0,&_argo1))
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxStyledTextEvent_SetDragResult",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
return NULL;
}
}
- if (_argo1) {
- if (_argo1 == Py_None) { _arg1 = NULL; }
- else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDragResult_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextEvent_SetDragResult. Expected _wxDragResult_p.");
- return NULL;
- }
- }
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- wxStyledTextEvent_SetDragResult(_arg0,*_arg1);
+ wxStyledTextEvent_SetDragResult(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
#define wxStyledTextEvent_GetDragResult(_swigobj) (_swigobj->GetDragResult())
static PyObject *_wrap_wxStyledTextEvent_GetDragResult(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
- wxDragResult * _result;
+ wxDragResult _result;
wxStyledTextEvent * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
- char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStyledTextEvent_GetDragResult",_kwnames,&_argo0))
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = new wxDragResult (wxStyledTextEvent_GetDragResult(_arg0));
+ _result = (wxDragResult )wxStyledTextEvent_GetDragResult(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
-} SWIG_MakePtr(_ptemp, (void *) _result,"_wxDragResult_p");
- _resultobj = Py_BuildValue("s",_ptemp);
+} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}