wxDataViewCtrl problem with Key event Linux

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Adwaith
Earned a small fee
Earned a small fee
Posts: 20
Joined: Sat Nov 21, 2015 7:01 am

wxDataViewCtrl problem with Key event Linux

Post by Adwaith » Thu Jun 21, 2018 10:50 am

Hi,
I am using wxDataViewCtrl to view and modify the shortcut key combinations of certain panels that I can open. In windows, everything is working alright. I am facing this issue only in Red Hat. My wxWidgets version is 3.0.1 and RHEL version is 7.4. Let me come to my issue. I get the key combinations of the keys I press from EVT_CHAR_HOOK and set it to the respective text column of dataviewctrl. My problem is, the key event gets hit only if I press Shift, Alt or Ctrl. If I press any other keys, it does not go to any of the key events but, a small popup appears which shows the letter I typed. Please note this happens only in RedHat. I also tried using EVT_KEY_DOWN, EVT_CHAR but they are of no use. I am creating the dataviewctrl in the below mentioned process. I have also attached the screenshot of how my implementation looks like.

Code: Select all

void KeyBoardShortcut::CreateDataTree()
{
	wxString SelectedValue = m_Keyboardcombo->GetString(0);
	m_TreeCtrl = new wxDataViewCtrl(this, MW_TREECTRL_KEYBOARD_SHORTCUT, wxDefaultPosition, /*wxSize(600, 500)*//*, style*/wxDefaultSize);
	
	m_shrtcut_model = new ShortcutModel(SelectedValue);
	m_TreeCtrl->AssociateModel(m_shrtcut_model.get());
	CreateColumn();
	
	m_TreeCtrl->Expand(m_shrtcut_model->GetRootItem());
	m_TreeCtrl->Expand(m_shrtcut_model->GetFirstTabItem());

#if wxUSE_DRAG_AND_DROP && wxUSE_UNICODE
	m_ctrl[0]->EnableDragSource(wxDF_UNICODETEXT);
	m_ctrl[0]->EnableDropTarget(wxDF_UNICODETEXT);
#endif // wxUSE_DRAG_AND_DROP && wxUSE_UNICODE

}
void KeyBoardShortcut::CreateColumn()
{
wxDataViewTextRenderer *tr =
		new wxDataViewTextRenderer("string", wxDATAVIEW_CELL_INERT);
	//wxSize textctrl =tr->GetSize();
	wxDataViewColumn *column0 =
		new wxDataViewColumn("Tabs", tr, 0, 350, wxALIGN_LEFT,
		 wxDATAVIEW_COL_RESIZABLE);
	m_TreeCtrl->InsertColumn(0,column0);


	// column 1 of the view control:
	m_TreeCtrl->AppendTextColumn("Shortcuts",
		1,
		wxDATAVIEW_CELL_EDITABLE,
		/*wxCOL_WIDTH_AUTOSIZE*/210);
}
Attachments
Capture.PNG
Capture.PNG (10.77 KiB) Viewed 562 times

Post Reply