Second Frame ChildFocusEvent Gives Only First Child Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Harsh
Knows some wx things
Knows some wx things
Posts: 32
Joined: Tue Apr 13, 2021 5:03 am

Second Frame ChildFocusEvent Gives Only First Child

Post by Harsh » Fri Apr 30, 2021 9:08 am

Target : Create Suggestion List On wxTextCtrl Focus.

Previous Attempts :
1. AutoComplete : Cannot create Multi-Coloumn Suggestion.
2. Panel with info with Raise() - Stays behide wxScrolledWindow. Without wxScrolledWindow Works.
3. wxListCtrl, wxGrid and other widgets : With wxScrolledWindow Crashes, Without wxScrolledwindow works.

Now Current Attempt :

4. Create wxFrame with Style : wxFRAME_TOOL_WINDOW|wxSTAY_ON_TOP - VBOX with button - On Focus Show Frame - on click set button info. - On Focus Out Hide Frame.

Code: Select all

#ifndef MYFRAME_H
#define MYFRAME_H
#include<wx/frame.h>
#include<wx/sizer.h>
#include<wx/button.h>
#include<wx/textctrl.h>
#include<wx/panel.h>

class MyFrame:public wxFrame{
    public:
        MyFrame();
    private:
        wxPanel *panel;
        wxFrame *list;
        wxBoxSizer *vbox;
        wxButton *btn;
        wxTextCtrl *txt;
        wxRect rect;
        int flag=0,flag1=0;
        
        void ChildFocus(wxChildFocusEvent &event);
        void OnFocus(wxFocusEvent &event);
        void Suggestion();
        void OnFocusOut(wxFocusEvent &event);
        void HideSuggestion();
        void ShowList();
        void FrameFocus(wxFocusEvent &event);
};
#endif
Request :

1. If could solve ChildFocusEvent Problem, It will worth my days of hard work.
2. If You have another logic or suggestion your well come.

User avatar
doublemax
Moderator
Moderator
Posts: 16012
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Second Frame ChildFocusEvent Gives Only First Child

Post by doublemax » Fri Apr 30, 2021 9:14 am

Check out wxPopupTransientWindow, and the "popup" sample that comes with wxWidgets.
https://docs.wxwidgets.org/trunk/classw ... indow.html
Use the source, Luke!

Harsh
Knows some wx things
Knows some wx things
Posts: 32
Joined: Tue Apr 13, 2021 5:03 am

Re: Second Frame ChildFocusEvent Gives Only First Child

Post by Harsh » Fri Apr 30, 2021 9:45 am

doublemax wrote:
Fri Apr 30, 2021 9:14 am
Check out wxPopupTransientWindow, and the "popup" sample that comes with wxWidgets.
https://docs.wxwidgets.org/trunk/classw ... indow.html
Thank you DoubleMax.

I will try

Post Reply