控件没有mouseup函数。应该怎么弄。
我在使用Scintilla做个简单的源码编辑器。Scintilla本身没有像tpanel一样的mouseup可以调用。我是想右键Scintilla文本框弹出一个TPopupMenu,
Scintilla 控件代码如下:
class TScEdit : public TWinControl{protected: virtual void __fastcall CreateParams(Controls::TCreateParams &Params) { TWinControl::CreateParams(Params); CreateSubClass(Params, "Scintilla"); } virtual void __fastcall WndProc(Messages::TMessage &Message) { TWinControl::WndProc(Message); if(Message.Msg == WM_GETDLGCODE) //让窗体接受方向键和TAB键 Message.Result = DLGC_WANTALLKEYS|DLGC_WANTARROWS|DLGC_WANTTAB; if (Message.Msg == WM_RBUTTONUP) { POINT P; GetCursorPos(&P); TPopupMenu *PopupMenux=new TPopupMenu(this); // PopupMenu1->Popup(P.x, P.y); } }public: __fastcall TScEdit(Classes::TComponent* AOwner) :TWinControl(AOwner){;} sptr_t SendEditor(unsigned int iMessage, uptr_t wParam = 0, sptr_t lParam = 0) { return SendMessage(Handle, iMessage, wParam, lParam); }};
TPopupMenu *PopupMenux=Screen->ActiveForm->PopupMenu;if(PopupMenux ){...}