I'm writing DLL plug-in for another aplication.
I'm using wxWidgets 2.8.10 for my GUI DLL.
I am calling my DLL library, and this library creates a wxFrame with a wxButton. I have a tooltip for this button (SetToolTip), but when i execute my DLL library, no tooltip displayed...
But when applying toolbar button to my frame tip for toolbar icon displays properly. This is strange for me.
Is there anyone to help me please ? Thanks in advance.
ToolTip display problem in DLL !!!
ToolTip display problem in DLL !!!
Regards
Greg
Greg
Thanks feelthat for Your answer.
I tried Your code but still doesn't work.
I can not see tool tip while loading my dll- dialog.
What I'm doing wrong? Can You help me?
Here is my snippet I tested:
I tried Your code but still doesn't work.
I can not see tool tip while loading my dll- dialog.
What I'm doing wrong? Can You help me?
Here is my snippet I tested:
Code: Select all
class MyButton : public wxButton {
public:
MyButton( wxWindow* parent, wxWindowID id, const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxValidator& validator = wxDefaultValidator,
const wxString& name=wxEmptyString) : wxButton( parent, id, label,
pos, size, style, validator, name )
{
wxToolTip * tooltip = new wxToolTip( name );
tooltip->Enable( false );
SetToolTip( tooltip );
}
private:
DECLARE_EVENT_TABLE()
void OnEnterWindow( wxMouseEvent & event );
};
BEGIN_EVENT_TABLE( MyButton, wxButton )
EVT_ENTER_WINDOW(MyButton::OnEnterWindow)
END_EVENT_TABLE()
void MyButton::OnEnterWindow(wxMouseEvent& event)
{
int screenX,screenY;
WXMSG tipmsg;
this->GetScreenPosition(&screenX,&screenY);
tipmsg.hwnd = (HWND)this->GetHWND();
tipmsg.lParam = event.GetY();
tipmsg.lParam = (tipmsg.lParam<<16) | event.GetX();
tipmsg.message = WM_MOUSEMOVE;
tipmsg.pt.x = screenX + event.GetX();
tipmsg.pt.y = screenY + event.GetY();
tipmsg.time = event.GetTimestamp();
tipmsg.wParam = 0;
if( this->GetToolTip() )
{
printf ("GetToolTip=%i\n", tipmsg.hwnd);
printf ("%i\n", event.GetY());
printf ("%i %i\n", tipmsg.pt.x, tipmsg.pt.y);
this->GetToolTip()->RelayEvent(&tipmsg);
}
}
Regards
Greg
Greg