def OnCellClicked(self, cell, x, y, evt):
self.log.WriteText('OnCellClicked: %s, (%d %d)\n' % (cell, x, y))
+ if isinstance(cell, html.HtmlWordCell):
+ sel = html.HtmlSelection()
+ self.log.WriteText(' %s\n' % cell.ConvertToText(sel))
super(MyHtmlWindow, self).OnCellClicked(cell, x, y, evt)
bool found; \
wxPyBlock_t blocked = wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
- PyObject* obj = wxPyConstructObject((void*)cell, wxT("wxHtmlCell"), 0); \
+ PyObject* obj = wxPyMake_wxObject(cell, 0); \
wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Oii)",obj,x,y)); \
Py_DECREF(obj); \
} \
bool found; \
wxPyBlock_t blocked = wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
- PyObject* obj = wxPyConstructObject((void*)cell, wxT("wxHtmlCell"), 0); \
+ PyObject* obj = wxPyMake_wxObject(cell, 0); \
PyObject* o2 = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0); \
wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OiiO)",obj,x,y,o2)); \
Py_DECREF(obj); \
//---------------------------------------------------------------------------
+
+%typemap(out) wxHtmlCell* { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) const wxHtmlCell* { $result = wxPyMake_wxObject($1, $owner); }
+
//---------------------------------------------------------------------------
%newgroup
class wxHtmlCell : public wxObject {
public:
+ %typemap(out) wxHtmlCell*; // turn off this typemap
+
wxHtmlCell();
+ // Turn it back on again
+ %typemap(out) wxHtmlCell* { $result = wxPyMake_wxObject($1, $owner); }
+
int GetPosX();
int GetPosY();
int GetWidth();
{
public:
wxHtmlWordCell(const wxString& word, wxDC& dc);
+ wxString ConvertToText(wxHtmlSelection *sel) const;
+ bool IsLinebreakAllowed() const;
+ void SetPreviousWord(wxHtmlWordCell *cell);
};
int GetCurIndex();
int GetMaxIndex();
const wxString& GetName();
- // WXWIN_COMPATIBILITY_2_4
-#if 0
- wxHtmlContentsItem* GetContentsItem();
-#endif
};
//---------------------------------------------------------------------------
// TODO: this one needs fixed...
const wxHtmlBookRecArray& GetBookRecArray();
- // WXWIN_COMPATIBILITY_2_4
-#if 0
- wxHtmlContentsItem* GetContents();
- int GetContentsCnt();
- wxHtmlContentsItem* GetIndex();
- int GetIndexCnt();
-#endif
};
//---------------------------------------------------------------------------