U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » LineEdit, EditFields, DocEdit » LineEdit get Key press no subclass
LineEdit get Key press no subclass [message #59093] Tue, 01 November 2022 18:46 Go to next message
wakhshti is currently offline  wakhshti
Messages: 2
Registered: November 2022
Junior Member
Main Window has a LineEdit widget. i want to get Keypress event.
no subclass, just the regular way?
is it possible or do i must subclass ?

-----------------------------------------------------
// MainWindow (.h)
-----------------------------------------------------
class MainWindow : public WithmainLayout<TopWindow>
{
public:
	MainWindow();
	LineEdit txtSearch;
};


-----------------------------------------------------
// MainWindow (.cpp)
-----------------------------------------------------
#include "MainWindow.h"

MainWindow::MainWindow()
{
	CtrlLayout(*this, "MainWindow");
	
	// how to set Key(dword key, int count) event of txtSearch ?
	
}

Re: LineEdit get Key press no subclass [message #59098 is a reply to message #59093] Wed, 02 November 2022 10:12 Go to previous message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Depends:

Do you want change the meaning of some key that is consumed by LineEdit? In that case, you indeed need to subclass LineEdit.

Do you want to catch some key that is ignored by LineEdit? If yes, just add Key virtual method to the main window - ignored keys are passed to parent (that is the purpose of Key bool return value).
Previous Topic: issue with right to left languages (Arabic & Hebrew)
Next Topic: How to use LineEdit's default "Key" handler? no subclass
Goto Forum:
  


Current Time: Sat Apr 25 03:19:36 GMT+2 2026

Total time taken to generate the page: 0.00501 seconds