1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Denis Pershin
8 // Copyright: (c) Denis Pershin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "treectrl.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
27 #include "wx/gtk/treectrl.h"
28 #include <wx/textctrl.h>
33 //static void wxConvertToGtkTreeItem(wxTreeCtrl *owner, wxTreeItem& info, GtkTreeItem **gtkItem);
34 //static void wxConvertFromGtkTreeItem(wxTreeItem& info, GtkTreeItem *gtkItem);
35 static void gtk_treectrl_count_callback (GtkWidget
*widget
, gpointer data
);
36 // static void gtk_treectrl_next_callback (GtkWidget *widget, gpointer data);
37 // static void gtk_treectrl_next_visible_callback (GtkWidget *widget, gpointer data);
38 // static void gtk_treectrl_next_selected_callback (GtkWidget *widget, gpointer data);
40 static void gtk_treeitem_expand_callback(GtkWidget
*widget
, wxTreeItemId
*treeitem
);
41 static void gtk_treeitem_collapse_callback(GtkWidget
*widget
, wxTreeItemId
*treeitem
);
42 static void gtk_treeitem_select_callback(GtkWidget
*widget
, wxTreeItemId
*treeitem
);
44 static void gtk_treeitem_expand_callback(GtkWidget
*widget
, wxTreeItemId
*treeitem
) {
45 wxTreeCtrl
*owner
= (wxTreeCtrl
*)gtk_object_get_data(GTK_OBJECT(widget
), "owner");
49 // long id = (long)gtk_object_get_data(GTK_OBJECT(widget), "id");
50 owner
->SendExpanding(GTK_TREE_ITEM(widget
));
51 owner
->SendExpanded(GTK_TREE_ITEM(widget
));
54 static void gtk_treeitem_collapse_callback(GtkWidget
*widget
, wxTreeItemId
*treeitem
) {
55 wxTreeCtrl
*owner
= (wxTreeCtrl
*)gtk_object_get_data(GTK_OBJECT(widget
), "owner");
59 // long id = (long)gtk_object_get_data(GTK_OBJECT(widget), "id");
60 owner
->SendCollapsing(GTK_TREE_ITEM(widget
));
61 owner
->SendCollapsed(GTK_TREE_ITEM(widget
));
64 static void gtk_treeitem_select_callback(GtkWidget
*widget
, wxTreeItemId
*treeitem
) {
65 wxTreeCtrl
*owner
= (wxTreeCtrl
*)gtk_object_get_data(GTK_OBJECT(widget
), "owner");
69 // long id = (long)gtk_object_get_data(GTK_OBJECT(widget), "id");
70 owner
->SendSelChanging(GTK_TREE_ITEM(widget
));
71 owner
->SendSelChanged(GTK_TREE_ITEM(widget
));
74 #if !USE_SHARED_LIBRARY
75 IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl
, wxControl
)
79 void wxTreeCtrl::Init() {
80 m_imageListNormal
= NULL
;
81 m_imageListState
= NULL
;
85 bool wxTreeCtrl::Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
,
86 const wxSize
& size
, long style
,
87 const wxValidator
& validator
, const wxString
& name
) {
95 m_windowStyle
= style
;
110 printf("precreate\n");
111 PreCreation( parent
, id
, pos
, size
, style
, name
);
115 m_widget
= gtk_scrolled_window_new(NULL
, NULL
);
117 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(m_widget
),
118 GTK_POLICY_AUTOMATIC
, GTK_POLICY_AUTOMATIC
);
121 m_tree
= GTK_TREE(gtk_tree_new());
124 gtk_container_add(GTK_CONTAINER(m_widget
), GTK_WIDGET(m_tree
));
126 // gtk_widget_set_parent(GTK_WIDGET(m_tree), m_widget);
128 gtk_widget_show(GTK_WIDGET(m_tree
));
131 SetValidator(validator
);
133 printf("postcreate\n");
136 gtk_widget_realize(GTK_WIDGET(m_tree
));
143 wxTreeCtrl::~wxTreeCtrl(void) {
149 static void gtk_treectrl_count_callback (GtkWidget
*widget
, gpointer data
) {
150 int count
= (*((int *)data
));
153 if (GTK_IS_CONTAINER(widget
))
154 gtk_container_foreach(GTK_CONTAINER(widget
), gtk_treectrl_count_callback
, data
);
157 size_t wxTreeCtrl::GetCount() const {
160 if (m_anchor
!= NULL
)
161 gtk_container_foreach(GTK_CONTAINER(m_anchor
), gtk_treectrl_count_callback
, &count
);
165 unsigned int wxTreeCtrl::GetIndent() const {
166 return m_tree
->indent_value
;
169 void wxTreeCtrl::SetIndent(unsigned int indent
) {
170 m_tree
->indent_value
= indent
;
173 wxImageList
*wxTreeCtrl::GetImageList() const {
174 return m_imageListNormal
;
177 wxImageList
*wxTreeCtrl::GetStateImageList() const {
178 return m_imageListState
;
181 void wxTreeCtrl::SetImageList(wxImageList
*imageList
) {
182 m_imageListNormal
= imageList
;
185 void wxTreeCtrl::SetStateImageList(wxImageList
*imageList
) {
186 m_imageListState
= imageList
;
189 wxString
wxTreeCtrl::GetItemText(const wxTreeItemId
&item
) const {
195 GtkLabel
*l
= GTK_LABEL(gtk_object_get_data(GTK_OBJECT((GtkTreeItem
*)item
), "w_label"));
196 gtk_label_get(l
, &t
);
201 int wxTreeCtrl::GetItemImage(const wxTreeItemId
& item
) const {
205 return (int)gtk_object_get_data(GTK_OBJECT((GtkTreeItem
*)item
), "image");
208 int wxTreeCtrl::GetItemSelectedImage(const wxTreeItemId
& item
) const {
212 return (int)gtk_object_get_data(GTK_OBJECT((GtkTreeItem
*)item
), "selectedImage");
215 wxTreeItemData
*wxTreeCtrl::GetItemData(const wxTreeItemId
& item
) const {
219 return (wxTreeItemData
*)gtk_object_get_data(GTK_OBJECT((GtkTreeItem
*)item
), "data");
222 void wxTreeCtrl::SetItemText(const wxTreeItemId
& item
, const wxString
& text
) {
226 GtkLabel
*l
= GTK_LABEL(gtk_object_get_data(GTK_OBJECT((GtkTreeItem
*)item
), "w_label"));
227 gtk_label_set(l
, text
);
230 void wxTreeCtrl::SetItemImage(const wxTreeItemId
& item
, int image
) {
234 gtk_object_set_data(GTK_OBJECT((GtkTreeItem
*)item
), "image", (void *)image
);
237 void wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId
& item
, int image
) {
241 gtk_object_set_data(GTK_OBJECT((GtkTreeItem
*)item
), "selectedImage", (void *)image
);
244 void wxTreeCtrl::SetItemData(const wxTreeItemId
& item
, wxTreeItemData
*data
) {
248 gtk_object_set_data(GTK_OBJECT((GtkTreeItem
*)item
), "data", data
);
251 bool wxTreeCtrl::IsVisible(const wxTreeItemId
& item
) const {
252 #warning "Need to implement IsVisible"
256 bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId
& item
) const {
259 gtk_container_foreach(GTK_CONTAINER((GtkTreeItem
*)item
), gtk_treectrl_count_callback
, &count
);
264 bool wxTreeCtrl::IsExpanded(const wxTreeItemId
& item
) const {
265 return (((GtkTreeItem
*)item
)->expanded
!= 0);
268 bool wxTreeCtrl::IsSelected(const wxTreeItemId
& item
) const {
269 #warning "Need to implement IsSelected"
273 wxTreeItemId
wxTreeCtrl::GetRootItem() const {
277 wxTreeItemId
wxTreeCtrl::GetSelection() const {
278 #warning "Need to complete gtk_treectrl_next_selected_callback"
279 GtkTreeItem
*next
= NULL
;
281 GList
*list
= gtk_container_children(GTK_CONTAINER(m_anchor
));
282 next
= GTK_TREE_ITEM(list
->data
);
283 // gtk_container_foreach(GTK_CONTAINER(m_anchor), gtk_treectrl_next_selected_callback, &next);
288 wxTreeItemId
wxTreeCtrl::GetParent(const wxTreeItemId
& item
) const {
289 #warning "data 'parent' is missing!!!"
291 return (GtkTreeItem
*)gtk_object_get_data(GTK_OBJECT((GtkTreeItem
*)item
), "parent");
296 wxTreeItemId
wxTreeCtrl::GetFirstChild(const wxTreeItemId
& item
, long& cookie
) const {
297 #warning "Need to implement GetFirstChild"
301 wxTreeItemId
wxTreeCtrl::GetNextChild(const wxTreeItemId
& item
, long& cookie
) const {
302 #warning "Need to implement GetNextChild"
306 wxTreeItemId
wxTreeCtrl::GetNextSibling(const wxTreeItemId
& item
) const {
307 #warning "Need to implement GetNextSibling"
311 wxTreeItemId
wxTreeCtrl::GetPrevSibling(const wxTreeItemId
& item
) const {
312 #warning "Need to implement GetPrevSibling"
316 wxTreeItemId
wxTreeCtrl::GetFirstVisibleItem() const {
317 #warning "Need to implement GetFirstVisibleItem"
321 wxTreeItemId
wxTreeCtrl::GetNextVisible(const wxTreeItemId
& item
) const {
322 #warning "Need to implement GetNextVisible"
326 wxTreeItemId
wxTreeCtrl::GetPrevVisible(const wxTreeItemId
& item
) const {
327 #warning "Need to implement GetPrevVisible"
331 wxTreeItemId
wxTreeCtrl::AddRoot(const wxString
& text
, int image
,
332 int selectedImage
, wxTreeItemData
*data
) {
333 return p_InsertItem(0, text
, image
, selectedImage
, data
);
336 wxTreeItemId
wxTreeCtrl::PrependItem(const wxTreeItemId
& parent
,
337 const wxString
& text
, int image
, int selectedImage
,
338 wxTreeItemData
*data
) {
339 #warning "Need to implement PrependItem"
343 wxTreeItemId
wxTreeCtrl::InsertItem(const wxTreeItemId
& parent
,
344 const wxTreeItemId
& idPrevious
, const wxString
& text
,
345 int image
, int selectedImage
, wxTreeItemData
*data
) {
346 #warning "Need to implement InsertItem"
350 wxTreeItemId
wxTreeCtrl::AppendItem(const wxTreeItemId
& parent
,
351 const wxString
& text
, int image
, int selectedImage
,
352 wxTreeItemData
*data
) {
353 return p_InsertItem(parent
, text
, image
, selectedImage
, data
);
356 wxTreeItemId
wxTreeCtrl::p_InsertItem(GtkTreeItem
*p
,
357 const wxString
& text
, int image
, int selectedImage
,
358 wxTreeItemData
*data
) {
361 printf("begin insert\n");
363 item
= GTK_TREE_ITEM(gtk_tree_item_new());
365 GtkHBox
*m_box
= GTK_HBOX(gtk_hbox_new(FALSE
, 0));
366 gtk_container_add (GTK_CONTAINER (item
), GTK_WIDGET(m_box
));
368 gtk_object_set_data(GTK_OBJECT(item
), "w_box", m_box
);
371 const wxImageList
*list
;
372 if ((list
= GetImageList(wxIMAGE_LIST_NORMAL
)) != NULL
)
373 if ((bmp
= list
->GetBitmap(image
)) != NULL
)
375 GdkBitmap
*mask
= NULL
;
377 mask
= bmp
->GetMask()->GetBitmap();
378 GtkPixmap
*m_image_widget
= GTK_PIXMAP(gtk_pixmap_new(bmp
->GetPixmap(), mask
));
379 gtk_misc_set_alignment (GTK_MISC (m_image_widget
), 0.0, 0.5);
380 gtk_box_pack_start(GTK_BOX(m_box
), GTK_WIDGET(m_image_widget
), FALSE
, FALSE
, 0);
381 gtk_object_set_data(GTK_OBJECT(item
), "w_image", (void *)m_image_widget
);
382 gtk_object_set_data(GTK_OBJECT(item
), "image", (void *)image
);
383 gtk_widget_show (GTK_WIDGET(m_image_widget
));
385 GtkLabel
*m_label_widget
= GTK_LABEL(gtk_label_new ((char *)(const char *)text
));
386 gtk_misc_set_alignment (GTK_MISC (m_label_widget
), 0.5, 0.5);
387 gtk_box_pack_start(GTK_BOX(m_box
), GTK_WIDGET(m_label_widget
), FALSE
, FALSE
, 0);
388 gtk_object_set_data(GTK_OBJECT(item
), "w_label", m_label_widget
);
389 gtk_widget_show (GTK_WIDGET(m_label_widget
));
391 gtk_widget_show(GTK_WIDGET(m_box
));
393 gtk_object_set_data(GTK_OBJECT(item
), "owner", this);
396 if (p
->subtree
== NULL
) {
397 GtkTree
*tree
= GTK_TREE(gtk_tree_new());
398 gtk_tree_item_set_subtree(GTK_TREE_ITEM(p
), GTK_WIDGET(tree
));
399 gtk_widget_show(GTK_WIDGET(tree
));
403 gtk_container_add(GTK_CONTAINER(p
->subtree
), GTK_WIDGET(item
));
405 printf("Adding root\n");
406 printf("m_tree = %p\n", m_tree
);
408 gtk_container_add(GTK_CONTAINER(m_tree
), GTK_WIDGET(item
));
412 if ((info.m_mask & wxTREE_MASK_CHILDREN) != 0) {
413 GtkTree *tree = GTK_TREE(gtk_tree_new());
414 gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), GTK_WIDGET(tree));
415 gtk_widget_show(GTK_WIDGET(tree));
419 gtk_object_set_data(GTK_OBJECT(item
), "data", data
);
421 gtk_widget_show(GTK_WIDGET(item
));
423 gtk_signal_connect(GTK_OBJECT(item
), "select",
424 GTK_SIGNAL_FUNC(gtk_treeitem_select_callback
), (gpointer
)this );
426 gtk_signal_connect(GTK_OBJECT(item
), "deselect",
427 GTK_SIGNAL_FUNC(gtk_treeitem_select_callback
), (gpointer
)this );
429 gtk_signal_connect(GTK_OBJECT(item
), "expand",
430 GTK_SIGNAL_FUNC(gtk_treeitem_expand_callback
), (gpointer
)this );
431 gtk_signal_connect(GTK_OBJECT(item
), "collapse",
432 GTK_SIGNAL_FUNC(gtk_treeitem_collapse_callback
), (gpointer
)this );
437 void wxTreeCtrl::Delete(const wxTreeItemId
& item
) {
441 GtkTreeItem
*parent
= GTK_TREE_ITEM(GTK_WIDGET((GtkTreeItem
*)item
)->parent
);
445 gtk_container_remove(GTK_CONTAINER(parent
), GTK_WIDGET((GtkTreeItem
*)item
));
450 void wxTreeCtrl::DeleteAllItems() {
451 gtk_tree_item_remove_subtree(m_anchor
);
454 void wxTreeCtrl::Expand(const wxTreeItemId
& item
) {
458 gtk_tree_item_expand(GTK_TREE_ITEM((GtkTreeItem
*)item
));
461 void wxTreeCtrl::Collapse(const wxTreeItemId
& item
) {
465 gtk_tree_item_collapse(GTK_TREE_ITEM((GtkTreeItem
*)item
));
468 void wxTreeCtrl::CollapseAndReset(const wxTreeItemId
& item
) {
472 gtk_tree_item_collapse(GTK_TREE_ITEM((GtkTreeItem
*)item
));
473 gtk_tree_item_remove_subtree(GTK_TREE_ITEM((GtkTreeItem
*)item
));
476 void wxTreeCtrl::Toggle(const wxTreeItemId
& item
) {
480 if (((GtkTreeItem
*)item
)->expanded
)
481 gtk_tree_item_collapse(GTK_TREE_ITEM((GtkTreeItem
*)item
));
483 gtk_tree_item_expand(GTK_TREE_ITEM((GtkTreeItem
*)item
));
486 void wxTreeCtrl::Unselect() {
487 #warning "Need to implement Unselect"
490 void wxTreeCtrl::SelectItem(const wxTreeItemId
& item
) {
494 gtk_tree_item_select((GtkTreeItem
*)item
);
497 void wxTreeCtrl::EnsureVisible(const wxTreeItemId
& item
) {
498 #warning "Need to implement EnsureVisible"
501 void wxTreeCtrl::ScrollTo(const wxTreeItemId
& item
) {
502 #warning "Need to implement ScrollTo"
505 wxTextCtrl
* wxTreeCtrl::EditLabel(const wxTreeItemId
& item
,
506 wxClassInfo
* textControlClass
) {
507 wxASSERT( textControlClass
->IsKindOf(CLASSINFO(wxTextCtrl
)) );
508 #warning "Need to implement EditLabel"
512 wxTextCtrl
* wxTreeCtrl::GetEditControl() const {
516 void wxTreeCtrl::EndEditLabel(const wxTreeItemId
& item
, bool discardChanges
) {
517 #warning "Need to implement EndEditLabel"
520 void wxTreeCtrl::ExpandItem(const wxTreeItemId
& item
, int action
) {
522 case wxTREE_EXPAND_EXPAND
:
526 case wxTREE_EXPAND_COLLAPSE
:
530 case wxTREE_EXPAND_COLLAPSE_RESET
:
531 CollapseAndReset(item
);
534 case wxTREE_EXPAND_TOGGLE
:
539 wxFAIL_MSG("unknown action in wxTreeCtrl::ExpandItem");
543 wxTreeItemId
wxTreeCtrl::InsertItem(const wxTreeItemId
& parent
,
544 const wxString
& text
, int image
, int selImage
,
546 // InsertItem(parent, insertAfter, text, image, selImage);
547 #warning "Need to implement InsertItem"
552 long wxTreeCtrl::GetChild(long item) const {
554 GtkTreeItem *next = NULL;
556 p = findGtkTreeItem(item);
557 GList *list = gtk_container_children(GTK_CONTAINER(p));
558 next = GTK_TREE_ITEM(list->data);;
561 return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
566 long wxTreeCtrl::GetFirstVisibleItem(void) const {
567 GtkTreeItem *next = NULL;
569 GList *list = gtk_container_children(GTK_CONTAINER(m_anchor));
570 next = GTK_TREE_ITEM(list->data);;
571 // gtk_container_foreach(GTK_CONTAINER(m_anchor), gtk_treectrl_next_visible_callback, &next);
574 return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
579 long wxTreeCtrl::GetNextVisibleItem(long item) const {
581 GtkTreeItem *next = NULL;
583 p = findGtkTreeItem(item);
584 GList *list = gtk_container_children(GTK_CONTAINER(p));
585 next = GTK_TREE_ITEM(list->data);;
586 // gtk_container_foreach(GTK_CONTAINER(p), gtk_treectrl_next_visible_callback, &next);
589 return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
594 bool wxTreeCtrl::GetItem(wxTreeItem& info) const {
597 p = findGtkTreeItem(info.m_itemId);
600 wxLogSysError("TreeCtrl::GetItem failed");
604 wxConvertFromGtkTreeItem(info, p);
609 bool wxTreeCtrl::SetItem(wxTreeItem& info) {
612 p = findGtkTreeItem(info.m_itemId);
615 wxLogSysError("TreeCtrl::SetItem failed");
619 wxConvertToGtkTreeItem(this, info, &p);
624 int wxTreeCtrl::GetItemState(long item, long stateMask) const {
627 info.m_mask = wxTREE_MASK_STATE ;
628 info.m_stateMask = stateMask;
629 info.m_itemId = item;
637 bool wxTreeCtrl::SetItemState(long item, long state, long stateMask) {
640 info.m_mask = wxTREE_MASK_STATE ;
641 info.m_state = state;
642 info.m_stateMask = stateMask;
643 info.m_itemId = item;
645 return SetItem(info);
651 bool wxTreeCtrl::DeleteChildren(long item) {
654 p = findGtkTreeItem(item);
658 gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p));
665 long wxTreeCtrl::InsertItem(long parent, wxTreeItem& info, long insertAfter) {
667 GtkTreeItem *item = NULL;
669 info.m_itemId = m_curitemId;
672 wxConvertToGtkTreeItem(this, info, &item);
675 p = findGtkTreeItem(parent);
676 if (p->subtree == NULL) {
677 GtkTree *tree = GTK_TREE(gtk_tree_new());
678 gtk_tree_item_set_subtree(GTK_TREE_ITEM(p), GTK_WIDGET(tree));
679 gtk_widget_show(GTK_WIDGET(tree));
683 gtk_container_add(GTK_CONTAINER(p->subtree), GTK_WIDGET(item));
686 gtk_container_add(GTK_CONTAINER(m_tree), GTK_WIDGET(item));
689 if ((info.m_mask & wxTREE_MASK_CHILDREN) != 0) {
690 GtkTree *tree = GTK_TREE(gtk_tree_new());
691 gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), GTK_WIDGET(tree));
692 gtk_widget_show(GTK_WIDGET(tree));
695 gtk_widget_show(GTK_WIDGET(item));
697 gtk_signal_connect(GTK_OBJECT(item), "select",
698 GTK_SIGNAL_FUNC(gtk_treeitem_select_callback), (gpointer)this );
700 gtk_signal_connect(GTK_OBJECT(item), "deselect",
701 GTK_SIGNAL_FUNC(gtk_treeitem_select_callback), (gpointer)this );
703 gtk_signal_connect(GTK_OBJECT(item), "expand",
704 GTK_SIGNAL_FUNC(gtk_treeitem_expand_callback), (gpointer)this );
705 gtk_signal_connect(GTK_OBJECT(item), "collapse",
706 GTK_SIGNAL_FUNC(gtk_treeitem_collapse_callback), (gpointer)this );
708 return info.m_itemId;
711 long wxTreeCtrl::InsertItem(long parent, const wxString& label, int image,
712 int selImage, long insertAfter) {
716 info.m_mask = wxTREE_MASK_TEXT;
718 info.m_mask |= wxTREE_MASK_IMAGE | wxTREE_MASK_SELECTED_IMAGE;
719 info.m_image = image;
721 info.m_selectedImage = image;
723 info.m_selectedImage = selImage;
726 return InsertItem(parent, info, insertAfter);
730 void wxTreeCtrl::SendExpanding(const wxTreeItemId
& item
) {
731 wxTreeEvent
event(wxEVT_COMMAND_TREE_ITEM_EXPANDING
, GetId());
732 event
.SetEventObject(this);
736 void wxTreeCtrl::SendExpanded(const wxTreeItemId
& item
) {
737 wxTreeEvent
event(wxEVT_COMMAND_TREE_ITEM_EXPANDED
, GetId());
738 event
.SetEventObject(this);
742 void wxTreeCtrl::SendCollapsing(const wxTreeItemId
& item
) {
743 wxTreeEvent
event(wxEVT_COMMAND_TREE_ITEM_COLLAPSING
, GetId());
744 event
.SetEventObject(this);
748 void wxTreeCtrl::SendCollapsed(const wxTreeItemId
& item
) {
749 wxTreeEvent
event(wxEVT_COMMAND_TREE_ITEM_COLLAPSED
, GetId());
750 event
.SetEventObject(this);
754 void wxTreeCtrl::SendSelChanging(const wxTreeItemId
& item
) {
755 wxTreeEvent
event(wxEVT_COMMAND_TREE_SEL_CHANGED
, GetId());
756 event
.SetEventObject(this);
760 void wxTreeCtrl::SendSelChanged(const wxTreeItemId
& item
) {
761 wxTreeEvent
event(wxEVT_COMMAND_TREE_SEL_CHANGING
, GetId());
762 event
.SetEventObject(this);
767 IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent
, wxCommandEvent
)
769 wxTreeEvent::wxTreeEvent(wxEventType commandType
, int id
):
770 wxCommandEvent(commandType
, id
) {