SOLVED!
StaticTextMouseMoved is not called.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-08-20
02:42 PM
- last edited on
‎2021-09-14
09:20 AM
by
Noemi Balogh
‎2021-08-20
02:42 PM
I was created simple UI with static text. And I want to do anything when cursor moves on the text, but the function StaticTextMouseMoved is not calling. Could you tell me if I do anything wrong?
class PluginAvailabilityManagementDialog : public DG::ModalDialog, public DG::PanelObserver, public DG::ButtonItemObserver, public DG::CompoundItemObserver, public DG::StaticTextObserver { public: PluginAvailabilityManagementDialog(GSResModule dialResModule); ~PluginAvailabilityManagementDialog(); private: virtual void PanelOpened(const DG::PanelOpenEvent& ev) override; virtual void ButtonClicked(const DG::ButtonClickEvent& ev) override; virtual void StaticTextClicked(const DG::StaticTextClickEvent& ev) override; virtual void StaticTextDoubleClicked(const DG::StaticTextDoubleClickEvent& ev) override; virtual void StaticTextMouseMoved(const DG::StaticTextMouseMoveEvent& ev, bool* noDefaultCursor) override; static const short PLUGIN_AVAILABILITY_MANAGEMENT_DIALOG_RESID = 32530; enum { LaterButtonID = 2, UpdateNowButtonID = 5, NewFeaturesButtonID = 6, textID = 3, }; DG::Button laterButton_; DG::Button updateNowButton_; DG::Button newFeaturesButton_; DG::LeftText leftText_; };
PluginAvailabilityManagementDialog::PluginAvailabilityManagementDialog(GSResModule dialResModule) : DG::ModalDialog(dialResModule, PLUGIN_AVAILABILITY_MANAGEMENT_DIALOG_RESID, dialResModule), laterButton_(GetReference(), LaterButtonID), updateNowButton_(GetReference(), UpdateNowButtonID), newFeaturesButton_(GetReference(), NewFeaturesButtonID), leftText_(GetReference(), textID) { AttachToAllItems(*this); } PluginAvailabilityManagementDialog::~PluginAvailabilityManagementDialog() { } void PluginAvailabilityManagementDialog::PanelOpened(const DG::PanelOpenEvent& ev) { } void PluginAvailabilityManagementDialog::ButtonClicked(const DG::ButtonClickEvent& ev) { } void PluginAvailabilityManagementDialog::StaticTextClicked(const DG::StaticTextClickEvent& ev) { } void PluginAvailabilityManagementDialog::StaticTextDoubleClicked(const DG::StaticTextDoubleClickEvent& ev) { leftText_.SetTextColor(Gfx::Color::Green); } void PluginAvailabilityManagementDialog::StaticTextMouseMoved(const DG::StaticTextMouseMoveEvent& ev, bool* noDefaultCursor) { DG::InformationAlert("Called","","OK"); }
/* ---------------------------------------------------------- Dialog */ 'GDLG' 32530 Modal 40 40 445 561 "Dialog" { /* [ 1] */ Icon 0 0 445 55 10018 /* [ 2] */ Button 141 412 160 44 LargePlain "Later" /* [ 3] */ LeftText 110 115 223 19 LargeBold "Text" /* [ 4] */ LeftText 121 150 201 28 LargePlain vCenter "Text center" /* [ 5] */ Button 141 481 160 25 LargeUnderline noFrame BevelEdge "Update now" /* [ 6] */ Button 141 170 160 25 LargeUnderline noFrame BevelEdge "features" }
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-08-20 03:02 PM
‎2021-08-20
03:02 PM
For performance reasons mouse move events are not called by default. Try to enable it on your control by calling the below function in your dialog's constructor:
myStaticText.EnableMouseMoveEvent ();
3 REPLIES 3
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-08-20 03:02 PM
‎2021-08-20
03:02 PM
For performance reasons mouse move events are not called by default. Try to enable it on your control by calling the below function in your dialog's constructor:
myStaticText.EnableMouseMoveEvent ();
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-08-20 03:09 PM
‎2021-08-20
03:09 PM
Thanks a lot. It's work!!!
Viktor wrote:
For performance reasons mouse move events are not called by default. Try to enable it on your control by calling the below function in your dialog's constructor:myStaticText.EnableMouseMoveEvent ();
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-08-20 03:27 PM
‎2021-08-20
03:27 PM
When I hover over the text, the StaticTextMouseMoved event is called, when I move the cursor from the text, no events are called. Are there any events for such a case?
For example:
When the cursor is over the text, the text turns red. When the cursor is not over the text, the text will be blue.
For example:
When the cursor is over the text, the text turns red. When the cursor is not over the text, the text will be blue.
Viktor wrote:
For performance reasons mouse move events are not called by default. Try to enable it on your control by calling the below function in your dialog's constructor:myStaticText.EnableMouseMoveEvent ();