]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/wxblistctrl.cpp
- wxbHistoryTextCtrl : Created a new text control that keep an history
[bacula/bacula] / bacula / src / wx-console / wxblistctrl.cpp
index 0034f06bbdaeddcdffb580f46fc1ae33e2f304db..a4db96ba33363d587833b09d72fd5dea09c04a2a 100644 (file)
@@ -37,8 +37,9 @@ END_EVENT_TABLE()
 DEFINE_LOCAL_EVENT_TYPE(wxbLIST_MARKED_EVENT)
 
 wxbListCtrl::wxbListCtrl(
-      wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size): 
-            wxListCtrl(parent, id, pos, size,wxLC_REPORT) {
+      wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos, const wxSize& size): 
+            wxListCtrl(parent, id, pos, size, wxLC_REPORT | wxSUNKEN_BORDER) {
+   this->handler = handler;
 }
 
 wxbListCtrl::~wxbListCtrl() {}
@@ -50,7 +51,7 @@ void wxbListCtrl::OnDoubleClicked(wxMouseEvent& event) {
    if (event.GetX() < GetColumnWidth(0)) {
       wxbListMarkedEvent evt(GetId());
 
-      GetParent()->GetEventHandler()->ProcessEvent(evt);
+      handler->ProcessEvent(evt);
       
       //No Skip : we don't want to go in this directory (if it is a directory)
    }
@@ -63,12 +64,9 @@ void wxbListCtrl::OnDoubleClicked(wxMouseEvent& event) {
  * Send mark event if the user right clicked on an item.
  */
 void wxbListCtrl::OnRightClicked(wxMouseEvent& event) {
-   if (event.GetX() < GetColumnWidth(0)) {
-      wxbListMarkedEvent evt(GetId());
+   wxbListMarkedEvent evt(GetId());
 
-      GetParent()->GetEventHandler()->ProcessEvent(evt);
-   }
-   event.Skip();
+   handler->ProcessEvent(evt);
 }
 
 /* Customized tree event, used for marking events */