]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlcell.cpp
Chnages to mono-bitmap code.
[wxWidgets.git] / src / html / htmlcell.cpp
index 38988b6cb2120006d3a05ee02fc6ec5c1ef84a21..542c1c656e3af11270bd422445182082964416fb 100644 (file)
@@ -49,15 +49,18 @@ wxHtmlCell::~wxHtmlCell()
 }
 
 
-void wxHtmlCell::OnMouseClick(wxWindow *parent, int x, int y,
-                              bool WXUNUSED(left),
-                              bool WXUNUSED(middle),
-                              bool WXUNUSED(right))
+void wxHtmlCell::OnMouseClick(wxWindow *parent, int x, int y, 
+                              const wxMouseEvent& event)
 {
     wxHtmlLinkInfo *lnk = GetLink(x, y);
     if (lnk != NULL)
-        ((wxHtmlWindow*)parent) -> OnLinkClicked(lnk);
+    {
+        wxHtmlLinkInfo lnk2(*lnk);
+        lnk2.SetEvent(&event);
+        lnk2.SetHtmlCell(this);
+        ((wxHtmlWindow*)parent) -> OnLinkClicked(lnk2);
         // note : this overcasting is legal because parent is *always* wxHtmlWindow
+    }
 }
 
 
@@ -397,14 +400,14 @@ void wxHtmlContainerCell::InsertCell(wxHtmlCell *f)
 
 void wxHtmlContainerCell::SetAlign(const wxHtmlTag& tag)
 {
-    if (tag.HasParam("ALIGN")) {
-        wxString alg = tag.GetParam("ALIGN");
+    if (tag.HasParam(wxT("ALIGN"))) {
+        wxString alg = tag.GetParam(wxT("ALIGN"));
         alg.MakeUpper();
-        if (alg == "CENTER")
+        if (alg == wxT("CENTER"))
             SetAlignHor(wxHTML_ALIGN_CENTER);
-        else if (alg == "LEFT")
+        else if (alg == wxT("LEFT"))
             SetAlignHor(wxHTML_ALIGN_LEFT);
-        else if (alg == "RIGHT")
+        else if (alg == wxT("RIGHT"))
             SetAlignHor(wxHTML_ALIGN_RIGHT);
     }
 }
@@ -413,11 +416,11 @@ void wxHtmlContainerCell::SetAlign(const wxHtmlTag& tag)
 
 void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag& tag, double pixel_scale)
 {
-    if (tag.HasParam("WIDTH")) {
+    if (tag.HasParam(wxT("WIDTH"))) {
         int wdi;
-        wxString wd = tag.GetParam("WIDTH");
+        wxString wd = tag.GetParam(wxT("WIDTH"));
 
-        if (wd[wd.Length()-1] == '%') {
+        if (wd[wd.Length()-1] == wxT('%')) {
             wxSscanf(wd.c_str(), wxT("%i%%"), &wdi);
             SetWidthFloat(wdi, wxHTML_UNITS_PERCENT);
         }
@@ -444,7 +447,7 @@ const wxHtmlCell* wxHtmlContainerCell::Find(int condition, const void* param) co
 
 
 
-void wxHtmlContainerCell::OnMouseClick(wxWindow *parent, int x, int y, bool left, bool middle, bool right)
+void wxHtmlContainerCell::OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event)
 {
     if (m_Cells) {
         wxHtmlCell *c = m_Cells;
@@ -453,7 +456,7 @@ void wxHtmlContainerCell::OnMouseClick(wxWindow *parent, int x, int y, bool left
                     (c -> GetPosY() <= y) &&
                     (c -> GetPosX() + c -> GetWidth() > x) &&
                     (c -> GetPosY() + c -> GetHeight() > y)) {
-                c -> OnMouseClick(parent, x - c -> GetPosX(), y - c -> GetPosY(), left, middle, right);
+                c -> OnMouseClick(parent, x - c -> GetPosX(), y - c -> GetPosY(), event);
                 break;
             }
             c = c -> GetNext();